-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate escaping of quotes in check constraint expressions (MySQL) #42424
Comments
Yes. Please open the PR. |
Just for documentation purposes, the problem here is similar to #41156. |
The PR is ready to merge, would be cool if somebody can have a look :) |
Bump, what needs doing here? Are there any issues with the attached MR? |
I went ahead and re opened the PR, I'll see if I can get somebody to take a look |
In case somebody will have a look. I rebased the PR onto main. |
Is there any progress on this? I'm facing the same issue I would be more than happy to see this fix merged |
Steps to reproduce
With a check constraint in the (MySQL) database and the Rails project set to use the schema.rb format I end up with duplicate escape sequences for quotes in the expression of the check constraint.
schema.rb
schema.rb
contains duplicate escaping for the quotes in the check constraint expressionrails db:schema:load
leads to an SQL syntax errorHere is an executable version of the problem (I used MySQL
Ver 8.0.23 for osx10.15 on x86_64
):Expected behavior
E.g. a migration like this:
should generate a schema like that:
Actual behavior
It generates a schema like this:
System configuration
Rails version: 6.1.3.2
Ruby version: 2.6.3
Potential fix
I created a monkey patch which fixes the issue for my project locally:
If this goes into the right direction I'd open up a pull request and write the corresponding tests.
Diff: https://github.com/rails/rails/compare/main...Flixt:fix-mysql-check-constraints-quoting?expand=1
The text was updated successfully, but these errors were encountered: