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/no_engine_substitution.test
--source include/have_example_plugin.inc
--source include/not_embedded.inc

--echo #
--echo # Bug#27502530: DISABLING NO_ENGINE_SUBSTITUTION DOES NOT BEHAVE AS
--echo #               DOCUMENTED
--echo #

CALL mtr.add_suppression("default_storage_engine is set to a disabled storage engine .*");
CALL mtr.add_suppression("default_tmp_storage_engine is set to a disabled storage engine .*");

--echo # Started the server by disabling InnoDB using system variable 'disabled_storage_engines'
SELECT @@disabled_storage_engines;
SET DEFAULT_STORAGE_ENGINE= MyISAM;
SELECT @@default_storage_engine;

--echo
--echo # NO_ENGINE_SUBSTITUTION enabled
--disable_warnings
SET SQL_MODE= 'NO_ENGINE_SUBSTITUTION';
--enable_warnings

CREATE TABLE t1(c1 INT) ENGINE= MyISAM;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES(1);

--error ER_DISABLED_STORAGE_ENGINE
CREATE TABLE t2(c1 INT) ENGINE= InnoDB;

--error ER_DISABLED_STORAGE_ENGINE
CREATE TEMPORARY TABLE t2(c1 INT) ENGINE= InnoDB;

--error ER_DISABLED_STORAGE_ENGINE
ALTER TABLE t1 ENGINE= InnoDB;

--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc

--echo # Restart the server disabling the myisam storage engine using variable 'disabled_storage_engines'
--exec echo "restart: --disabled_storage_engines=myisam,example" >$MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc

SELECT @@disabled_storage_engines;
SET @old_default_engine= @@default_storage_engine;

--echo # Changing the default engine to InnoDB
SET DEFAULT_STORAGE_ENGINE= InnoDB;
SELECT @@default_storage_engine;

--error ER_DISABLED_STORAGE_ENGINE
CREATE TABLE t2(c1 INT) ENGINE= MyISAM;

SELECT * FROM t1;

--echo # Checking table creation with dynamic storage plugins
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN';

--ERROR ER_DISABLED_STORAGE_ENGINE
CREATE TABLE t1(a int) ENGINE=EXAMPLE;

--echo
--echo # NO_ENGINE_SUBSTITUTION disabled
--disable_warnings
SET SQL_MODE='';
--enable_warnings

--echo # The disabled engine is substituted with the default engine for the table.

# Engine for the table substituted to InnoDB
CREATE TABLE t2(c1 INT) ENGINE= MyISAM;
SHOW CREATE TABLE t2;

CREATE TABLE t3 LIKE t1;
SHOW CREATE TABLE t3;

CREATE TEMPORARY TABLE t4(c1 INT) ENGINE= MyISAM;
SHOW CREATE TABLE t4;

CREATE TABLE t5 (c1 INT) ENGINE= ARCHIVE;
--echo # ALTER TABLE ... ENGINE reports a warning and the table is not altered.
ALTER TABLE t5 ENGINE= MyISAM;
SHOW CREATE TABLE t5;

DELIMITER /;
CREATE PROCEDURE p1()
BEGIN
  CREATE TABLE t6(c1 INT) ENGINE= MyISAM;
END /

DELIMITER ;/
CALL p1();
SHOW CREATE TABLE t6;

CREATE TABLE t7 (c1 INT) ENGINE= EXAMPLE;
SHOW CREATE TABLE t7;

# If disabled engine and the default engine are the same.
SET DEFAULT_STORAGE_ENGINE= MyISAM;
--error ER_DISABLED_STORAGE_ENGINE
CREATE TABLE t8 (c1 INT) ENGINE= MyISAM;

# If disabled engine and default engine both are in the disabled SE list.
--error ER_DISABLED_STORAGE_ENGINE
CREATE TABLE t8 (c1 INT) ENGINE= EXAMPLE;

# Cleanup
UNINSTALL PLUGIN EXAMPLE;
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP TABLE t7;

SET @@default_storage_engine=@old_default_engine;
--disable_warnings
SET sql_mode= DEFAULT;
--enable_warnings

--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc

--echo # Restart the server disabling archive engine via '--skip-archive or --archive=off'
--exec echo "restart: --archive=off" >$MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc

SET @old_default_engine= @@default_storage_engine;
SET DEFAULT_STORAGE_ENGINE= MyISAM;
SET DEFAULT_TMP_STORAGE_ENGINE= MyISAM;

--echo
--echo # NO_ENGINE_SUBSTITUTION enabled
--disable_warnings
SET SQL_MODE='NO_ENGINE_SUBSTITUTION';
--enable_warnings

--error ER_UNKNOWN_STORAGE_ENGINE
CREATE TABLE t1 (c1 INT) ENGINE= ARCHIVE;

--error ER_UNKNOWN_STORAGE_ENGINE
CREATE TEMPORARY TABLE t1 (c1 INT) ENGINE= ARCHIVE;

CREATE TABLE t1 (c1 INT) ENGINE=MyISAM;
--error ER_UNKNOWN_STORAGE_ENGINE
ALTER TABLE t1 ENGINE= ARCHIVE;

--echo
--echo # NO_ENGINE_SUBSTITUTION disabled
--disable_warnings
SET SQL_MODE='';
--enable_warnings

CREATE TABLE t2 (c1 INT) ENGINE=ARCHIVE;
SHOW CREATE TABLE t2;

CREATE TEMPORARY TABLE t3 (c1 INT) ENGINE= ARCHIVE;
SHOW CREATE TABLE t3;

--echo # ALTER TABLE .. ENGINE reports a warning and the table is not altered.
ALTER TABLE t1 ENGINE= ARCHIVE;
SHOW CREATE TABLE t1;

--echo
# Cleanup
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;

SET @@default_storage_engine= @old_default_engine;
--disable_warnings
SET sql_mode = DEFAULT;
--enable_warnings

--source include/restart_mysqld.inc

Anon7 - 2022
AnonSec Team