#1 2023-02-07 13:49:37

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Table name case using Firedac with mysql in a linux server

Trying to use firedac from a windows client to connect to a Mysql database in a unix server I am getting errors that a table (with name in upper case) does not exist, and trying to create it I am getting errors. the table exists in the filesystem in lowercase.
I tried to fix it without success by adding

var dbmormot: TSqlDBFireDACConnectionProperties;
with dbmormot.Parameters do begin Add('MetaCaseInsCat=True'); Add('MetaCaseIns=True'); end;

and also:

procedure checkconnection(Sender: TSqlDBConnection; Event: TOnSqlDBProcessEvent);
begin 
if Event<>speCreated then exit; 
with TSqlDBFireDACConnection(Sender).Database do begin
Params.Add('MetaCaseInsCat=True'); 
Params.Add('MetaCaseIns=True'); 
end;

I noticed that mormot2 in mormot.rad.firedac line 332,
    meta.ObjectName := Utf8ToString(UpperCase(aTableName));
or in line 367
  TableName := Utf8ToString(UpperCase(aTableName));

I remove the Uppercase in both places and it works.

How do you propose me to deal with it? Am I missing an other configuration tunning point?
Thank you in advace

Last edited by dcoun (2023-02-07 13:53:56)

Offline

#2 2023-02-09 08:17:25

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: Table name case using Firedac with mysql in a linux server

@ab do you propose something for the above?
It works OK after removing the "Uppercase" in Mormot2's mormot.rad.firedac and I do not have any special config in Mariadb

Offline

#3 2023-02-09 09:45:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,725
Website

Re: Table name case using Firedac with mysql in a linux server

Please try https://github.com/synopse/mORMot2/commit/67005a11

The uppercase conversion may still be needed with some databases.
Therefore, deleting the UpperCase() may not please everyone.
So I introduced a new property. By default, it should work for you now.

Offline

#4 2023-02-09 09:57:57

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 430

Re: Table name case using Firedac with mysql in a linux server

Thank you a lot @ab

Offline

Board footer

Powered by FluxBB