Skip to content

Commit

Permalink
MDEV-7280 DATABASE: CREATE OR REPLACE
Browse files Browse the repository at this point in the history
A test clean-up: The "SHOW DATABASES" queries now use "LIKE 'db%'",
to display only the databases created during this test,
thus exclude the system databases, as some of them can be optional
(e.g. performance_schema).
  • Loading branch information
Alexander Barkov committed Dec 10, 2014
1 parent dd270e4 commit 31c7458
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
27 changes: 6 additions & 21 deletions mysql-test/suite/rpl/r/rpl_create_drop_db.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,23 @@ Warnings:
Note 1007 Can't create database 'db1'; database exists
CREATE OR REPLACE DATABASE db2;
CREATE OR REPLACE DATABASE db1;
SHOW DATABASES;
Database
SHOW DATABASES LIKE 'db%';
Database (db%)
db1
db2
information_schema
mtr
mysql
performance_schema
test
CREATE DATABASE db1;
ERROR HY000: Can't create database 'db1'; database exists
DROP DATABASE db3;
ERROR HY000: Can't drop database 'db3'; database doesn't exist
CREATE DATABASE IF NOT EXISTS db3;
SHOW DATABASES;
Database
SHOW DATABASES LIKE 'db%';
Database (db%)
db1
db2
db3
information_schema
mtr
mysql
performance_schema
test
DROP DATABASE db1;
DROP DATABASE db2;
DROP DATABASE IF EXISTS db3;
SHOW DATABASES;
Database
information_schema
mtr
mysql
performance_schema
test
SHOW DATABASES LIKE 'db%';
Database (db%)
include/rpl_end.inc
6 changes: 3 additions & 3 deletions mysql-test/suite/rpl/t/rpl_create_drop_db.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE OR REPLACE DATABASE db2;
CREATE OR REPLACE DATABASE db1;
sync_slave_with_master;

SHOW DATABASES;
SHOW DATABASES LIKE 'db%';

connection master;
--error ER_DB_CREATE_EXISTS
Expand All @@ -20,14 +20,14 @@ DROP DATABASE db3;
CREATE DATABASE IF NOT EXISTS db3;
sync_slave_with_master;

SHOW DATABASES;
SHOW DATABASES LIKE 'db%';

connection master;
DROP DATABASE db1;
DROP DATABASE db2;
DROP DATABASE IF EXISTS db3;
sync_slave_with_master;

SHOW DATABASES;
SHOW DATABASES LIKE 'db%';

--source include/rpl_end.inc

0 comments on commit 31c7458

Please sign in to comment.