{"action":"opened","issue":{"url":"https://api.github.com/repos/alibaba/druid/issues/2028","repository_url":"https://api.github.com/repos/alibaba/druid","labels_url":"https://api.github.com/repos/alibaba/druid/issues/2028/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/druid/issues/2028/comments","events_url":"https://api.github.com/repos/alibaba/druid/issues/2028/events","html_url":"https://github.com/alibaba/druid/issues/2028","id":262960055,"number":2028,"title":"不支持 MySQL 建表时存在索引","user":{"login":"lg-Cat73","id":29110074,"avatar_url":"https://avatars3.githubusercontent.com/u/29110074?v=4","gravatar_id":"","url":"https://api.github.com/users/lg-Cat73","html_url":"https://github.com/lg-Cat73","followers_url":"https://api.github.com/users/lg-Cat73/followers","following_url":"https://api.github.com/users/lg-Cat73/following{/other_user}","gists_url":"https://api.github.com/users/lg-Cat73/gists{/gist_id}","starred_url":"https://api.github.com/users/lg-Cat73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lg-Cat73/subscriptions","organizations_url":"https://api.github.com/users/lg-Cat73/orgs","repos_url":"https://api.github.com/users/lg-Cat73/repos","events_url":"https://api.github.com/users/lg-Cat73/events{/privacy}","received_events_url":"https://api.github.com/users/lg-Cat73/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-04T23:17:16Z","updated_at":"2017-10-04T23:17:16Z","closed_at":null,"author_association":"NONE","body":"我在单元测试的时候用的会重新初始化测试数据库已便保证是测试所需的结构和数据。\r\n\r\n然而在建表的时候抛错了，语句如下：\r\n\r\n```sql\r\nDROP TABLE IF EXISTS `admin`;\r\nCREATE TABLE `admin` (\r\n  `id` char(20) NOT NULL,\r\n  `username` varchar(16) NOT NULL COMMENT '用户名',\r\n  `password` varchar(32) NOT NULL COMMENT '密码',\r\n  `permission` varchar(255) NOT NULL DEFAULT '' COMMENT '权限',\r\n  PRIMARY KEY (`id`) USING BTREE\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员';\r\n```\r\n错误如下：\r\n```sql\r\nCaused by: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'id`) USING BTREE ) ENGINE=InnoDB DE', expect RPAREN, actual IDENTIFIER pos 224, line 1, column 219, token IDENTIFIER USING : CREATE TABLE `admin` ( `id` char(20) NOT NULL, `username` varchar(16) NOT NULL COMMENT '用户名', `password` varchar(32) NOT NULL COMMENT '密码', `permission` varchar(255) NOT NULL DEFAULT '' COMMENT '权限', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员'\r\n\tat com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:798)\r\n\tat com.alibaba.druid.wall.WallFilter.check(WallFilter.java:780)\r\n\tat com.alibaba.druid.wall.WallFilter.statement_execute(WallFilter.java:413)\r\n\tat com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2598)\r\n\tat com.alibaba.druid.filter.FilterAdapter.statement_execute(FilterAdapter.java:2473)\r\n\tat com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:188)\r\n\tat com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2598)\r\n\tat com.alibaba.druid.proxy.jdbc.StatementProxyImpl.execute(StatementProxyImpl.java:147)\r\n\tat com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:497)\r\n\tat org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:470)\r\n\t... 116 more\r\nCaused by: com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'id`) USING BTREE ) ENGINE=InnoDB DE', expect RPAREN, actual IDENTIFIER pos 224, line 1, column 219, token IDENTIFIER USING\r\n\tat com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:285)\r\n\tat com.alibaba.druid.sql.parser.SQLParser.accept(SQLParser.java:293)\r\n\tat com.alibaba.druid.sql.dialect.mysql.parser.MySqlCreateTableParser.parseCreateTable(MySqlCreateTableParser.java:189)\r\n\tat com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseCreate(MySqlStatementParser.java:224)\r\n\tat com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:157)\r\n\tat com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:79)\r\n\tat com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:622)\r\n\tat com.alibaba.druid.wall.WallProvider.check(WallProvider.java:576)\r\n\tat com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:785)\r\n\t... 125 more\r\n```\r\n"}}
{"actor":{"display_login":"lg-Cat73"}}