[MXS-3616] Support MARIADB_CLIENT_EXTENDED_TYPE_INFO Created: 2021-06-16  Updated: 2023-10-16  Resolved: 2023-10-16

Status: Closed
Project: MariaDB MaxScale
Component/s: Protocol
Affects Version/s: None
Fix Version/s: 24.02.0

Type: New Feature Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Sprint: MXS-SPRINT-192

 Description   

Add support for the extended type info flag MARIADB_CLIENT_EXTENDED_TYPE_INFO: https://mariadb.com/kb/en/result-set-packets/#column-definition-packet



 Comments   
Comment by markus makela [ 2022-09-08 ]

Should be relatively easy to add support for this. The only thing that needs changing is any of the packet parsers that handle field definitions (e.g. cache filter).

Comment by markus makela [ 2022-12-02 ]

This is trivial to fix in 22.08 or anything newer:

diff --git a/include/maxscale/protocol/mariadb/mysql.hh b/include/maxscale/protocol/mariadb/mysql.hh
index 422665d730..9178337e7a 100644
--- a/include/maxscale/protocol/mariadb/mysql.hh
+++ b/include/maxscale/protocol/mariadb/mysql.hh
@@ -318,6 +318,7 @@ enum gw_mysql_capabilities_t
 // Default extended flags that MaxScale supports
 constexpr const uint32_t MXS_EXTRA_CAPABILITIES_SERVER =
     MXS_MARIA_CAP_STMT_BULK_OPERATIONS
+    | MXS_MARIA_CAP_EXTENDED_TYPES
     | MXS_MARIA_CAP_CACHE_METADATA;
 
 // Same as above, for uint64.
diff --git a/server/modules/protocol/MariaDB/mariadb_client.cc b/server/modules/protocol/MariaDB/mariadb_client.cc
index a3b8955a29..a833b81871 100644
--- a/server/modules/protocol/MariaDB/mariadb_client.cc
+++ b/server/modules/protocol/MariaDB/mariadb_client.cc
@@ -525,7 +525,12 @@ bool MariaDBClientConnection::send_server_handshake()
         {
             // The metadata caching was added in 10.6 and should only be enabled if all nodes support it.
             caps &= ~(MXS_MARIA_CAP_CACHE_METADATA << 32);
-            mxb_assert((caps & MXS_EXTRA_CAPS_SERVER64) == (MXS_MARIA_CAP_STMT_BULK_OPERATIONS << 32));
+        }
+
+        if (min_version < 100500)
+        {
+            // The extended type info was added in 10.5
+            caps &= ~(MXS_MARIA_CAP_EXTENDED_TYPES << 32);
         }
     }
 
@@ -534,6 +539,7 @@ bool MariaDBClientConnection::send_server_handshake()
         // Some module requires that only the base protocol is used, most likely due to the fact
         // that it processes the contents of the resultset.
         caps &= ~((MXS_MARIA_CAP_CACHE_METADATA << 32) | GW_MYSQL_CAPABILITIES_DEPRECATE_EOF);
+        caps &= ~(MXS_MARIA_CAP_EXTENDED_TYPES << 32);
         mxb_assert((caps & MXS_EXTRA_CAPS_SERVER64) == (MXS_MARIA_CAP_STMT_BULK_OPERATIONS << 32)
                    || cap_types != CapTypes::MARIADB);
         mxb_assert((caps & GW_MYSQL_CAPABILITIES_DEPRECATE_EOF) == 0);

The OLD_PROTOCOL capability makes sure that any modules that can't work with it don't have it enabled.

The Connector/J test suite fails because of this and getting this fixed would help take it into use in MaxScale.

Generated at Thu Feb 08 04:22:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.