Skip to content

Float Params don't work for SQLite. Probably only effect ARM

Original Reporter info from Mantis: doconnor
  • Reporter name: Darwin O'Connor

Description:

Using SQLDB to connect to a SQLite database and then do a query and set a float parameter, the value does not get passed correctly.

This probably only happens on ARM.

Uses SQLite 3.8.9 from installed from Gentoo.

Steps to reproduce:

This program will reproduce the problem. For me it returns 0 instead of the parameter being passed. If I switch to an integer parameter it will work.

It takes a SQLite database name as parameter, but it doesn't do anything to the database.

program floatparam;

uses db, sqlite3conn, sqldb;

var
   Conn : TSQLite3Connection;
   trans : TSQLTransaction;
   q : TSQLQuery;

begin
   Conn:=TSQLite3Connection.create(nil);
   Conn.DatabaseName:=paramstr(1);
   Conn.open;
   trans:=TSQLTransaction.create(nil);
   trans.Database:=conn;
   trans.Options:=[stoUseImplicit];
   conn.transaction:=trans;
   q:=TSQLQuery.create(nil);
   q.Database:=Conn;
   q.sql.add('select :p');
   q.params[0].Asfloat:=43.082375834;
   q.open;
   writeln(q.Fields[0].AsFloat);
   q.Close;
   q.free;
   trans.free;
   conn.free;
end.

Mantis conversion info:

  • Mantis ID: 28140
  • OS: Android 4.4 with Gentoo.prefix
  • OS Build: 4.4
  • Build: SVN from May 5, 2015
  • Platform: LG G3
  • Version: 3.1.1
  • Monitored by: » doconnor (Darwin O'Connor)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information