Below is the list of changes that have just been committed into a local
5.0 repository of cps. When cps does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-12-11 17:22:16+03:00, petr@stripped +1 -0
Bug #23667 "CREATE TABLE LIKE is not isolated from alteration by other connections"
5.0 version of the fix (should probably go to 4.1 as well).
5.1 fix should be different (due to changes which come with introduction of
RBR)
sql/sql_table.cc@stripped, 2006-12-11 17:22:13+03:00, petr@stripped +9 -9
use LOCK_open to protect create table like from
concurrent connections
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: petr
# Host: outpost.site
# Root: /home/cps/mysql/trees/5.0-runtime-19044
--- 1.326/sql/sql_table.cc 2006-11-16 22:19:27 +03:00
+++ 1.327/sql/sql_table.cc 2006-12-11 17:22:13 +03:00
@@ -2684,7 +2684,6 @@
bool res= TRUE;
db_type not_used;
- TABLE_LIST src_tables_list;
DBUG_ENTER("mysql_create_like_table");
DBUG_ASSERT(table_ident->db.str); /* Must be set in the parser */
src_db= table_ident->db.str;
@@ -2705,12 +2704,15 @@
DBUG_RETURN(-1);
}
- bzero((gptr)&src_tables_list, sizeof(src_tables_list));
- src_tables_list.db= src_db;
- src_tables_list.table_name= src_table;
-
- if (lock_and_wait_for_table_name(thd, &src_tables_list))
- goto err;
+ /*
+ All DDL statements should obtain LOCK_open to protect itself from
+ conflicting DDLs.
+ However it might make sense to lock src table with usual table lock
+ here as well. The reason is that LOCK_open is used inconsistently
+ and it might be the case that some operation could modify src table w/o
+ the lock.
+ */
+ pthread_mutex_lock(&LOCK_open);
if ((tmp_table= find_temporary_table(thd, src_db, src_table)))
strxmov(src_path, (*tmp_table)->s->path, reg_ext, NullS);
@@ -2824,8 +2826,6 @@
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
err:
- pthread_mutex_lock(&LOCK_open);
- unlock_table_name(thd, &src_tables_list);
pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(res);
}
| Thread |
|---|
| • bk commit into 5.0 tree (petr:1.2318) BUG#23667 | Petr Chardin | 11 Dec |