mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-438 Microseconds: Precision is ignored in CURRENT_TIMESTAMP(N) when it is given as a default column value
For MySQL 5.6 compatibility, support precision specification in CURRENT_TIMESTAMP in a default clause, when it's not less than the column's precision.
This commit is contained in:
@ -278,3 +278,23 @@ select * from t1;
|
||||
a
|
||||
2011-01-01 01:01:01.12345
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) default current_timestamp);
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) default current_timestamp());
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) default current_timestamp(2));
|
||||
ERROR 42000: Invalid default value for 'a'
|
||||
create table t1 (a timestamp(5) default current_timestamp(5));
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) default current_timestamp(6));
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) on update current_timestamp);
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) on update current_timestamp());
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) on update current_timestamp(3));
|
||||
ERROR HY000: Invalid ON UPDATE clause for 'a' column
|
||||
create table t1 (a timestamp(5) on update current_timestamp(5));
|
||||
drop table t1;
|
||||
create table t1 (a timestamp(5) on update current_timestamp(6));
|
||||
drop table t1;
|
||||
|
@ -14,3 +14,18 @@ insert t1 values ();
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# MDEV-438 Microseconds: Precision is ignored in CURRENT_TIMESTAMP(N) when it is given as a default column value
|
||||
#
|
||||
create table t1 (a timestamp(5) default current_timestamp); drop table t1;
|
||||
create table t1 (a timestamp(5) default current_timestamp()); drop table t1;
|
||||
--error ER_INVALID_DEFAULT
|
||||
create table t1 (a timestamp(5) default current_timestamp(2));
|
||||
create table t1 (a timestamp(5) default current_timestamp(5)); drop table t1;
|
||||
create table t1 (a timestamp(5) default current_timestamp(6)); drop table t1;
|
||||
create table t1 (a timestamp(5) on update current_timestamp); drop table t1;
|
||||
create table t1 (a timestamp(5) on update current_timestamp()); drop table t1;
|
||||
--error ER_INVALID_ON_UPDATE
|
||||
create table t1 (a timestamp(5) on update current_timestamp(3));
|
||||
create table t1 (a timestamp(5) on update current_timestamp(5)); drop table t1;
|
||||
create table t1 (a timestamp(5) on update current_timestamp(6)); drop table t1;
|
||||
|
Reference in New Issue
Block a user