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
5f8cc099
Commit
5f8cc099
authored
Aug 27, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE
parent
91dc31d3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
mysql-test/r/drop.result
mysql-test/r/drop.result
+10
-0
mysql-test/t/drop.test
mysql-test/t/drop.test
+10
-0
sql/sql_table.cc
sql/sql_table.cc
+17
-0
No files found.
mysql-test/r/drop.result
View file @
5f8cc099
...
...
@@ -44,3 +44,13 @@ mysql
test
drop database mysqltest;
ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
drop table t1;
flush tables with read lock;
create table t1(n int);
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
unlock tables;
create table t1(n int);
show tables;
Tables_in_test
t1
drop table t1;
mysql-test/t/drop.test
View file @
5f8cc099
...
...
@@ -43,3 +43,13 @@ drop database mysqltest;
show
databases
;
--
error
1008
drop
database
mysqltest
;
# test create table and FLUSH TABLES WITH READ LOCK
drop
table
t1
;
flush
tables
with
read
lock
;
--
error
1099
;
create
table
t1
(
n
int
);
unlock
tables
;
create
table
t1
(
n
int
);
show
tables
;
drop
table
t1
;
sql/sql_table.cc
View file @
5f8cc099
...
...
@@ -900,6 +900,23 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN
(
-
1
);
}
VOID
(
pthread_mutex_lock
(
&
LOCK_open
));
if
(
global_read_lock
)
{
thd
->
mysys_var
->
current_mutex
=
&
LOCK_open
;
thd
->
mysys_var
->
current_cond
=
&
COND_refresh
;
if
(
thd
->
global_read_lock
)
my_error
(
ER_TABLE_NOT_LOCKED_FOR_WRITE
,
MYF
(
0
),
table_name
);
else
while
(
global_read_lock
&&
!
thd
->
killed
)
(
void
)
pthread_cond_wait
(
&
COND_refresh
,
&
LOCK_open
);
pthread_mutex_lock
(
&
thd
->
mysys_var
->
mutex
);
thd
->
mysys_var
->
current_mutex
=
0
;
thd
->
mysys_var
->
current_cond
=
0
;
pthread_mutex_unlock
(
&
thd
->
mysys_var
->
mutex
);
if
(
error
)
goto
end
;
}
if
(
!
tmp_table
&&
!
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
))
{
if
(
!
access
(
path
,
F_OK
))
...
...
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