Commit ce7b8e12 authored by unknown's avatar unknown

Fix for Bug#34852: SHOW OPEN TABLES output is not repeatable

(show_check.test fails sporadically).

Fix test case for Bug#12183 to make it stable.


mysql-test/r/show_check.result:
  Fix result file.
mysql-test/t/show_check.test:
  Make test case for Bug#12183 stable.
parent ba3112b5
......@@ -662,53 +662,44 @@ t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect
show create table t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
drop table if exists t1;
CREATE TABLE txt1(a int);
CREATE TABLE tyt2(a int);
CREATE TABLE urkunde(a int);
# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
use mysqltest1;
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
FLUSH TABLES;
SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone_name, txt1, tyt2, urkunde LIMIT 0;
SELECT 1 FROM t1;
1
SHOW OPEN TABLES;
Database Table In_use Name_locked
mysql db 0 0
test urkunde 0 0
mysql time_zone 0 0
mysql general_log 0 0
test txt1 0 0
mysql proc 0 0
test tyt2 0 0
mysql user 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES FROM mysql;
SELECT 1 FROM t2;
1
SHOW OPEN TABLES FROM mysqltest1;
Database Table In_use Name_locked
mysql db 0 0
mysql time_zone 0 0
mysql general_log 0 0
mysql proc 0 0
mysql user 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES FROM mysql LIKE 'u%';
mysqltest1 t1 0 0
mysqltest1 t2 0 0
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
Database Table In_use Name_locked
mysql user 0 0
SHOW OPEN TABLES LIKE 't%';
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
Database Table In_use Name_locked
mysql time_zone 0 0
test txt1 0 0
test tyt2 0 0
mysql time_zone_name 0 0
SHOW OPEN TABLES LIKE '%o%';
mysqltest1 t1 0 0
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
Database Table In_use Name_locked
mysql time_zone 0 0
mysql general_log 0 0
mysql proc 0 0
mysql time_zone_name 0 0
mysqltest1 t1 0 0
FLUSH TABLES;
SHOW OPEN TABLES;
Database Table In_use Name_locked
mysql general_log 0 0
DROP TABLE txt1;
DROP TABLE tyt2;
DROP TABLE urkunde;
DROP DATABASE mysqltest1;
use test;
SHOW TABLES FROM non_existing_database;
ERROR 42000: Unknown database 'non_existing_database'
End of 4.1 tests
......
......@@ -435,28 +435,66 @@ drop table if exists t1;
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar
# First we close all open tables with FLUSH tables and then we open some.
#
CREATE TABLE txt1(a int);
CREATE TABLE tyt2(a int);
CREATE TABLE urkunde(a int);
# make the output deterministic:
# the order used in SHOW OPEN TABLES
# is too much implementation dependent
--echo
--echo # Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
--echo
# NOTE: SHOW OPEN TABLES does not sort result list by database or table names.
# Tables are listed in the order they were opened. We can not use the system
# database (mysql) for the test here, because we have no control over the order
# of opening tables in it. Consequently, we can not use 'SHOW OPEN TABLES'.
--disable_warnings
DROP DATABASE IF EXISTS mysqltest1;
--enable_warnings
CREATE DATABASE mysqltest1;
use mysqltest1;
--echo
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
--echo
--disable_ps_protocol
FLUSH TABLES;
SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone_name, txt1, tyt2, urkunde LIMIT 0;
SHOW OPEN TABLES;
SHOW OPEN TABLES FROM mysql;
SHOW OPEN TABLES FROM mysql LIKE 'u%';
SHOW OPEN TABLES LIKE 't%';
SHOW OPEN TABLES LIKE '%o%';
--echo
SELECT 1 FROM t1;
SELECT 1 FROM t2;
--echo
SHOW OPEN TABLES FROM mysqltest1;
--echo
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
--echo
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
--echo
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
--echo
FLUSH TABLES;
SHOW OPEN TABLES;
--enable_ps_protocol
DROP TABLE txt1;
DROP TABLE tyt2;
DROP TABLE urkunde;
--echo
DROP DATABASE mysqltest1;
use test;
--echo
#
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment