Skip to content

Commit c96bdd7

Browse files
authored
MySQL proxy improvements (#289)
This PR further improves and refactors the original MySQL proxy prototype. Notably: - Add relevant docs and manual links to all packet manipulation methods. - Refactor packet building, fix packet sequence ID handling. - Refactor packet parsing and authentication. - Use `pack()` and `unpack()` when possible. - Fix connecting with no password specified. - Support specifying database name during the authentication phase (support the `MySQL_Protocol::CLIENT_CONNECT_WITH_DB` capability). - Correctly support the `MySQL_Protocol::CLIENT_DEPRECATE_EOF` capability. - Add MySQL CLI tests. I've tried the proxy with the following tools, which are working now: - MySQL CLI - Adminer - phpMyAdmin - TablePlus I think this is a good point to stop at for this PR. The refactor may go further, and there are more things to implement (prepared statements for `mysqli`, full authentication support, and more), but I'd leave those to separate issues. I'm also considering moving the packet building methods from `MySQL_Protocol` to `MySQL_Session`, as currently, these need to pass many function parameters in some cases, while in the `MySQL_Session` class, private state properties could be used directly for some attributes.
2 parents 211fd2b + 41612c1 commit c96bdd7

File tree

6 files changed

+799
-373
lines changed

6 files changed

+799
-373
lines changed

0 commit comments

Comments
 (0)