summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/sp.result1
-rw-r--r--mysql-test/t/sp.test1
-rw-r--r--sql/item.h2
-rw-r--r--sql/item_func.cc3
4 files changed, 5 insertions, 2 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index d15031989bf..823c6f78cee 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -8027,6 +8027,7 @@ CREATE TABLE `t1` (
CREATE TABLE `t2` (
`ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
+insert t1 values (1);
CREATE FUNCTION `f1`(`P_DC_CD` VARBINARY(50), `P_SYS_DATE` DATETIME) RETURNS datetime
DETERMINISTIC
SQL SECURITY INVOKER
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index b56ab6c3b11..0e42bf3c831 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -9316,6 +9316,7 @@ CREATE TABLE `t1` (
CREATE TABLE `t2` (
`ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
+insert t1 values (1);
--delimiter $$
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;
}