diff --git a/mysql-test/suite/parts/r/show_create.result b/mysql-test/suite/parts/r/show_create.result index 79ac61d180d..596233fdf8b 100644 --- a/mysql-test/suite/parts/r/show_create.result +++ b/mysql-test/suite/parts/r/show_create.result @@ -103,3 +103,15 @@ t_partition CREATE TABLE `t_partition` ( PARTITION BY HASH (`f1`) PARTITIONS 2 drop table t_partition; +create table t1 (a int) partition by range(a) (partition p0 values less than (5)); +set sql_mode='ansi_quotes'; +alter table t1 add partition (partition p1 values less than (10)); +set sql_mode= default; +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"p0" VALUES LESS THAN (5) ENGINE = MyISAM, + PARTITION "p1" VALUES LESS THAN (10)' at line 2 +Warnings: +Warning 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"p0" VALUES LESS THAN (5) ENGINE = MyISAM, + PARTITION "p1" VALUES LESS THAN (10)' at line 2 +drop table t1; diff --git a/mysql-test/suite/parts/t/show_create.test b/mysql-test/suite/parts/t/show_create.test index 9c43b163790..4a54b6b41b3 100644 --- a/mysql-test/suite/parts/t/show_create.test +++ b/mysql-test/suite/parts/t/show_create.test @@ -39,3 +39,13 @@ create table t_partition (f1 int) partition by hash(f1) partitions 2; select * from t_partition as tbl; show create table t_partition; drop table t_partition; + +# +# MDEV-16792 Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno or wrong result upon SHOW TABLE STATUS after adding partition under ANSI_QUOTES +# +create table t1 (a int) partition by range(a) (partition p0 values less than (5)); +set sql_mode='ansi_quotes'; +alter table t1 add partition (partition p1 values less than (10)); +set sql_mode= default; +show table status; +drop table t1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6af64b3bb11..fe5454f1051 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4795,9 +4795,7 @@ public: const char* msg, Sql_condition ** cond_hdl) { - if (sql_errno == ER_PARSE_ERROR || - sql_errno == ER_TRG_NO_DEFINER || - sql_errno == ER_TRG_NO_CREATION_CTX) + if (sql_errno == ER_TRG_NO_DEFINER || sql_errno == ER_TRG_NO_CREATION_CTX) return true; if (*level != Sql_condition::WARN_LEVEL_ERROR)