[patch_done] TimeStamp patch

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
Shagrat3
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 28.07.2009, 16:02
Contact:

[patch_done] TimeStamp patch

Post by Shagrat3 »

TimeStamp patch

[code]Index: ZDbcPostgreSqlStatement.pas
===================================================================
--- ZDbcPostgreSqlStatement.pas (revision 1553)
+++ ZDbcPostgreSqlStatement.pas (working copy)
@@ -436,7 +436,7 @@
[FormatDateTime('hh":"mm":"ss', SoftVarManager.GetAsDateTime(Value))]);
stTimestamp:
Result := Format('''%s''::timestamp',
- [FormatDateTime('yyyy-mm-dd hh":"mm":"ss',
+ [FormatDateTime('yyyy-mm-dd hh":"mm":"ss"."zzz',
SoftVarManager.GetAsDateTime(Value))]);
stAsciiStream:
begin
[/code]
You do not have the required permissions to view the files attached to this post.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Shagrat3,

first of all, is see you use my old branch. Please stop doing this use http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing instead.

Accordingly you patch: Do you know if all postgre servers do understand the milliseconds syntax? If no than we can bind your patch to a server or client version xUP. What do you think?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Shagrat3
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 28.07.2009, 16:02
Contact:

Post by Shagrat3 »

http://www.postgresql.org/docs/7.1/stat ... etime.html
Version 7.1 has "ms"

http://www.postgresql.org/docs/9.2/stat ... etime.html
Version 9.2 has "ms" to

When i use synchronization from table1 to table2 without "ms"
I have a wrong values
Last edited by Shagrat3 on 12.12.2012, 12:56, edited 1 time in total.
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Post by marcov »

User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Shagrat3,

thanks. Patch applied Rev. 2076 \testing-7.1 (behavior freeze on Zeos7.0.x) with some little changes. On Zeos7 \testing-7.1 we've got some more Statement-Types. I've also opened this door for ftTime-Fields + PostgreSQL.

marcov,

thanks for the cross-links to SQLDB. The MSec support for FireBird exists longer than i'm team-member on ZeosLib
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Post by marcov »

Note that I couldn't quickly find reports for other database types doesn't mean they don't support it.

It might be that those changes were bundled with other fixes for e.g. Mysql.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

marcov,

yes that's right, Marco.

I've googled some RDBMS we do support:

MySQL does support it since v5.6: https://blogs.oracle.com/MySqlOnWindows ... n_datetime
So we can add this support by checking the version (not very cool)

The SQLDB for SQLite does use Double values. We currently store formated strings without msecs. But i can imagine this will work too (SQLite is lazy on proofing the values). Also do i think about supporting a generic way to read DateTime values written with SQLDB.

All other Drivers do allready support the msecs.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Locked