summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-03-16 07:40:11 +0200
committerunknown <bell@sanja.is.com.ua>2004-03-16 07:40:11 +0200
commitc7fd1fa4968b9649567895af2b5ebf11ca2f5e6c (patch)
treeed85d427ded2a3c957cb64be83314ba53f015811 /sql/item_func.cc
parent7b13e02039f5a38dced00ca9590512e132226c40 (diff)
parent17f8d3d725f4b465a8a0dc8e96b04cd973c47fd5 (diff)
downloadmariadb-git-c7fd1fa4968b9649567895af2b5ebf11ca2f5e6c.tar.gz
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-fix_fields-4.1 sql/item.cc: Auto merged sql/item_func.cc: Auto merged
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc43
1 files changed, 23 insertions, 20 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 817bd2b866b..878c4d2ea5f 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1731,7 +1731,7 @@ bool udf_handler::get_arguments() { return 0; }
pthread_mutex_t LOCK_user_locks;
static HASH hash_user_locks;
-class ULL
+class User_level_lock
{
char *key;
uint key_length;
@@ -1743,7 +1743,7 @@ public:
pthread_t thread;
ulong thread_id;
- ULL(const char *key_arg,uint length, ulong id)
+ User_level_lock(const char *key_arg,uint length, ulong id)
:key_length(length),count(1),locked(1), thread_id(id)
{
key=(char*) my_memdup((byte*) key_arg,length,MYF(0));
@@ -1757,7 +1757,7 @@ public:
}
}
}
- ~ULL()
+ ~User_level_lock()
{
if (key)
{
@@ -1767,11 +1767,12 @@ public:
pthread_cond_destroy(&cond);
}
inline bool initialized() { return key != 0; }
- friend void item_user_lock_release(ULL *ull);
- friend char *ull_get_key(const ULL *ull,uint *length,my_bool not_used);
+ friend void item_user_lock_release(User_level_lock *ull);
+ friend char *ull_get_key(const User_level_lock *ull, uint *length,
+ my_bool not_used);
};
-char *ull_get_key(const ULL *ull,uint *length,
+char *ull_get_key(const User_level_lock *ull, uint *length,
my_bool not_used __attribute__((unused)))
{
*length=(uint) ull->key_length;
@@ -1799,7 +1800,7 @@ void item_user_lock_free(void)
}
}
-void item_user_lock_release(ULL *ull)
+void item_user_lock_release(User_level_lock *ull)
{
ull->locked=0;
if (mysql_bin_log.is_open())
@@ -1855,7 +1856,7 @@ longlong Item_master_pos_wait::val_int()
void debug_sync_point(const char* lock_name, uint lock_timeout)
{
THD* thd=current_thd;
- ULL* ull;
+ User_level_lock* ull;
struct timespec abstime;
int lock_name_len,error=0;
lock_name_len=strlen(lock_name);
@@ -1873,7 +1874,7 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
this case, we will not be waiting, but rather, just waste CPU and
memory on the whole deal
*/
- if (!(ull= ((ULL*) hash_search(&hash_user_locks,lock_name,
+ if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks, lock_name,
lock_name_len))))
{
pthread_mutex_unlock(&LOCK_user_locks);
@@ -1934,7 +1935,7 @@ longlong Item_func_get_lock::val_int()
longlong timeout=args[1]->val_int();
struct timespec abstime;
THD *thd=current_thd;
- ULL *ull;
+ User_level_lock *ull;
int error=0;
pthread_mutex_lock(&LOCK_user_locks);
@@ -1953,10 +1954,11 @@ longlong Item_func_get_lock::val_int()
thd->ull=0;
}
- if (!(ull= ((ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(),
- res->length()))))
+ if (!(ull= ((User_level_lock *) hash_search(&hash_user_locks,
+ (byte*) res->ptr(),
+ res->length()))))
{
- ull=new ULL(res->ptr(),res->length(), thd->thread_id);
+ ull=new User_level_lock(res->ptr(),res->length(), thd->thread_id);
if (!ull || !ull->initialized())
{
delete ull;
@@ -2025,7 +2027,7 @@ longlong Item_func_get_lock::val_int()
longlong Item_func_release_lock::val_int()
{
String *res=args[0]->val_str(&value);
- ULL *ull;
+ User_level_lock *ull;
longlong result;
if (!res || !res->length())
{
@@ -2036,8 +2038,9 @@ longlong Item_func_release_lock::val_int()
result=0;
pthread_mutex_lock(&LOCK_user_locks);
- if (!(ull= ((ULL*) hash_search(&hash_user_locks,(const byte*) res->ptr(),
- res->length()))))
+ if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks,
+ (const byte*) res->ptr(),
+ res->length()))))
{
null_value=1;
}
@@ -3044,7 +3047,7 @@ longlong Item_func_is_free_lock::val_int()
{
String *res=args[0]->val_str(&value);
THD *thd=current_thd;
- ULL *ull;
+ User_level_lock *ull;
null_value=0;
if (!res || !res->length())
@@ -3054,7 +3057,7 @@ longlong Item_func_is_free_lock::val_int()
}
pthread_mutex_lock(&LOCK_user_locks);
- ull= (ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(),
+ ull= (User_level_lock *) hash_search(&hash_user_locks, (byte*) res->ptr(),
res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)
@@ -3066,14 +3069,14 @@ longlong Item_func_is_used_lock::val_int()
{
String *res=args[0]->val_str(&value);
THD *thd=current_thd;
- ULL *ull;
+ User_level_lock *ull;
null_value=1;
if (!res || !res->length())
return 0;
pthread_mutex_lock(&LOCK_user_locks);
- ull= (ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(),
+ ull= (User_level_lock *) hash_search(&hash_user_locks, (byte*) res->ptr(),
res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)