[ODBC-403] Unknown system variable 'STATEMENT' Created: 2023-11-28  Updated: 2023-11-30  Resolved: 2023-11-30

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.1.19
Fix Version/s: 3.1.20, 3.2.2

Type: Bug Priority: Major
Reporter: Lukas Belza Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 1
Labels: None
Environment:

Windows Server
MariaDB 10.0.38 (64bit)
ODBC driver 3.1.19 (32bit)



 Description   

Our .NET application uses MariaDB ODBC driver to get information from target MariaDB servers - it is monitoring software that can retrieve information from different versions of MariaDB.

New version of ODBC driver 3.1.19 (32bit) is failing with following error when we try to execute simple DB command on older versions of MariaDB (e.g. 10.0.38 or 5.5.64).

System.Data.Odbc.OdbcException (0x80131937): ERROR [HY000] [ma-3.1.19][10.0.38-MariaDB]Unknown system variable 'STATEMENT'

The driver is working against the latest MariaDB version (11.2.2).

This is regression bug as it was working with ODBC driver 3.1.16.

I believe the root cause is SET STATEMENT
https://github.com/mariadb-corporation/mariadb-connector-odbc/blob/014e86b910e91dbce64ebb5ed7200316c3012949/ma_statement.c#L663

This feature is available from MariaDB 10.1.2 (https://docs.w3cub.com/mariadb/set-statement/index).

It is possible to extend following condition to check also version of target DB if SET STATEMENT command is available?
https://github.com/mariadb-corporation/mariadb-connector-odbc/blob/014e86b910e91dbce64ebb5ed7200316c3012949/ma_statement.c#L790



 Comments   
Comment by Lawrin Novitsky [ 2023-11-30 ]

The fix has been pushed.

Technically, we do not support those old server versions that do not support SET STATEMENT. That means, that we do not test against those old server versions. Thus, even though I've fixed it now, there is no promise the code won't get lost at some point. Unlikely, though

Generated at Thu Feb 08 03:28:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.