-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Fix issue:Add field type judgment in PaginationContext #34332
base: master
Are you sure you want to change the base?
Conversation
…rameters is greater than the number of inserted fields
# Conflicts: # proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
@@ -58,7 +58,7 @@ private Long getValue(final PaginationValueSegment paginationValueSegment, final | |||
if (null == obj) { | |||
return null; | |||
} | |||
return obj instanceof Long ? (long) obj : (int) obj; | |||
return obj instanceof byte[] ? (long) (((byte[]) obj)[0] - '0') : obj instanceof Long ? (long) obj : (int) obj; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the LIMIT parameter a byte[]? Is this a special treatment of the MySQL protocol for the Go language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, please add an E2E SQL that can reproduce this exception. You can add a new case in https://github.com/apache/shardingsphere/blob/master/test/e2e/sql/src/test/resources/cases/dql/e2e-dql-select.xml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not particularly clear about the processing method of the Go language, I just found that the LIMIT parameter will be resolved to byte[] when I use Golang to execute prepare sql.
such as : SELECT order_id FROM t_order LIMIT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, please add an E2E SQL that can reproduce this exception. You can add a new case in https://github.com/apache/shardingsphere/blob/master/test/e2e/sql/src/test/resources/cases/dql/e2e-dql-select.xml.
I have already added an E2E SQL case
Fixes #34289.
Add type judgment for the limit parameter
Changes proposed in this pull request:
Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.