summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-20 20:02:01 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-20 20:02:17 +0200
commit378beed0a680172d6570117c853d803e30983199 (patch)
treeae8cd84af068adb40ac1f469b32703ceefd252a9 /sql/table.cc
parentb7434bacbdd99d9c60499415f8be10aa59234dbf (diff)
downloadmariadb-git-378beed0a680172d6570117c853d803e30983199.tar.gz
MDEV-13290: Assertion Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' or `! is_set()' failed
followup for 97c2a7354b6 - don't use thd->is_error(), the error could've been set before TABLE_LIST::cleanup_items. Use the error handler to count errors. This fixes rpl.rpl_row_binlog_max_cache_size - it was failing when ER_STMT_CACHE_FULL happened duing multi-table update. Because multi_update::abort_result_set() calls do_updates() to update as much as possible, so one cannot rely on thd->is_error() after that.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/table.cc b/sql/table.cc
index ff9c4217b7d..36ed9be8084 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -4628,7 +4628,13 @@ void TABLE_LIST::cleanup_items()
int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
{
- if (check_option && check_option->val_int() == 0)
+ Counting_error_handler ceh;
+ thd->push_internal_handler(&ceh);
+ bool res= check_option && check_option->val_int() == 0;
+ thd->pop_internal_handler();
+ if (ceh.errors)
+ return(VIEW_CHECK_ERROR);
+ if (res)
{
TABLE_LIST *main_view= top_table();
if (ignore_failure)
@@ -4642,9 +4648,6 @@ int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
main_view->view_name.str);
return(VIEW_CHECK_ERROR);
}
- /* We check thd->error() because it can be set by conversion problem. */
- if (thd->is_error())
- return(VIEW_CHECK_ERROR);
return(VIEW_CHECK_OK);
}