diff options
author | unknown <monty@hundin.mysql.fi> | 2002-06-30 18:57:21 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-06-30 18:57:21 +0300 |
commit | a86390f01ae108baf07707d401e35c3c4e1e9041 (patch) | |
tree | c1bcaea9558c224371254c107ba497d9242758b7 /sql/item_func.cc | |
parent | a88c8630ec426c88cd7eae7acf2985a254d3faba (diff) | |
download | mariadb-git-a86390f01ae108baf07707d401e35c3c4e1e9041.tar.gz |
Update for running gcc 3.x (mainly on HPUX)
Portability fixes for HPUX
Rename of CHECK_LOCK to IS_FREE_LOCK
Apply lower_case_table_names also to databases
Cleanup of describe code
Don't allow \ in database names
Build-tools/Do-compile:
Added option --make-options
Docs/manual.texi:
Changelog
Added XOR, ^ and IS_FREE_LOCK() descriptions
acinclude.m4:
Update for running gcc 3.x on HPUX
client/mysql.cc:
Portability fix
client/mysqlbinlog.cc:
Fix for using gcc 3.1
configure.in:
Fix for using gcc 3.1
include/my_global.h:
Fix for using gcc 3.1
include/my_pthread.h:
Removed warning on HPUX
innobase/configure.in:
Portability fix (for gcc 3.1 on HPUX)
innobase/ut/ut0ut.c:
Portability fix (for gcc 3.1 on HPUX)
mysql-test/r/func_test.result:
Test of new functions
mysql-test/r/rpl_get_lock.result:
Test of new functions
mysql-test/t/func_test.test:
Test of new functions
mysql-test/t/rpl_get_lock.test:
Test of new functions
mysys/my_tempnam.c:
Portability fix
sql/item_cmpfunc.cc:
Added comments to Item_cond_xor.
Fixed NULL handling for XOR
sql/item_create.cc:
rename of CHECK_LOCK to IS_FREE_LOCK
sql/item_create.h:
rename of CHECK_LOCK to IS_FREE_LOCK
sql/item_func.cc:
Cleanup XOR handling
sql/item_func.h:
rename of CHECK_LOCK to IS_FREE_LOCK
sql/lex.h:
rename of CHECK_LOCK to IS_FREE_LOCK
sql/mysqld.cc:
Moved chroot() to be exectued earlier.
sql/sql_db.cc:
Apply lower_case_table_names also to databases
sql/sql_parse.cc:
Apply lower_case_table_names also to databases
sql/sql_select.cc:
Cleanup describe code (after Sinisa's patch for EXPLAIN + UNION)
sql/table.cc:
Don't allow \ in database names
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 4dfd9e3585f..a81a736c304 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2260,18 +2260,9 @@ double Item_func_match::val() longlong Item_func_bit_xor::val_int() { ulonglong arg1= (ulonglong) args[0]->val_int(); - if (args[0]->null_value) - { - null_value=1; - return 0; - } ulonglong arg2= (ulonglong) args[1]->val_int(); - if (args[1]->null_value) - { - null_value=1; + if ((null_value= (args[0]->null_value || args[1]->null_value))) return 0; - } - null_value=0; return (longlong) (arg1 ^ arg2); } @@ -2295,12 +2286,17 @@ Item *get_system_var(LEX_STRING name) /* Check a user level lock. - Returns 1: available - Returns 0: already taken - Returns NULL: Error + + SYNOPSIS: + val_int() + + RETURN VALUES + 1 Available + 0 Already taken + NULL Error */ -longlong Item_func_check_lock::val_int() +longlong Item_func_is_free_lock::val_int() { String *res=args[0]->val_str(&value); struct timespec abstime; @@ -2309,23 +2305,17 @@ longlong Item_func_check_lock::val_int() int error=0; null_value=0; - - if (/* check_global_access(thd,SUPER_ACL) ||*/ !res || !res->length()) + if (!res || !res->length()) { null_value=1; return 0; } pthread_mutex_lock(&LOCK_user_locks); - - ull= (ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(), res->length()); - pthread_mutex_unlock(&LOCK_user_locks); - if (!ull || !ull->locked) return 1; - return 0; } |