summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-08-11 18:58:22 -0700
committerjimw@mysql.com <>2005-08-11 18:58:22 -0700
commit898aae5e0f13a3461699e447a559247474a5b2e1 (patch)
tree7938a2593a4978018f3aaa25e99fa2e4c2e47b79 /sql/item_func.cc
parent7d1c4bc3c96bccdae1289bf40eb6464c7d1ec2d8 (diff)
downloadmariadb-git-898aae5e0f13a3461699e447a559247474a5b2e1.tar.gz
Add SLEEP(seconds) function, which always returns 0 after the given
number of seconds (which can include microseconds). (Bug #6760)
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 71e0f29ffc7..ef1c85f6120 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3259,6 +3259,17 @@ void Item_func_benchmark::print(String *str)
str->append(')');
}
+/* This function is just used to create tests with time gaps */
+
+longlong Item_func_sleep::val_int()
+{
+ DBUG_ASSERT(fixed == 1);
+ double time= args[0]->val_real();
+ my_sleep((ulong)time*1000000L);
+ return 0;
+}
+
+
#define extra_size sizeof(double)
static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,