Commit 118677a2 authored by unknown's avatar unknown
Browse files

Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1

into  mysql.com:/home/cps/mysql/trees/mysql-5.1-virgin


sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/handler.cc:
  manual merge
parents a649c631 992aceaf
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -74,3 +74,16 @@ show tables;
Tables_in_test
t1
drop table t1;
drop database if exists mysqltest;
drop table if exists t1;
create table t1 (i int);
lock tables t1 read;
create database mysqltest;
 drop table t1;
show open tables;
 drop database mysqltest;
select 1;
1
1
unlock tables;
End of 5.0 tests
+41 −0
Original line number Diff line number Diff line
@@ -81,3 +81,44 @@ show tables;
drop table t1;

# End of 4.1 tests


#
# Test for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES causes
# server to crash". Crash (caused by failed assertion in 5.0 or by null
# pointer dereference in 5.1) happened when one ran SHOW OPEN TABLES
# while concurrently doing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE
# or any other command that takes name-lock) in other connection.
# 
# Also includes test for similar bug#12212 "Crash that happens during
# removing of database name from cache" reappeared in 5.1 as bug#19403
# In its case crash happened when one concurrently executed DROP DATABASE
# and one of name-locking command.
# 
--disable_warnings
drop database if exists mysqltest;
drop table if exists t1;
--enable_warnings
create table t1 (i int);
lock tables t1 read;
create database mysqltest;
connect (addconroot1, localhost, root,,);
--send drop table t1
connect (addconroot2, localhost, root,,);
# Server should not crash in any of the following statements
--disable_result_log
show open tables;
--enable_result_log
--send drop database mysqltest
connection default;
select 1;
unlock tables;
connection addconroot1;
--reap
connection addconroot2;
--reap
disconnect addconroot1;
disconnect addconroot2;
connection default;

--echo End of 5.0 tests
+27 −27
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
# Check that the configuration file contains only instances that we expect.

--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

# Check that mysqld1 is reported as running.
@@ -79,7 +79,7 @@ CREATE INSTANCE mysqld3
SHOW INSTANCES;
 
--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

# Check that CREATE INSTANCE fails for existing instance. Let's all three
@@ -101,7 +101,7 @@ CREATE INSTANCE mysqld3;
#   - without values;

--echo --------------------------------------------------------------------
--exec grep nonguarded $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^nonguarded\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

CREATE INSTANCE mysqld4
@@ -112,15 +112,15 @@ CREATE INSTANCE mysqld4
SHOW INSTANCES;

--echo --------------------------------------------------------------------
--exec grep nonguarded $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^nonguarded\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

#   - with value;

--echo --------------------------------------------------------------------
--exec grep test-A $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-A\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep test-B $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-B\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

CREATE INSTANCE mysqld5
@@ -132,9 +132,9 @@ CREATE INSTANCE mysqld5
SHOW INSTANCES;

--echo --------------------------------------------------------------------
--exec grep test-A $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-A\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-B $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-B\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

# Check that CREATE INSTANCE parses options and handles grammar errors
@@ -144,7 +144,7 @@ SHOW INSTANCES;
#   - check handling of extra spaces;

--echo --------------------------------------------------------------------
--exec grep test-C $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-C\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

CREATE INSTANCE mysqld6
@@ -156,17 +156,17 @@ CREATE INSTANCE mysqld6
SHOW INSTANCES;

--echo --------------------------------------------------------------------
--exec grep test-C1 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-C1\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-C2 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-C2\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

#   - check handling of grammar error;

--echo --------------------------------------------------------------------
--exec grep test-D $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-D\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep test-E $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-E\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

--error ER_SYNTAX_ERROR
@@ -182,21 +182,21 @@ CREATE INSTANCE mysqld8 test-F = ;
SHOW INSTANCES;

--echo --------------------------------------------------------------------
--exec grep test-D $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-D\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep test-E $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-E\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

#   - check parsing of string option values

--echo --------------------------------------------------------------------
--exec grep test-1 $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-1\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep test-2 $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-2\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep test-3 $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-3\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep test-4 $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-4\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

CREATE INSTANCE mysqld9
@@ -233,21 +233,21 @@ CREATE INSTANCE mysqld13 test-bad=' \ ';
SHOW INSTANCES;

--echo --------------------------------------------------------------------
--exec grep test-1 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-1\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-2 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-2\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-3 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-3\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-4 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-4\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-5 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-5\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-6 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-6\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-7 $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^test-7\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------
--exec grep test-bad $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^test-bad\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------


