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
134d7d5c
Commit
134d7d5c
authored
Jun 17, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into mysql.com:/home/ram/work/b28144/b28144.5.1
parents
0cdd3e2f
fbfa18da
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
6 deletions
+54
-6
mysql-test/r/flush.result
mysql-test/r/flush.result
+16
-0
mysql-test/t/flush.test
mysql-test/t/flush.test
+25
-1
sql/lock.cc
sql/lock.cc
+1
-3
sql/log.h
sql/log.h
+6
-0
sql/sql_base.cc
sql/sql_base.cc
+6
-2
No files found.
mysql-test/r/flush.result
View file @
134d7d5c
...
@@ -55,3 +55,19 @@ flush tables with read lock;
...
@@ -55,3 +55,19 @@ flush tables with read lock;
insert into t2 values(1);
insert into t2 values(1);
unlock tables;
unlock tables;
drop table t1, t2;
drop table t1, t2;
End of 5.0 tests
set @old_general_log= @@general_log;
set @old_read_only= @@read_only;
set global general_log= on;
flush tables with read lock;
flush logs;
unlock tables;
set global read_only=1;
flush logs;
unlock tables;
flush tables with read lock;
flush logs;
unlock tables;
set global general_log= @old_general_log;
set global read_only= @old_read_only;
End of 5.1 tests
mysql-test/t/flush.test
View file @
134d7d5c
...
@@ -133,4 +133,28 @@ disconnect con3;
...
@@ -133,4 +133,28 @@ disconnect con3;
connection
default
;
connection
default
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
# End of 5.0 tests
--
echo
End
of
5.0
tests
#
# Bug #26380: LOCK TABLES + FLUSH LOGS causes deadlock
#
set
@
old_general_log
=
@@
general_log
;
set
@
old_read_only
=
@@
read_only
;
set
global
general_log
=
on
;
flush
tables
with
read
lock
;
flush
logs
;
unlock
tables
;
set
global
read_only
=
1
;
flush
logs
;
unlock
tables
;
flush
tables
with
read
lock
;
flush
logs
;
unlock
tables
;
set
global
general_log
=
@
old_general_log
;
set
global
read_only
=
@
old_read_only
;
--
echo
End
of
5.1
tests
sql/lock.cc
View file @
134d7d5c
...
@@ -707,9 +707,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
...
@@ -707,9 +707,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
if
(
!
table_ptr
[
i
]
->
file
->
if
(
!
table_ptr
[
i
]
->
file
->
check_if_locking_is_allowed
(
thd
->
lex
->
sql_command
,
thd
->
lex
->
type
,
check_if_locking_is_allowed
(
thd
->
lex
->
sql_command
,
thd
->
lex
->
type
,
table_ptr
[
i
],
count
,
i
,
&
system_count
,
table_ptr
[
i
],
count
,
i
,
&
system_count
,
(
thd
==
logger
.
get_general_log_thd
())
||
logger
.
is_privileged_thread
(
thd
)))
(
thd
==
logger
.
get_slow_log_thd
())
||
(
thd
==
logger
.
get_privileged_thread
())))
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
...
sql/log.h
View file @
134d7d5c
...
@@ -600,6 +600,12 @@ public:
...
@@ -600,6 +600,12 @@ public:
else
else
return
NULL
;
return
NULL
;
}
}
bool
is_privileged_thread
(
THD
*
thd
)
{
return
thd
==
get_general_log_thd
()
||
thd
==
get_slow_log_thd
()
||
thd
==
get_privileged_thread
();
}
};
};
enum
enum_binlog_format
{
enum
enum_binlog_format
{
...
...
sql/sql_base.cc
View file @
134d7d5c
...
@@ -4018,6 +4018,11 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
...
@@ -4018,6 +4018,11 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
{
{
DBUG_ASSERT
(
thd
->
lock
==
0
);
// You must lock everything at once
DBUG_ASSERT
(
thd
->
lock
==
0
);
// You must lock everything at once
TABLE
**
start
,
**
ptr
;
TABLE
**
start
,
**
ptr
;
uint
lock_flag
=
MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN
;
/* Don't honor the GLOBAL READ LOCK if called from a logger */
if
(
logger
.
is_privileged_thread
(
thd
))
lock_flag
|=
MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK
;
if
(
!
(
ptr
=
start
=
(
TABLE
**
)
thd
->
alloc
(
sizeof
(
TABLE
*
)
*
count
)))
if
(
!
(
ptr
=
start
=
(
TABLE
**
)
thd
->
alloc
(
sizeof
(
TABLE
*
)
*
count
)))
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
...
@@ -4046,8 +4051,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
...
@@ -4046,8 +4051,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
}
}
if
(
!
(
thd
->
lock
=
mysql_lock_tables
(
thd
,
start
,
(
uint
)
(
ptr
-
start
),
if
(
!
(
thd
->
lock
=
mysql_lock_tables
(
thd
,
start
,
(
uint
)
(
ptr
-
start
),
MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN
,
lock_flag
,
need_reopen
)))
need_reopen
)))
{
{
if
(
thd
->
lex
->
requires_prelocking
())
if
(
thd
->
lex
->
requires_prelocking
())
{
{
...
...
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