Commit fcbb672f authored by Aleksey Midenkov's avatar Aleksey Midenkov

SQL: NOT NULL for timestamps [#63, #300]

parent 55e9a5e2
......@@ -132,7 +132,7 @@ drop table t2;
create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
describe t2;
Field Type Null Key Default Extra
a datetime YES NULL
a datetime NO NULL
b time NO NULL
c date NO NULL
d int(3) NO NULL
......
......@@ -787,7 +787,7 @@ drop table t2;
create table t2 select f2 from (select now() f2 from t1) a;
show columns from t2;
Field Type Null Key Default Extra
f2 datetime YES NULL
f2 datetime NO NULL
drop table t2, t1;
CREATE TABLE t1(
id int PRIMARY KEY,
......
......@@ -39,14 +39,14 @@ t1 CREATE TABLE `t1` (
`sec_to_time(12345)` time DEFAULT NULL,
`sec_to_time(12345.6789)` time(4) DEFAULT NULL,
`sec_to_time(1234567e-2)` time(6) DEFAULT NULL,
`now()` datetime DEFAULT NULL,
`now()` datetime NOT NULL,
`curtime(0)` time NOT NULL,
`utc_timestamp(1)` datetime(1) DEFAULT NULL,
`utc_timestamp(1)` datetime(1) NOT NULL,
`utc_time(2)` time(2) NOT NULL,
`current_time(3)` time(3) NOT NULL,
`current_timestamp(4)` datetime(4) DEFAULT NULL,
`localtime(5)` datetime(5) DEFAULT NULL,
`localtimestamp(6)` datetime(6) DEFAULT NULL,
`current_timestamp(4)` datetime(4) NOT NULL,
`localtime(5)` datetime(5) NOT NULL,
`localtimestamp(6)` datetime(6) NOT NULL,
`time_to_sec(123456)` bigint(17) DEFAULT NULL,
`time_to_sec('12:34:56.789')` decimal(19,3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
......
......@@ -1693,7 +1693,6 @@ Item_func_now::Item_func_now(THD *thd, uint dec) :
last_query_id(0)
{
decimals= dec;
maybe_null= true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment