Page 1 of 1
Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 04.09.2013, 10:43
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
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 10.09.2013, 20:03
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?
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 11.09.2013, 13:39
by afreitag
Windows, PostgreSQL is the same as for last Zeos version, ZConnection settings maybe...
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 17.09.2013, 09:13
by afreitag
sorry exception is when sText := 'C:\User'; not sText := 'C:/User';
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 25.09.2013, 19:41
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;
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 03.10.2013, 12:01
by afreitag
OK, so I have to check Connection properties or download new version of Zeos
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 14.10.2013, 09:09
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.
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
Posted: 14.10.2013, 11:50
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.