[CONC-628] Version string cannot be split fully Created: 2022-12-22  Updated: 2023-03-14  Resolved: 2023-01-16

Status: Closed
Project: MariaDB Connector/C
Component/s: Other
Affects Version/s: 3.1
Fix Version/s: 3.1.20

Type: Bug Priority: Blocker
Reporter: Cole Busby (Inactive) Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by CONPY-244 Check the version of libmariadb.so du... Closed

 Description   

  File "/root/.pyenv/versions/3.10.7/lib/python3.10/site-packages/mariadb/__init__.py", line 136, in <module>
  File "/root/.pyenv/versions/3.10.7/lib/python3.10/site-packages/mariadb/__init__.py", line 136, in <genexpr>
ValueError: invalid literal for int() with base 10: '17-12'

when installing MariaDB Server 10.5.17 or 10.5.18 on a CentOS 7 host, the mariadb connector is throwing this error to us during our connect.

>10.6 is not throwing this issue.



 Comments   
Comment by Georg Richter [ 2022-12-27 ]

During initialization mariadb module loads the client version via mysql_get_client_info into mariadbapi_version.

mysql_get_client_info uses MARIADB_PACKAGE_VERSION macro, which is defined in mariadb_version.h. It has the format major.minor.patch.

Obviously someone changed this to another format when building ES packages, instead of 3.3.3 it was changed to 10.5.17-12,which explains this issue.

This change in ES also has other impacts, e.g. it is impossible to determine if a feature is supported by checking the client version (10 is always > 3)

Comment by Georg Richter [ 2023-01-10 ]

cole.busby Could you please attach output from mariadb_config and the include file mariadb_version.h from ES installation?

Comment by Georg Richter [ 2023-01-10 ]

Changed status to "needs feedback"

Comment by Georg Richter [ 2023-01-11 ]

MariaDB Connector/Python v1.1.3 requires MariaDB Connector/C >= 3.2.4, actual version (v.1.1.5) requires 3.3.1 (3.2 is discontinued).

in mariadb_posix.py (v1.1.3)
required_version = "3.2.4"

MariaDB ES 10.5.x ships Connector/C 3.1 - which is < 3.2.4. If the installation passed, it indicates that the C/C version was modified (and bumped) and all further capability checks (in mostly every product) will return wrong results.

Comment by Georg Richter [ 2023-01-16 ]

The problem is that MariaDB Connector/Python was built with the required minimum version of Connector/C, but an older connector/c client library is in default path.

Comment by Georg Richter [ 2023-01-16 ]

Not a bug, since the correct version of Connector/C is not in default place, so the unsupported Connector/C shared library from ES will be loaded instead.

Fix for CONPY-244 will now throw an exception during module initialization if an incompatible library was loaded.

Comment by Sergei Golubchik [ 2023-01-16 ]

This is Connector/C bug, it was returning a wrong version to the Connector/Python.

Fixed in https://github.com/mariadb-corporation/mariadb-connector-c/commit/d204e83104222844251b221e9be7eb3dd9f8d63d

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