-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
MyCat Prepared Statement Id溢出Bug #2598
Comments
使用的是:Mycat-server-1675-release 这个版本,1.7好像解决了这个问题,但为什么还没有发布? |
@chank 这个故障我来确认下 |
@chank 问题已经修复。 分析:Prepare交互流程:
问题原因:
修复方法:
|
@funnyAnt @junwen12221 你只是改为AtomicInteger的话还是会溢出的,应该要将static去掉,将递增改为连接级别的 |
junwen12221
added a commit
that referenced
this issue
Oct 8, 2020
#2598 修复Prepared Statement Id溢出Bug
|
@funnyAnt 请问什么时候可以发布啊? |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MyCat Prepared Statement Id溢出:
原因分析:
MyCat Prepared Statement Id是实例(进程)级别递增,只有重启MyCat Prepared Statement Id才会从0开始(MySQL Driver约定的Prepared Statement Id只有32位):
https://github.com/MyCATApache/Mycat-Server/blob/https/github.com/MyCATApache/Mycat-Server/tree/Mycat-server-1.6.76-test/src/main/java/io/mycat/server/handler/ServerPrepareHandler.java#L80
https://github.com/MyCATApache/Mycat-Server/blob/https/github.com/MyCATApache/Mycat-Server/tree/Mycat-server-1.6.76-test/src/main/java/io/mycat/backend/mysql/BufferUtil.java#L55
但MySQL Server的Prepared Statement Id是在连接(线程)级别递增的,重新连接Prepared Statement就会从0开始:
https://github.com/mysql/mysql-server/blob/8.0/sql/sql_class.h#L2169
因此,MyCat对Prepared Statement Id的生成没有与MySQL Server保存一致,请问是否能保持一致?
The text was updated successfully, but these errors were encountered: