You are not logged in.
TDateTimeMS type is supposed to have a millisecond part, when adding to an external database (e.g., PostgreSQL).
It works as expected if the record is added individually using the Add method.
Howerver, when BatchAdd, mORMot will mistakenly strip off the millisecond part of TDateTimeMS field inside method TSQLDBStatementWithParams.BindArray, Line 7891-7896, of SynDB.pas:
if (ParamType=ftDate) and (ChangeFirstChar<>'T') then
for i := 0 to ValuesCount-1 do // fix e.g. for PostgreSQL
if (p^.VArray[i]<>'') and (p^.VArray[i][1]='''') then begin
v.From(PUTF8Char(pointer(p^.VArray[i]))+1,length(p^.VArray[i])-2); // <<--- This line would strip off the millisecond part?
p^.VArray[i] := v.FullText({expanded=}true,ChangeFirstChar,'''');
end;
I also checked the mORMot-generated SQL query sent to the database engine, which confirmed the above.
Can you please double check? Thanks.
Last edited by wxinix (2021-05-09 01:37:37)
Offline
Which provider (SynDB properties class) are you using?
Please try my latest patch on trunk.
I use PostgresSQL. TSQLDBZEOSConnectionProperties
Thank you very much. The latest patch works!
Offline