reproducable bug using postgres 9
Posted: Fri 25 Aug 2017 11:56
Using unicode, no autocommit, no fetchall. c++ builder XE10, unidac 7.0.2.
I get an exception "The portail « PORTALST471817920 » does not exist" (and the same program works agains mariadb, oracle, ...).
Here is a sample to reproduce the issue:
Script to create table:
on a form, drop a PostgresSQLUniProvider, a TUniConnection (autocommit false, UseUnicode true,and connect it), a TUniQuery q1 (Unidirectional=true, FetchRows=3, SELECT ID FROM T1 ORDER BY id), add the id field, add a TUniSQL qd1 with query "delete from t1 where id=:1".
Add a Button with this code:
=> Exception ---------------------------
Debugger Exception Notification
---------------------------
Project Project83.exe raised exception class EPgError with message 'le portail « PORTALST471817920 » n'existe pas'
---------------------------
Break Continue Help
---------------------------
occurs when <fetchrows> rows have been read.
This programs works fine with the same db in mariadb. Problem is caused by the transaction restart (commit in the middle). Without these lines it works perfectly.
Can you investigate and include a fix in next release?
Regards.
I get an exception "The portail « PORTALST471817920 » does not exist" (and the same program works agains mariadb, oracle, ...).
Here is a sample to reproduce the issue:
Script to create table:
Code: Select all
rollback;
drop table t1;
create table t1(id int, primary key(id));
insert into t1(id) values (1);
insert into t1(id) values (2);
insert into t1(id) values (3);
insert into t1(id) values (4);
insert into t1(id) values (5);
insert into t1(id) values (6);
insert into t1(id) values (7);
commit;
Add a Button with this code:
Code: Select all
UniConnection1->StartTransaction();
q1->Open();
qd1->Prepare();
int i=0;
for (; !q1->Eof; q1->Next()) {
if (i%5==0) {
UniConnection1->Commit();
UniConnection1->StartTransaction();
}
qd1->Params->Items[0]->AsInteger=q1id->AsInteger;
qd1->Execute();
}
q1->Close();
UniConnection1->Commit();
Debugger Exception Notification
---------------------------
Project Project83.exe raised exception class EPgError with message 'le portail « PORTALST471817920 » n'existe pas'
---------------------------
Break Continue Help
---------------------------
occurs when <fetchrows> rows have been read.
This programs works fine with the same db in mariadb. Problem is caused by the transaction restart (commit in the middle). Without these lines it works perfectly.
Can you investigate and include a fix in next release?
Regards.