summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-12-21 19:39:32 +0200
committerunknown <monty@mysql.com>2003-12-21 19:39:32 +0200
commitd31c6628e1494dd561f96cfb8a1fbfde17fc8ed4 (patch)
tree82780d2f52e09f3ef112e35fc6f6b3e1dadc3a56 /sql/item_func.cc
parent9e56a0a7711e1f6f2b234db54b3e3d2004069bbf (diff)
downloadmariadb-git-d31c6628e1494dd561f96cfb8a1fbfde17fc8ed4.tar.gz
Portability fixes found during 5.0 test compilation
Fixed bug in ORDER BY on a small column (Bug #2147) Fixed error from pthread_mutex_destroy() when one had wrong errmsg file client/mysqltest.c: Added handling of error on query send (Needed for init_connection.test) mysql-test/mysql-test-run.sh: Added tracing of mysqldump and mysqlbinlog mysql-test/r/init_connect.result: Updated tests mysql-test/r/order_by.result: Added test for bug filesort bug mysql-test/t/init_connect-master.opt: Added proper quoting (for Solaris and OSF) mysql-test/t/init_connect.test: Portability fix mysql-test/t/order_by.test: Added test for bug #2147 (bug in filesort) sql/filesort.cc: Fixed bug in filesort (Bug #2147) sql/item.h: Clear 'fixed' on cleanup (For prepared statements) sql/item_func.cc: Protect mutex destroy. (Fixed error from pthread_mutex_destroy() when one had wrong errmsg file) sql/log_event.cc: Portability fix sql/sql_class.h: Fixed compiler warning sql/sql_prepare.cc: Portability fix. (Some compilers doesn't support jump over variables declared in for())
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 8d8b77e527e..a251be402ce 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1772,17 +1772,25 @@ char *ull_get_key(const ULL *ull,uint *length,
return (char*) ull->key;
}
+
+static bool item_user_lock_inited= 0;
+
void item_user_lock_init(void)
{
pthread_mutex_init(&LOCK_user_locks,MY_MUTEX_INIT_SLOW);
hash_init(&hash_user_locks,system_charset_info,
16,0,0,(hash_get_key) ull_get_key,NULL,0);
+ item_user_lock_inited= 1;
}
void item_user_lock_free(void)
{
- hash_free(&hash_user_locks);
- pthread_mutex_destroy(&LOCK_user_locks);
+ if (item_user_lock_inited)
+ {
+ item_user_lock_inited= 0;
+ hash_free(&hash_user_locks);
+ pthread_mutex_destroy(&LOCK_user_locks);
+ }
}
void item_user_lock_release(ULL *ull)
@@ -2442,7 +2450,7 @@ Item_func_get_user_var::val_str(String *str)
{
DBUG_ENTER("Item_func_get_user_var::val_str");
if (!var_entry)
- return (String*) 0; // No such variable
+ DBUG_RETURN((String*) 0); // No such variable
DBUG_RETURN(var_entry->val_str(&null_value, str, decimals));
}