Recent

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

CharlyTango

  • New Member
  • *
  • Posts: 48
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 mysqlconn.inc
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}

and

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.

Quote
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

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
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.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018