-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Prepared Statements Bind Variable Error #5255
Comments
@PrismaPhonic Have you tried a recent build of Vitess? Prepared statement support was added at the beginning of August. #5018 |
@derekperkins Peter @PrismaPhonic is an engineer at PlanetScale. He was testing Prepared Statements. |
Ah, my bad. |
Just to clarify that the primary problem of 50% IO error occurred when the schema had no primary key, and no indexes (only vindex on the name, which wasn't indexed). |
@PrismaPhonic should this issue be closed now? Putting |
Yes it should be. Closing now. |
Overview of the Issue
When using the most popular MySQL client library in Rust (https://docs.rs/mysql/16.1.0/mysql/) prepared statements (using the libraries
prep_exec
method) produces errors some of the time, whereas using normal queries does not. I've tested this against normal MySQL, where standard MySQL never errors onprep_exec
usage.Details
Here's an example of a raw query, where arguments are handled with a simple formatted string and sent over to vitess as a query:
Here is that same implementation using
prep_exec
:Error Message
Here is the error message I get some of the time when using
prep_exec
:For what it's worth this is actually a different error message than what I was getting before. The schema prior to this had no primary key, and no indexes (only vindex). In that version of the application
prep_exec
resulted in 50% IO error (https://docs.rs/mysql/16.1.0/mysql/enum.Error.html#variant.IoError). That schema queried on the puppersname
, which was not indexed. The error rate now is much lower (roughly 10%) and is thisbind variable is nil
error. Might be worth looking into handling of prepared statements in cases where the are no indexes.The text was updated successfully, but these errors were encountered: