MySQL: Setting for assumed capabilities
Summary
When a MySQL conversation is missing the Login/Greeting then later on it might have issues to decode packets that depend on the capability flags set during this stage. Currently some capabilities are assumed if none are set, however as the capabilities depend on the version of MySQL or MariaDB and the configuration this likely won't be able to do a perfect job.
It might be good to allow the user to configure what capabilities should be assumed.
Options
Option 1: Let people set which flags they want to assume
example:
-
DEPRECATE_EOF -
Query Attributes
Possible issues:
A. People might not know what versions set what flags. So they might not know that they need to set the DEPRECATE_EOF
and/or query attributes flags if result sets fail to decode properly.
B. People might set weird/unexpected combinations. Not sure how much of a problem this really is. Not sure if there is a good way to validate this. An example might be if someone sets DEPRECATE_EOF
without setting PROTOCOL_41
.
C. Naming. We have MYSQL_CAPS_CU
in the code and mysql.caps.cu
in the interface. And this is know as CLIENT_PROTOCOL_41
on https://dev.mysql.com/doc/dev/mysql-server/latest/group__group__cs__capabilities__flags.html and in mysql_com.h
.
Option 2. Let people pick a MySQL/MariaDB version they want to assume
example:
Assume Server Implementation: MySQL 8.4 / MySQL 8.0 / MySQL 5.7 / MariaDB 11.3 / MariaDB 11.2
Option 3. Let people copy/set a hex value
- Server Capabilities: 0xf7fe
- Server Capabilities Extended: 0x81bf
Besides having "caps" and "caps_ext" for both client and server we also have mariadb_server_ext_caps
and mariadb_client_ext_caps
.
If we include client and MariaDB capabilities:
Capability Set | Client | Server |
---|---|---|
Basic | 0xf7fe | 0xf7fe |
Extended | 0x81bf | 0x81bf |
MariaDB Extended | 0x0 | 0x0 |
And then we ideally would have an option to make it easy/obvious for someone to copy these flags from an earlier (full) conversation.
Option 4. Combination of option 1 and option 2
Either select something like "MySQL 8.0" or "Custom" and then modify individual flags.
Other questions
- Are we convinced this is really needed?