View Issue Details

IDProjectCategoryView StatusLast Update
0038894FPCDatabasepublic2021-05-15 14:22
ReporterDarwin O'Connor Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformX64OSGentoo/Linux 
Product Version3.2.0 
Summary0038894: Fields are not returned property with using EXECUTE queries.
DescriptionIn PostgreSQL 13.2 when you do a PREPARE statement followed by an EXECUTE the field values returned are completely wrong.
Steps To ReproduceThis 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.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-05-15 14:21 Darwin O'Connor New Issue