Author Topic: MariaDB support and extended functions for TSQLConnector  (Read 345 times)


  • New Member
  • *
  • Posts: 25
MariaDB support and extended functions for TSQLConnector
« on: January 13, 2023, 11:10:01 am »
Using TSQLConnector to connect to multiple database servers is an elegant variant. However, a popular server like MariaDB is handled only rudimentarily.

found in
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}


Code: Pascal  [Select][+][-]
  1. procedure TConnectionName.DoInternalConnect;
  2. var
  3.   FullVersion: string;
  4. begin
  5.   InitialiseMysql;
  6.   if not SkipLibraryVersionCheck then
  7.     begin
  8.     FullVersion:=strpas(mysql_get_client_info());
  9.     // Version string should start with version number:
  10.     // Note: in case of MariaDB version mismatch: tough luck, we report MySQL
  11.     // version only.
  12.     if (pos(MySQLVersion, FullVersion) <> 1) and
  13.        (pos(MariaDBVersion, FullVersion) <> 1) then
  14.       Raise EInOutError.CreateFmt(SErrVersionMisMatch,[ClassName,MySQLVersion,FullVersion]);
  15.     end;  
  16.   inherited DoInternalConnect;
  17.   ConnectToServer;
  18.   SelectDatabase;
  19. end;

The built-in version check, which makes sense for a proxy object (especially when TSQLConnector searches for the access library itself), becomes a problem when current or old versions are not supported.

The MySQL80Connection can not work with the installed MySQL Client Version: Expected (8.0), got (10.5.18).

You can assign any access library to TSQLConnector using TSQLDBLibraryLoader, but then the version control takes effect.

In the direct access components like TMySQL80Connection this is solved with an attribute SkipLibraryVersionCheck which disables the version check.

Unfortunately SkipLibraryVersionCheck is not passed through to TSQLConnector which leads to version conflicts again and again.

Who do I need to contact to make two requests?

1_ Include SkipLibraryVersionCheck in TSQLConnector. Possibly only switchable if TSQLDBLibraryLoader is used.

2_ Better support for MariaDB which is more common in smaller and larger environments due to MySQL ownership.

Lazarus stable, Win32/64


  • Hero Member
  • *****
  • Posts: 12971
Re: MariaDB support and extended functions for TSQLConnector
« Reply #1 on: January 13, 2023, 02:16:23 pm »
File two bug reports on the bug tracker against fcl-db
1. for 1
2. for 2.

1. seems a potential bug while 2. seems a feature request, anyway the reports should be separated, since they are separate issues.
I actually get compliments for being rude... (well, Dutch, but that is the same)


TinyPortal © 2005-2018