|
| 1 | +# ==== Purpose ==== |
| 2 | +# |
| 3 | +# This test will initialize a new instance of a mysql server enabling binary |
| 4 | +# logging and GTID features. After the server initialization, the test case |
| 5 | +# will connect to the new server and no GTIDs are expected to be generated |
| 6 | +# during the initialization (GTID_EXECUTED should be empty). |
| 7 | +# |
| 8 | +# ==== Related Bugs and Worklogs ==== |
| 9 | +# |
| 10 | +# Bug#22102456 ENABLING GTID AT STARTUP RESULTS IN UNNECESSARY GTID SETS |
| 11 | +# |
| 12 | + |
| 13 | +--source include/not_embedded.inc |
| 14 | +--source include/have_no_undo_tablespaces.inc |
| 15 | + |
| 16 | +--let BASEDIR= `select @@basedir` |
| 17 | +--let DDIR=$MYSQL_TMP_DIR/installdb_test |
| 18 | +--let MYSQLD_LOG=$MYSQL_TMP_DIR/server.log |
| 19 | +--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 |
| 20 | +--let init_args=--explicit_defaults_for_timestamp --gtid-mode=on --enforce-gtid-consistency=on --log-bin=mysql-bin --server-id=1 |
| 21 | +--let BOOTSTRAP_SQL=$MYSQL_TMP_DIR/tiny_bootstrap.sql |
| 22 | +#--let PASSWD_FILE=$MYSQL_TMP_DIR/password_file.txt |
| 23 | + |
| 24 | +# We don't care about innodb warnings at this point |
| 25 | +CALL mtr.add_suppression("InnoDB:"); |
| 26 | +USE mysql; |
| 27 | + |
| 28 | +--echo # Shut server down |
| 29 | +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 30 | +--shutdown_server |
| 31 | +--source include/wait_until_disconnected.inc |
| 32 | +--echo # Server is down |
| 33 | + |
| 34 | +--echo # Run the server with: |
| 35 | +--echo # --initialize-insecure |
| 36 | +--echo # $init_args |
| 37 | +--exec $MYSQLD $extra_args --initialize-insecure --datadir=$DDIR $init_args > $MYSQLD_LOG 2>&1 |
| 38 | + |
| 39 | +--echo # Restart the server against DDIR |
| 40 | +--exec echo "restart:--datadir=$DDIR $init_args" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 41 | +--enable_reconnect |
| 42 | +--source include/wait_until_connected_again.inc |
| 43 | + |
| 44 | +--echo # Connect as root |
| 45 | +connect(root_con,localhost,root,,mysql); |
| 46 | + |
| 47 | +--let $assert_text= GTID_EXECUTED should be empty after initialization |
| 48 | +--let $assert_cond= @@GLOBAL.GTID_EXECUTED = "" |
| 49 | +--source include/assert.inc |
| 50 | + |
| 51 | +--echo # Clean up |
| 52 | +# Shut server down |
| 53 | +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 54 | +--shutdown_server |
| 55 | +--source include/wait_until_disconnected.inc |
| 56 | + |
| 57 | +# Delete mysqld log |
| 58 | +remove_file $MYSQLD_LOG; |
| 59 | +# Delete datadir |
| 60 | +--perl |
| 61 | +use File::Path 'rmtree'; |
| 62 | +$DDIR=$ENV{"DDIR"}; |
| 63 | +rmtree([ "$DDIR" ]); |
| 64 | +EOF |
| 65 | + |
| 66 | +--echo # Restarting the server after cleaning it up |
| 67 | +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 68 | +--enable_reconnect |
| 69 | +--source include/wait_until_connected_again.inc |
0 commit comments