|
5 | 5 | # Verify the sys.format_path() function perfoms as expected
|
6 | 6 | #
|
7 | 7 |
|
| 8 | +# Save current server option values; |
| 9 | +let $page_size = `select @@innodb_page_size`; |
| 10 | +let $innodb_undo_tablespaces = `select @@innodb_undo_tablespaces`; |
| 11 | +let $MYSQLD_BASEDIR= `select @@basedir`; |
| 12 | + |
| 13 | +# Create custom datadir |
| 14 | +--mkdir $MYSQL_TMP_DIR/custom_datadir |
| 15 | +let $CUSTOM_DATADIR = $MYSQL_TMP_DIR/custom_datadir/data; |
| 16 | + |
| 17 | +# Stop the server because the MTR uses default value for innodb_undo_directory. |
| 18 | +--source include/shutdown_mysqld.inc |
| 19 | + |
| 20 | +let BOOTSTRAP_SQL=$MYSQL_TMP_DIR/boot.sql; |
| 21 | + |
| 22 | +# Create bootstrap file |
| 23 | +write_file $BOOTSTRAP_SQL; |
| 24 | +CREATE DATABASE test; |
| 25 | +EOF |
| 26 | + |
| 27 | +# Set the bootstrap parameter with new innodb_undo_directory |
| 28 | +let NEW_CMD = $MYSQLD --no-defaults --initialize-insecure $KEYRING_PLUGIN_OPT --lc_messages_dir=$MYSQL_SHAREDIR --innodb-page-size=$page_size --innodb-undo-tablespaces=$innodb_undo_tablespaces --basedir=$MYSQLD_BASEDIR --datadir=$CUSTOM_DATADIR --innodb_log_file_size=5M --innodb_log_files_in_group=2 --innodb_undo_directory=$MYSQLTEST_VARDIR/tmp/innodb_undo --init-file=$BOOTSTRAP_SQL --secure-file-priv="" </dev/null>>$MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1; |
| 29 | + |
| 30 | +# Run the bootstrap command |
| 31 | +--exec $NEW_CMD |
| 32 | + |
| 33 | +# Start the DB server with new datadir, innodb_data_home_dir, innodb_log_group_home_dir and innodb_undo_directory |
| 34 | +--replace_result $CUSTOM_DATADIR CUSTOM_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $innodb_undo_tablespaces innodb_undo_tablespaces |
| 35 | +--let $restart_parameters="restart: --datadir=$CUSTOM_DATADIR --innodb_data_home_dir=$MYSQLTEST_VARDIR/tmp/innodb --innodb_log_group_home_dir=$MYSQLTEST_VARDIR/tmp/innodb_logs --innodb_undo_directory=$MYSQLTEST_VARDIR/tmp/innodb_undo --innodb_undo_tablespaces=$innodb_undo_tablespaces" |
| 36 | +--source include/start_mysqld.inc |
| 37 | + |
8 | 38 | # Passing NULL should return NULL
|
9 | 39 | SELECT sys.format_path(NULL);
|
10 | 40 |
|
@@ -40,3 +70,12 @@ SELECT sys.format_path(@mypath);
|
40 | 70 |
|
41 | 71 | # Unrecognized paths should return the full path
|
42 | 72 | SELECT sys.format_path('/foo/bar/baz.foo');
|
| 73 | + |
| 74 | +# Restart the server |
| 75 | +let $restart_parameters=; |
| 76 | +--source include/restart_mysqld.inc |
| 77 | + |
| 78 | +# Cleanup |
| 79 | +--remove_file $BOOTSTRAP_SQL |
| 80 | +let CLEANUP_FOLDER= $MYSQL_TMP_DIR/custom_datadir; |
| 81 | +--source include/cleanup_folder.inc |
0 commit comments