ifnull on timestamp doesn't work

Bug #315304 reported by Stewart Smith
2
Affects Status Importance Assigned to Milestone
Drizzle
Invalid
High
Jay Pipes

Bug Description

find out why this was needed:

--- /home/stewart/drizzle/tests/tests/r/create.result 2009-01-07 13:43:37.920608815 +0300
+++ /home/stewart/drizzle/tests/tests/r/create.reject 2009-01-09 04:32:49.707620666 +0300
@@ -437,7 +437,7 @@
 2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02binary data 02:00:00
 drop table t1, t2;
 create table t1 (a int, b int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), o char(10));
-create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
+create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
 show create table t2;
 Table Create Table
 t2 CREATE TABLE `t2` (
@@ -449,7 +449,6 @@
   `ifnull(g,g)` double(4,3),
   `ifnull(h,h)` decimal(5,4),
   `ifnull(j,j)` date,
- `ifnull(k,k)` timestamp NOT NULL,
   `ifnull(l,l)` datetime,
   `ifnull(m,m)` varchar(1),
   `ifnull(o,o)` varchar(10)

Revision history for this message
Jay Pipes (jaypipes) wrote :

Stewart, I'll take this since I am already reworking time handling in the server. See lp:~jaypipes/drizzle/temporal.

Changed in drizzle:
assignee: nobody → jaypipes
Jay Pipes (jaypipes)
Changed in drizzle:
importance: Undecided → High
milestone: none → cirrus
status: New → Confirmed
Revision history for this message
Jay Pipes (jaypipes) wrote :

I can no longer reproduce this in trunk or my local temporal branch:

drizzle> create table t1 (f1 timestamp not null);
Query OK, 0 rows affected (2.36 sec)

drizzle> select ifnull(f1,f1) from t1;
Empty set (5.04 sec)

drizzle> insert into t1 values (null);
Query OK, 1 row affected (1.94 sec)

drizzle> select ifnull(f1,f1) from t1;
+---------------------+
| ifnull(f1,f1) |
+---------------------+
| 2009-01-20 01:39:54 |
+---------------------+
1 row in set (2.59 sec)

drizzle> create table t2 select ifnull(f1,f1) from t1;
Query OK, 1 row affected (4.14 sec)
Records: 1 Duplicates: 0 Warnings: 0

drizzle> show create table t2\G
*************************** 1. row ***************************
       Table: t2
Create Table: CREATE TABLE `t2` (
  `ifnull(f1,f1)` timestamp NOT NULL
) ENGINE=InnoDB
1 row in set (1.69 sec)

drizzle> select * from t2;
+---------------------+
| ifnull(f1,f1) |
+---------------------+
| 2009-01-20 01:39:54 |
+---------------------+
1 row in set (0.97 sec)

Changed in drizzle:
status: Confirmed → Incomplete
Revision history for this message
Jay Pipes (jaypipes) wrote :

Marking as invalid, as I can no longer reproduce this bug

Changed in drizzle:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.