Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.1.18, 10.0.28, 10.2.2
Description
MariaDB [test]> set sql_mode='';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> create table t1(a timestamp, b timestamp);
|
Query OK, 0 rows affected (0.11 sec)
|
|
MariaDB [test]> set sql_mode = 'NO_ZERO_DATE';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> create table t2(a timestamp, b timestamp);
|
ERROR 1067 (42000): Invalid default value for 'b'
|
|
MariaDB [test]> create table t2(a timestamp, b int, c timestamp);
|
ERROR 1067 (42000): Invalid default value for 'c'
|
|
MariaDB [test]> create table t2(a timestamp);
|
Query OK, 0 rows affected (0.07 sec)
|
Index creation is affected as well.
MariaDB [test]> set sql_mode='';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> create table t1(a timestamp, b timestamp);
|
Query OK, 0 rows affected (0.06 sec)
|
|
MariaDB [test]> set sql_mode='NO_ZERO_DATE';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> create index idx on t1(a);
|
ERROR 1067 (42000): Invalid default value for 'b'
|
|
MariaDB [test]> set sql_mode='NO_ZERO_DATE,STRICT_TRANS_TABLES';
|
Query OK, 0 rows affected (0.01 sec)
|
|
MariaDB [test]> create index idx on t1(a);
|
ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column 'b' at row 1
|
Also, it seems impossible to use current_timestamp in CREATE TABLE .. ON UPDATE.
MariaDB [test]> set sql_mode = 'NO_ZERO_DATE';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> create table t1 (a timestamp(5) on update current_timestamp(5));
|
ERROR 1067 (42000): Invalid default value for 'a'
|
|
MariaDB [test]> create table t1 (a timestamp(5) on update current_timestamp(4));
|
ERROR 1294 (HY000): Invalid ON UPDATE clause for 'a' column
|
|
MariaDB [test]> create table t1 (a timestamp(5) on update current_timestamp(6));
|
ERROR 1067 (42000): Invalid default value for 'a'
|
|
MariaDB [test]> create table t1 (a timestamp on update current_timestamp);
|
ERROR 1067 (42000): Invalid default value for 'a'
|
Attachments
Issue Links
- relates to
-
MDEV-7635 update defaults and simplify mysqld config parameters
- Closed