Skip to content

handle byte[] pagination parameters in PaginationContext(#34289)#38057

Merged
terrymanu merged 3 commits intoapache:masterfrom
aMetric:master
Feb 17, 2026
Merged

handle byte[] pagination parameters in PaginationContext(#34289)#38057
terrymanu merged 3 commits intoapache:masterfrom
aMetric:master

Conversation

@aMetric
Copy link
Contributor

@aMetric aMetric commented Feb 16, 2026

What is the purpose of the change

Fixes #34289.

When executing MySQL prepared statements with pagination placeholders (for example, LIMIT ? or LIMIT ?, ?), some clients (such as Go MySQL clients) may send parameter values as byte[] in binary protocol.
PaginationContext previously assumed pagination marker values were only Long or Integer, which could cause runtime failures in the proxy execution path.

This PR makes pagination parameter conversion robust for binary-protocol inputs without changing normal numeric behavior.

Brief changelog

  • Refactor pagination marker conversion in:
    • PaginationContext#getValue
    • add PaginationContext#getLongValue
  • Support pagination marker values from:
    • Number
    • byte[] (parsed as UTF-8 full numeric string)
    • string-like objects via toString()
  • Add dedicated unit tests:
    • PaginationContextTest#assertGetActualOffsetWithByteArrayParameters
    • PaginationContextTest#assertGetActualRowCountWithByteArrayParameters
    • SelectStatementContextTest#assertBindParametersPopulatePaginationContextWithByteArrayParameters

@aMetric aMetric marked this pull request as draft February 16, 2026 04:03
@aMetric aMetric marked this pull request as ready for review February 16, 2026 04:13
@terrymanu
Copy link
Member

Please fix spotless for code format

@aMetric
Copy link
Contributor Author

aMetric commented Feb 16, 2026

Hi @terrymanu ,

Happy New Year! 🎉

I've fixed the code format with Spotless. Please review when you have time.

Thanks!

@terrymanu terrymanu added this to the 5.5.3 milestone Feb 17, 2026
@terrymanu terrymanu merged commit af83587 into apache:master Feb 17, 2026
148 checks passed
@terrymanu
Copy link
Member

@aMetric Happy New Year! 🎉
Thank you for contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Class MySQLComStmtExecuteExecutor throws a NullPointerException when select with limit by Golang

2 participants