Skip to content

Fix autocommit status in MySQL protocol handshake packet #1089

Description

@footka

Description

During MySQL protocol connection establishment, the server is expected to return the connection's autocommit status in the handshake packet (which should match the global autocommit setting). However, the current implementation hardcodes this value to 0.

This causes an issue with certain client drivers. To optimize performance and avoid an extra SET autocommit command, some drivers check if the autocommit value in the handshake packet matches the autocommit parameter specified in the connection string. If they match, the driver skips sending the SET command. A problem occurs when global autocommit=1 and the connection parameter specifies autocommit=0. In this case, the driver receives a handshake value of 0 (hardcoded), which matches its requested autocommit=0, so it does not send a SET autocommit=0 command. The connection then incorrectly uses the global autocommit=1 setting.

Environment

(Please provide the output of bin/observer -V. If the test involves a change in OBPROXY version, also provide the output of obproxy -V.)

Steps to Reproduce

(This is a consistent issue. Specific reproduction steps or SQL scripts can be attached.)

Additional Context

  • Is this an RD-provided temporary version?: No / [Specify if provided by xxx]
  • Reproducibility: Consistent
  • Test Changes: [e.g., Added xx test scenario / Changed machine / Ran new xx tool / Issue appeared after replacing with new version]
  • Other anomalies or changes in the environment?: No / Clog disk was full / Manual operations performed / xx exception was injected
  • Environment Information: Please provide the connection strings for the problematic tenant and the sys tenant, as well as deployment information. Was the scene preserved?
  • Log Information:

Note on Issue Type (for internal/external business feedback):

  • Customer Service Feedback: Refers specifically to issues before production deployment or during POC, where a product bug is confirmed to require a fix and release.
  • Online Issue: A product bug that occurred after production deployment but is not classified as a fault.
  • Online Fault: A product bug that occurred after production deployment and caused business errors or negative impact on the customer side (the delivery service team has final authority on fault classification).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions