[CONPY-244] Check the version of libmariadb.so during module initialization Created: 2023-01-16  Updated: 2023-02-01  Resolved: 2023-01-16

Status: Closed
Project: MariaDB Connector/Python
Component/s: Installation
Affects Version/s: 1.1.5
Fix Version/s: 1.1.6

Type: Task Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Posix


Issue Links:
Problem/Incident
causes CONC-628 Version string cannot be split fully Closed

 Description   

If MariaDB Connector/Python was built with minimum required version of Connector/C, it still might fail during module initialization or when executing connect() method if an older unsupported Connector/C client library will be loaded from default location.

Instead of we should raise an exception during module initialization:

if (mysql_get_client_version() < MARIADB_PACKAGE_VERSION_ID)
    {
      char errmsg[255];
 
      snprintf(errmsg, 254, "MariaDB Connector/Python was build with MariaDB Connector/C %s, "
               "while the loaded MariaDB Connector/C library has version %s.",
               MARIADB_PACKAGE_VERSION, mysql_get_client_info());
      PyErr_SetString(PyExc_ImportError, errmsg);
      goto error;
    }


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