Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
-
None
Description
With default SQL_MODE (which includes STRICT_TRANS_TABLES in all affected versions):
--source include/have_partition.inc
|
|
create table t (a int) with system versioning; |
alter table t partition by system_time partitions 3; |
|
show create table t; |
--let $show= query_get_value(show create table t, 'Create Table', 1)
|
|
drop table t; |
--eval $show
|
|
# Cleanup
|
drop table if exists t; |
10.5 |
MariaDB [test]> create table t (a int) with system versioning; |
Query OK, 0 rows affected (0.033 sec) |
|
MariaDB [test]> alter table t partition by system_time partitions 3; |
Query OK, 0 rows affected, 1 warning (0.084 sec) |
Records: 0 Duplicates: 0 Warnings: 1
|
|
MariaDB [test]> show warnings;
|
+---------+------+----------------------------------------------------------------------------------+ |
| Level | Code | Message | |
+---------+------+----------------------------------------------------------------------------------+ |
| Warning | 4115 | Maybe missing parameters: no rotation condition for multiple HISTORY partitions. | |
+---------+------+----------------------------------------------------------------------------------+ |
1 row in set (0.000 sec) |
So, ALTER produces a warning, but still partitions the table:
MariaDB [test]> show create table t; |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ |
| t | CREATE TABLE `t` ( |
`a` int(11) DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING |
PARTITION BY SYSTEM_TIME |
PARTITIONS 3 |
|
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ |
1 row in set (0.023 sec) |
Attempt to re-run this CREATE TABLE however leads to an error:
MariaDB [test]> drop table t; |
Query OK, 0 rows affected (0.040 sec) |
|
MariaDB [test]> CREATE TABLE `t` ( |
-> `a` int(11) DEFAULT NULL |
-> ) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING |
-> PARTITION BY SYSTEM_TIME |
-> PARTITIONS 3;
|
ERROR 4115 (HY000): Maybe missing parameters: no rotation condition for multiple HISTORY partitions. |
Unsetting strict SQL mode makes it a warning again (notoriously, STRICT_TRANS_TABLES affects it, regardless whether it's InnoDB or MyISAM).
Attachments
Issue Links
- causes
-
MDEV-31822 ALTER TABLE ENGINE=x started failing instead of producing warning on unsupported TRANSACTIONAL=1
- Closed