{"action":"created","issue":{"url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/419","labels_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/419/labels{/name}","comments_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/419/comments","events_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/419/events","html_url":"https://github.com/MyCATApache/Mycat-Server/issues/419","id":98874203,"number":419,"title":"1.4RC版本，使用大批量INSERT语句插入数据时丢失与MYSQL的连接","user":{"login":"441853335","id":13634277,"avatar_url":"https://avatars.githubusercontent.com/u/13634277?v=3","gravatar_id":"","url":"https://api.github.com/users/441853335","html_url":"https://github.com/441853335","followers_url":"https://api.github.com/users/441853335/followers","following_url":"https://api.github.com/users/441853335/following{/other_user}","gists_url":"https://api.github.com/users/441853335/gists{/gist_id}","starred_url":"https://api.github.com/users/441853335/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/441853335/subscriptions","organizations_url":"https://api.github.com/users/441853335/orgs","repos_url":"https://api.github.com/users/441853335/repos","events_url":"https://api.github.com/users/441853335/events{/privacy}","received_events_url":"https://api.github.com/users/441853335/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-04T02:13:30Z","updated_at":"2015-08-04T09:06:16Z","closed_at":null,"body":"使用source语句大批量INSERT语句，格式如：insert into table1(col1,col2,...) values(v1,v2,...)(v3,v4,...)...  \r\n在values数量很小的情况下没有问题，但是在values数量很大的时候（十万百万级，文件大约数百M）就会丢失连接，还有就是在MYSQL单机中加载文件一切正常。\r\n怀疑是JVM内存与MYCAT缓存的问题。\r\n已经尝试过调大 MaxPermSize，MaxDirectMemorySize，processorBufferChunk，processorBufferPool，maxPacketSize等参数，MYSQL相关的参数max_allowed_packet，max_heap_table_size，tmp_table_size也做过调整，均无效果。\r\n\r\n日志如下：\r\n\r\n\t(273302, 19247, 'Add', NULL, 'c:\\\\documents and settings\\\\autoer\\\\application data\\\\xda7a\\\\jlxf.exe'),\r\n err:java.sql.SQLSyntaxErrorException: com.alibaba.druid.sql.parser.ParserException: syntax error, expect ')'\r\njava.sql.SQLSyntaxErrorException: com.alibaba.druid.sql.parser.ParserException: syntax error, expect ')'\r\n\tat org.opencloudb.route.impl.DruidMycatRouteStrategy.routeNormalSqlWithAST(DruidMycatRouteStrategy.java:53)\r\n\tat org.opencloudb.route.impl.AbstractRouteStrategy.route(AbstractRouteStrategy.java:57)\r\n\tat org.opencloudb.route.RouteService.route(RouteService.java:118)\r\n\tat org.opencloudb.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:201)\r\n\tat org.opencloudb.server.ServerConnection.execute(ServerConnection.java:154)\r\n\tat org.opencloudb.server.ServerQueryHandler.query(ServerQueryHandler.java:120)\r\n\tat org.opencloudb.net.FrontendConnection.query(FrontendConnection.java:319)\r\n\tat org.opencloudb.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)\r\n\tat org.opencloudb.net.FrontendConnection.rawHandle(FrontendConnection.java:456)\r\n\tat org.opencloudb.net.FrontendConnection.handle(FrontendConnection.java:434)\r\n\tat org.opencloudb.net.AbstractConnection.onReadData(AbstractConnection.java:306)\r\n\tat org.opencloudb.net.NIOSocketWR.asynRead(NIOSocketWR.java:186)\r\n\tat org.opencloudb.net.AbstractConnection.asynRead(AbstractConnection.java:267)\r\n\tat org.opencloudb.net.NIOReactor$RW.run(NIOReactor.java:96)\r\n\tat java.lang.Thread.run(Thread.java:722)\r\nCaused by: com.alibaba.druid.sql.parser.ParserException: syntax error, expect ')'\r\n\tat com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseValueClause(MySqlStatementParser.java:2009)\r\n\tat com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseInsert(MySqlStatementParser.java:1957)\r\n\tat com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser.parseInsert(MySqlStatementParser.java:153)\r\n\tat com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:160)\r\n\tat com.alibaba.druid.sql.parser.SQLStatementParser.parseStatement(SQLStatementParser.java:1658)\r\n\tat org.opencloudb.route.impl.DruidMycatRouteStrategy.routeNormalSqlWithAST(DruidMycatRouteStrategy.java:49)\r\n\t... 14 more\r\n\r\n从日志来看是语法错误，初步判断是由于整个INSERT语句未读取完整导致。\r\n虽然可以使用替代方案来完成大批量数据插入，但是还是想知道这个问题有没有解决的方法。"},"comment":{"url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/comments/127533791","html_url":"https://github.com/MyCATApache/Mycat-Server/issues/419#issuecomment-127533791","issue_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/419","id":127533791,"user":{"login":"mycatmerger","id":10161777,"avatar_url":"https://avatars.githubusercontent.com/u/10161777?v=3","gravatar_id":"","url":"https://api.github.com/users/mycatmerger","html_url":"https://github.com/mycatmerger","followers_url":"https://api.github.com/users/mycatmerger/followers","following_url":"https://api.github.com/users/mycatmerger/following{/other_user}","gists_url":"https://api.github.com/users/mycatmerger/gists{/gist_id}","starred_url":"https://api.github.com/users/mycatmerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mycatmerger/subscriptions","organizations_url":"https://api.github.com/users/mycatmerger/orgs","repos_url":"https://api.github.com/users/mycatmerger/repos","events_url":"https://api.github.com/users/mycatmerger/events{/privacy}","received_events_url":"https://api.github.com/users/mycatmerger/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T09:06:16Z","updated_at":"2015-08-04T09:06:16Z","body":"估计跟sql过长了，druid解析出的错；建议分批拆开或者使用load data"}}