summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorChad MILLER <chad@mysql.com>2008-07-10 14:50:07 -0400
committerChad MILLER <chad@mysql.com>2008-07-10 14:50:07 -0400
commitc425bf421da9ffa55d3d568f70508fa12dd07aa0 (patch)
tree667c2782c7fcee247010d3413aaf80a81fc6dd92 /sql/item_func.cc
parent6a6e77eeffc7dbd72888ef685fdb93fc2ae7aed6 (diff)
parent0db1f520c629455b4766c3d8f57a9767d7f6a98f (diff)
downloadmariadb-git-c425bf421da9ffa55d3d568f70508fa12dd07aa0.tar.gz
Merge chunk from trunk.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index cfe6c9a63d0..87e547d1f89 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -3729,6 +3729,18 @@ longlong Item_func_sleep::val_int()
DBUG_ASSERT(fixed == 1);
double time= args[0]->val_real();
+ /*
+ On 64-bit OSX pthread_cond_timedwait() waits forever
+ if passed abstime time has already been exceeded by
+ the system time.
+ When given a very short timeout (< 10 mcs) just return
+ immediately.
+ We assume that the lines between this test and the call
+ to pthread_cond_timedwait() will be executed in less than 0.00001 sec.
+ */
+ if (time < 0.00001)
+ return 0;
+
set_timespec_nsec(abstime, (ulonglong)(time * ULL(1000000000)));
pthread_cond_init(&cond, NULL);
@@ -3985,7 +3997,7 @@ double user_var_entry::val_real(my_bool *null_value)
/* Get the value of a variable as an integer */
-longlong user_var_entry::val_int(my_bool *null_value)
+longlong user_var_entry::val_int(my_bool *null_value) const
{
if ((*null_value= (value == 0)))
return LL(0);
@@ -5515,6 +5527,8 @@ Item_func_sp::make_field(Send_field *tmp_field)
DBUG_ENTER("Item_func_sp::make_field");
DBUG_ASSERT(sp_result_field);
sp_result_field->make_field(tmp_field);
+ if (name)
+ tmp_field->col_name= name;
DBUG_VOID_RETURN;
}