Add suport for BIGINT column datatype for TSQLite3Connection
Original Reporter info from Mantis: lacak @lacak.sk
-
Reporter name: LacaK
Original Reporter info from Mantis: lacak @lacak.sk
- Reporter name: LacaK
Description:
There is in sqlite3conn.pp on line 319:
- (n:'LARGEINT'; t:ftlargeInt),
please change it to:
+ (n:'BIGINT'; t:ftLargeInt),
SQL Standard (and also other databases) defines BIGINT not LARGEINT as valid data type.
Backward compatibility is not problem, because if data type not found in FieldMap then field's affinity will be used (see line 372: stInteger: ft1:=ftLargeInt;)
Additional information:
Test-case (I do not fully understand how it works, but can it be something like this)?:
testLargeIntValuesCount = 21;
testLargeIntValues : Array[0..testLargeIntValuesCount-1] of Largeint = (low(Largeint),-maxInt-1,-maxInt,-maxSmallint-1,-maxSmallint,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint+1,MaxInt,MaxInt+1,high(Largeint));
procedure TTestFieldTypes.TestSQLBigint;
var
i: byte;
begin
CreateTableWithFieldType(ftLargeInt,'BIGINT');
TestFieldDeclaration(ftLargeInt, SizeOf(Largeint));
for i := 0 to testLargeIntValuesCount-1 do
TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (' + inttostr(testLargeIntValues[i]) + ')');
with TSQLDBConnector(DBConnector).Query do
begin
Open;
for i := 0 to testLargeIntValuesCount-1 do
begin
AssertEquals(testLargeIntValues[i], Fields[0].AsLargeInt);
Next;
end;
Close;
end;
end;