Skip to content
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

Resetting sql_mode on top of sql file breaks import when ANSI_QUOTES was in the original #279

Open
Jalliuz opened this issue Feb 21, 2024 · 0 comments

Comments

@Jalliuz
Copy link

Jalliuz commented Feb 21, 2024

I have the option "ANSI_QUOTES" in my original sql_mode. Which means the table names etc. get surrounded with double quotes in the exported sql

CREATE TABLE "my_table"

But on top of the exported sql there is this comment:
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

So when importing the sql file again the sql_mode does not have the option ANSI_QUOTES anymore and the import fails fails because the dump has double quotes around table names and column names.

Solution is: if the option ANSI_QUOTES was present during the generation of the dump, it must stay present during the import too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant