Skip to content

Conversation

@adityasharmawork
Copy link

Describe the changes that are made

  • Updated pkg/agent/proxy/integrations/mysql/wire/decode.go to explicitly populate ServerCaps and ClientCaps in DecodeContext during the handshake phase.
  • Updated pkg/agent/proxy/integrations/mysql/recorder/query.go to check for CLIENT_DEPRECATE_EOF capability before expecting/reading EOF packets in handlePreparedStmtResponse and handleBinaryResultSet. This prevents Keploy from hanging by waiting for EOF packets that the server does not send when this flag is negotiated.

Links & References

Closes: #3449

  • NA

🔗 Related PRs

  • NA

🐞 Related Issues

📄 Related Documents

  • NA

What type of PR is this? (check all applicable)

  • 📦 Chore
  • 🍕 Feature
  • 🐞 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🔁 CI
  • ⏩ Revert

Added e2e test pipeline?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help (Requires specific MySQL/TiDB environment setup)

Added comments for hard-to-understand areas?

  • 👍 yes
  • 🙅 no, because the code is self-explanatory

Added to documentation?

  • 📜 README.md
  • 📓 Wiki
  • 🙅 no documentation needed

Are there any sample code or steps to test the changes?

  • 👍 yes, mentioned below
  • 🙅 no, because it is not needed

Steps:

  1. Start Keploy in record mode.
  2. Connect to a MySQL 5.7+ or TiDB database using a client that negotiates the CLIENT_DEPRECATE_EOF flag (e.g., standard JDBC driver or MySQL 5.7.5+ command line client).
  3. Execute a query using Prepared Statements.
  4. Verify that Keploy successfully captures the traffic and does not hang indefinitely.

Self Review done?

  • ✅ yes
  • ❌ no, because I need help

Any relevant screenshots, recordings or logs?

  • NA

🧠 Semantics for PR Title & Branch Name

  • PR Title: fix: Keploy hangs when intercepting MySQL/TiDB connections with CLIENT_DEPRECATE_EOF

Additional checklist:

…field

Signed-off-by: Aditya Sharma <adityasharma2005123@gmail.com>
Signed-off-by: Aditya Sharma <adityasharma2005123@gmail.com>
@adityasharmawork adityasharmawork force-pushed the fix-mysql.tidb-connections branch from 6930aac to 2661e05 Compare January 5, 2026 06:19
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