[CONPY-128] Add get_server_version() function Created: 2020-11-11  Updated: 2020-11-16  Resolved: 2020-11-16

Status: Closed
Project: MariaDB Connector/Python
Component/s: Generic
Affects Version/s: 1.0.4
Fix Version/s: 1.0.5

Type: New Feature Priority: Major
Reporter: Frank Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

During the migration from the MySQL connector to the MariaDB one, I found an missing but important function.
Here the description of it:
https://dev.mysql.com/doc/connector-python/en/connector-python-api-cext-get-server-version.html



 Comments   
Comment by Georg Richter [ 2020-11-11 ]

What's wrong with using server_version?

>>> import mariadb
>>> conn=mariadb.connect()
>>> conn.server_version;
100600

Comment by Frank [ 2020-11-11 ]

get_server_version will return an tuple and server_version only an integer.
So you can simple access the needed part of the version number.
get_server_version will return ("5", "5","1") for example for version 5.5.1

Comment by Georg Richter [ 2020-11-16 ]

Implemented in rev. a47d3e5d760d037e57082b663d7f3c9fd350a998

Added connection attribute server_version_info and (for compatibility) get_server_version() method. Both return a tuple, describing the version number of connected server in following format: (MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)

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