-
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
*: in prepared statement limit/offset may be placeholder #2364
Conversation
err error | ||
) | ||
if limit.Offset != nil { | ||
offset, err = getUintForLimitOffset(limit.Offset.GetValue()) |
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.
How about using evalAstExpr?
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.
This expr must be ConstExpr and its real value must be unsigned int.
LGTM |
@hanfei1991 PTAL |
mysql> prepare ppp from "select * from t limit ?"; mysql> set @A = 1.1; mysql> execute ppp using @A; double is also ok. May be we should build a datum and cast it to int. |
b8756d0
to
4143763
Compare
@hanfei1991 PTAL |
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.
LGTM
Fix #2180
In prepareed statement, limit/offset may be placeholder:
prepare stmt_test_1 from 'select id from prepare_test limit ? offset ?'