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 restart, for create statement whose index_col_name with the option of [(length)] [ASC | DESC] #244

Closed
actiontech-bot opened this issue Sep 3, 2017 · 0 comments

Comments

@actiontech-bot
Copy link
Member

actiontech-bot commented Sep 3, 2017

Raised by: @sevenFH

mysql> create table mytest_test1(id int,data varchar(10),key (data(2)));
Query OK, 0 rows affected (0.06 sec)

mysql> show create table mytest_test1;
+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table        | Create Table                                                                                                                                                |
+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mytest_test1 | CREATE TABLE `mytest_test1` (
  `id` int(11) DEFAULT NULL,
  `data` varchar(10) DEFAULT NULL,
  KEY `data` (`data`(2))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+--------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> 

Restart mycat server

[root@10-186-23-12 logs]# sh ../bin/mycat restart
Stopping Mycat-server...
Stopped Mycat-server.
Starting Mycat-server...
[root@10-186-23-12 logs]# ps aux|grep mycat
root     10883  0.0  0.0  19128   800 ?        Sl   16:12   0:00 /opt/mycat/bin/./wrapper-linux-x86-64 /opt/mycat/conf/wrapper.conf wrapper.syslog.ident=mycat wrapper.pidfile=/opt/mycat/logs/mycat.pid wrapper.daemonize=TRUE wrapper.lockfile=/var/lock/subsys/mycat
root     10885 36.5  7.1 8064256 282508 ?      Sl   16:12   0:02 java -DMYCAT_HOME=. -server -XX:MaxPermSize=64M -XX:+AggressiveOpts -XX:MaxDirectMemorySize=2G -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1984 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Xmx4G -Xms1G -Djava.library.path=lib -classpath lib/wrapper.jar:conf:lib/wrapper.jar:lib/ehcache-core-2.6.11.jar:lib/commons-collections-3.2.1.jar:lib/log4j-1.2-api-2.7.jar:lib/leveldb-api-0.7.jar:lib/zookeeper-3.4.6.jar:lib/reflectasm-1.03.jar:lib/joda-time-2.9.3.jar:lib/jline-0.9.94.jar:lib/curator-client-2.11.0.jar:lib/gson-2.8.0.jar:lib/log4j-slf4j-impl-2.7.jar:lib/asm-4.0.jar:lib/log4j-1.2.17.jar:lib/leveldb-0.7.jar:lib/libwrapper-linux-x86-32.so:lib/hamcrest-library-1.3.jar:lib/velocity-1.7.jar:lib/libwrapper-linux-ppc-64.so:lib/jsr305-2.0.3.jar:lib/univocity-parsers-2.2.1.jar:lib/dom4j-1.6.1.jar:lib/minlog-1.2.jar:lib/commons-lang-2.6.jar:lib/protobuf-java-2.6.1.jar:lib/hamcrest-core-1.3.jar:lib/guava-19.0.jar:lib/disruptor-3.3.6.jar:lib/log4j-core-2.7.jar:lib/log4j-api-2.7.jar:lib/Action_Mycat-2.17.08.0-dev.jar:lib/curator-framework-2.11.0.jar:lib/libwrapper-linux-x86-64.so:lib/curator-recipes-2.11.0.jar:lib/slf4j-api-1.6.1.jar:lib/druid-1.0.31.jar:lib/fastjson-1.2.12.jar:lib/kryo-2.10.jar:lib/objenesis-1.2.jar:lib/netty-3.7.0.Final.jar:lib/mapdb-1.0.7.jar -Dwrapper.key=qKWomBSsmq1opmuB -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=10883 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp io.mycat.MycatStartup start
root     10926  0.0  0.0 103252   868 pts/5    R+   16:12   0:00 grep mycat

Log error

2017-09-01 16:12:32.844  WARN [BusinessExecutor5] (io.mycat.backend.mysql.nio.MySQLConnectionHandler.handleDataError(MySQLConnectionHandler.java:231)) - MySQLConnection [id=82, lastTime=1504253552344, user=test, schema=db2, old shema=db2, borrowed=false, fromSlaveDB=false, threadId=12825, charset=utf8, txIsolation=-1, autocommit=true, attachment=null, respHandler=null, host=10.186.23.11, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false] handle data error:
java.lang.ClassCastException: com.alibaba.druid.sql.ast.expr.SQLMethodInvokeExpr cannot be cast to com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr
	at io.mycat.meta.table.MetaHelper.genIndexName(MetaHelper.java:71) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.meta.table.MetaHelper.initTableMeta(MetaHelper.java:57) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.meta.table.AbstractTableMetaHandler$MySQLTableStructureListener.initTableMeta(AbstractTableMetaHandler.java:139) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.meta.table.AbstractTableMetaHandler$MySQLTableStructureListener.onResult(AbstractTableMetaHandler.java:113) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.meta.table.AbstractTableMetaHandler$MySQLTableStructureListener.onResult(AbstractTableMetaHandler.java:66) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.sqlengine.OneRawSQLQueryResultHandler.finished(OneRawSQLQueryResultHandler.java:85) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.sqlengine.SQLJob.doFinished(SQLJob.java:95) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.sqlengine.SQLJob.rowEofResponse(SQLJob.java:156) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.backend.mysql.nio.MySQLConnectionHandler.handleRowEofPacket(MySQLConnectionHandler.java:223) ~[Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.backend.mysql.nio.MySQLConnectionHandler.handleData(MySQLConnectionHandler.java:132) [Action_Mycat-2.17.08.0-dev.jar:?]
	at io.mycat.net.handler.BackendAsyncHandler$1.run(BackendAsyncHandler.java:55) [Action_Mycat-2.17.08.0-dev.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]

Can not log in

[root@10-186-23-12 ~]# mycat8066
Warning: Using a password on the command line interface can be insecure.

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

4 participants