I'm fixing a problem with method makeDBFieldValue in the concrete DBMS
class implementations. 

this method was introduced as a tool to provide a uniform way to handle
date, time and timestamp database fields when building SQL queries with
Tcl. One of the cases handled by this method is when you want to have a
time reference expressed in seconds (Unix epoch) to be compared, for
instance, with the output of [clock seconds]. 

The "SECS" case of the method was wrong in Sqlite and Mysql as the
number of seconds value was built creating a sort of serial number by
concatenating the datetime as <year><month><day><hr><min><sec>. This
clearly is a number which bumps up by 40 units every minute at least
(much more when for example the minutes hand completes a lap) making the
comparison with [clock seconds] useless, but also making delta times
computed with it not comparable with real seconds durations. This is the
case of class Session which uses this method to determine when a session
has to be refreshed or removed from the database.  This bug had so far
no noticeable side effect in Session because a session lifetime is
usually several hours while the discrepancy becomes relevant when
comparing time intervals of the order of minutes.

I fixed and commited the classes Sqlite and Mysql and I'm going to fix
also Postgresql. I could also fix the Oracle class. Oracle has no native
way to return the Unix timestamp in SQL queries. A workaround exists but
I don't have an Oracle installation to test it, so I please any Oracle
user to volunteer for a test (I can provide simple scripts for testing
it with the Session package)

 -- Massimo
 


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org

Reply via email to