Case sensitive issues under 10.3+Linux

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
hsvandrew
Posts: 11
Joined: Fri 06 May 2016 01:22

Case sensitive issues under 10.3+Linux

Post by hsvandrew » Sun 13 Jan 2019 01:26

const
PgDACVersion = '5.3.8';

Issues we've noticed when compiling for Centos7 under Rio 10.3 that don't seem to be a problem compiling the same code for Win64 on Rio 10.3

//Issue 1

Code: Select all

thisQuery.SQL.text := 'select x from table where field= :PARAMname';
thisQuery.ParamByName('paramNAME').asString := 'value'; //Under Linux - Param Name is now case sensitive
thisQuery.open;
//Issue 2

Code: Select all

if thisQuery.locate('myCharVaryingNoSizeLimitfield','aValidValueInWRONGcase',[loCaseInsensitive]) then
//loCaseInsenstive ignored
Here is our connection + query setup
Postgres 10

fConnection := TPgConnection.create(nil);
fConnection.Pooling := false;
fConnection.LoginPrompt := False;
fConnection.Options.ApplicationName := ExtractFileName(paramstr(0));
fConnection.Options.UseUnicode := true;
fConnection.Options.EnableComposites := true;
fConnection.Options.DefaultSortType := stCaseInsensitive;

thisQuery := TPgQuery.Create(nil);
thisQuery.Connection := fConnection;
thisQuery.readonly := true;
thisQuery.cachedUpdates := true;
thisQuery.FetchAll := true;
thisQuery.Options.LocalMasterDetail := true;
thisQuery.Options.StrictUpdate := false;

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Case sensitive issues under 10.3+Linux

Post by azyk » Wed 16 Jan 2019 14:52

We cannot reproduce the issues. Please send us the result of executing Case_sensitive_Linux console application. The code is below. Open it in Delphi, set the credentials and run.

Code: Select all

program Case_sensitive_Linux;

{$APPTYPE CONSOLE}
{$R *.res}

uses
  System.SysUtils,
  PgAccess,
  PgClasses,
  MemData,
  Data.DB;

var
  fConnection: TPgConnection;
  thisQuery: TpGQuery;
begin
  try
    fConnection := TPgConnection.Create(nil);
    try

      fConnection.Pooling := false;
      fConnection.LoginPrompt := false;
      fConnection.Options.ApplicationName := ExtractFileName(paramstr(0));
      fConnection.Options.UseUnicode := true;
      fConnection.Options.EnableComposites := true;
      fConnection.Options.DefaultSortType := stCaseInsensitive;
      // SET UP CREDENTIALS
      fConnection.Server := 'Server';
      fConnection.Database := 'Database';
      fConnection.Username := 'Username';
      fConnection.Password := 'Password';
      fConnection.Port := 5432;

      thisQuery := TpGQuery.Create(nil);
      try
        thisQuery.Connection := fConnection;
        thisQuery.readonly := true;
        thisQuery.cachedUpdates := true;
        thisQuery.FetchAll := true;
        thisQuery.Options.LocalMasterDetail := true;
        thisQuery.Options.StrictUpdate := false;

        // Issue 1
        thisQuery.SQL.text := 'select job from emp where job= :PARAMname';
        thisQuery.ParamByName('paramNAME').asString := 'MANAGER';
        // Under Linux - Param Name is now case sensitive
        thisQuery.open;
        if thisQuery.RecordCount <> 3 then
          Writeln('Issue 1. BUG.')
        else
          Writeln('Issue 1. Not reproduced');

        // Issue 2
        thisQuery.SQL.text := 'select job from emp';
        thisQuery.open;

        if thisQuery.locate('job', 'MaNaGeR', [loCaseInsensitive]) then
        // loCaseInsenstive ignored
          Writeln('Issue 2. Not reproduced')
        else
          Writeln('Issue 2. BUG.');
      finally
        thisQuery.Free;
      end;
    finally
      fConnection.Free;
    end;

  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
  Writeln('Press ENTER to exit.');
  Readln;

end.
Script for create emp table is in the InstallDemoObjects.sql file. The file located where PgDAC demos were installed.

hsvandrew
Posts: 11
Joined: Fri 06 May 2016 01:22

Re: Case sensitive issues under 10.3+Linux

Post by hsvandrew » Mon 21 Jan 2019 23:02

I can confirm that your console app works on Linux (centos7), but the same code fails inside an Apache module on the same linux server connecting to the same postgres database server & database.
The apache module is brand new (created from a new Delphi template) and contains the same code base as your demo i.e. no additional units other than those included by EMB

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Case sensitive issues under 10.3+Linux

Post by azyk » Wed 23 Jan 2019 09:24

To fix the issue, we need to investigate it. We cannot reproduce the issue in our test environment. Please provide the following additional information:

- Compose a small sample Delphi project for the issue reproduction.
- Include the script of test tables creation.
- Step-By-Step instructions on how to set up the Apache module.

Post Reply