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

Bit-Field processed incorrectly #21

Open
codeage opened this issue Nov 15, 2012 · 0 comments
Open

Bit-Field processed incorrectly #21

codeage opened this issue Nov 15, 2012 · 0 comments

Comments

@codeage
Copy link

codeage commented Nov 15, 2012

Reproduction steps:

  1. Add a bit field named 'SEX' to the source table and set the default value to 0;
  2. Run schemasync to create the patch script;
  3. Import the patch script into mysql;

Following script fails:

ALTER TABLE `table1` ADD COLUMN `SEX` bit(1) NULL DEFAULT 'b'0'' AFTER `LEVEL`;

with error:

ERROR 1064 (42000) at line 9: You have an error in your SQL syntax; 
check the manual that corresponds to your MySQL server version for the right 
syntax to use near '0'' AFTER `LEVEL`' at line 1

This error is caused by the extra single quotation surrounding b'0'. Correct script should be:

ALTER TABLE `table1` ADD COLUMN `SEX` bit(1) NULL DEFAULT b'0' AFTER `LEVEL`;
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