Commit e4b466aa authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-16792 Assertion `m_status == DA_ERROR' failed in...

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

if opening a table fails with a syntax error, the error shouldn't
be suppressed completely as if it didn't happen at all.
parent 1ebec103
...@@ -103,3 +103,15 @@ t_partition CREATE TABLE `t_partition` ( ...@@ -103,3 +103,15 @@ t_partition CREATE TABLE `t_partition` (
PARTITION BY HASH (`f1`) PARTITION BY HASH (`f1`)
PARTITIONS 2 PARTITIONS 2
drop table t_partition; 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;
...@@ -39,3 +39,13 @@ create table t_partition (f1 int) partition by hash(f1) partitions 2; ...@@ -39,3 +39,13 @@ create table t_partition (f1 int) partition by hash(f1) partitions 2;
select * from t_partition as tbl; select * from t_partition as tbl;
show create table t_partition; show create table t_partition;
drop 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;
...@@ -4795,9 +4795,7 @@ class Warnings_only_error_handler : public Internal_error_handler ...@@ -4795,9 +4795,7 @@ class Warnings_only_error_handler : public Internal_error_handler
const char* msg, const char* msg,
Sql_condition ** cond_hdl) Sql_condition ** cond_hdl)
{ {
if (sql_errno == ER_PARSE_ERROR || if (sql_errno == ER_TRG_NO_DEFINER || sql_errno == ER_TRG_NO_CREATION_CTX)
sql_errno == ER_TRG_NO_DEFINER ||
sql_errno == ER_TRG_NO_CREATION_CTX)
return true; return true;
if (*level != Sql_condition::WARN_LEVEL_ERROR) if (*level != Sql_condition::WARN_LEVEL_ERROR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment