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

全局序列号-8.8方式配置自增长主键一直报错 #60

Open
wincLei opened this issue Mar 12, 2018 · 1 comment
Open

全局序列号-8.8方式配置自增长主键一直报错 #60

wincLei opened this issue Mar 12, 2018 · 1 comment

Comments

@wincLei
Copy link

wincLei commented Mar 12, 2018

[DEBUG][Thread-1] get next segement of sequence from db for sequnce:USER_INFO curVal 0 (io.mycat.route.sequence.handler.IncrSequenceMySQLHandler:IncrSequenceMySQLHandler.java:113)
INFO | jvm 1 | 2018/03/12 19:06:20 | 2018-03-12 19:06:19,953 [DEBUG][Thread-1] execute in datanode cashtoutiaoDn1 for fetch sequnce sql SELECT mycat_seq_nextval('USER_INFO') (io.mycat.route.sequence.handler.FetchMySQLSequnceHandler:IncrSequenceMySQLHandler.java:151)
INFO | jvm 1 | 2018/03/12 19:06:20 | 2018-03-12 19:06:19,953 [DEBUG][Thread-1] rrs.getRunOnSlave() null (io.mycat.backend.datasource.PhysicalDBNode:PhysicalDBNode.java:96)
INFO | jvm 1 | 2018/03/12 19:06:20 | 2018-03-12 19:06:19,953 [DEBUG][Thread-1] rrs.getRunOnSlave() null (io.mycat.backend.datasource.PhysicalDBNode:PhysicalDBNode.java:127)
INFO | jvm 1 | 2018/03/12 19:06:20 | 2018-03-12 19:06:19,953 [WARN ][Thread-1] executeException java.io.UnsupportedEncodingException: unsupported yet (io.mycat.route.sequence.handler.FetchMySQLSequnceHandler:IncrSequenceMySQLHandler.java:237)
INFO | jvm 1 | 2018/03/12 19:06:20 | 2018-03-12 19:06:20,355 [DEBUG][Timer0] JDBCHeartBeat con query sql: select user() (io.mycat.backend.jdbc.JDBCHeartbeat:JDBCHeartbeat.java:109)
INFO | jvm 1 | 2018/03/12 19:06:20 | 2018-03-12 19:06:20,358 [DEBUG][Timer0] JDBCHeartBeat con query sql: select user() (io.mycat.backend.jdbc.JDBCHeartbeat:JDBCHeartbeat.java:109)
INFO | jvm 1 | 2018/03/12 19:06:20 | 2018-03-12 19:06:20,361 [DEBUG][Timer0] JDBCHeartBeat con query sql: select user() (io.mycat.backend.jdbc.JDBCHeartbeat:JDBCHeartbeat.java:109)
INFO | jvm 1 | 2018/03/12 19:06:30 | 2018-03-12 19:06:29,965 [ERROR][Thread-1] MyCATSequenceProcessor.executeSeq(SesionSQLPair) java.lang.RuntimeException: can't fetch sequnce in db,sequnce :USER_INFO detail:java.io.UnsupportedEncodingException: unsupported yet
INFO | jvm 1 | 2018/03/12 19:06:30 | at io.mycat.route.sequence.handler.IncrSequenceMySQLHandler.getSeqValueFromDB(IncrSequenceMySQLHandler.java:125)
INFO | jvm 1 | 2018/03/12 19:06:30 | at io.mycat.route.sequence.handler.IncrSequenceMySQLHandler.nextId(IncrSequenceMySQLHandler.java:94)
INFO | jvm 1 | 2018/03/12 19:06:30 | at io.mycat.route.parser.druid.DruidSequenceHandler.getExecuteSql(DruidSequenceHandler.java:64)
INFO | jvm 1 | 2018/03/12 19:06:30 | at io.mycat.route.MyCATSequnceProcessor.executeSeq(MyCATSequnceProcessor.java:85)
INFO | jvm 1 | 2018/03/12 19:06:30 | at io.mycat.route.MyCATSequnceProcessor.access$200(MyCATSequnceProcessor.java:19)
INFO | jvm 1 | 2018/03/12 19:06:30 | at io.mycat.route.MyCATSequnceProcessor$ExecuteThread.run(MyCATSequnceProcessor.java:110)
INFO | jvm 1 | 2018/03/12 19:06:30 | (io.mycat.route.MyCATSequnceProcessor:MyCATSequnceProcessor.java:89)

server.xml 里面配置了1

表user_info配置了主键自增,schema.xml 中配置了

一直报上面的错误,希望给予指导

走了一些debug的流程,代码有点多,而且貌似跟8.3的方法有重叠交叉的部分,比较困惑

@llg-software
Copy link

llg-software commented Jul 20, 2018

这个问题我也遇到了,找了好久,后面发现是 UnsupportedEncodingException 这个异常,连蒙带猜的,修改了

<dataHost name="shard1" maxCon="1000" minCon="10" balance="1" writeType="0" dbType="mysql" dbDriver="native" switchType="-1" slaveThreshold="100">

把dbDriver="jdbc" 改成 dbDriver="native" 居然正常了,

mysql> select last_insert_id();
+------------------+
| LAST_INSERT_ID() |
+------------------+
| 105 |
+------------------+
1 row in set (0.00 sec)

神奇的mycat,坑太多了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants