Browse Source

* fix for #21381. Add a default parameter to switch.

git-svn-id: trunk@20454 -
marco 13 years ago
parent
commit
7de37b0ad9
1 changed files with 3 additions and 4 deletions
  1. 3 4
      packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp

+ 3 - 4
packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp

@@ -505,16 +505,15 @@ begin
   Delete(S,1,P);
 end;
 
-Function ParseSQLiteDate(S : ShortString) : TDateTime;
+Function ParseSQLiteDate(S : ShortString;sepc:ansichar=' ') : TDateTime;
 
 Var
   Year, Month, Day : Integer;
-
 begin
  Result:=0;
  If TryStrToInt(NextWord(S,'-'),Year) then
    if TryStrToInt(NextWord(S,'-'),Month) then
-     if TryStrToInt(NextWord(S,'-'),Day) then
+     if TryStrToInt(NextWord(S,sepc),Day) then
         Result:=EncodeDate(Year,Month,Day);
 end;
 
@@ -560,7 +559,7 @@ begin
     else if (Pos(':',S)<>0) then
       TS:=S;
     end;
-  Result:=ComposeDateTime(ParseSQLiteDate(DS),ParseSQLiteTime(TS,False));
+  Result:=ComposeDateTime(ParseSQLiteDate(DS,'-'),ParseSQLiteTime(TS,False));
 end;
 
 function TSQLite3Connection.LoadField(cursor : TSQLCursor;FieldDef : TfieldDef;buffer : pointer; out CreateBlob : boolean) : boolean;