config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/ndb/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/ndb/t/ndb_discover_db.test

# The include statement below is a temp one for tests that are yet to
#be ported to run with InnoDB,
#but needs to be kept for tests that would need MyISAM in future.
--source include/force_myisam_default.inc

-- source include/have_multi_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc

-- disable_warnings
drop database if exists discover_db;
drop database if exists discover_db_2;
-- enable_warnings

#
# Prepare for testing database discovery by creating
# databases, and removing them on one mysqld
# The discovery happens in ndb_discover_db2.test
#

#
# Shutdown server 1
#

-- connection server1

# Ignore the warning generated by ndbcluster's binlog thread
# when mysqld is restarted
--disable_query_log ONCE
call mtr.add_suppression("mysqld startup An incident event has been written");

# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to.
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect
wait
EOF
# Send shutdown to the connected server and give
# it 30 seconds to die before zapping it.
shutdown_server 30;
# Check server is gone.
--source include/wait_until_disconnected.inc

#
# Create databases while server1 is down
#
-- connection server2

# check that created database is discovered
create database discover_db;
create table discover_db.t1 (a int key, b int) engine ndb;

# check that altered database is discovered
create database discover_db_2;
alter database discover_db_2 character set binary;
create table discover_db_2.t1 (a int key, b int) engine ndb;

#
# Startup server1
#

-- connection server1
# Write file to make mysql-test-run.pl start up the server again.
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect
restart
EOF
# Turn on reconnect.
--enable_reconnect
# Call script that will poll the server waiting for it to be back online again.
--source include/wait_until_connected_again.inc
# Turn off reconnect again.
--disable_reconnect
#

#
# Now check that databases have been discovered
#

show create database discover_db;
show create database discover_db_2;
reset master;
insert into discover_db.t1 values (1,1);
--source include/show_binlog_events.inc
reset master;
insert into discover_db_2.t1 values (1,1);
--source include/show_binlog_events.inc

 #
# Bug#16890703 MYSQLD STUCK IN OPN TABLES ON SELECT FROM 
# RESTORED TABLE WHERE DB IS NOT THERE
#
-- connection server2
let $MYSQLD_DATADIR= `select @@datadir`;
--echo Deleting table t1 metadata files and discover_db directory from fs.
#--echo rm -fr $MYSQLD_DATADIR/discover_db/*
--remove_file $MYSQLD_DATADIR/discover_db/db.opt
--remove_file $MYSQLD_DATADIR/discover_db/t1.ndb
--remove_file $MYSQLD_DATADIR/discover_db/t1.frm
#--echo rmdir $MYSQLD_DATADIR/discover_db
rmdir $MYSQLD_DATADIR/discover_db;
-- connection server1
let $MYSQLD_DATADIR= `select @@datadir`;
--echo Deleting table t1 metadata files and discover_db directory from fs.
#--echo rm -fr $MYSQLD_DATADIR/discover_db/*
--remove_file $MYSQLD_DATADIR/discover_db/db.opt
--remove_file $MYSQLD_DATADIR/discover_db/t1.ndb
--remove_file $MYSQLD_DATADIR/discover_db/t1.frm
#--echo rmdir $MYSQLD_DATADIR/discover_db
rmdir $MYSQLD_DATADIR/discover_db;

flush tables;
--echo Attempt to access table should get error
--error ER_NO_SUCH_TABLE
select * from discover_db.t1;

--echo Attempt to access table after database created should be ok
create database discover_db;
select * from discover_db.t1;

#
# Cleanup
#
drop database discover_db;
drop database discover_db_2;

Man Man