Bug #29822 | Wrong ordering of timediff() result | ||
---|---|---|---|
Submitted: | 16 Jul 2007 14:08 | Modified: | 17 Jul 2007 9:24 |
Reporter: | Tomas Telensky | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.45-log | OS: | Linux |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[16 Jul 2007 14:08]
Tomas Telensky
[16 Jul 2007 15:10]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described: mysql> select timediff(now(), '2007-07-04 10:10:01') < timediff(now(), '2007-07-14 00:00:00') t; Field 1: `t` Catalog: `def` Database: `` Table: `` Org_table: `` Type: LONGLONG Collation: binary (63) Length: 1 Max_length: 1 Decimals: 0 Flags: BINARY NUM +------+ | t | +------+ | 1 | +------+ 1 row in set (0.00 sec) mysql> select timediff(now(), '2007-07-04 10:10:01'), timediff(now(), '2007-07-14 00:00:00') t; Field 1: `timediff(now(), '2007-07-04 10:10:01')` Catalog: `def` Database: `` Table: `` Org_table: `` Type: TIME Collation: binary (63) Length: 23 Max_length: 9 Decimals: 6 Flags: BINARY Field 2: `t` Catalog: `def` Database: `` Table: `` Org_table: `` Type: TIME Collation: binary (63) Length: 23 Max_length: 8 Decimals: 6 Flags: BINARY +----------------------------------------+----------+ | timediff(now(), '2007-07-04 10:10:01') | t | +----------------------------------------+----------+ | 295:57:05 | 66:07:06 | +----------------------------------------+----------+ So, results are of type TIME but compared as strings, not as periods of time.
[17 Jul 2007 9:24]
Evgeny Potemkin
Duplicate of the bug#29555.