summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index efc42c1b73f..fded5fa1391 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -5592,8 +5592,13 @@ Item_func_sp::fix_fields(THD *thd, Item **ref)
#endif /* ! NO_EMBEDDED_ACCESS_CHECKS */
}
+
if (!m_sp->m_chistics->detistic)
- used_tables_cache |= RAND_TABLE_BIT;
+ {
+ used_tables_cache |= RAND_TABLE_BIT;
+ const_item_cache= FALSE;
+ }
+
DBUG_RETURN(res);
}
@@ -5601,8 +5606,12 @@ Item_func_sp::fix_fields(THD *thd, Item **ref)
void Item_func_sp::update_used_tables()
{
Item_func::update_used_tables();
+
if (!m_sp->m_chistics->detistic)
- used_tables_cache |= RAND_TABLE_BIT;
+ {
+ used_tables_cache |= RAND_TABLE_BIT;
+ const_item_cache= FALSE;
+ }
}