Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.27, 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
-
None
-
Linux
Description
See the following test script:
CREATE TABLE test( |
t text NOT NULL, |
d date NOT NULL |
);
|
|
insert into test values ("x",CURRENT_DATE()); |
|
SET SESSION sql_mode = "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE"; |
|
ALTER TABLE test |
CHANGE d d DATE NOT NULL AFTER t, |
ADD i text NOT NULL AFTER d |
;
|
Resulting in
Error (1292): Incorrect date value: '0000-00-00' for column `test`.`d` at row 1
As you can see this is totally wrong, there is no such value 0000-00-00 in this table, and the alter statement should succeed.
Attachments
Issue Links
- relates to
-
MDEV-24691 sql_mode NO_ZERO_DATE conflicts with versioned tables
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Summary | change of date fields wrong if more fields added | change of date fields wrong in strictmode (NO_ZERO_DATE) if more fields added |
Affects Version/s | 10.2 [ 14601 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Affects Version/s | 5.5 [ 15800 ] | |
Affects Version/s | 10.1 [ 16100 ] | |
Affects Version/s | 10.0 [ 16000 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Link | This issue relates to MDEV-24691 [ MDEV-24691 ] |
Assignee | Sergei Golubchik [ serg ] |
Summary | change of date fields wrong in strictmode (NO_ZERO_DATE) if more fields added | ALTER TABLE wrongly checks for field's default value is AFTER is used |
Summary | ALTER TABLE wrongly checks for field's default value is AFTER is used | ALTER TABLE wrongly checks for field's default value if AFTER is used |
Fix Version/s | 10.2.38 [ 25207 ] | |
Fix Version/s | 10.3.29 [ 25206 ] | |
Fix Version/s | 10.4.19 [ 25205 ] | |
Fix Version/s | 10.5.10 [ 25204 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | Confirmed [ 10101 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 120960 ] | MariaDB v4 [ 159140 ] |
Thanks! I repeated as described on 5.5-10.5 with Myisam table, while no error with InnoDB table on 5.5-10.2,
but error on 10.3-10.5
--source include/have_innodb.inc
query 'ALTER TABLE test change d d DATE NOT NULL AFTER t, ADD i int ' failed: 1292: Incorrect date value: '0000-00-00' for column `test`.`t1`.`d` at row 1