2
0
Эх сурвалжийг харах

* Added recognition of CLOB fields to TSqlite3Conn + test, bug #17004

git-svn-id: trunk@16853 -
joost 14 жил өмнө
parent
commit
5fc605df60

+ 2 - 1
packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp

@@ -312,7 +312,7 @@ Type
   end;
   
 Const
-  FieldMapCount = 19;
+  FieldMapCount = 20;
   FieldMap : Array [1..FieldMapCount] of TFieldMap = (
    (n:'INT'; t: ftInteger),
    (n:'LARGEINT'; t:ftlargeInt),
@@ -332,6 +332,7 @@ Const
    (n:'NUMERIC'; t: ftBCD),
    (n:'DECIMAL'; t: ftBCD),
    (n:'TEXT'; t: ftmemo),
+   (n:'CLOB'; t: ftmemo),
    (n:'BLOB'; t: ftBlob)
 { Template:
   (n:''; t: ft)

+ 25 - 0
packages/fcl-db/tests/testfieldtypes.pas

@@ -96,6 +96,9 @@ type
     procedure TestClearUpdateableStatus;
     procedure TestReadOnlyParseSQL; // bug 9254
     procedure TestGetTables;
+
+    // Test SQL-field type recognition
+    procedure TestSQLClob;
   end;
 
 implementation
@@ -1580,6 +1583,28 @@ begin
     end;
 end;
 
+procedure TTestFieldTypes.TestSQLClob;
+var
+  i          : byte;
+begin
+  CreateTableWithFieldType(ftMemo,'CLOB');
+  TestFieldDeclaration(ftMemo,0);
+
+  for i := 0 to testValuesCount-1 do
+    TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (' + QuotedStr(testStringValues[i]) + ')');
+
+  with TSQLDBConnector(DBConnector).Query do
+    begin
+    Open;
+    for i := 0 to testValuesCount-1 do
+      begin
+      AssertEquals(testStringValues[i],fields[0].AsString);
+      Next;
+      end;
+    close;
+    end;
+end;
+
 procedure TTestFieldTypes.TestUpdateIndexDefs;
 var ds : TSQLQuery;
 begin