1# 2# test mysqld in bootstrap mode 3# 4--disable_warnings 5drop table if exists t1; 6--enable_warnings 7 8 9# Add the datadir to the bootstrap command 10let $MYSQLD_DATADIR= `select @@datadir`; 11let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --default-storage-engine=MyISAM --default-tmp-storage-engine=MyISAM --skip-innodb; 12# 13# Check that --bootstrap reads from stdin 14# 15--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql 16use test; 17CREATE TABLE t1(a int); 18EOF 19--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 20drop table t1; 21remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql; 22# 23# Check that --bootstrap of file with SQL error returns error 24# 25--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql 26use test; 27CREATE TABLE t1; 28EOF 29--error 1 30--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 31# Table t1 should not exists 32--error 1051 33drop table t1; 34remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql; 35 36# 37# Bootstrap with a query larger than 2*thd->net.max_packet 38# 39set @my_max_allowed_packet= @@max_allowed_packet; 40set global max_allowed_packet=100*@@max_allowed_packet; 41--disable_query_log 42create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b; 43eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1; 44--enable_query_log 45--error 1 46--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 47remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql; 48 49set global max_allowed_packet=@my_max_allowed_packet; 50drop table t1; 51 52