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
1198b23a
Commit
1198b23a
authored
Apr 03, 2004
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge eagle.mysql.r18.ru:/home/vva/work/mysql.orig/clear/mysql-4.1
into eagle.mysql.r18.ru:/home/vva/work/BUG_2397/mysql-4.1
parents
970bf544
7a580ce9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
mysql-test/r/rename.result
mysql-test/r/rename.result
+14
-0
mysql-test/t/rename.test
mysql-test/t/rename.test
+24
-0
sql/sql_rename.cc
sql/sql_rename.cc
+3
-0
No files found.
mysql-test/r/rename.result
View file @
1198b23a
...
@@ -39,3 +39,17 @@ select * from t3;
...
@@ -39,3 +39,17 @@ select * from t3;
drop table if exists t1,t2,t3,t4;
drop table if exists t1,t2,t3,t4;
Warnings:
Warnings:
Note 1051 Unknown table 't4'
Note 1051 Unknown table 't4'
CREATE TABLE t1 (a int);
CREATE TABLE t3 (a int);
FLUSH TABLES WITH READ LOCK;
RENAME TABLE t1 TO t2, t3 to t4;
show tables;
Tables_in_test
t1
t3
UNLOCK TABLES;
show tables;
Tables_in_test
t2
t4
drop table t2, t4;
mysql-test/t/rename.test
View file @
1198b23a
...
@@ -35,3 +35,27 @@ select * from t3;
...
@@ -35,3 +35,27 @@ select * from t3;
# This should give a warning for t4
# This should give a warning for t4
drop
table
if
exists
t1
,
t2
,
t3
,
t4
;
drop
table
if
exists
t1
,
t2
,
t3
,
t4
;
#
# Test-case for Bug #2397 RENAME TABLES is not blocked by
# FLUSH TABLES WITH READ LOCK
#
connect
(
con1
,
localhost
,
root
,,);
connect
(
con2
,
localhost
,
root
,,);
connection
con1
;
CREATE
TABLE
t1
(
a
int
);
CREATE
TABLE
t3
(
a
int
);
connection
con2
;
FLUSH
TABLES
WITH
READ
LOCK
;
connection
con1
;
send
RENAME
TABLE
t1
TO
t2
,
t3
to
t4
;
connection
con2
;
sleep
1
;
show
tables
;
UNLOCK
TABLES
;
sleep
1
;
show
tables
;
drop
table
t2
,
t4
;
sql/sql_rename.cc
View file @
1198b23a
...
@@ -46,6 +46,8 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
...
@@ -46,6 +46,8 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
if
(
wait_if_global_read_lock
(
thd
,
0
))
DBUG_RETURN
(
1
);
VOID
(
pthread_mutex_lock
(
&
LOCK_open
));
VOID
(
pthread_mutex_lock
(
&
LOCK_open
));
if
(
lock_table_names
(
thd
,
table_list
))
if
(
lock_table_names
(
thd
,
table_list
))
goto
err
;
goto
err
;
...
@@ -93,6 +95,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
...
@@ -93,6 +95,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
err:
err:
pthread_mutex_unlock
(
&
LOCK_open
);
pthread_mutex_unlock
(
&
LOCK_open
);
start_waiting_global_read_lock
(
thd
);
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
...
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