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

Class MySQLComStmtExecuteExecutor throws a NullPointerException when select with limit by Golang #34289

Open
strawberry1314 opened this issue Jan 9, 2025 · 1 comment · May be fixed by #34332
Milestone

Comments

@strawberry1314
Copy link
Contributor

Bug Report

Which version of ShardingSphere did you use?

5.5.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

proxy

Expected behavior

select success

Actual behavior

Class MySQLComStmtExecuteExecutor throws NullPointerException
image

Reason analyze (If you can)

For some prepared query SQL statements with limit condition, class PaginationContext will throw a ClassCastException when init creating, causing the query fail, and the final manifestation is that class MySQLComStmtExecuteExecutor throws a NullPointerException

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

1、use Golang to execute the SQL statement
image
2、sql statement example:
select id, content from test_table where version=? and create_time>? order by create_time desc limit ?, ?

Example codes for reproduce this issue (such as a github link).

Class:PaginationContext
the obj is instanceof byte[], if it is forcefully converted to int, a ClassCastException will be thrown
image

@terrymanu
Copy link
Member

@strawberry1314 Thank you to find the issue, could you submit a PR to fix it too?

@strawberry1314 strawberry1314 linked a pull request Jan 13, 2025 that will close this issue
7 tasks
@taojintianxia taojintianxia added this to the 5.5.3 milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants