summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-08-19 15:51:40 -0700
committerunknown <jimw@mysql.com>2005-08-19 15:51:40 -0700
commit41cd7b54ccf877c0be7b19dea60873aeefde72fe (patch)
treeeb83e995b3e5e80628e119c0486767207a3c8e08 /sql/item_create.cc
parenta2ae2a1f52a5acb4427b59da25e10b39fdd78c19 (diff)
downloadmariadb-git-41cd7b54ccf877c0be7b19dea60873aeefde72fe.tar.gz
Fix cases where SLEEP() calls would get optimized away or cached. (Bug #12689)
mysql-test/r/func_misc.result: Add new results mysql-test/t/func_misc.test: Add new regression test. sql/item_create.cc: When SLEEP() is used, mark the statement as uncacheable. sql/item_func.h: Flag SLEEP() as not constant, and set RAND_TABLE_BIT so that it is always evaluated.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 8798bf889fc..77476e41d0b 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -356,6 +356,7 @@ Item *create_func_sha(Item* a)
Item *create_func_sleep(Item* a)
{
+ current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
return new Item_func_sleep(a);
}