1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-02 14:22:51 +03:00
Files
mariadb/mysql-test/suite/sys_vars/t/storage_engine_basic.test
Magne Mahre 3ac6a4b451 WL#5349 Change default storage engine to InnoDB
The default storage engine is changed from MyISAM to
InnoDB, in all builds except for the embedded server.

In addition, the following system variables are 
changed:

  * innodb_file_per_table is enabled
  * innodb_strict_mode is enabled
  * innodb_file_format_name_update is changed
    to 'Barracuda'

The test suite is changed so that tests that do not
explicitly include the have_innodb.inc are run with
--default-storage-engine=MyISAM.  This is to ease the
transition, so that most regression tests are run
with the same engine as before.

Some tests are disabled for the embedded server
regression test, as the output of certain statements
will be different that for the regular server
(i.e SELECT @@default_storage_engine).  This is to
ease transition.
2010-06-17 22:51:35 +02:00

191 lines
7.1 KiB
Plaintext

--source include/not_windows_embedded.inc
# remove this when
# Bug#53947 InnoDB: Assertion failure in thread 4224 in file
# .\sync\sync0sync.c line 324
# is fixed
############## mysql-test\t\storage_engine_basic.test ##################
# #
# #
# Creation Date: 2008-02-14 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable #
# storage_engine that check behavior of this #
# variable with valid values, invalid values, accessing #
# variable with scope that is allowed and with scope that #
# is now allowed. #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html#option_mysqld_storage_engine #
# #
########################################################################
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/load_sysvars.inc
######################################################################
# START OF storage_engine TESTS #
######################################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.storage_engine;
SELECT @start_global_value;
SET @start_session_value = @@session.storage_engine;
SELECT @start_session_value;
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
######################################################################
# Display the DEFAULT value of storage_engine #
######################################################################
SET @@global.storage_engine = INNODB;
SET @@global.storage_engine = DEFAULT;
SELECT @@global.storage_engine;
SET @@session.storage_engine = INNODB;
SET @@session.storage_engine = DEFAULT;
SELECT @@session.storage_engine;
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
########################################################################
# Change the value of storage_engine to a valid value for GLOBAL Scope #
########################################################################
SET @@global.storage_engine = MYISAM;
SELECT @@global.storage_engine;
SET @@global.storage_engine = MERGE;
SELECT @@global.storage_engine;
SET @@global.storage_engine = MEMORY;
SELECT @@global.storage_engine;
SET @@global.storage_engine = INNODB;
SELECT @@global.storage_engine;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
#########################################################################
# Change the value of storage_engine to a valid value for SESSION Scope #
#########################################################################
SET @@session.storage_engine = MYISAM;
SELECT @@session.storage_engine;
SET @@session.storage_engine = MERGE;
SELECT @@session.storage_engine;
SET @@session.storage_engine = MEMORY;
SELECT @@session.storage_engine;
SET @@session.storage_engine = INNODB;
SELECT @@session.storage_engine;
--echo '#------------------FN_DYNVARS_005_04-----------------------#'
##################################################################
# Change the value of storage_engine to an invalid value #
##################################################################
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.storage_engine = 8199;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.storage_engine = NULL;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.storage_engine = -1024;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.storage_engine = 65530.34;
--Error ER_UNKNOWN_STORAGE_ENGINE
SET @@global.storage_engine = FILE;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.storage_engine = 8199;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.storage_engine = 65530.34;
--Error ER_UNKNOWN_STORAGE_ENGINE
SET @@session.storage_engine = RECORD;
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.storage_engine =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='storage_engine';
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.storage_engine =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='storage_engine';
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.storage_engine = TRUE;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.storage_engine = FALSE;
--echo '#---------------------FN_DYNVARS_001_8----------------------#'
###############################################################
# Check if accessing variable with SESSION,LOCAL and without #
# SCOPE points to same session variable #
###############################################################
SET @@storage_engine = MYISAM;
SELECT @@storage_engine = @@local.storage_engine;
SELECT @@local.storage_engine = @@session.storage_engine;
--echo '#---------------------FN_DYNVARS_001_9----------------------#'
#########################################################################
# Check if storage_engine can be accessed with and without @@ sign #
#########################################################################
SET storage_engine = MEMORY;
SELECT @@storage_engine;
--Error ER_UNKNOWN_TABLE
SELECT local.storage_engine;
--Error ER_UNKNOWN_TABLE
SELECT session.storage_engine;
--Error ER_BAD_FIELD_ERROR
SELECT storage_engine = @@session.storage_engine;
# check the old obsolete name
SET @@storage_engine = @start_global_value;
####################################
# Restore initial value #
####################################
SET @@global.storage_engine = @start_global_value;
SELECT @@global.storage_engine;
SET @@session.storage_engine = @start_session_value;
SELECT @@session.storage_engine;
#############################################################
# END OF storage_engine TESTS #
#############################################################