mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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.
This commit is contained in:
@@ -662,53 +662,44 @@ t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect
|
|||||||
show create table t1;
|
show create table t1;
|
||||||
ERROR HY000: Incorrect information in file: './test/t1.frm'
|
ERROR HY000: Incorrect information in file: './test/t1.frm'
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
CREATE TABLE txt1(a int);
|
|
||||||
CREATE TABLE tyt2(a int);
|
# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
|
||||||
CREATE TABLE urkunde(a int);
|
|
||||||
|
DROP DATABASE IF EXISTS mysqltest1;
|
||||||
|
CREATE DATABASE mysqltest1;
|
||||||
|
use mysqltest1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(a INT);
|
||||||
|
CREATE TABLE t2(a INT);
|
||||||
|
|
||||||
FLUSH TABLES;
|
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
|
1
|
||||||
SHOW OPEN TABLES;
|
SELECT 1 FROM t2;
|
||||||
|
1
|
||||||
|
|
||||||
|
SHOW OPEN TABLES FROM mysqltest1;
|
||||||
Database Table In_use Name_locked
|
Database Table In_use Name_locked
|
||||||
mysql db 0 0
|
mysqltest1 t1 0 0
|
||||||
test urkunde 0 0
|
mysqltest1 t2 0 0
|
||||||
mysql time_zone 0 0
|
|
||||||
mysql general_log 0 0
|
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
|
||||||
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;
|
|
||||||
Database Table In_use Name_locked
|
Database Table In_use Name_locked
|
||||||
mysql db 0 0
|
|
||||||
mysql time_zone 0 0
|
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
|
||||||
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%';
|
|
||||||
Database Table In_use Name_locked
|
Database Table In_use Name_locked
|
||||||
mysql user 0 0
|
mysqltest1 t1 0 0
|
||||||
SHOW OPEN TABLES LIKE 't%';
|
|
||||||
|
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
|
||||||
Database Table In_use Name_locked
|
Database Table In_use Name_locked
|
||||||
mysql time_zone 0 0
|
mysqltest1 t1 0 0
|
||||||
test txt1 0 0
|
|
||||||
test tyt2 0 0
|
|
||||||
mysql time_zone_name 0 0
|
|
||||||
SHOW OPEN TABLES LIKE '%o%';
|
|
||||||
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
|
|
||||||
FLUSH TABLES;
|
FLUSH TABLES;
|
||||||
SHOW OPEN TABLES;
|
|
||||||
Database Table In_use Name_locked
|
DROP DATABASE mysqltest1;
|
||||||
mysql general_log 0 0
|
use test;
|
||||||
DROP TABLE txt1;
|
|
||||||
DROP TABLE tyt2;
|
|
||||||
DROP TABLE urkunde;
|
|
||||||
SHOW TABLES FROM non_existing_database;
|
SHOW TABLES FROM non_existing_database;
|
||||||
ERROR 42000: Unknown database 'non_existing_database'
|
ERROR 42000: Unknown database 'non_existing_database'
|
||||||
End of 4.1 tests
|
End of 4.1 tests
|
||||||
|
@@ -435,28 +435,66 @@ drop table if exists t1;
|
|||||||
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar
|
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar
|
||||||
# First we close all open tables with FLUSH tables and then we open some.
|
# 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:
|
--echo
|
||||||
# the order used in SHOW OPEN TABLES
|
--echo # Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
|
||||||
# is too much implementation dependent
|
--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
|
--disable_ps_protocol
|
||||||
FLUSH TABLES;
|
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;
|
--echo
|
||||||
SHOW OPEN TABLES FROM mysql;
|
|
||||||
SHOW OPEN TABLES FROM mysql LIKE 'u%';
|
SELECT 1 FROM t1;
|
||||||
SHOW OPEN TABLES LIKE 't%';
|
SELECT 1 FROM t2;
|
||||||
SHOW OPEN TABLES LIKE '%o%';
|
|
||||||
|
--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;
|
FLUSH TABLES;
|
||||||
SHOW OPEN TABLES;
|
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
|
||||||
DROP TABLE txt1;
|
--echo
|
||||||
DROP TABLE tyt2;
|
|
||||||
DROP TABLE urkunde;
|
DROP DATABASE mysqltest1;
|
||||||
|
use test;
|
||||||
|
|
||||||
|
--echo
|
||||||
|
|
||||||
#
|
#
|
||||||
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
|
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user