-
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
"incorrect string value" error when using prepared statements #5075
Comments
@tirsen can you give us the client-side input values for the insert statement, and the schema of |
I'm getting a different error now:
|
Looks like the auto inc isn't being dealt with properly for prepared statements? I think this is a regression that can possibly mask the error I reported in this bug. |
This is reproduced by turning on prepared statements in misk in this PR: cashapp/misk#1202 You should be able to reproduce that locally by checking out that branch. You can change the Vitess image used in docker here: https://github.com/cashapp/misk/blob/jontirsen/2019-09-20/prep-stmt/misk-hibernate/src/main/kotlin/misk/vitess/StartVitessService.kt#L43 |
@tirsen I believe the bug you're encountering is one we just fixed. When you have some free time would you please try this build: https://github.com/planetscale/vitess-releases/releases/tag/fae58cc. |
I'm getting another error now: |
phew I finally managed to coax the actual statement and its variables out of Hibernate:
|
|
I'll report this as a separate issue. This particular issue is probably resolved. |
Thanks! I will close it, but feel free to re-open later as necessary. |
I'm trying to use the new support for prepared statements but I'm having an issue in one of our unit tests.
Caused by: java.sql.SQLException: vtgate: http://76b5d68fad4d:27000/: transaction rolled back due to partial DML execution: Code: INVALID_ARGUMENT
target: contacts_hashed_aliases.80-.master, used tablet: test-4 (localhost): vttablet: rpc error: code = InvalidArgument desc = Incorrect string value: '\xFD\x83P\x00\x00\x00...' for column 'app_token' at row 2 (errno 1366) (sqlstate HY000) (CallerID: userData1): Sql: "insert into hashed_aliases(app_token, hashed_alias) values (:_app_token0, :_hashed_alias0),(:_app_token1, :_hashed_alias1) on duplicate key update id = id /* vtgate:: keyspace_id:ae1ff99631b6191f02ae1ae7710c6b6f,ae1ff99631b6191f02ae1ae7710c6b6f */", BindVars: {#maxLimit: "type:INT64 value:"10001" "_app_token0: "type:VARBINARY value:"from hashed_alias_lookup where 1 != 1she" "_app_token1: "type:VARBINARY value:"alias\014hashed_alias\014?\000\024\000\000\000\375\203P\000\000\000000000000" "_hashed_alias0: "type:VARBINARY value:"_alias_lookup\014hashed" "_hashed_alias1: "type:VARBINARY value:"\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" "v1: "type:VARBINARY value:"from hashed_alias_lookup where 1 != 1she" "v2: "type:VARBINARY value:"_alias_lookup\014hashed" "v3: "type:VARBINARY value:"alias\014hashed_alias\014?\000\024\000\000\000\375\203P\000\000\000000000000" "v4: "type:VARBINARY value:"\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002" "}
The text was updated successfully, but these errors were encountered: