diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-12-08 22:54:58 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-12-08 23:19:55 +0100 |
commit | 03dabfa84d6bc9a8197c8d9fbe80f2a7f6a5b6ac (patch) | |
tree | 1f9544efa27f3fa5f6a2c1fcdb40cf95dc7933ff /sql | |
parent | ab65db6d3fc0c876130cefb45a63cdaad4018f8c (diff) | |
download | mariadb-git-03dabfa84d6bc9a8197c8d9fbe80f2a7f6a5b6ac.tar.gz |
MDEV-10713: signal 11 error on multi-table update - crash in handler::increment_statistics or in make_select or assertion failure pfs_thread == ((PFS_thread*) pthread_getspecific((THR_PFS)))
Different fix. Don't allow Item_func_sp to be evaluated unless
all tables are prelocked.
Extend the test case to make sure Item_func_sp::val_str is called
(the table must have at least one row for that).
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.h | 2 | ||||
-rw-r--r-- | sql/item_func.cc | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/sql/item.h b/sql/item.h index 41e6fe0e38e..89155ac00db 100644 --- a/sql/item.h +++ b/sql/item.h @@ -3294,7 +3294,7 @@ public: if (result_type() == ROW_RESULT) orig_item->bring_value(); } - virtual bool is_expensive() { return orig_item->is_expensive(); } + bool is_expensive() { return orig_item->is_expensive(); } bool is_expensive_processor(uchar *arg) { return orig_item->is_expensive_processor(arg); } bool check_vcol_func_processor(uchar *arg) diff --git a/sql/item_func.cc b/sql/item_func.cc index 6c80c7d3d86..89d3cd9e32a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -6778,7 +6778,8 @@ Item_func_sp::init_result_field(THD *thd) bool Item_func_sp::is_expensive() { - return !(m_sp->m_chistics->detistic); + return !m_sp->m_chistics->detistic || + current_thd->locked_tables_mode < LTM_LOCK_TABLES; } |