Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
36120d42
Commit
36120d42
authored
Mar 15, 2004
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix of compilation failure of latest 4.1 tree: new constants in mysqld.cc
exceed unsigned long limit.
parent
e43ac760
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
35 deletions
+39
-35
include/config-win.h
include/config-win.h
+1
-0
include/my_global.h
include/my_global.h
+8
-0
sql/item_func.cc
sql/item_func.cc
+23
-20
sql/item_func.h
sql/item_func.h
+2
-2
sql/mysql_priv.h
sql/mysql_priv.h
+0
-8
sql/mysqld.cc
sql/mysqld.cc
+4
-4
sql/sql_class.h
sql/sql_class.h
+1
-1
No files found.
include/config-win.h
View file @
36120d42
...
...
@@ -95,6 +95,7 @@ functions */
#define LONGLONG_MAX ((__int64) 0x7FFFFFFFFFFFFFFF)
#define ULONGLONG_MAX ((unsigned __int64) 0xFFFFFFFFFFFFFFFF)
#define LL(A) ((__int64) A)
#define ULL(A) ((unsigned __int64) A)
/* Type information */
...
...
include/my_global.h
View file @
36120d42
...
...
@@ -842,6 +842,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#endif
#endif
#ifndef ULL
#ifdef HAVE_LONG_LONG
#define ULL(A) A ## ULL
#else
#define ULL(A) A ## UL
#endif
#endif
/*
Defines to make it possible to prioritize register assignments. No
longer that important with modern compilers.
...
...
sql/item_func.cc
View file @
36120d42
...
...
@@ -1728,7 +1728,7 @@ bool udf_handler::get_arguments() { return 0; }
pthread_mutex_t
LOCK_user_locks
;
static
HASH
hash_user_locks
;
class
U
LL
class
U
ser_level_lock
{
char
*
key
;
uint
key_length
;
...
...
@@ -1740,7 +1740,7 @@ public:
pthread_t
thread
;
ulong
thread_id
;
U
LL
(
const
char
*
key_arg
,
uint
length
,
ulong
id
)
U
ser_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
));
...
...
@@ -1754,7 +1754,7 @@ public:
}
}
}
~
U
LL
()
~
U
ser_level_lock
()
{
if
(
key
)
{
...
...
@@ -1764,11 +1764,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
U
LL
*
ull
,
uint
*
length
,
char
*
ull_get_key
(
const
U
ser_level_lock
*
ull
,
uint
*
length
,
my_bool
not_used
__attribute__
((
unused
)))
{
*
length
=
(
uint
)
ull
->
key_length
;
...
...
@@ -1796,7 +1797,7 @@ void item_user_lock_free(void)
}
}
void
item_user_lock_release
(
U
LL
*
ull
)
void
item_user_lock_release
(
U
ser_level_lock
*
ull
)
{
ull
->
locked
=
0
;
if
(
mysql_bin_log
.
is_open
())
...
...
@@ -1852,7 +1853,7 @@ longlong Item_master_pos_wait::val_int()
void
debug_sync_point
(
const
char
*
lock_name
,
uint
lock_timeout
)
{
THD
*
thd
=
current_thd
;
U
LL
*
ull
;
U
ser_level_lock
*
ull
;
struct
timespec
abstime
;
int
lock_name_len
,
error
=
0
;
lock_name_len
=
strlen
(
lock_name
);
...
...
@@ -1870,7 +1871,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
=
((
U
LL
*
)
hash_search
(
&
hash_user_locks
,
lock_name
,
if
(
!
(
ull
=
((
U
ser_level_lock
*
)
hash_search
(
&
hash_user_locks
,
lock_name
,
lock_name_len
))))
{
pthread_mutex_unlock
(
&
LOCK_user_locks
);
...
...
@@ -1931,7 +1932,7 @@ longlong Item_func_get_lock::val_int()
longlong
timeout
=
args
[
1
]
->
val_int
();
struct
timespec
abstime
;
THD
*
thd
=
current_thd
;
U
LL
*
ull
;
U
ser_level_lock
*
ull
;
int
error
=
0
;
pthread_mutex_lock
(
&
LOCK_user_locks
);
...
...
@@ -1950,10 +1951,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
U
LL
(
res
->
ptr
(),
res
->
length
(),
thd
->
thread_id
);
ull
=
new
U
ser_level_lock
(
res
->
ptr
(),
res
->
length
(),
thd
->
thread_id
);
if
(
!
ull
||
!
ull
->
initialized
())
{
delete
ull
;
...
...
@@ -2022,7 +2024,7 @@ longlong Item_func_get_lock::val_int()
longlong
Item_func_release_lock
::
val_int
()
{
String
*
res
=
args
[
0
]
->
val_str
(
&
value
);
U
LL
*
ull
;
U
ser_level_lock
*
ull
;
longlong
result
;
if
(
!
res
||
!
res
->
length
())
{
...
...
@@ -2033,8 +2035,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
;
}
...
...
@@ -3041,7 +3044,7 @@ longlong Item_func_is_free_lock::val_int()
{
String
*
res
=
args
[
0
]
->
val_str
(
&
value
);
THD
*
thd
=
current_thd
;
U
LL
*
ull
;
U
ser_level_lock
*
ull
;
null_value
=
0
;
if
(
!
res
||
!
res
->
length
())
...
...
@@ -3051,7 +3054,7 @@ longlong Item_func_is_free_lock::val_int()
}
pthread_mutex_lock
(
&
LOCK_user_locks
);
ull
=
(
U
LL
*
)
hash_search
(
&
hash_user_locks
,
(
byte
*
)
res
->
ptr
(),
ull
=
(
U
ser_level_lock
*
)
hash_search
(
&
hash_user_locks
,
(
byte
*
)
res
->
ptr
(),
res
->
length
());
pthread_mutex_unlock
(
&
LOCK_user_locks
);
if
(
!
ull
||
!
ull
->
locked
)
...
...
@@ -3063,14 +3066,14 @@ longlong Item_func_is_used_lock::val_int()
{
String
*
res
=
args
[
0
]
->
val_str
(
&
value
);
THD
*
thd
=
current_thd
;
U
LL
*
ull
;
U
ser_level_lock
*
ull
;
null_value
=
1
;
if
(
!
res
||
!
res
->
length
())
return
0
;
pthread_mutex_lock
(
&
LOCK_user_locks
);
ull
=
(
U
LL
*
)
hash_search
(
&
hash_user_locks
,
(
byte
*
)
res
->
ptr
(),
ull
=
(
U
ser_level_lock
*
)
hash_search
(
&
hash_user_locks
,
(
byte
*
)
res
->
ptr
(),
res
->
length
());
pthread_mutex_unlock
(
&
LOCK_user_locks
);
if
(
!
ull
||
!
ull
->
locked
)
...
...
sql/item_func.h
View file @
36120d42
...
...
@@ -864,9 +864,9 @@ public:
** User level locks
*/
class
U
LL
;
class
U
ser_level_lock
;
void
item_user_lock_init
(
void
);
void
item_user_lock_release
(
U
LL
*
ull
);
void
item_user_lock_release
(
U
ser_level_lock
*
ull
);
void
item_user_lock_free
(
void
);
class
Item_func_get_lock
:
public
Item_int_func
...
...
sql/mysql_priv.h
View file @
36120d42
...
...
@@ -64,14 +64,6 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
#define all_bits_set(A,B) ((A) & (B) != (B))
#ifndef LL
#ifdef HAVE_LONG_LONG
#define LL(A) A ## LL
#else
#define LL(A) A ## L
#endif
#endif
extern
CHARSET_INFO
*
system_charset_info
,
*
files_charset_info
;
extern
CHARSET_INFO
*
national_charset_info
,
*
table_alias_charset
;
...
...
sql/mysqld.cc
View file @
36120d42
...
...
@@ -308,10 +308,10 @@ double log_10[32]; /* 10 potences */
ulonglong
log_10_int
[
20
]
=
{
1
,
10
,
100
,
1000
,
10000UL
,
100000UL
,
1000000UL
,
10000000UL
,
100000000UL
,
1000000000UL
,
10000000000UL
,
100000000000UL
,
1000000000000UL
,
10000000000000UL
,
100000000000000UL
,
1000000000000000UL
,
10000000000000000UL
,
100000000000000000UL
,
1000000000000000000UL
,
10000000000000000000UL
ULL
(
100000000
),
ULL
(
1000000000
),
ULL
(
10000000000
),
ULL
(
100000000000
)
,
ULL
(
1000000000000
),
ULL
(
10000000000000
),
ULL
(
100000000000000
),
ULL
(
1000000000000000
),
ULL
(
10000000000000000
),
ULL
(
100000000000000000
)
,
ULL
(
1000000000000000000
),
ULL
(
10000000000000000000
)
};
time_t
start_time
;
...
...
sql/sql_class.h
View file @
36120d42
...
...
@@ -657,7 +657,7 @@ public:
points to a lock object if the lock is present. See item_func.cc and
chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK.
*/
U
LL
*
ull
;
U
ser_level_lock
*
ull
;
#ifndef DBUG_OFF
uint
dbug_sentry
;
// watch out for memory corruption
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment