From 0e6f2757d11502d74d21e4a75fa5247fc3334024 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Fri, 11 Nov 2022 14:37:40 +0300 Subject: 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. --- sql/sql_yacc.yy | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sql/sql_yacc.yy') diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7bf3429642b..99c17b5bbf9 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4815,13 +4815,17 @@ opt_part_values: part_values_in {} | CURRENT_SYM { +#ifdef WITH_PARTITION_STORAGE_ENGINE if (Lex->part_values_current(thd)) MYSQL_YYABORT; +#endif } | HISTORY_SYM { +#ifdef WITH_PARTITION_STORAGE_ENGINE if (Lex->part_values_history(thd)) MYSQL_YYABORT; +#endif } | DEFAULT { -- cgit v1.2.1