Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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
1.1935 05/06/03 15:29:05 msvensson@neptunus.(none) +5 -0
BUG#9998 MySQL client hangs on "USE database"
Use open_normal_and_derived_tables instead of open_and_lock_tables when reading
metadata for a table.
Add two test cases, one for "USE database" and one for "SHOW COLUMNS FROM table"
sql/sql_show.cc
1.248 05/06/03 15:29:02 msvensson@neptunus.(none) +4 -5
Open tables without locking when reading metadata
mysql-test/t/mysql.test
1.2 05/06/03 15:29:02 msvensson@neptunus.(none) +9 -0
Add test case for BUG9998
- lock table t1 for write from mysql-test, then execute 'mysql' and call "USE test".
This will test exactly what caused the bug.
mysql-test/t/lock_multi.test
1.9 05/06/03 15:29:01 msvensson@neptunus.(none) +12 -0
Test that "show columsn from t1" is not locked by another thread having a write lock
on t1
mysql-test/r/mysql.result
1.2 05/06/03 15:29:01 msvensson@neptunus.(none) +6 -0
Updated results for test case for bug9998
mysql-test/r/lock_multi.result
1.12 05/06/03 15:29:01 msvensson@neptunus.(none) +7 -0
Updated test results for test case for bug9998
# 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: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/bug9998
--- 1.247/sql/sql_show.cc 2005-05-26 21:01:48 +02:00
+++ 1.248/sql/sql_show.cc 2005-06-03 15:29:02 +02:00
@@ -348,7 +348,7 @@
table_list->table_name));
/* Only one table for now, but VIEW can involve several tables */
- if (open_and_lock_tables(thd, table_list))
+ if (open_normal_and_derived_tables(thd, table_list))
{
DBUG_RETURN(TRUE);
}
@@ -539,8 +539,7 @@
DBUG_ENTER("mysqld_list_fields");
DBUG_PRINT("enter",("table: %s",table_list->table_name));
- table_list->lock_type= TL_UNLOCK;
- if (open_and_lock_tables(thd, table_list))
+ if (open_normal_and_derived_tables(thd, table_list))
DBUG_VOID_RETURN;
table= table_list->table;
@@ -1938,7 +1937,7 @@
bool res;
lex->all_selects_list= lsel;
- res= open_and_lock_tables(thd, show_table_list);
+ res= open_normal_and_derived_tables(thd, show_table_list);
if (schema_table->process_table(thd, show_table_list,
table, res, show_table_list->db,
show_table_list->alias))
@@ -2043,7 +2042,7 @@
show_table_list->lock_type= lock_type;
lex->all_selects_list= &sel;
lex->derived_tables= 0;
- res= open_and_lock_tables(thd, show_table_list);
+ res= open_normal_and_derived_tables(thd, show_table_list);
if (schema_table->process_table(thd, show_table_list, table,
res, base_name,
show_table_list->alias))
--- 1.11/mysql-test/r/lock_multi.result 2004-11-05 16:28:58 +01:00
+++ 1.12/mysql-test/r/lock_multi.result 2005-06-03 15:29:01 +02:00
@@ -36,3 +36,10 @@
drop table t2;
ERROR 42S02: Table 'test.t2' doesn't exist
drop table t1;
+create table t1(a int);
+lock tables t1 write;
+show columns from t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+unlock tables;
+drop table t1;
--- 1.8/mysql-test/t/lock_multi.test 2004-10-06 18:14:30 +02:00
+++ 1.9/mysql-test/t/lock_multi.test 2005-06-03 15:29:01 +02:00
@@ -94,3 +94,15 @@
reap;
connection locker;
drop table t1;
+
+
+#
+# BUG#9998 - MySQL client hangs on USE "database"
+
+create table t1(a int);
+lock tables t1 write;
+connection reader;
+show columns from t1;
+connection locker;
+unlock tables;
+drop table t1;
--- 1.1/mysql-test/r/mysql.result 2005-05-17 21:13:30 +02:00
+++ 1.2/mysql-test/r/mysql.result 2005-06-03 15:29:01 +02:00
@@ -48,3 +48,9 @@
a
1
drop table t1;
+create table t1(a int);
+lock tables t1 write;
+database()
+test
+unlock tables;
+drop table t1;
--- 1.1/mysql-test/t/mysql.test 2005-05-17 21:13:30 +02:00
+++ 1.2/mysql-test/t/mysql.test 2005-06-03 15:29:02 +02:00
@@ -30,5 +30,14 @@
select "Test 'go' command \g" as " ";
--exec $MYSQL test -e 'select * from t1\g'
--enable_query_log
+drop table t1;
+#
+# BUG9998 - MySQL client hangs on USE "database"
+#
+create table t1(a int);
+lock tables t1 write;
+--exec $MYSQL -e 'use test; select database();'
+unlock tables;
drop table t1;
+
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.1935) BUG#9998 | msvensson | 3 Jun |