`
gaojingsong
  • 浏览: 1202667 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

Mycat 之MySQL随机函数又爆Bug

阅读更多

今天测试了一下Mycat中的MySQL随机函数,又发现一个这样的Bug

2016-12-10 22:38:39,109 [INFO ][$_NIOREACTOR-2-RW] close connection,reason:quit cmd ,ServerConnection [id=4, schema=TESTDB, host=127.0.0.1, user=root,txIsolation=3, autocommit=true, schema=TESTDB]  (io.mycat.net.AbstractConnection:AbstractConnection.java:508) 

2016-12-10 22:40:22,953 [WARN ][$_NIOREACTOR-3-RW] caught exception  java.lang.IllegalArgumentException: all columns in order by clause should be in the selected column list!RAND()

at io.mycat.sqlengine.mpp.DataMergeService.onRowMetaData(DataMergeService.java:156)

at io.mycat.backend.mysql.nio.handler.MultiNodeQueryHandler.fieldEofResponse(MultiNodeQueryHandler.java:650)

at io.mycat.backend.mysql.nio.MySQLConnectionHandler.handleFieldEofPacket(MySQLConnectionHandler.java:192)

at io.mycat.backend.mysql.nio.MySQLConnectionHandler.handleData(MySQLConnectionHandler.java:118)

at io.mycat.net.handler.BackendAsyncHandler.offerData(BackendAsyncHandler.java:36)

at io.mycat.backend.mysql.nio.MySQLConnectionHandler.handle(MySQLConnectionHandler.java:80)

at io.mycat.net.AbstractConnection.handle(AbstractConnection.java:263)

at io.mycat.net.AbstractConnection.onReadData(AbstractConnection.java:321)

at io.mycat.net.NIOSocketWR.asynRead(NIOSocketWR.java:190)

at io.mycat.net.AbstractConnection.asynRead(AbstractConnection.java:273)

at io.mycat.net.NIOReactor$RW.run(NIOReactor.java:102)

at java.lang.Thread.run(Thread.java:722)

 (io.mycat.backend.mysql.nio.handler.MultiNodeQueryHandler:MultiNodeQueryHandler.java:663) 

2016-12-10 22:40:22,984 [INFO ][$_NIOREACTOR-3-RW] close connection,reason:java.lang.IllegalArgumentException: all columns in order by clause should be in the selected column list!RAND() ,MySQLConnection [id=28, lastTime=1481380822875, user=root, schema=db3, old shema=db3, borrowed=true, fromSlaveDB=false, threadId=25, charset=utf8, txIsolation=3, autocommit=true, attachment=dn3{SELECT *

FROM t_gaojs

ORDER BY RAND()

LIMIT 5}, respHandler=io.mycat.backend.mysql.nio.handler.MultiNodeQueryHandler@4f27a1, host=localhost, port=3306, statusSync=io.mycat.backend.mysql.nio.MySQLConnection$StatusSync@b2d7e8, writeQueue=0, modifiedSQLExecuted=false]  (io.mycat.net.AbstractConnection:AbstractConnection.java:508) 

2016-12-10 22:40:22,984 [INFO ][$_NIOREACTOR-3-RW] close connection,reason:java.lang.IllegalArgumentException: all columns in order by clause should be in the selected column list!RAND() ,MySQLConnection [id=15, lastTime=1481380822875, user=root, schema=db1, old shema=db1, borrowed=true, fromSlaveDB=false, threadId=20, charset=utf8, txIsolation=3, autocommit=true, attachment=dn1{SELECT *

FROM t_gaojs

ORDER BY RAND()

 

1)在Mycat中测试MySQL的随机函数

 

错误如下:

 

 

3)可以在非Mycat环境中执行的SQL语句

 

4)独创一条Mycat可以执行的SQL,可是结果不对

 

 

5)普通的Mycat环境根本不认识这个独有的SQL语句。

 

 

测试语句如下:

select * from t_gaojs ORDER BY RAND()  limit 3

select * from t_gaojs ORDER BY id R1AND()  limit 1

select * from t_gaojs ORDER BY id RAND()  limit 

  • 大小: 140 KB
  • 大小: 50.5 KB
  • 大小: 47.8 KB
  • 大小: 60.4 KB
  • 大小: 60.5 KB
0
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics