baomidou / mybatis-plus

An powerful enhanced toolkit of MyBatis for simplify development
https://baomidou.com
Apache License 2.0
16.3k stars 4.3k forks source link

自定义类 实现 IDdl 接口,执行 SQL 某些关键词报错 #6208

Closed Tellsea closed 2 months ago

Tellsea commented 3 months ago

MybatisPlus 3.5.4

执行语句: INSERT INTO sys_config VALUES (6, '系统访问-黑名单列表', 'sys.login.blackIPList', '', 'Y', '设置登录IP黑名单限制,多个匹配项以;分隔,支持匹配(*通配、网段)', 'admin', '2024-04-15 09:42:31', 'admin', '2024-04-15 09:42:31', 1);

报错内容: Error executing: INSERT INTO sys_config VALUES (6, '系统访问-黑名单列表', 'sys.login.blackIPList', '', 'Y', '设置登录IP黑名单限制,多个匹配项以 . Cause: java.sql.SQLSyntaxErrorException: 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 ''设置登录IP黑名单限制,多个匹配项以' at line 3

miemieYaho commented 3 months ago

mp不参与sql执行

qmdx commented 3 months ago

检查下是不是因为可能是使用符合 ; 内部分,这个默认会作为执行 SQL 分割结束符合,如果是这个问题可以根据文档 https://baomidou.com/guides/auto-ddl/ 执行 SQL 结束符,或者过滤执行 脚本的特殊符号