Recent

Author Topic: MariaDB/TMySQLConnection mismatch - again.  (Read 2735 times)

GordonFindlay

  • New Member
  • *
  • Posts: 15
MariaDB/TMySQLConnection mismatch - again.
« on: April 12, 2024, 09:05:34 am »
Lazarus 3.2, FPC 3.2.2

Once again  MariaDB was updated - part of an openSUSE leap routine update - and has clashed with Lazarus use of MySQL Connectors - errors like:

Code: Text  [Select][+][-]
  1. TMySQL57Connection cannot work with the installed MySQLClient version: expected (5.7) got (3.1.22)

(Same sort of thing for other connection types as might be expected.)

Usually I just find a newer version of libmysqlclient.so.  But in openSUSE libmysqlclient.so is just a symlink to libmariadb.so.3 - which is where the returned 3.1.22 comes from.

On this system I cannot even build a new libmysqlclient as the make fails, complaining about the installed version of gcc being too old.

And what damage would be caused by replacing the symlink by a real shared object?

My next option I guess is to modify the source code for the connection to respond correctly to MariaDB version reports - the code has a comment to the effect of  'we check only MySQL values - tough'. I'm reluctant to butcher well-written code though.

Or perhaps to change distribution.

Anyone with a better idea?  And is it time that mariaDB should be better supported?
« Last Edit: April 12, 2024, 09:07:54 am by GordonFindlay »

rvk

  • Hero Member
  • *****
  • Posts: 6199
Re: MariaDB/TMySQLConnection mismatch - again.
« Reply #1 on: April 12, 2024, 09:23:39 am »
Yes, very annoying all those differen db components.
They should have taken that into account when programming that part.
You can't even distribute your application without requiring the exact correct lib version.
Which could be difficult with dozens of programs at different customers.

But... You can set the property SkipLibraryVersionCheck to false.
Then it will just skip the check.

GordonFindlay

  • New Member
  • *
  • Posts: 15
Re: MariaDB/TMySQLConnection mismatch - again.
« Reply #2 on: April 12, 2024, 10:13:48 am »
I know about the SkipLibraryVersionCheck stunt.  But there are reports that while a connection might be established,
issues can occur later.  If nothing else is suggested I'll have a longer play with that.

I agree with you that there are issues with distribution. Even though most of my use is for just one project, creating something that can get broken by a routine distro update  is not desirable.

CharlyTango

  • Jr. Member
  • **
  • Posts: 52
Re: MariaDB/TMySQLConnection mismatch - again.
« Reply #3 on: April 12, 2024, 11:39:22 am »
That's why i don't use SQLDB against MariaDB. I use ZEOSDB instead. (installable via OPM)

obviously there is no intention to seriously support MariaDB with SQLDB.

File: mysqlconn.inc
Line 85


Code: Pascal  [Select][+][-]
  1.   MariaDBVersion =
  2. {$IFDEF mysql57}
  3.     '10.';
  4. {$ELSE}
  5. {$IFDEF mysql56}   // MariaDB 10.0 is compatible with MySQL 5.6
  6.     '10.';
  7. {$ELSE} // MariaDB 5.1..5.5 presumably report the same version number as MySQL
  8.     MySQLVersion;
  9. {$ENDIF}
  10. {$ENDIF}

MariaDB is on version 11.2.1 (RC) -or something - IMHO that will not really work.

Line 581:

Code: Pascal  [Select][+][-]
  1. // Note: in case of MariaDB version mismatch: tough luck, we report MySQL

As far as I know there is no version control in ZEOS in the way of SQLDB (at least I haven't come across it yet).
Therefore, it is usually sufficient to use the correct access library. Older versions usually work as long as you don't need newer SQL functions

A New Version of ZEOS was just released https://forum.lazarus.freepascal.org/index.php/topic,66893.0/topicseen.html
« Last Edit: April 12, 2024, 11:45:39 am by CharlyTango »
Lazarus stable, Win32/64

GordonFindlay

  • New Member
  • *
  • Posts: 15
Re: MariaDB/TMySQLConnection mismatch - again.
« Reply #4 on: April 13, 2024, 12:08:55 am »
Thanks for answers so far.

I've had a look through Distrowatch to see how mariaDB and MySQL rate - mariaDB is much more widely supported 'out of the box' which makes me wonder about comments such as Charly Tango (and OP) pointed out.

I've stress-tested the SkipLibraryVersionCheck stunt and it hasn't caused any further problems in my current application. Still strike me as ludicrous, and fragile. But I'll use it to finish version1; for version 2 (if and when it occurs) I will take a long hard look at zeosDB, as I can hardly guarantee that some later update to mariaDB won't lead to trouble.

I note that mariaDB as distributed with openSUSE Leap right now is version 10.6; there are four later versions already, and an RC for a fifth.

rvk

  • Hero Member
  • *****
  • Posts: 6199
Re: MariaDB/TMySQLConnection mismatch - again.
« Reply #5 on: April 13, 2024, 12:18:54 am »
I've stress-tested the SkipLibraryVersionCheck stunt and it hasn't caused any further problems in my current application. Still strike me as ludicrous, and fragile. But I'll use it to finish version1; for version 2 (if and when it occurs) I will take a long hard look at zeosDB, as I can hardly guarantee that some later update to mariaDB won't lead to trouble.
The point is that ZeosDB would be the same as SkipLibraryVersionCheck=true in sqldb.
It doesn't have a lib check but it also doesn't guarantee working correctly with newer versions (just like sqldb). So for that matter it makes no difference.

I myself don't like ZeosDB because you can have only one transaction per db connection and I don't like opening up multiple db connection just to have a separate transaction. But maybe that's just me.

 

TinyPortal © 2005-2018