diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-07-16 22:15:55 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-08-04 10:55:21 +0530 |
commit | 745fa255ba73ab8b703481c4c420bfec7d11f6b3 (patch) | |
tree | 43fcceeeec2dafffbb76f87ea2779cf1954c593a /sql/sql_show.cc | |
parent | 87b1625b5ccb3e0e7f15a32e15892227463c7796 (diff) | |
download | mariadb-git-745fa255ba73ab8b703481c4c420bfec7d11f6b3.tar.gz |
MDEV-14836: Assertion `m_status == DA_ERROR' failed in
Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
open_normal_and_derived_table() fails because the query was already killed
as rows examined by the query are more than the limit. However, this isn't a
real error.
Fix: Check if there is actually an error before calling thd->sql_errno()
and later send a warning in handle_select() if no real error.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 18b7e92bca5..5544c765775 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4430,7 +4430,7 @@ fill_schema_table_by_open(THD *thd, bool is_show_fields_or_keys, Again we don't do this for SHOW COLUMNS/KEYS because of backward compatibility. */ - if (!is_show_fields_or_keys && result && + if (!is_show_fields_or_keys && result && thd->is_error() && (thd->get_stmt_da()->sql_errno() == ER_NO_SUCH_TABLE || thd->get_stmt_da()->sql_errno() == ER_WRONG_OBJECT)) { @@ -5614,15 +5614,21 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS rather than in SHOW COLUMNS */ - push_warning(thd, Sql_condition::WARN_LEVEL_WARN, - thd->get_stmt_da()->sql_errno(), - thd->get_stmt_da()->message()); - thd->clear_error(); + if (thd->is_error()) + { + /* + The the query was aborted because examined rows exceeded limit. + Don't send the warning here. It is done later, in handle_select(). + */ + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + thd->get_stmt_da()->sql_errno(), + thd->get_stmt_da()->message()); + thd->clear_error(); + } res= 0; } DBUG_RETURN(res); } - show_table= tables->table; count= 0; ptr= show_table->field; |