Browse Source

fcl-db: tests: MS SQL Server and Sybase do not support dates before 1753 for their DATETIME data type so do not try insert these dates into test tables.
(MS SQL 2008 introduced DATETIME2, which support full range of years 0000-9999).

git-svn-id: trunk@22998 -

lacak 12 years ago
parent
commit
4aa8b2cef7
1 changed files with 8 additions and 0 deletions
  1. 8 0
      packages/fcl-db/tests/sqldbtoolsunit.pas

+ 8 - 0
packages/fcl-db/tests/sqldbtoolsunit.pas

@@ -282,6 +282,14 @@ begin
       end;
       end;
     end;
     end;
 
 
+  if SQLServerType in [ssMSSQL, ssSybase] then
+    // Some DB's do not support datetime values before 1753-01-01
+    for i := 18 to testValuesCount-1 do
+      begin
+      testValues[ftDate,i] := testValues[ftDate,0];
+      testValues[ftDateTime,i] := testValues[ftDateTime,0];
+      end;
+
   // DecimalSeparator must correspond to monetary locale (lc_monetary) set on PostgreSQL server
   // DecimalSeparator must correspond to monetary locale (lc_monetary) set on PostgreSQL server
   // Here we assume, that locale on client side is same as locale on server
   // Here we assume, that locale on client side is same as locale on server
   if SQLServerType in [ssPostgreSQL] then
   if SQLServerType in [ssPostgreSQL] then