Re: [Lazarus] Multiple versions of MySQL/MariaDB

2015-08-28 Thread leledumbo
 Is it possible to detect which version of MySQL/MariaDB is used , and 
 according to the result select the right connection, at run-time ?

Trial and error:
Loop over the connection component until you find one that doesn't raise
exception when activated. Simple, but takes more resource.

Querying the tool:
Executes `mysql --version` and parse the result. Apparently the output is
consistent enough between versions, it's always the fifth column. More
complicated logic, but lower resource usage.

Let the user decide:
Provide a config file and let user fill it. Just connect anyway to whatever
value supplied by user, certainly you can limit to certain accepted values
only. This lifts the responsibility to user to supply the correct version.



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Multiple-versions-of-MySQL-MariaDB-tp4043756p4043757.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Multiple versions of MySQL/MariaDB

2015-08-28 Thread Michael Van Canneyt



On Fri, 28 Aug 2015, Koenraad Lelong wrote:


Hi,

What defines the TMySQL-connection-version ? Are those the installed 
libraries on the client ? Or is it the server ?


Is it possible to detect which version of MySQL/MariaDB is used , and 
according to the result select the right connection, at run-time ?


Load the mysql library manually and check the version returned by

function mysql_get_client_version:culong;

By far the easiest, I would imagine ?

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Multiple versions of MySQL/MariaDB

2015-08-28 Thread Koenraad Lelong

Hi,

What defines the TMySQL-connection-version ? Are those the installed 
libraries on the client ? Or is it the server ?


Is it possible to detect which version of MySQL/MariaDB is used , and 
according to the result select the right connection, at run-time ?


The problem is that my development-PC does not neccessarily have the 
same libraties as the user-PC.


FWIW, I'm running linux on the development-PC.

Regards,

Koenraad.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus