Query doesn't close when SQL.Text assigned
Posted: 13.04.2024, 16:13
I installed ZeosLib 8.0.0 on Lazarus 3.2, FPC 3.2.2.
I found a major problem: active query doesn't close when SQL.Text property is assigned. I think it's related to this thread: viewtopic.php?t=143732
If I create table like this:
And then run following queries:
In 7.2.14 I get following:
But in 8.0.0 I get this:
It looks like that instead of automatically closing query when SQL.Text is assigned, in version 8.0.0 new text is checked against existing one, and if they are the same, query is not closed. If I add a single space somewhere in 2nd query, results are as expected.
I tried to enable ACTIVE_DATASET_SQL_CHANGE_EXCEPTION, but that also don't detect assignment.
How can I turn on behavior like it was in previous Zeos versions?
I found a major problem: active query doesn't close when SQL.Text property is assigned. I think it's related to this thread: viewtopic.php?t=143732
If I create table like this:
Code: Select all
With ZQuery1 do
begin
SQL.Text := 'create table zeostest (fint1 int, fint2 int, primary key (fint1))';
ExecSQL;
SQL.Text := 'insert into zeostest (fint1, fint2) values (:fint1, :fint2)';
Prepare;
ParamByName('fint1').AsInteger := 1;
ParamByName('fint2').AsInteger := 10;
ExecSQL;
ParamByName('fint1').AsInteger := 2;
ParamByName('fint2').AsInteger := 20;
ExecSQL;
ParamByName('fint1').AsInteger := 3;
ParamByName('fint2').AsInteger := 30;
ExecSQL;
end;
Code: Select all
With ZQuery1 do
begin
SQL.Text := 'select * from zeostest where fint1 = :fint1';
ParamByName('fint1').AsInteger := 1;
Open;
WriteLn(FieldByName('fint2').AsString);
SQL.Text := 'select * from zeostest where fint1 = :fint1';
ParamByName('fint1').AsInteger := 2;
Open;
WriteLn(FieldByName('fint2').AsString);
SQL.Text := 'select * from zeostest where fint1 = :fint1';
ParamByName('fint1').AsInteger := 3;
Open;
WriteLn(FieldByName('fint2').AsString);
end;
Code: Select all
10
20
30
Code: Select all
10
10
10
I tried to enable ACTIVE_DATASET_SQL_CHANGE_EXCEPTION, but that also don't detect assignment.
How can I turn on behavior like it was in previous Zeos versions?