-
Notifications
You must be signed in to change notification settings - Fork 72
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
Ruby binding throws TRILOGY_INVALID_SEQUENCE_ID when a multi-statement is followed by another query #195
Comments
I think that is expected (although we might be able to improve the error message and documentation around this). We need to read all the results before we can make another query, and If you do the same sort of thing with the mysql2 gem the error message is |
Thanks for the clarification @composerinteralia - I agree that the error documentation could stand to be improved. To add some more context: I'll follow up internally to make sure we're handling this scenario correctly if this is indeed intended behavior. I can confirm the above test case also fails in MySQL. |
Ah, interesting. I wonder if rails/rails@86f0259 will have solved that. |
Thanks for sharing that - it doesn't immediately solve it in our codebase, but i'll try to make a smaller test case with a vanilla Rails installation and see if that would fix it. |
👋 Hello! We discovered that the ruby binding will throw
TRILOGY_INVALID_SEQUENCE_ID
when executing a multi-statement query followed directly another query, without fetching all results withnext_result
.For example, the following snippet works fine:
This next snippet, however, throws
TRILOGY_INVALID_SEQUENCE_ID
Here's a script to reproduce:
Running this yields:
We're seeing this with Trilogy 2.8.1 against MySQL 8.3.0 on OSX using Ruby 3.3.2 (
ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin23]
)From what I can tell (i'm not familiar with the codebase and it's been a minute since I've written C) it seems that something isn't getting reset correctly when
client.query
is called and trilogy_packet_parser_execute() isn't agreeing with it's current state vs what is coming in off the wire.The text was updated successfully, but these errors were encountered: