summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-02-20 10:32:09 +0100
committerSergei Golubchik <serg@mariadb.org>2019-02-21 15:04:03 +0100
commit132216faf7df6c73d93fed0ee4c26ed2421c96d6 (patch)
treeb352494fb98b2d019f8e0b61e05de1ed9083fbd2
parent65ffea3924f8d90bce5ae5188d5b44feaaaf6c7f (diff)
downloadmariadb-git-132216faf7df6c73d93fed0ee4c26ed2421c96d6.tar.gz
don't invoke error interceptors for fatal errors
and, again, *don't use thd->clear_error()* this fixed main.sp_notembedded failure on various amd64 platforms (where ER_STACK_OVERRUN_NEED_MORE happens to fire in open_stat_tables() under Dummy_error_handler)
-rw-r--r--sql/sql_class.cc3
-rw-r--r--sql/sql_statistics.cc25
2 files changed, 2 insertions, 26 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 05534eb717e..27f00e8c5b1 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1040,7 +1040,8 @@ Sql_condition* THD::raise_condition(uint sql_errno,
level= Sql_condition::WARN_LEVEL_ERROR;
}
- if (handle_condition(sql_errno, sqlstate, &level, msg, &cond))
+ if (!is_fatal_error &&
+ handle_condition(sql_errno, sqlstate, &level, msg, &cond))
DBUG_RETURN(cond);
switch (level) {
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 8683368e818..a9b6ba222f9 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -3334,7 +3334,6 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables)
{
TABLE_LIST stat_tables[STATISTICS_TABLES];
Open_tables_backup open_tables_backup;
- bool has_error_active= thd->is_error();
DBUG_ENTER("read_statistics_for_tables_if_needed");
DEBUG_SYNC(thd, "statistics_read_start");
@@ -3343,11 +3342,7 @@ int read_statistics_for_tables_if_needed(THD *thd, TABLE_LIST *tables)
DBUG_RETURN(0);
if (open_stat_tables(thd, stat_tables, &open_tables_backup, FALSE))
- {
- if (!has_error_active)
- thd->clear_error();
DBUG_RETURN(1);
- }
for (TABLE_LIST *tl= tables; tl; tl= tl->next_global)
{
@@ -3416,15 +3411,10 @@ int delete_statistics_for_table(THD *thd, const LEX_CSTRING *db,
TABLE_LIST tables[STATISTICS_TABLES];
Open_tables_backup open_tables_backup;
int rc= 0;
- bool has_error_active= thd->is_error();
DBUG_ENTER("delete_statistics_for_table");
if (open_stat_tables(thd, tables, &open_tables_backup, TRUE))
- {
- if (!has_error_active)
- thd->clear_error();
DBUG_RETURN(0);
- }
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
@@ -3506,16 +3496,11 @@ int delete_statistics_for_column(THD *thd, TABLE *tab, Field *col)
TABLE_LIST tables;
Open_tables_backup open_tables_backup;
int rc= 0;
- bool has_error_active= thd->is_error();
DBUG_ENTER("delete_statistics_for_column");
if (open_single_stat_table(thd, &tables, &stat_table_name[1],
&open_tables_backup, TRUE))
- {
- if (!has_error_active)
- thd->clear_error();
DBUG_RETURN(0);
- }
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
@@ -3574,16 +3559,11 @@ int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info,
TABLE_LIST tables;
Open_tables_backup open_tables_backup;
int rc= 0;
- bool has_error_active= thd->is_error();
DBUG_ENTER("delete_statistics_for_index");
if (open_single_stat_table(thd, &tables, &stat_table_name[2],
&open_tables_backup, TRUE))
- {
- if (!has_error_active)
- thd->clear_error();
DBUG_RETURN(0);
- }
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
@@ -3760,7 +3740,6 @@ int rename_column_in_stat_tables(THD *thd, TABLE *tab, Field *col,
TABLE_LIST tables;
Open_tables_backup open_tables_backup;
int rc= 0;
- bool has_error_active= thd->is_error();
DBUG_ENTER("rename_column_in_stat_tables");
if (tab->s->tmp_table != NO_TMP_TABLE)
@@ -3768,11 +3747,7 @@ int rename_column_in_stat_tables(THD *thd, TABLE *tab, Field *col,
if (open_single_stat_table(thd, &tables, &stat_table_name[1],
&open_tables_backup, TRUE))
- {
- if (!has_error_active)
- thd->clear_error();
DBUG_RETURN(rc);
- }
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();