1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-29841 More descriptive text for ER_PARTITION_WRONG_TYPE

For commands

  (1) alter table t1 add partition (partition p2);
  (2) alter table t1 add partition (partition px history);

It printed the same error message:

   Wrong partitioning type, expected type: `SYSTEM_TIME`

For (1) it is not clear from the syntax that we are trying to add
HASH partition. For (2) it is not clear that the table partitioning is
different than SYSTEM_TIME. Now it prints what type we are trying to
add to what type of partitioning.

Fixed warning unused function rename_field_in_list() for compilation
without partitioning.
This commit is contained in:
Aleksey Midenkov
2022-11-11 14:37:40 +03:00
parent 08e2c98ec8
commit 0e6f2757d1
9 changed files with 122 additions and 37 deletions

View File

@@ -96,6 +96,16 @@ with system versioning
partition by system_time (
partition p0 history,
partition pn current);
create or replace table t1 (a int)
partition by range (a) (
partition p0 history,
partition p1 current);
ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `RANGE`
create or replace table t1 (b int)
partition by range (a) (
partition p0 current,
partition p1 history);
ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `RANGE`
## ALTER TABLE
alter table t1 add partition (
partition p1 current);
@@ -150,7 +160,7 @@ partition by system_time limit 1;
alter table t1 change x big int;
create or replace table t1 (i int) engine myisam partition by hash(i) partitions 2;
alter table t1 add partition (partition px history);
ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
ERROR HY000: Wrong partition type `SYSTEM_TIME` for partitioning by `HASH`
## INSERT, UPDATE, DELETE
create or replace table t1 (x int)
with system versioning
@@ -1105,7 +1115,7 @@ drop table t1;
create table t1 (a int) with system versioning partition by system_time
(partition p1 history, partition pn current);
alter table t1 add partition (partition p2);
ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
ERROR HY000: Wrong partition type `HASH` for partitioning by `SYSTEM_TIME`
# MDEV-17891 Assertion failures in select_insert::abort_result_set and
# mysql_load upon attempt to replace into a full table
set @@max_heap_table_size= 1024*1024;