-
Notifications
You must be signed in to change notification settings - Fork 109
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
Comma Seperated ALTER TABLE comamnds causes Error Code 1054 #27
Comments
Yes, this can be implemented. I had plans to fix this but have not had the time to do it. Pull requests welcome. |
Unfortunately, I don't know Python, so I don't feel able to contribute. But this tool is exactly what I need to nightly schema comparisons with CRON. If you manage to find time, that would be great. Thanks. |
I have coded one AWK script to improve the .patch script, content like this: ################################## VARIABLES & FUNCTIONS ###################################### ################################## MAIN BODY ############################################## ($1 ~ /^ALTER TABLE
##% this field belongs to current Row 1 {print $0} |
The .patch script generated produces comma separated statements like this:
ALTER TABLE a ADD COLUMN b tinyint(1) NOT NULL DEFAULT '0' AFTER
c
, ADD COLUMN
d
tinyint(1) NULL DEFAULT '1' AFTERf
;But this is a known problem and produces Error Code: 1054
http://bugs.mysql.com/bug.php?id=60650
A suggested fix is to use separate ALTER TABLE statements:
ALTER TABLE a ADD COLUMN b tinyint(1) NOT NULL DEFAULT '0' AFTER
c
ALTER TABLE a ADD COLUMN
d
tinyint(1) NULL DEFAULT '1' AFTERf
;Can this be implemented?
The text was updated successfully, but these errors were encountered: