Mycat批量插入报错

没落孤鸿 发布于 2016/05/19 14:37
阅读 2K+
收藏 0

批量插入使用注解

/*!mycat:catlet=demo.catlets.BatchInsertSequence */
INSERT INTO unit (id,name)
VALUES
(next VALUE FOR UNIT,'1'),
(next VALUE FOR UNIT,'2'),
(next VALUE FOR UNIT,'3'),
(next VALUE FOR UNIT,'4')
查看日志报错
05/19 10:20:10.034  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:119) -BatchInsertSequence.route(......)
java.lang.NullPointerException
	at demo.catlets.BatchInsertSequence.route(BatchInsertSequence.java:87)
	at org.opencloudb.route.handler.HintCatletHandler.route(HintCatletHandler.java:52)
	at org.opencloudb.route.RouteService.route(RouteService.java:107)
	at org.opencloudb.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:201)
	at org.opencloudb.server.ServerConnection.execute(ServerConnection.java:154)
	at org.opencloudb.server.ServerQueryHandler.query(ServerQueryHandler.java:120)
	at org.opencloudb.net.FrontendConnection.query(FrontendConnection.java:319)
	at org.opencloudb.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at org.opencloudb.net.FrontendConnection.rawHandle(FrontendConnection.java:456)
	at org.opencloudb.net.FrontendConnection.handle(FrontendConnection.java:434)
	at org.opencloudb.net.AbstractConnection.onReadData(AbstractConnection.java:307)
	at org.opencloudb.net.NIOSocketWR.asynRead(NIOSocketWR.java:186)
	at org.opencloudb.net.AbstractConnection.asynRead(AbstractConnection.java:268)
	at org.opencloudb.net.NIOReactor$RW.run(NIOReactor.java:96)
	at java.lang.Thread.run(Thread.java:745)
05/19 10:20:10.035  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:131) -BatchInsertSequence.getRoute(String sql)
java.lang.NullPointerException
05/19 10:20:10.036  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:64) -BatchInsertSequence.processSQL(String sql, EngineCtx ctx)
java.lang.NullPointerException
	at demo.catlets.BatchInsertSequence.processSQL(BatchInsertSequence.java:52)
	at org.opencloudb.route.handler.HintCatletHandler.route(HintCatletHandler.java:53)
	at org.opencloudb.route.RouteService.route(RouteService.java:107)
	at org.opencloudb.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:201)
	at org.opencloudb.server.ServerConnection.execute(ServerConnection.java:154)
	at org.opencloudb.server.ServerQueryHandler.query(ServerQueryHandler.java:120)
	at org.opencloudb.net.FrontendConnection.query(FrontendConnection.java:319)
	at org.opencloudb.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at org.opencloudb.net.FrontendConnection.rawHandle(FrontendConnection.java:456)
	at org.opencloudb.net.FrontendConnection.handle(FrontendConnection.java:434)
	at org.opencloudb.net.AbstractConnection.onReadData(AbstractConnection.java:307)
	at org.opencloudb.net.NIOSocketWR.asynRead(NIOSocketWR.java:186)
	at org.opencloudb.net.AbstractConnection.asynRead(AbstractConnection.java:268)
	at org.opencloudb.net.NIOReactor$RW.run(NIOReactor.java:96)
	at java.lang.Thread.run(Thread.java:745)
何解?求大神解答,是我的语句有问题吗
加载中
0
1972873004
1972873004

不支持insert into

0
941219
941219

可能是没找到对应的序列值,你用的本地文件方式还是数据库的方式?

返回顶部
顶部