Commit 03dabfa8 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-10713: signal 11 error on multi-table update - crash in...

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).
parent ab65db6d
...@@ -8027,6 +8027,7 @@ CREATE TABLE `t1` ( ...@@ -8027,6 +8027,7 @@ CREATE TABLE `t1` (
CREATE TABLE `t2` ( CREATE TABLE `t2` (
`ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL `ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
insert t1 values (1);
CREATE FUNCTION `f1`(`P_DC_CD` VARBINARY(50), `P_SYS_DATE` DATETIME) RETURNS datetime CREATE FUNCTION `f1`(`P_DC_CD` VARBINARY(50), `P_SYS_DATE` DATETIME) RETURNS datetime
DETERMINISTIC DETERMINISTIC
SQL SECURITY INVOKER SQL SECURITY INVOKER
......
...@@ -9316,6 +9316,7 @@ CREATE TABLE `t1` ( ...@@ -9316,6 +9316,7 @@ CREATE TABLE `t1` (
CREATE TABLE `t2` ( CREATE TABLE `t2` (
`ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL `ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ; ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
insert t1 values (1);
--delimiter $$ --delimiter $$
......
...@@ -3294,7 +3294,7 @@ class Item_cache_wrapper :public Item_result_field ...@@ -3294,7 +3294,7 @@ class Item_cache_wrapper :public Item_result_field
if (result_type() == ROW_RESULT) if (result_type() == ROW_RESULT)
orig_item->bring_value(); 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) bool is_expensive_processor(uchar *arg)
{ return orig_item->is_expensive_processor(arg); } { return orig_item->is_expensive_processor(arg); }
bool check_vcol_func_processor(uchar *arg) bool check_vcol_func_processor(uchar *arg)
......
...@@ -6778,7 +6778,8 @@ Item_func_sp::init_result_field(THD *thd) ...@@ -6778,7 +6778,8 @@ Item_func_sp::init_result_field(THD *thd)
bool Item_func_sp::is_expensive() 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;
} }
......
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