Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using(subquery column) #255

Closed
FlyingMao opened this issue Sep 8, 2017 · 0 comments
Closed

Error when using(subquery column) #255

FlyingMao opened this issue Sep 8, 2017 · 0 comments
Assignees
Milestone

Comments

@FlyingMao
Copy link

steps:

mysql> CREATE TABLE a_test(`id` int(10) unsigned NOT NULL,`t_id` int(10) unsigned NOT NULL DEFAULT '0',`name` char(120) NOT NULL DEFAULT '',`pad` int(11) NOT NULL,PRIMARY KEY (`id`),KEY `k_1` (`t_id`));
Query OK, 0 rows affected (0.03 sec)

mysql> CREATE TABLE a_order(`id` int(10) unsigned NOT NULL,`o_id` int(10) unsigned NOT NULL DEFAULT '0',`name` char(120) NOT NULL DEFAULT '',`pad` int(11) NOT NULL,PRIMARY KEY (`id`),KEY `k_1` (`o_id`));
Query OK, 0 rows affected (0.03 sec)

mysql> insert into a_test values(1,1,'test中id为1',1),(2,2,'test_2',2),(3,3,'test中id为3',4),(4,4,'$test$4',3),(5,5,'test...5',1),(6,6,'test6',6);
Query OK, 6 rows affected (0.02 sec)

mysql> insert into a_order values(1,1,'order中id为1',1),(2,2,'test_2',2),(3,3,'order中id为3',3),(4,4,'$order$4',4),(5,5,'order...5',1);
Query OK, 5 rows affected (0.02 sec)

mysql> select * from a_test a join (select * from a_order where pad>0) b  using(pad) order by a.id,b.id;
ERROR 1003 (HY000): field not found:b.pad
mysql> select * from a_test a join (select * from a_order where pad>0) b  using(pad) order by a.id,b.id;
ERROR 1003 (HY000): Illegal Capacity: -1


general.log

170908 18:33:25	  226 Query	SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
		  226 Query	select `a`.`pad`,`a`.`id`,`a`.`name`,`a`.`t_id` from  `a_test` `a`
		  199 Query	SET autocommit=1;
		  199 Query	select `a`.`pad`,`a`.`id`,`a`.`name`,`a`.`t_id` from  `a_test` `a`
		  223 Query	select `a_order`.`id` as `id`,`a_order`.`o_id` as `o_id`,`a_order`.`name` as `name` from  `a_order` where pad > 0
		  222 Query	SET autocommit=1;
		  222 Query	select `a_order`.`id` as `id`,`a_order`.`o_id` as `o_id`,`a_order`.`name` as `name` from  `a_order` where pad > 0

dble.log

2017-09-08 18:32:46.100  WARN [complexQueryExecutor108] (com.actiontech.dble.backend.mysql.nio.MySQLConnectionHandler.handleDataError(MySQLConnectionHandler.java:231)) - MySQLConnection [id=105, lastTime=1504866766083, user=test, schema=db1, old shema=db1, borrowed=true, fromSlaveDB=false, threadId=200, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=com.actiontech.dble.backend.mysql.nio.handler.query.impl.BaseSelectHandler@230030d0, host=10.186.24.46, port=3306, statusSync=com.actiontech.dble.backend.mysql.nio.MySQLConnection$StatusSync@78f216da, writeQueue=0, modifiedSQLExecuted=false] handle data error:
com.actiontech.dble.plan.common.exception.MySQLOutPutException: field not found:b.pad
	at com.actiontech.dble.backend.mysql.nio.handler.util.HandlerTool.createFieldItem(HandlerTool.java:249) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.util.HandlerTool.createItem(HandlerTool.java:101) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.util.HandlerTool.createFunctionItem(HandlerTool.java:207) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.util.HandlerTool.createItem(HandlerTool.java:85) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.query.impl.WhereHandler.fieldEofResponse(WhereHandler.java:40) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.query.impl.join.JoinHandler.fieldEofResponse(JoinHandler.java:99) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.query.impl.SendMakeHandler.fieldEofResponse(SendMakeHandler.java:78) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.query.impl.MultiNodeMergeHandler.fieldEofResponse(MultiNodeMergeHandler.java:105) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.query.impl.BaseSelectHandler.fieldEofResponse(BaseSelectHandler.java:100) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.MySQLConnectionHandler.handleFieldEofPacket(MySQLConnectionHandler.java:192) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.MySQLConnectionHandler.handleData(MySQLConnectionHandler.java:118) [dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.net.handler.BackendAsyncHandler$1.run(BackendAsyncHandler.java:55) [dble-2.17.08.0-dev.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [?:1.7.0_05]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [?:1.7.0_05]
	at java.lang.Thread.run(Thread.java:722) [?:1.7.0_05]
2017-09-08 18:34:26.524  WARN [Timer0] (com.actiontech.dble.net.NIOProcessor.backendCheck(NIOProcessor.java:219)) - found backend connection SQL timeout ,close it MySQLConnection [id=95, lastTime=1504865865543, user=test, schema=db2, old shema=db2, borrowed=true, fromSlaveDB=false, threadId=195, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=SQLJob [ id=0,dataNodeOrDatabase=db2,sql=select user(),  jobHandler=com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler@6c6d07fa], host=10.186.24.46, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]
2017-09-08 18:35:01.332  WARN [complexQueryExecutor110] (com.actiontech.dble.backend.mysql.nio.MySQLConnectionHandler.handleDataError(MySQLConnectionHandler.java:231)) - MySQLConnection [id=105, lastTime=1504866901323, user=test, schema=db1, old shema=db1, borrowed=true, fromSlaveDB=false, threadId=200, charset=utf8, txIsolation=3, autocommit=true, attachment=dn2{select `a_order`.`id` as `id`,`a_order`.`o_id` as `o_id`,`a_order`.`name` as `name` from  `a_order` where pad > 0}.1, respHandler=com.actiontech.dble.backend.mysql.nio.handler.query.impl.BaseSelectHandler@177bb2da, host=10.186.24.46, port=3306, statusSync=com.actiontech.dble.backend.mysql.nio.MySQLConnection$StatusSync@78f216da, writeQueue=0, modifiedSQLExecuted=false] handle data error:
java.lang.IllegalArgumentException: Illegal Capacity: -1
	at java.util.ArrayList.<init>(ArrayList.java:130) ~[?:1.7.0_05]
	at com.actiontech.dble.net.mysql.RowDataPacket.<init>(RowDataPacket.java:67) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.handler.query.impl.BaseSelectHandler.rowResponse(BaseSelectHandler.java:107) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.MySQLConnectionHandler.handleRowPacket(MySQLConnectionHandler.java:204) ~[dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.backend.mysql.nio.MySQLConnectionHandler.handleData(MySQLConnectionHandler.java:135) [dble-2.17.08.0-dev.jar:?]
	at com.actiontech.dble.net.handler.BackendAsyncHandler$1.run(BackendAsyncHandler.java:55) [dble-2.17.08.0-dev.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [?:1.7.0_05]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [?:1.7.0_05]
	at java.lang.Thread.run(Thread.java:722) [?:1.7.0_05]

yanhuqing666 added a commit that referenced this issue Sep 12, 2017
@FlyingMao FlyingMao added this to the 2.17.08.0 milestone Sep 13, 2017
yanhuqing666 added a commit that referenced this issue May 27, 2020
sunsun314 pushed a commit that referenced this issue Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants