2 # test mysqld in bootstrap mode
5 drop table if exists t1;
9 # Add the datadir to the bootstrap command
10 let $MYSQLD_DATADIR= `select @@datadir`;
11 let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR;
14 # Check that --bootstrap reads from stdin
16 --write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql
18 CREATE TABLE t1(a int);
20 --exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
22 remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
25 # Check that --bootstrap of file with SQL error returns error
27 --write_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql
32 --exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
33 # Table t1 should not exists
36 remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;
39 # Bootstrap with a query larger than 2*thd->net.max_packet
41 set @my_max_allowed_packet= @@max_allowed_packet;
42 set global max_allowed_packet=100*@@max_allowed_packet;
44 create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
45 eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
48 --exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
49 remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql;
51 set global max_allowed_packet=@my_max_allowed_packet;