-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Medoo ignores SET SQL_MODE command for MySQL database connections #1048
Comments
You are right. I will fix that. |
Thank you for fast reply! |
I had a related issue to this one to share and add to the conversation. An observation I noticed in Medoo#1044 yesterday is that the default line referenced by @scr4bble above: Ends up overriding the For example, with PlanetScale the default
So after the A potential alternative approach that would simply add in the
Which should leave the It still doesn't make |
Information
Describe the Problem
Medoo ignores SET SQL_MODE command when used in options during Medoo object creation. It is probably executed but then there is the same command executed again in Medoo code and overwrites whatever user has set.
Result is then that no matter the user sets, SQL_MODE always equals "ANSI_QUOTES".
Detail Code
The detail code you are using causes the problem.
SQL_MODE gets overwritten by this code in Medoo.php:
Expected output
I would expect Medoo to parse SET SQL_MODE (if entered by the user), check if ANSI_QUOTES is in the modes that user specified, if not then add it to the list, if yes, then just continue and let the command execute.
Instead of adding another SET SQL_MODE command into $commands array that overwrites the user specified SQL modes.
The text was updated successfully, but these errors were encountered: