Skip to content

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

Open
@strawberry1314

Description

@strawberry1314

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions