Skip to content

Copy the in_transaction flag into Trilogy::Result#20

Merged
byroot merged 1 commit intomainfrom
copy-in-transaction-flag-to-result
Mar 27, 2026
Merged

Copy the in_transaction flag into Trilogy::Result#20
byroot merged 1 commit intomainfrom
copy-in-transaction-flag-to-result

Conversation

@brasic
Copy link
Copy Markdown
Contributor

@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.
@byroot byroot force-pushed the copy-in-transaction-flag-to-result branch from a60296a to f687c8d Compare March 27, 2026 14:30
@byroot byroot merged commit 7bfa6dd into main Mar 27, 2026
44 checks passed
@byroot byroot deleted the copy-in-transaction-flag-to-result branch March 27, 2026 14:39
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.

2 participants