+24 −24
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@
# - check the configuration file;

--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------

# - check the running instances.
@@ -133,25 +133,25 @@ UNSET mysqld2.server_id = 11;
SET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc = 0010, mysqld3.ddd = 0020;

--echo --------------------------------------------------------------------
--exec grep aaa $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^aaa\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------
--exec grep bbb $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^bbb\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------
--exec grep ccc $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^ccc\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------
--exec grep ddd $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^ddd\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------

UNSET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc, mysqld3.ddd;

--echo --------------------------------------------------------------------
--exec grep aaa $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^aaa\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep bbb $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^bbb\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep ccc $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^ccc\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep ddd $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^ddd\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

# - check that if some instance name is invalid or the active is active,
@@ -161,22 +161,22 @@ UNSET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc, mysqld3.ddd;
SET mysqld2.aaa, mysqld3.bbb, mysqld.ccc = 0010;

--echo --------------------------------------------------------------------
--exec grep aaa $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^aaa\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep bbb $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^bbb\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep ccc $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^ccc\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

--error 3015 # ER_INSTANCE_IS_ACTIVE
SET mysqld2.aaa, mysqld3.bbb, mysqld1.ccc = 0010;

--echo --------------------------------------------------------------------
--exec grep aaa $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^aaa\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep bbb $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^bbb\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep ccc $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^ccc\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

# - check that if some instance name is invalid or the active is active,
@@ -186,14 +186,14 @@ SET mysqld2.aaa, mysqld3.bbb, mysqld1.ccc = 0010;
UNSET mysqld2.server_id, mysqld3.server_id, mysqld.ccc;

--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

--error 3015 # ER_INSTANCE_IS_ACTIVE
UNSET mysqld2.server_id, mysqld3.server_id, mysqld1.ccc;

--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf;
--echo --------------------------------------------------------------------

DROP INSTANCE mysqld3;
@@ -207,21 +207,21 @@ SET mysqld2 . server_id = 222 ;
SET   mysqld2  .  server_id  =  222  , mysqld2  .  aaa  , mysqld2  .  bbb  ;

--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------
--exec grep aaa $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^aaa\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------
--exec grep bbb $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^bbb\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------

UNSET mysqld2  . aaa  ,  mysqld2  .  bbb ;

--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------
--exec grep aaa $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^aaa\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------
--exec grep bbb $MYSQLTEST_VARDIR/im.cnf || true;
--exec grep '^bbb\>' $MYSQLTEST_VARDIR/im.cnf || true;
--echo --------------------------------------------------------------------

###########################################################################
@@ -235,7 +235,7 @@ UNSET mysqld2 . aaa , mysqld2 . bbb ;
#     server_id=SERVER_ID for mysqld2);

--echo --------------------------------------------------------------------
--exec grep server_id $MYSQLTEST_VARDIR/im.cnf ;
--exec grep '^server_id\>' $MYSQLTEST_VARDIR/im.cnf ;
--echo --------------------------------------------------------------------

#   - (for mysqld1) check that the running instance has not been affected:
+4 −4
Original line number Diff line number Diff line
@@ -72,10 +72,10 @@ ulong savepoint_alloc_size= 0;

static const LEX_STRING sys_table_aliases[]=
{
  {(char*)STRING_WITH_LEN("INNOBASE")},  {(char*)STRING_WITH_LEN("INNODB")},
  {(char*)STRING_WITH_LEN("NDB")},       {(char*)STRING_WITH_LEN("NDBCLUSTER")},
  {(char*)STRING_WITH_LEN("HEAP")},      {(char*)STRING_WITH_LEN("MEMORY")},
  {(char*)STRING_WITH_LEN("MERGE")},     {(char*)STRING_WITH_LEN("MRG_MYISAM")},
  { C_STRING_WITH_LEN("INNOBASE") },  { C_STRING_WITH_LEN("INNODB") },
  { C_STRING_WITH_LEN("NDB") },       { C_STRING_WITH_LEN("NDBCLUSTER") },
  { C_STRING_WITH_LEN("HEAP") },      { C_STRING_WITH_LEN("MEMORY") },
  { C_STRING_WITH_LEN("MERGE") },     { C_STRING_WITH_LEN("MRG_MYISAM") },
  {NullS, 0}
};

Loading