Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL)
-
None
Description
set sql_mode=default;
|
drop table if exists t1;
|
create table t1 (a timestamp);
|
insert into t1 values (0);
|
set sql_mode='TRADITIONAL';
|
drop table if exists t2;
|
create table t2 as select * from t1;
|
The last statement should fail on error, because zero date is not allowed by sql_mode.
Note, if I change data time from TIMESTAMP to DATE or DATETIME, it correctly returns the error:
ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column 'a' at row 1
|
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Summary | Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT | Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field |
Description |
{code} set sql_mode=default; drop table if exists t1; create table t1 (a timestamp); insert into t1 values (0); set sql_mode='TRADITIONAL'; drop table if exists t2; create table t2 as select * from t1; {code} The last statement should fail on error, because zero date is not allowed by sql_mode. |
{code} set sql_mode=default; drop table if exists t1; create table t1 (a timestamp); insert into t1 values (0); set sql_mode='TRADITIONAL'; drop table if exists t2; create table t2 as select * from t1; {code} The last statement should fail on error, because zero date is not allowed by sql_mode. Note, if I change data time from TIMESTAMP to DATE or DATETIME, it correctly returns the error: {noformat} ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column 'a' at row 1 {noformat} |
Component/s | Temporal Types [ 11000 ] | |
Fix Version/s | 10.1.6 [ 19401 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 70321 ] | MariaDB v4 [ 149300 ] |