All: I noticed the following when using sqlite to timestamp flags in an embedded system. I will lay out the tests performed and the results I got.
First, an overview. I am working with a linux 2.6.26 kernel and sqlite v3.5.0. For the handling of timezones, I use the zoneinfo files. /etc/localtime is a symbolic link to /var/tmp/localtime. At boot the proper timezone file is copied to /var/tmp/localtime (the reason for this setup is /etc resides in a read only partition. I timestamp each flag using 'Insert into flags (timestamp, FLAGDATA...) values (datetime('now','localtime), FLAGDATA)'. Now on to my issue. --Scenario A-- Boot System Update /var/localtime with correct zoneinfo file Write Flag(s) ------------------------------------------------------------------ Result.... All time stamps match my localtime. --Scenario B-- Boot System Write 1 Flag Update /var/localtime with correct zoneinfo file Write a few flags (5-10) ....Some time elapses.... Write some more flags ------------------------------------------------------------------- Result... The first flag ,written before /var/localtime, is written in UTC. I expect this since the symbolic link does not yet point to a valid zoneinfo file. The next few flags (5-10 depending on what the system is doing) are also in UTC, these flags are the same flags written in Scenario A after the zoneinfo update. The system may briefly stop writing flags, then write some more due to a button press or something. Eventually the flags receive the correct timestamp for my timezone settings. I think, but cant say for certain, that the timestamp becomes 'correct' after a small amount of time elapses. So this email isn't blaming SQLite for my improper timestamps even after I set the correct zoneinfo file. I am just trying to understand what is going on. Should I assume that my observation of 'Set zoneinfo first, then use datetime functions' is a valid fix? Or am I fooling myself? I just wanted to know the mechanism at work here. Of course I do fully acknowledge this is could be an artifact in the GLIBC library. If someone knows the particular reason this is happening, even if it is GLIBC fault, I would love to know. My last bit of information which may be relevant is all flags are written in individual transactions. Thanks in advance, Rich _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users