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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
24d45c5c
Commit
24d45c5c
authored
Jul 27, 2005
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/my/mysql-4.0
into mysql.com:/home/my/mysql-4.1
parents
3f6023c7
4098c40d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
19 deletions
+33
-19
.bzrignore
.bzrignore
+1
-1
include/thr_lock.h
include/thr_lock.h
+1
-1
mysys/thr_lock.c
mysys/thr_lock.c
+2
-2
sql/lock.cc
sql/lock.cc
+15
-5
sql/mysql_priv.h
sql/mysql_priv.h
+3
-0
sql/slave.cc
sql/slave.cc
+1
-1
sql/sql_base.cc
sql/sql_base.cc
+10
-9
No files found.
.bzrignore
View file @
24d45c5c
...
@@ -890,6 +890,7 @@ scripts/mysqld_multi
...
@@ -890,6 +890,7 @@ scripts/mysqld_multi
scripts/mysqld_safe
scripts/mysqld_safe
scripts/mysqldumpslow
scripts/mysqldumpslow
scripts/mysqlhotcopy
scripts/mysqlhotcopy
scripts/mysqlhotcopy.sh.rej
scripts/safe_mysqld
scripts/safe_mysqld
select_test
select_test
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
...
@@ -1052,4 +1053,3 @@ vio/test-ssl
...
@@ -1052,4 +1053,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslclient
vio/test-sslserver
vio/test-sslserver
vio/viotest-ssl
vio/viotest-ssl
scripts/mysqlhotcopy.sh.rej
include/thr_lock.h
View file @
24d45c5c
...
@@ -111,7 +111,7 @@ void thr_unlock(THR_LOCK_DATA *data);
...
@@ -111,7 +111,7 @@ void thr_unlock(THR_LOCK_DATA *data);
int
thr_multi_lock
(
THR_LOCK_DATA
**
data
,
uint
count
);
int
thr_multi_lock
(
THR_LOCK_DATA
**
data
,
uint
count
);
void
thr_multi_unlock
(
THR_LOCK_DATA
**
data
,
uint
count
);
void
thr_multi_unlock
(
THR_LOCK_DATA
**
data
,
uint
count
);
void
thr_abort_locks
(
THR_LOCK
*
lock
);
void
thr_abort_locks
(
THR_LOCK
*
lock
);
bool
thr_abort_locks_for_thread
(
THR_LOCK
*
lock
,
pthread_t
thread
);
my_
bool
thr_abort_locks_for_thread
(
THR_LOCK
*
lock
,
pthread_t
thread
);
void
thr_print_locks
(
void
);
/* For debugging */
void
thr_print_locks
(
void
);
/* For debugging */
my_bool
thr_upgrade_write_delay_lock
(
THR_LOCK_DATA
*
data
);
my_bool
thr_upgrade_write_delay_lock
(
THR_LOCK_DATA
*
data
);
my_bool
thr_reschedule_write_lock
(
THR_LOCK_DATA
*
data
);
my_bool
thr_reschedule_write_lock
(
THR_LOCK_DATA
*
data
);
...
...
mysys/thr_lock.c
View file @
24d45c5c
...
@@ -966,10 +966,10 @@ void thr_abort_locks(THR_LOCK *lock)
...
@@ -966,10 +966,10 @@ void thr_abort_locks(THR_LOCK *lock)
This is used to abort all locks for a specific thread
This is used to abort all locks for a specific thread
*/
*/
bool
thr_abort_locks_for_thread
(
THR_LOCK
*
lock
,
pthread_t
thread
)
my_
bool
thr_abort_locks_for_thread
(
THR_LOCK
*
lock
,
pthread_t
thread
)
{
{
THR_LOCK_DATA
*
data
;
THR_LOCK_DATA
*
data
;
bool
found
=
FALSE
;
my_
bool
found
=
FALSE
;
DBUG_ENTER
(
"thr_abort_locks_for_thread"
);
DBUG_ENTER
(
"thr_abort_locks_for_thread"
);
pthread_mutex_lock
(
&
lock
->
mutex
);
pthread_mutex_lock
(
&
lock
->
mutex
);
...
...
sql/lock.cc
View file @
24d45c5c
...
@@ -335,7 +335,18 @@ void mysql_lock_abort(THD *thd, TABLE *table)
...
@@ -335,7 +335,18 @@ void mysql_lock_abort(THD *thd, TABLE *table)
}
}
/* Abort one thread / table combination */
/*
Abort one thread / table combination
SYNOPSIS
mysql_lock_abort_for_thread()
thd Thread handler
table Table that should be removed from lock queue
RETURN
0 Table was not locked by another thread
1 Table was locked by at least one other thread
*/
bool
mysql_lock_abort_for_thread
(
THD
*
thd
,
TABLE
*
table
)
bool
mysql_lock_abort_for_thread
(
THD
*
thd
,
TABLE
*
table
)
{
{
...
@@ -348,10 +359,9 @@ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table)
...
@@ -348,10 +359,9 @@ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table)
{
{
for
(
uint
i
=
0
;
i
<
locked
->
lock_count
;
i
++
)
for
(
uint
i
=
0
;
i
<
locked
->
lock_count
;
i
++
)
{
{
bool
found
;
if
(
thr_abort_locks_for_thread
(
locked
->
locks
[
i
]
->
lock
,
found
=
thr_abort_locks_for_thread
(
locked
->
locks
[
i
]
->
lock
,
table
->
in_use
->
real_id
))
table
->
in_use
->
real_id
);
result
=
TRUE
;
result
|=
found
;
}
}
my_free
((
gptr
)
locked
,
MYF
(
0
));
my_free
((
gptr
)
locked
,
MYF
(
0
));
}
}
...
...
sql/mysql_priv.h
View file @
24d45c5c
...
@@ -763,12 +763,15 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db,
...
@@ -763,12 +763,15 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db,
const
char
*
table_name
);
const
char
*
table_name
);
void
remove_db_from_cache
(
const
char
*
db
);
void
remove_db_from_cache
(
const
char
*
db
);
void
flush_tables
();
void
flush_tables
();
/* bits for last argument to remove_table_from_cache() */
#define RTFC_NO_FLAG 0x0000
#define RTFC_NO_FLAG 0x0000
#define RTFC_OWNED_BY_THD_FLAG 0x0001
#define RTFC_OWNED_BY_THD_FLAG 0x0001
#define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002
#define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002
#define RTFC_CHECK_KILLED_FLAG 0x0004
#define RTFC_CHECK_KILLED_FLAG 0x0004
bool
remove_table_from_cache
(
THD
*
thd
,
const
char
*
db
,
const
char
*
table
,
bool
remove_table_from_cache
(
THD
*
thd
,
const
char
*
db
,
const
char
*
table
,
uint
flags
);
uint
flags
);
bool
close_cached_tables
(
THD
*
thd
,
bool
wait_for_refresh
,
TABLE_LIST
*
tables
);
bool
close_cached_tables
(
THD
*
thd
,
bool
wait_for_refresh
,
TABLE_LIST
*
tables
);
void
copy_field_from_tmp_record
(
Field
*
field
,
int
offset
);
void
copy_field_from_tmp_record
(
Field
*
field
,
int
offset
);
int
fill_record
(
List
<
Item
>
&
fields
,
List
<
Item
>
&
values
,
bool
ignore_errors
);
int
fill_record
(
List
<
Item
>
&
fields
,
List
<
Item
>
&
values
,
bool
ignore_errors
);
...
...
sql/slave.cc
View file @
24d45c5c
...
@@ -3331,9 +3331,9 @@ log space");
...
@@ -3331,9 +3331,9 @@ log space");
mi
->
abort_slave
=
0
;
// TODO: check if this is needed
mi
->
abort_slave
=
0
;
// TODO: check if this is needed
DBUG_ASSERT
(
thd
->
net
.
buff
!=
0
);
DBUG_ASSERT
(
thd
->
net
.
buff
!=
0
);
net_end
(
&
thd
->
net
);
// destructor will not free it, because net.vio is 0
net_end
(
&
thd
->
net
);
// destructor will not free it, because net.vio is 0
close_thread_tables
(
thd
,
0
);
pthread_mutex_lock
(
&
LOCK_thread_count
);
pthread_mutex_lock
(
&
LOCK_thread_count
);
THD_CHECK_SENTRY
(
thd
);
THD_CHECK_SENTRY
(
thd
);
close_thread_tables
(
thd
);
delete
thd
;
delete
thd
;
pthread_mutex_unlock
(
&
LOCK_thread_count
);
pthread_mutex_unlock
(
&
LOCK_thread_count
);
pthread_cond_broadcast
(
&
mi
->
stop_cond
);
// tell the world we are done
pthread_cond_broadcast
(
&
mi
->
stop_cond
);
// tell the world we are done
...
...
sql/sql_base.cc
View file @
24d45c5c
...
@@ -2927,6 +2927,9 @@ void flush_tables()
...
@@ -2927,6 +2927,9 @@ void flush_tables()
The table will be closed (not stored in cache) by the current thread when
The table will be closed (not stored in cache) by the current thread when
close_thread_tables() is called.
close_thread_tables() is called.
PREREQUISITES
Lock on LOCK_open()
RETURN
RETURN
0 This thread now have exclusive access to this table and no other thread
0 This thread now have exclusive access to this table and no other thread
can access the table until close_thread_tables() is called.
can access the table until close_thread_tables() is called.
...
@@ -2942,6 +2945,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
...
@@ -2942,6 +2945,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
bool
result
=
0
,
signalled
=
0
;
bool
result
=
0
,
signalled
=
0
;
DBUG_ENTER
(
"remove_table_from_cache"
);
DBUG_ENTER
(
"remove_table_from_cache"
);
key_length
=
(
uint
)
(
strmov
(
strmov
(
key
,
db
)
+
1
,
table_name
)
-
key
)
+
1
;
key_length
=
(
uint
)
(
strmov
(
strmov
(
key
,
db
)
+
1
,
table_name
)
-
key
)
+
1
;
for
(;;)
for
(;;)
{
{
...
@@ -2999,15 +3003,12 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
...
@@ -2999,15 +3003,12 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
{
{
if
(
!
(
flags
&
RTFC_CHECK_KILLED_FLAG
)
||
!
thd
->
killed
)
if
(
!
(
flags
&
RTFC_CHECK_KILLED_FLAG
)
||
!
thd
->
killed
)
{
{
dropping_tables
++
;
if
(
likely
(
signalled
))
if
(
likely
(
signalled
))
{
dropping_tables
++
;
(
void
)
pthread_cond_wait
(
&
COND_refresh
,
&
LOCK_open
);
(
void
)
pthread_cond_wait
(
&
COND_refresh
,
&
LOCK_open
);
dropping_tables
--
;
continue
;
}
else
else
{
{
struct
timespec
abstime
;
/*
/*
It can happen that another thread has opened the
It can happen that another thread has opened the
table but has not yet locked any table at all. Since
table but has not yet locked any table at all. Since
...
@@ -3018,11 +3019,11 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
...
@@ -3018,11 +3019,11 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
and then we retry another loop in the
and then we retry another loop in the
remove_table_from_cache routine.
remove_table_from_cache routine.
*/
*/
pthread_mutex_unlock
(
&
LOCK_open
);
set_timespec
(
abstime
,
10
);
my_sleep
(
10
);
pthread_cond_timedwait
(
&
COND_refresh
,
&
LOCK_open
,
&
abstime
);
pthread_mutex_lock
(
&
LOCK_open
);
continue
;
}
}
dropping_tables
--
;
continue
;
}
}
}
}
break
;
break
;
...
...
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