Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
Post Reply
afreitag
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 03.09.2013, 13:46

Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by afreitag »

I have delphi xe3 prof. and zeos 7.0.3-stable installed, DB is PostgreSQL 9, and I have a problem when I put by Param string value (contains \U escape character) to TZQuery.SQL.Text.
code:
q := TZQuery.Create(nil);
q.Connection := Conn;
q.SQL.Text := 'select :content';
q.ParamByName('content').AsString := sText;
q.ExecSQL; //exception
q.Free;
when for example sText := 'C:/User'; executing this query q raises exception class EZSQLException with message 'SQL Error: ERROR: invalid Unicode escape at character 31 HINT: Unicode escapes must be \uXXXX or \UXXXXXXXX.'.
Putting this string by Param should'nt cause exception, this code is working fine with older version of Zeos. Is this the Zeos 7.0.3-stable bug :?:
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by EgonHugeist »

Can't reproduce it. Did add a test to our suites. Everything fine on my side...

Did you change something on the Postgres-settings.

Also would it be interesting to know which TZConnection settings you're using.

Edit: Have no XE3. Do you use Windows or IOS?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
afreitag
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 03.09.2013, 13:46

Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by afreitag »

Windows, PostgreSQL is the same as for last Zeos version, ZConnection settings maybe...
afreitag
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 03.09.2013, 13:46

Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by afreitag »

sorry exception is when sText := 'C:\User'; not sText := 'C:/User';
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by EgonHugeist »

Everything fine again. My testcase:

Code: Select all

procedure TZTestCompPostgreSQLBugReport.TestUnicodeEscape;
var Query: TZQuery;
begin
  if SkipForReason(srClosedBug) then Exit;

  Query := CreateQuery;
  Connection.Connect;
  try
    Query.SQL.Text := 'select :content';
    Query.ParamByName('content').AsString := 'C:\User';
    Query.ExecSQL;
    Query.SQL.Text := 'select :content';
    Query.ParamByName('content').AsString := 'C:/User';
    Query.ExecSQL;
  finally
    Query.Free;
  end;
end;
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
afreitag
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 03.09.2013, 13:46

Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by afreitag »

OK, so I have to check Connection properties or download new version of Zeos
afreitag
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 03.09.2013, 13:46

Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by afreitag »

reason of exception is the parameter 'standard_conforming_strings' in PosgreSQl DB, when this param is 'on' it's OK, when is 'off' the exception is raised, the question is: why the same application with the same database but with earlier Zeos version don't raise the exception when param 'standard_conforming_strings' is 'off'. I haven't found any setting this param in Zeos code.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Post by EgonHugeist »

Ok that's a start to check what's wrong. I'll prepare my test for "standart_conforming_strings=off" and check what happens.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply