XiaoMi / Gaea

Gaea is a mysql proxy, it's developed by xiaomi b2c-dev team.
Apache License 2.0
2.65k stars 427 forks source link

不支持多语句插入数据吗 #256

Closed zpl06468 closed 5 months ago

zpl06468 commented 5 months ago

INSERT INTO leo_test1.table_01 (id, name) VALUES (8, 'lisi');INSERT INTO leo_test1.table_01 (id, name) VALUES (9, 'wangwu'); 使用jdbc PreparedStatement preparedStatement = connection.prepareStatement(sql2); ResultSet resultSet = preparedStatement.executeQuery(); 执行上面语句报语法错误

xiyangxixian commented 5 months ago

目前这个版本是不支持的,需要修改 capability 的值

zpl06468 commented 5 months ago

麻烦问下 怎么改

xiyangxixian commented 5 months ago

这个暂时还无法通过修改配置来解决,需要修改代码,这块比较复杂,可以参考未合并的 muti-query 的 mr https://github.com/XiaoMi/Gaea/pull/217

zpl06468 commented 5 months ago

好像navicat上是可以的 是什么原因知道吗

xiyangxixian commented 5 months ago

navicat 上实际还是拆分成多条语句去执行多次这样

zpl06468 commented 5 months ago

好的 感谢