summaryrefslogtreecommitdiff
path: root/mysql-test/t/show_check.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/show_check.test')
-rw-r--r--mysql-test/t/show_check.test119
1 files changed, 90 insertions, 29 deletions
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index fa9dc7472fe..bc5ac8ac63f 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -1,3 +1,33 @@
+# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2 of
+# the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA
+#
+
+################################################################################
+#
+# NOTICE:
+#
+# This file unfortunately contains characters in various different encodings.
+# Be careful when editing this file to ensure that you (or your editor) do
+# not change things (such as encodings) on lines that you did not mean to
+# modify.
+#
+################################################################################
+
+
# Uses GRANT commands that usually disabled in embedded server
-- source include/not_embedded.inc
@@ -5,9 +35,6 @@
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
-# Save the initial number of concurrent sessions
---source include/count_sessions.inc
-
#
# Test of some show commands
#
@@ -53,7 +80,7 @@ optimize table t1;
optimize table t1;
drop table t1;
-#show variables;
+# show variables;
--echo -- Here we enable metadata just to check that the collation of the
--echo -- resultset is non-binary for string type. This should be changed
@@ -226,14 +253,6 @@ CREATE TABLE """a" (i INT);
SHOW CREATE TABLE """a";
DROP TABLE """a";
-# Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection
-#set names latin1;
-#create database `ä`;
-#create table `ä`.`ä` (a int) engine=heap;
-#--replace_column 7 # 8 # 9 #
-#show table status from `ä` LIKE 'ä';
-#drop database `ä`;
-
# to test quotes around keywords.. :
SET sql_mode= '';
@@ -332,6 +351,7 @@ drop table t1;
--error ER_DBACCESS_DENIED_ERROR
drop database mysqltest;
disconnect con1;
+--source include/wait_until_disconnected.inc
connect (con2,localhost,mysqltest_2,,test);
connection con2;
@@ -344,6 +364,7 @@ drop table mysqltest.t1;
--error ER_DBACCESS_DENIED_ERROR
drop database mysqltest;
disconnect con2;
+--source include/wait_until_disconnected.inc
connect (con3,localhost,mysqltest_3,,test);
connection con3;
@@ -353,6 +374,7 @@ show create database mysqltest;
drop table mysqltest.t1;
drop database mysqltest;
disconnect con3;
+--source include/wait_until_disconnected.inc
connection default;
set names binary;
@@ -362,15 +384,6 @@ delete from mysql.db
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
-# This test fails on MAC OSX, so it is temporary disabled.
-# This needs WL#1324 to be done.
-#set names latin1;
-#create database `ä`;
-#create table `ä`.`ä` (a int) engine=heap;
-#--replace_column 7 # 8 # 9 #
-#show table status from `ä` LIKE 'ä';
-#drop database `ä`;
-
# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was
# specified during table creation, but not otherwise. (Bug#7235)
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
@@ -900,10 +913,12 @@ CREATE TABLE t1(ËÏÌÏÎËÁ1 INT);
--let $outfile1=$MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
+--source include/count_sessions.inc
--echo
--echo ---> Dumping mysqltest1 to outfile1
-
--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1
+# Take care that the additional session caused by MYSQL_DUMP has disappeared.
+--source include/wait_until_count_sessions.inc
# - Clean mysqltest1;
@@ -917,9 +932,12 @@ DROP DATABASE mysqltest1;
--echo
--echo
+--source include/count_sessions.inc
--echo ---> Restoring mysqltest1...
--exec $MYSQL test < $outfile1
--remove_file $outfile1
+# Take care that the additional session caused by MYSQL has disappeared.
+--source include/wait_until_count_sessions.inc
# - Check definition of the table.
@@ -989,14 +1007,14 @@ grant select on `mysqltest`.`t1` to mysqltest_4@localhost;
connect (con4,localhost,mysqltest_4,,mysqltest);
connection con4;
show create database mysqltest;
+disconnect con4;
+--source include/wait_until_disconnected.inc
connection default;
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
delete from mysql.tables_priv where user='mysqltest_4';
flush privileges;
drop database mysqltest;
-connection default;
-disconnect con4;
#
# Ensure that show plugin code is tested
@@ -1048,11 +1066,23 @@ show full tables;
drop table `été`;
set names latin1;
+--echo #
+--echo # Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection
+--echo # Character set: Latin-1 (ISO-8859-1)
+--echo #
+SET NAMES latin1;
+CREATE DATABASE `ä`;
+CREATE TABLE `ä`.`ä` (a int) ENGINE=Memory;
+--replace_column 6 # 7 # 8 # 9 #
+SHOW TABLE STATUS FROM `ä` LIKE 'ä';
+DROP DATABASE `ä`;
+
#
# Bug#26402 Server crashes with old-style named table
#
--error ER_NO_SUCH_TABLE,ER_FILE_NOT_FOUND
show columns from `#mysql50#????????`;
+call mtr.add_suppression("Can.t find file: '.\\\\test\\\\\\?{8}.frm'");
#
# SHOW CREATE TRIGGER test.
@@ -1192,6 +1222,7 @@ SHOW ENGINE MYISAM STATUS;
--enable_result_log
disconnect conn1;
+--source include/wait_until_disconnected.inc
connection default;
DROP USER test_u@localhost;
@@ -1214,8 +1245,9 @@ CONNECTION con1;
--error ER_QUERY_INTERRUPTED
SHOW CREATE TABLE non_existent;
-CONNECTION default;
DISCONNECT con1;
+--source include/wait_until_disconnected.inc
+CONNECTION default;
--echo End of 5.1 tests
@@ -1239,9 +1271,11 @@ connection con1;
--echo # This statement used to be blocked.
SHOW CREATE TABLE t1;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
--echo # Switching to connection 'default'.
connection default;
-disconnect con1;
UNLOCK TABLES;
DROP TABLE t1;
@@ -1317,14 +1351,41 @@ connection con1;
# Should not block.
ALTER TABLE t1 CHARACTER SET = utf8;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
--echo # Connection default
connection default;
COMMIT;
DROP TRIGGER t1_bi;
DROP TABLE t1;
-disconnect con1;
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
+--echo #
+--echo # Bug#57306 SHOW PROCESSLIST does not display string literals well.
+--echo #
+
+SET NAMES latin1;
+SELECT GET_LOCK('t', 1000);
+--connect (con1,localhost,root,,)
+--connection con1
+SET NAMES latin1;
+--send SELECT GET_LOCK('t',1000) AS 'óóóó';
+--connection default
+# Make sure con1 has switched from "SET NAMES" to "SELECT GET_LOCK"
+let $wait_timeout= 10;
+let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%GET_LOCK%' AND ID != CONNECTION_ID();
+--source include/wait_condition.inc
+--replace_column 1 ### 3 ### 6 ### 7 ###
+SHOW PROCESSLIST;
+SET NAMES utf8;
+--replace_column 1 ### 3 ### 6 ### 7 ###
+SHOW PROCESSLIST;
+SELECT RELEASE_LOCK('t');
+--connection con1
+--reap
+--disconnect con1
+--source include/wait_until_disconnected.inc
+--connection default
+SET NAMES latin1;