-
Notifications
You must be signed in to change notification settings - Fork 5.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
the result of prepare is different from that of direct query #22949
Comments
/assign @guo-shaoge |
Looks like same problem: #23125 |
root cause: When rewrite GetVar expr, we use ETString as result type. (type of session var a is TypeVarString, we deduce result type of GetVar expr is string). So we convert 0x3135 as string, which is "15", which equals 0x0F. Fix suggestion: But we don't have BinaryLiteral/HexLiteral type in EvalType(only ETInt, ETReal, ETString...). So result type of any expr cannot be BinaryLiteral/HexLiteral. (see scalar_function.go:Eval(). Result type of an expression is related to eval type) Maybe we should use result type of an expression to choose evalXXX function. Then add evalHex function for GetVar expr. PS: But the better way maybe no type switch in runtime, use function pointer to eval. These two issues(#14370 #23114) are also related. Maybe we should consider changing evalXXX function when we refactor our engine. |
If
|
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master 745d20a
release-5.0-rc 64994e9
release-4.0 8e68350
The text was updated successfully, but these errors were encountered: