View Issue Details

IDProjectCategoryView StatusLast Update
0033711FPCFCLpublic2018-05-08 14:05
ReporterOndrej PokornyAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033711: [fcl-db] Fix FieldTypetoVariantMap for ftLargeint
DescriptionFieldTypetoVariantMap lists varError for ftLargeInt even if there is the varint64 variant type. As a result setting

TField.DataType := ftLargeint

clears the value!
Steps To Reproduceprogram DBLargeInt;

uses
  SysUtils, DB, SQLDB;
var
  Q: TSQLQuery;
  I: Integer;
begin
  Q := TSQLQuery.Create(nil);
  Q.SQL.Text := 'SELECT :PARAM';
  Q.Params[0].AsInteger := High(Integer);
  I := Q.Params[0].AsInteger;
  WriteLn(I);
  if Q.Params[0].DataType <> ftInteger then // this is OK -> just check that type is ftInteger
    Halt(2);
  Q.Params[0].DataType := ftLargeint; // the value is deleted !!!
  WriteLn(Q.Params[0].AsInteger);
  if I<>Q.Params[0].AsInteger then
    Halt(1);
  Q.Free;
end.
Additional InformationPatch attached.
TagsNo tags attached.
Fixed in Revision38950
FPCOldBugId
FPCTarget
Attached Files
  • db-largeint-variant-01.patch (474 bytes)
    Index: packages/fcl-db/src/base/db.pas
    ===================================================================
    --- packages/fcl-db/src/base/db.pas	(revision 38948)
    +++ packages/fcl-db/src/base/db.pas	(working copy)
    @@ -2112,7 +2112,7 @@
           {ftCursor} varError,
           {ftFixedChar} varOleStr,
           {ftWideString} varOleStr,
    -      {ftLargeint} varError,
    +      {ftLargeint} varint64,
           {ftADT} varError,
           {ftArray} varError,
           {ftReference} varError,
    

Activities

Ondrej Pokorny

2018-05-08 13:13

developer  

db-largeint-variant-01.patch (474 bytes)
Index: packages/fcl-db/src/base/db.pas
===================================================================
--- packages/fcl-db/src/base/db.pas	(revision 38948)
+++ packages/fcl-db/src/base/db.pas	(working copy)
@@ -2112,7 +2112,7 @@
       {ftCursor} varError,
       {ftFixedChar} varOleStr,
       {ftWideString} varOleStr,
-      {ftLargeint} varError,
+      {ftLargeint} varint64,
       {ftADT} varError,
       {ftArray} varError,
       {ftReference} varError,

Michael Van Canneyt

2018-05-08 13:44

administrator   ~0108201

Thanks for the patch. Applied.

(The code dates from the time that Int64 support was a bit iffy... )

Ondrej Pokorny

2018-05-08 14:05

developer   ~0108203

Thank you for the fast resolve.

Issue History

Date Modified Username Field Change
2018-05-08 13:13 Ondrej Pokorny New Issue
2018-05-08 13:13 Ondrej Pokorny File Added: db-largeint-variant-01.patch
2018-05-08 13:44 Michael Van Canneyt Fixed in Revision => 38950
2018-05-08 13:44 Michael Van Canneyt Note Added: 0108201
2018-05-08 13:44 Michael Van Canneyt Status new => resolved
2018-05-08 13:44 Michael Van Canneyt Fixed in Version => 3.1.1
2018-05-08 13:44 Michael Van Canneyt Resolution open => fixed
2018-05-08 13:44 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-05-08 13:44 Michael Van Canneyt Target Version => 3.2.0
2018-05-08 14:05 Ondrej Pokorny Note Added: 0108203
2018-05-08 14:05 Ondrej Pokorny Status resolved => closed