Skip to content
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

Copy the in_transaction flag into Trilogy::Result #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brasic
Copy link

@brasic brasic commented Apr 10, 2022

Similar to #17, added at @matthewd's suggestion.

The SERVER_STATUS_IN_TRANS flag is part of the server_status bitfield sent with every OK_Packet which is already stored on the connection. But this particular data is not always safe to read from the connection since in some cases one or more queries may have been executed since the result was generated, invalidating the prior data. To increase safety let's also store it on the Result itself.

This flag (SERVER_STATUS_IN_TRANS, position 0x0001) is part of the
server_status bitfield sent with every OK_Packet which is already stored
on the connection.  But this particular data is not always safe to read
from the connection since in some cases one or more queries may have
been executed since the result was generated.  So to increase safety
let's also store it on the Result itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant