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.0.30+使用cahcing_sha2_password时Fastauth报错问题 #5406

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kkz-01
Copy link

@kkz-01 kkz-01 commented Mar 12, 2025

环境描述:
MYSQL服务端版本:8.0.36
Canal:1.1.8
背景:MYSQL服务端版本为8.0.36时采用caching_sha2_password插件认证,使用caching_sha2_password登录插件账号FullAuth登录后服务端存在缓存,再次登录报错。断点发现非首次连接存在包未读的情况,导致后续访问越界。FullAuth情况正常
单元测试:
执行了com/alibaba/otter/canal/parse/driver/mysql/MysqlConnectorTest.java

报错如下:

java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at com.alibaba.otter.canal.parse.driver.mysql.utils.ByteHelper.readUnsignedShortLittleEndian(ByteHelper.java:61)
	at com.alibaba.otter.canal.parse.driver.mysql.packets.server.EOFPacket.fromBytes(EOFPacket.java:31)
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.parseEOFPacket(MysqlQueryExecutor.java:157)
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.readEofPacket(MysqlQueryExecutor.java:151)
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.query(MysqlQueryExecutor.java:74)
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.printSslStatus(MysqlConnector.java:95)
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:82)
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnectorTest.testQuery(MysqlConnectorTest.java:23)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


zhangkai seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@kkz-01
Copy link
Author

kkz-01 commented Mar 12, 2025

相关截图
截图1

@kkz-01
Copy link
Author

kkz-01 commented Mar 12, 2025

截图2

@kkz-01
Copy link
Author

kkz-01 commented Mar 12, 2025

执行完negotiate后还能读取到数据
截图3

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

Successfully merging this pull request may close these issues.

2 participants