Fields are not returned property with using EXECUTE queries.
Original Reporter info from Mantis: doconnor
-
Reporter name: Darwin O'Connor
Original Reporter info from Mantis: doconnor
- Reporter name: Darwin O'Connor
Description:
In PostgreSQL 13.2 when you do a PREPARE statement followed by an EXECUTE the field values returned are completely wrong.
Steps to reproduce:
This program prepares a statement and then executes it. It taxes a database as a parameter and the user name and password may have to be updated. For me this program returns 822083584 instead of 1.
program floatparam;
uses db, pqconnection, sqldb;
var
Conn : TPQConnection;
trans : TSQLTransaction;
q : TSQLQuery;
begin
Conn:=TPQConnection.create(nil);
Conn.DatabaseName:=paramstr(1);
Conn.UserName:='postgres';
Conn.Password:='';
Conn.open;
trans:=TSQLTransaction.create(nil);
trans.Database:=conn;
conn.transaction:=trans;
q:=TSQLQuery.create(nil);
q.Database:=Conn;
q.sql.add('prepare foo as select 1');
q.ExecSQL;
q.SQL.Clear;
q.SQL.Add('execute foo');
q.open;
writeln(stderr,q.Fields[0].AsInteger);
q.Close;
q.free;
trans.free;
conn.free;
end.
Mantis conversion info:
- Mantis ID: 38894
- OS: Gentoo/Linux
- Platform: X64
- Version: 3.2.0
- Monitored by: » doconnor (Darwin O'Connor)