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.
afreitag
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: 03.09.2013, 13:46

Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param

Postby afreitag » 04.09.2013, 10:43

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 Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

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

Postby EgonHugeist » 10.09.2013, 20:03

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?
King regards, Michael

You want to help? 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

Postby afreitag » 11.09.2013, 13:39

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

Postby afreitag » 17.09.2013, 09:13

sorry exception is when sText := 'C:\User'; not sText := 'C:/User';

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

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

Postby EgonHugeist » 25.09.2013, 19:41

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;
King regards, Michael

You want to help? 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

Postby afreitag » 03.10.2013, 12:01

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

Postby afreitag » 14.10.2013, 09:09

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 Dev Team
Zeos Dev Team
Posts: 1701
Joined: 31.03.2011, 22:38

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

Postby EgonHugeist » 14.10.2013, 11:50

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

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

Image


Return to “ZeosLib 7.0 Stable Forum”

Who is online

Users browsing this forum: No registered users and 1 guest