Обсуждение: Datetime regression tests are all failing
Your last commit seems to have broken timestamp, interval, reltime, and horology regress tests on HPUX. Minus signs are showing up in a lot of unexpected-looking places, eg *** ./expected/timestamp.out Sat Nov 25 11:05:59 2000 --- ./results/timestamp.out Thu Jan 18 01:28:28 2001 *************** *** 631,638 **** SELECT '' AS "53", d1 - timestamp '1997-01-02' AS diff FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01'AND '2038-01-01'; 53 | diff ! ----+---------------------------------------- ! | @ 9863 days 8 hours ago | @ 39 days 17 hours 32 mins 1 sec | @ 39 days 17 hours 32 mins 1.00 secs | @39 days 17 hours 32 mins 2.00 secs --- 631,638 ---- SELECT '' AS "53", d1 - timestamp '1997-01-02' AS diff FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01'AND '2038-01-01'; 53 | diff ! ----+-------------------------------------------- ! | @ -9863 days -8 hours ago | @ 39 days 17 hours 32 mins 1 sec | @ 39 days 17 hours 32 mins 1.00 secs |@ 39 days 17 hours 32 mins 2.00 secs Is this now the intended behavior? regards, tom lane
Tom Lane wrote: > > Your last commit seems to have broken timestamp, interval, reltime, > and horology regress tests on HPUX. Minus signs are showing up in > a lot of unexpected-looking places... > Is this now the intended behavior? Uh, no. Believe it or not, I had just noticed this myself, and have prepared patches to fix it up. The problem is with "traditional Postgres" interval output. The behavior before my recent patches was not correct when there was sign-mixing between fields, but the patches didn't do anything better, and as you noticed some of the regression test looks terrible. Anyway, I was just getting ready to send a note to the list to this effect. I'll try committing patches in the next few minutes, and I think the result is the cleanest interval representation we've had. I've included a few changes to the "leading sign" inclusion for the "ISO-style" interval also. There is a small chance that I won't be able to prepare good patches, since I'm currently sitting behind a firewall and can't update my CVS tree locally, but I expect to be able to do this on postgresql.org. Wish me luck ;) - Thomas
Fixes committed. - Thomas Fix up "Postgres-style" time interval representation when fields havemixed-signs. Previous effort left way too many minussigns, and was atleast as broken as the one before that :( Clean up "ISO-style" time interval representation to omit zero fields ifthere is at least one non-zero field. Supress someleading plus signswhen not necessary for clarity. Replace every #ifdef __CYGWIN__ block with a cleaner TIMEZONE_GLOBAL macrodefined in datetime.h.