config root man

Current Path : /home/usr.opt/mysql57/mysql-test/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/t/initialize_gtid.test

# ==== Purpose ====
#
# This test will initialize a new instance of a mysql server enabling binary
# logging and GTID features. After the server initialization, the test case
# will connect to the new server and no GTIDs are expected to be generated
# during the initialization (GTID_EXECUTED should be empty) except from the
# statements in the initialization file.
#
# ==== Related Bugs and Worklogs ====
#
# Bug#22102456 ENABLING GTID AT STARTUP RESULTS IN UNNECESSARY GTID SETS
#

--source include/not_embedded.inc
--source include/have_no_undo_tablespaces.inc

--let BASEDIR= `select @@basedir`
--let DDIR=$MYSQL_TMP_DIR/installdb_test
--let MYSQLD_LOG=$MYSQL_TMP_DIR/server.log
--let extra_args=--no-defaults --console --log-syslog=0 --loose-skip-auto_generate_certs --loose-skip-sha256_password_auto_generate_rsa_keys --skip-ssl --basedir=$BASEDIR --lc-messages-dir=$MYSQL_SHAREDIR
--let init_args=--explicit_defaults_for_timestamp --gtid-mode=on --enforce-gtid-consistency=on --log-bin=mysql-bin --server-id=1
--let BOOTSTRAP_SQL=$MYSQL_TMP_DIR/tiny_bootstrap.sql

# We don't care about innodb warnings at this point
CALL mtr.add_suppression("InnoDB:");
USE mysql;

--echo # Create bootstrap file
write_file $BOOTSTRAP_SQL;
CREATE DATABASE test;
CREATE TABLE test.t1(a INT) ENGINE=innodb;
BEGIN;
INSERT INTO test.t1 VALUES (1);
COMMIT;
SET sql_log_bin= 0;
BEGIN;
INSERT INTO test.t1 VALUES (2);
COMMIT;
SET sql_log_bin= 1;
DROP TABLE test.t1;
DROP DATABASE test;
EOF

--echo # Shut server down
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # Server is down

--echo # Run the server with:
--echo #   --initialize-insecure
--echo #   $init_args
--exec $MYSQLD $extra_args --initialize-insecure --datadir=$DDIR $init_args --init-file=$BOOTSTRAP_SQL > $MYSQLD_LOG 2>&1

--echo # Restart the server against DDIR
--exec echo "restart:--datadir=$DDIR $init_args" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc

--echo # Connect as root
connect(root_con,localhost,root,,mysql);

--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`
--let $assert_text= GTID_EXECUTED should have only the 5 GTIDs from the init-file
--let $assert_cond= @@GLOBAL.GTID_EXECUTED = "$master_uuid:1-5"
--source include/assert.inc

--echo # Clean up
# Shut server down
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc

# Delete mysqld log and init file
remove_file $MYSQLD_LOG;
# Delete datadir
--perl
use File::Path 'rmtree';
$DDIR=$ENV{"DDIR"};
rmtree([ "$DDIR" ]);
EOF

remove_file $BOOTSTRAP_SQL;

--echo # Restarting the server after cleaning it up
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc

Man Man