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
Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
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?
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/
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/
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
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
sorry exception is when sText := 'C:\User'; not sText := 'C:/User';
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
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/
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/
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
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
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.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Delphi XE3 Zeos 7.0.3 Stable problem with Query.Param
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/
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/