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类型字段默认值设置 b'0' 用goInception检测语法错误,直接在数据库里执行成功 #409

Closed
dbcmp opened this issue Nov 22, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@dbcmp
Copy link

dbcmp commented Nov 22, 2021

描述
建表时bit类型字段默认值设置 b'0' 用goInception检测语法错误,直接在数据库里执行成功

重现
SQL:
CREATE TABLE aaa (
id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
IsDeleted bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
PRIMARY KEY (Id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';

检测错误:
line 3 column 40 near "b '0' COMMENT '1: deleted, 0: normal',
PRIMARY KEY (Id)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = '应用表'"

直接在库里执行:
image

环境

  • 数据库: [mysql]
  • 版本: [例如 5.7.26]

参数
enable_enum_set_bit =true //三种类型有没有单独设置开关的方法?enum确实要单独禁

@hanchuanchuan
Copy link
Owner

默认值 b'0'的问题在之前的版本已经修复, 请升级到最新版本重试.
类型禁用问题已经添加新的自定义方式, 稍后发布新版本.

hanchuanchuan added a commit that referenced this issue Jan 11, 2022
feature: 添加参数disable_types可灵活配置禁用的数据类型(#400,#409)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants