diff options
Diffstat (limited to 'mysql-test/t')
428 files changed, 3495 insertions, 42146 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 76d57e76491..ae48d5a8736 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -751,6 +751,19 @@ ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4); SELECT * FROM t1; DROP TABLE t1; + +# +# Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types +# +create table t1 (a tinytext character set latin1); +alter table t1 convert to character set utf8; +show create table t1; +drop table t1; +create table t1 (a mediumtext character set latin1); +alter table t1 convert to character set utf8; +show create table t1; +drop table t1; + --echo End of 5.0 tests # diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index b42c8446a32..7139d95ab49 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1598,3 +1598,4 @@ CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive; INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL); FLUSH TABLE t1; SELECT * FROM t1 ORDER BY a; +DROP TABLE t1; diff --git a/mysql-test/t/auto_commit_basic.test b/mysql-test/t/auto_commit_basic.test deleted file mode 100644 index 0ea070ded59..00000000000 --- a/mysql-test/t/auto_commit_basic.test +++ /dev/null @@ -1,190 +0,0 @@ -############## mysql-test\t\auto_commit_basic.test ############################# -# # -# Variable Name: autocommit # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: NA # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "autocommit" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: (Not Mentioned on website) # -# # -################################################################################ - ---source include/load_sysvars.inc - -######################################################################## -# START OF autocommit TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of autocommit in a temporary variable # -######################################################################## - -SET @start_value = @@autocommit; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_003_01------------------------#' -######################################################################## -# Display the DEFAULT value of autocommit # -######################################################################## - -SET @@autocommit = 0; -SET @@autocommit = DEFAULT; -SELECT @@autocommit; -echo 'Bug: variable DEFAULT value not working and is not throwing error'; - ---echo '#---------------------FN_DYNVARS_003_02-------------------------#' -############################################### -# Check default value of variable # -############################################### - -SET @@autocommit = @start_value; -SELECT @@autocommit = 1; - - ---echo '#--------------------FN_DYNVARS_003_03------------------------#' -######################################################################## -# Change the value of autocommit to a valid value # -######################################################################## -SET @@autocommit = 0; -SELECT @@autocommit; -SET @@autocommit = 1; -SELECT @@autocommit; - - ---echo '#--------------------FN_DYNVARS_003_04-------------------------#' -########################################################################### -# Change the value of autocommit to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@autocommit = ''; - - ---echo '#-------------------FN_DYNVARS_003_05----------------------------#' -########################################################################### -# Test if accessing global autocommit gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.autocommit = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.autocommit; - - ---echo '#----------------------FN_DYNVARS_003_06------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@session.autocommit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='autocommit'; ---echo Bug # 34839: Values in variable and information_schema do not match for autocommit - ---echo '#----------------------FN_DYNVARS_003_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SET @@autocommit = 1; -SELECT @@autocommit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='autocommit'; - ---echo '#---------------------FN_DYNVARS_003_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@autocommit = OFF; -SELECT @@autocommit; -SET @@autocommit = ON; -SELECT @@autocommit; - ---echo '#---------------------FN_DYNVARS_003_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@autocommit = TRUE; -SELECT @@autocommit; -SET @@autocommit = FALSE; -SELECT @@autocommit; - - ---echo '#---------------------FN_DYNVARS_003_10----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@autocommit = 0; -SELECT @@autocommit = @@local.autocommit; -SELECT @@local.autocommit = @@session.autocommit; -SET @@autocommit = 1; -SELECT @@autocommit = @@local.autocommit; -SELECT @@session.autocommit = @@autocommit; - - ---echo '#---------------------FN_DYNVARS_003_11----------------------#' -##################################################################### -# Check if autocommit can be accessed with and without @@ sign # -##################################################################### - -SET autocommit = 1; -SELECT @@autocommit; ---Error ER_UNKNOWN_TABLE -SELECT local.autocommit; ---Error ER_UNKNOWN_TABLE -SELECT session.autocommit; ---Error ER_BAD_FIELD_ERROR -SELECT autocommit = @@session.autocommit; - - -############################## -# Restore initial value # -############################## - -SET @@autocommit = @start_value; -SELECT @@autocommit; - -######################################################################## -# END OF autocommit TESTS # -######################################################################## diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 47458c1f054..32f065171f2 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -149,7 +149,6 @@ delete from t1 where a=0; update t1 set a=0 where b=5; select * from t1 order by b; delete from t1 where a=0; ---error 1048 update t1 set a=NULL where b=6; update t1 set a=300 where b=7; SET SQL_MODE=''; @@ -165,7 +164,6 @@ delete from t1 where a=0; update t1 set a=0 where b=12; select * from t1 order by b; delete from t1 where a=0; ---error 1048 update t1 set a=NULL where b=13; update t1 set a=500 where b=14; select * from t1 order by b; diff --git a/mysql-test/t/auto_increment_increment_basic.test b/mysql-test/t/auto_increment_increment_basic.test deleted file mode 100644 index 4acfb8f503b..00000000000 --- a/mysql-test/t/auto_increment_increment_basic.test +++ /dev/null @@ -1,208 +0,0 @@ -############## mysql-test\t\auto_increment_increment_basic.test ################ -# # -# Variable Name: auto_increment_increment # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "auto_increment_increment"# -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_auto-increment-increment # -# # -################################################################################ - ---source include/load_sysvars.inc - -######################################################################## -# START OF auto_increment_increment TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.auto_increment_increment; -SELECT @start_global_value; -SET @start_session_value = @@session.auto_increment_increment; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_001_01-------------------------#' -######################################################################## -# Display the DEFAULT value of auto_increment_increment # -######################################################################## - -SET @@global.auto_increment_increment = 100; -SET @@global.auto_increment_increment = DEFAULT; -SELECT @@global.auto_increment_increment; - -SET @@session.auto_increment_increment = 200; -SET @@session.auto_increment_increment = DEFAULT; -SELECT @@session.auto_increment_increment; - - ---echo '#--------------------FN_DYNVARS_001_02-------------------------#' -######################################################################## -# Check the DEFAULT value of auto_increment_increment # -######################################################################## - -SET @@global.auto_increment_increment = DEFAULT; -SELECT @@global.auto_increment_increment = 1; - -SET @@session.auto_increment_increment = DEFAULT; -SELECT @@session.auto_increment_increment = 1; - - ---echo '#--------------------FN_DYNVARS_001_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.auto_increment_increment = 1; -SELECT @@global.auto_increment_increment; -SET @@global.auto_increment_increment = 60020; -SELECT @@global.auto_increment_increment; -SET @@global.auto_increment_increment = 65535; -SELECT @@global.auto_increment_increment; - - ---echo '#--------------------FN_DYNVARS_001_04-------------------------#' -################################################################### -# Change the value of variable to a valid value for SESSION Scope # -################################################################### - -SET @@session.auto_increment_increment = 1; -SELECT @@session.auto_increment_increment; -SET @@session.auto_increment_increment = 50050; -SELECT @@session.auto_increment_increment; -SET @@session.auto_increment_increment = 65535; -SELECT @@session.auto_increment_increment; - - ---echo '#------------------FN_DYNVARS_001_05-----------------------#' -#################################################################### -# Change the value of auto_increment_increment to an invalid value # -#################################################################### - -SET @@global.auto_increment_increment = 0; -SELECT @@global.auto_increment_increment; -SET @@global.auto_increment_increment = -1024; -SELECT @@global.auto_increment_increment; -SET @@global.auto_increment_increment = 65536; -SELECT @@global.auto_increment_increment; ---Error ER_PARSE_ERROR -SET @@global.auto_increment_increment = 65530.34.; -SELECT @@global.auto_increment_increment; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.auto_increment_increment = test; -SELECT @@global.auto_increment_increment; - -SET @@session.auto_increment_increment = 0; -SELECT @@session.auto_increment_increment; -SET @@session.auto_increment_increment = -2; -SELECT @@session.auto_increment_increment; ---Error ER_PARSE_ERROR -SET @@session.auto_increment_increment = 65530.34.; -SET @@session.auto_increment_increment = 65550; -SELECT @@session.auto_increment_increment; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.auto_increment_increment = test; -SELECT @@session.auto_increment_increment; - - ---echo '#------------------FN_DYNVARS_001_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SELECT @@global.auto_increment_increment = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='auto_increment_increment'; - - ---echo '#------------------FN_DYNVARS_001_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.auto_increment_increment = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='auto_increment_increment'; - - ---echo '#------------------FN_DYNVARS_001_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.auto_increment_increment = TRUE; -SELECT @@global.auto_increment_increment; -SET @@global.auto_increment_increment = FALSE; -SELECT @@global.auto_increment_increment; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -############################################################################### -# Check if global and session variables are independant of each other # -############################################################################### - -SET @@global.auto_increment_increment = 10; -SET @@session.auto_increment_increment = 11; -SELECT @@auto_increment_increment = @@global.auto_increment_increment; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@auto_increment_increment = 100; -SELECT @@auto_increment_increment = @@local.auto_increment_increment; -SELECT @@local.auto_increment_increment = @@session.auto_increment_increment; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################### -# Check if auto_increment_increment can be accessed with and without @@ sign # -############################################################################### - -SET auto_increment_increment = 1; -SELECT @@auto_increment_increment; ---Error ER_UNKNOWN_TABLE -SELECT local.auto_increment_increment; ---Error ER_UNKNOWN_TABLE -SELECT session.auto_increment_increment; ---Error ER_BAD_FIELD_ERROR -SELECT auto_increment_increment = @@session.auto_increment_increment; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.auto_increment_increment = @start_global_value; -SELECT @@global.auto_increment_increment; -SET @@session.auto_increment_increment = @start_session_value; -SELECT @@session.auto_increment_increment; - - -############################################################# -# END OF auto_increment_increment TESTS # -############################################################# - diff --git a/mysql-test/t/auto_increment_increment_func.test b/mysql-test/t/auto_increment_increment_func.test deleted file mode 100644 index 7822775fb35..00000000000 --- a/mysql-test/t/auto_increment_increment_func.test +++ /dev/null @@ -1,202 +0,0 @@ -############## mysql-test\t\auto_increment_increment_func.test ################ -# # -# Variable Name: auto_increment_increment # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "auto_increment_increment"# -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_auto-increment-increment # -# # -################################################################################ - -# save vars -SET @global_auto_increment_increment = @@global.auto_increment_increment; -SET @session_auto_increment_increment = @@session.auto_increment_increment; -SET @global_auto_increment_offset = @@global.auto_increment_offset; -SET @session_auto_increment_offset = @@session.auto_increment_offset; - - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - ---echo '#--------------------FN_DYNVARS_001_01-------------------------#' -########################################################## -# Setting initial value of auto_increment_increment # -########################################################## - ---echo ## Setting initial value of auto_increment_increment to 5 ## -SET @@auto_increment_increment = 5; - - ---echo '#--------------------FN_DYNVARS_001_02-------------------------#' -########################################################################### -# Inserting first value in table to check auto_increment_increment initial -# behavior -########################################################################### - ---echo ## Inserting first record in table to check behavior of the variable ## -INSERT into t1(name) values('Record_1'); -SELECT * from t1; - ---echo ## Changing value of variable to 10 ## -SET @@global.auto_increment_increment = 10; - ---echo ## Inserting record and verifying value of column id ## -INSERT into t1(name) values('Record_2'); -SELECT * from t1; - - ---echo ## Test behavior of variable after assigning some larger value to it ## -SELECT @@auto_increment_increment; -SET @@auto_increment_increment = 100; -INSERT into t1(name) values('Record_5'); -SELECT * from t1; - - ---echo '#--------------------FN_DYNVARS_001_03-------------------------#' -########################################################## -# Test behavior of variable on new connection # 01 # -########################################################## - ---echo ## Creating new connection test_con1 ## -CONNECT (test_con1,localhost,root,,); -CONNECTION test_con1; - ---echo ## Value of session & global vairable here should be 10 ## -SELECT @@global.auto_increment_increment = 10; -SELECT @@session.auto_increment_increment = 10; - ---echo ## Setting global value of variable and inserting data in table ## -SET @@global.auto_increment_increment = 20; -SELECT @@global.auto_increment_increment; -INSERT into t1(name) values('Record_6'); -SELECT * from t1; - ---echo ## Setting session value of variable and inserting data in table ## -SET @@session.auto_increment_increment = 2; -SELECT @@session.auto_increment_increment; -INSERT into t1(name) values('Record_8'); -INSERT into t1(name) values('Record_9'); -SELECT * from t1; - - ---echo '#--------------------FN_DYNVARS_001_04-------------------------#' -########################################################## -# Test behavior of variable on new connection # 02 # -########################################################## - ---echo ## Creating another new connection test_con2 ## -CONNECT (test_con2,localhost,root,,); -connection test_con2; - ---echo ## Verifying initial values of variable in global & session scope ## ---echo ## global & session initial value should be 20 ## -SELECT @@global.auto_increment_increment = 20; -SELECT @@session.auto_increment_increment = 20; - ---echo ## Setting value of session variable to 5 and verifying its behavior ## -SET @@session.auto_increment_increment = 5; -INSERT into t1(name) values('Record_10'); -SELECT * from t1; ---echo 'Bug#35362: Here Record_10 id should be 120 instead of 115 because we' ---echo 'have set the value of variable to 5' - -SET @@session.auto_increment_increment = 1; -SELECT @@auto_increment_increment; -SELECT @@global.auto_increment_increment; - - ---echo '#--------------------FN_DYNVARS_001_05-------------------------#' -##################################################################### -# Verify variable's value of connection # 01 after processing on -# connection # 02 -##################################################################### - ---echo ## Switching to test_con1 ## -connection test_con1; - ---echo ## Verifying values of global & session value of variable ## ---echo ## global value should be 20 ## -SELECT @@global.auto_increment_increment = 20; - ---echo ## session value should be 2 ## -SELECT @@session.auto_increment_increment = 2; - -INSERT into t1(name) values('Record_11'); -INSERT into t1(name) values('Record_12'); -SELECT * from t1; - - ---echo '#--------------------FN_DYNVARS_001_06-------------------------#' -############################################################################### -# Altering table field to different datatypes and checking their behavior # -############################################################################### - ---echo ## Changing column's datatype to SmallInt and verifying variable's behavior ## -ALTER table t1 MODIFY id SMALLINT NOT NULL auto_increment; -INSERT into t1(name) values('Record_13'); -INSERT into t1(name) values('Record_14'); -SELECT * from t1; - ---echo ## Changing column's datatype to BigInt and verifying variable's behavior ## -ALTER table t1 MODIFY id BIGINT NOT NULL auto_increment; -INSERT into t1(name) values('Record_15'); -INSERT into t1(name) values('Record_16'); -SELECT * from t1; - ---echo '#--------------------FN_DYNVARS_001_07-------------------------#' -############################################################################### -# Check behavior of variable after assigning invalid value # -############################################################################### - ---echo ## Verifying behavior of variable with negative value ## -SET @@auto_increment_increment = -10; -INSERT into t1(name) values('Record_17'); -INSERT into t1(name) values('Record_18'); -SELECT * from t1; - ---echo 'Bug#35364: Variable is incrementing some random values on assigning -ve value' - - -############################################################ -# Disconnecting all connection & dropping table # -############################################################ - ---echo ## Disconnecting test_con2 ## -DISCONNECT test_con2; - ---echo ## Dropping table t1 ## -DROP table if exists t1; - ---echo ## Disconnecting test_con1 ## -DISCONNECT test_con1; - ---echo ## switching to default connection ## -connection default; - -# restore vars -SET @@global.auto_increment_increment = @global_auto_increment_increment; -SET @@session.auto_increment_increment = @session_auto_increment_increment; -SET @@global.auto_increment_offset = @global_auto_increment_offset; -SET @@session.auto_increment_offset = @session_auto_increment_offset; diff --git a/mysql-test/t/auto_increment_offset_basic.test b/mysql-test/t/auto_increment_offset_basic.test deleted file mode 100644 index a98fd6467ad..00000000000 --- a/mysql-test/t/auto_increment_offset_basic.test +++ /dev/null @@ -1,214 +0,0 @@ -############## mysql-test\t\auto_increment_offset_basic.test ################### -# # -# Variable Name: auto_increment_offset # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "auto_increment_offset" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_auto-increment-offset # -# # -################################################################################ - ---source include/load_sysvars.inc - -##################################################################### -# START OF auto_increment_offset TESTS # -##################################################################### - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.auto_increment_offset; -SELECT @start_global_value; -SET @start_session_value = @@session.auto_increment_offset; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_002_01-------------------------#' -##################################################################### -# Display the DEFAULT value of auto_increment_offset # -##################################################################### - -SET @@global.auto_increment_offset = 100; -SET @@global.auto_increment_offset = DEFAULT; -SELECT @@global.auto_increment_offset; - -SET @@session.auto_increment_offset = 200; -SET @@session.auto_increment_offset = DEFAULT; -SELECT @@session.auto_increment_offset; - - ---echo '#--------------------FN_DYNVARS_002_02-------------------------#' -##################################################################### -# Check the DEFAULT value of auto_increment_offset # -##################################################################### - -SET @@global.auto_increment_offset = @start_global_value; -SELECT @@global.auto_increment_offset = 1; -SET @@session.auto_increment_offset = @start_session_value; -SELECT @@session.auto_increment_offset = 1; - - ---echo '#--------------------FN_DYNVARS_002_03-------------------------#' -############################################################################### -# Change the value of auto_increment_offset to a valid value for GLOBAL Scope # -############################################################################### - -SET @@global.auto_increment_offset = 1; -SELECT @@global.auto_increment_offset; -SET @@global.auto_increment_offset = 60020; -SELECT @@global.auto_increment_offset; -SET @@global.auto_increment_offset = 65535; -SELECT @@global.auto_increment_offset; - - ---echo '#--------------------FN_DYNVARS_002_04-------------------------#' -############################################################################### -# Change the value of auto_increment_offset to a valid value for SESSION Scope# -############################################################################### - -SET @@session.auto_increment_offset = 1; -SELECT @@session.auto_increment_offset; -SET @@session.auto_increment_offset = 50050; -SELECT @@session.auto_increment_offset; -SET @@session.auto_increment_offset = 65535; -SELECT @@session.auto_increment_offset; - - ---echo '#------------------FN_DYNVARS_002_05-----------------------#' -################################################################# -# Change the value of auto_increment_offset to an invalid value # -################################################################# -# for global scope -SET @@global.auto_increment_offset = 0; -SELECT @@global.auto_increment_offset; -SET @@global.auto_increment_offset = -1024; -SELECT @@global.auto_increment_offset; -SET @@global.auto_increment_offset = 65536; -SELECT @@global.auto_increment_offset; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.auto_increment_offset = ON; -SELECT @@global.auto_increment_offset; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.auto_increment_offset = OFF; -SELECT @@global.auto_increment_offset; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.auto_increment_offset = test; -SELECT @@global.auto_increment_offset; -# for session scope -SET @@session.auto_increment_offset = 0; -SELECT @@session.auto_increment_offset; -SET @@session.auto_increment_offset = -2; -SELECT @@session.auto_increment_offset; -SET @@session.auto_increment_offset = 65550; -SELECT @@session.auto_increment_offset; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.auto_increment_offset = ON; -SELECT @@session.auto_increment_offset; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.auto_increment_offset = OFF; -SELECT @@session.auto_increment_offset; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.auto_increment_offset = test; -SELECT @@session.auto_increment_offset; - - - ---echo '#------------------FN_DYNVARS_002_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SELECT @@global.auto_increment_offset = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='auto_increment_offset'; - - ---echo '#------------------FN_DYNVARS_002_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.auto_increment_offset = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='auto_increment_offset'; - - ---echo '#------------------FN_DYNVARS_002_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.auto_increment_offset = TRUE; -SELECT @@global.auto_increment_offset; -SET @@global.auto_increment_offset = FALSE; -SELECT @@global.auto_increment_offset; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -############################################################################### -# Check if global and session variables are independant of each other # -############################################################################### - -SET @@global.auto_increment_offset = 10; -SET @@session.auto_increment_offset = 11; -SELECT @@auto_increment_offset = @@global.auto_increment_offset; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@auto_increment_offset = 100; -SELECT @@auto_increment_offset = @@local.auto_increment_offset; -SELECT @@local.auto_increment_offset = @@session.auto_increment_offset; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################### -# Check if auto_increment_offset can be accessed with and without @@ sign # -############################################################################### - -SET auto_increment_offset = 1; -SELECT @@auto_increment_offset; ---Error ER_UNKNOWN_TABLE -SELECT local.auto_increment_offset; ---Error ER_UNKNOWN_TABLE -SELECT session.auto_increment_offset; ---Error ER_BAD_FIELD_ERROR -SELECT auto_increment_offset = @@session.auto_increment_offset; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.auto_increment_offset = @start_global_value; -SELECT @@global.auto_increment_offset; -SET @@session.auto_increment_offset = @start_session_value; -SELECT @@session.auto_increment_offset; - - -################################################### -# END OF auto_increment_offset TESTS # -################################################### - diff --git a/mysql-test/t/auto_increment_offset_func.test b/mysql-test/t/auto_increment_offset_func.test deleted file mode 100644 index 7e1668452cc..00000000000 --- a/mysql-test/t/auto_increment_offset_func.test +++ /dev/null @@ -1,200 +0,0 @@ -############## mysql-test\t\auto_increment_offset_func.test #################### -# # -# Variable Name: auto_increment_offset # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "auto_increment_offset" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_auto-increment-offset # -# # -################################################################################ - -# save vars -SET @global_auto_increment_increment = @@global.auto_increment_increment; -SET @session_auto_increment_increment = @@session.auto_increment_increment; -SET @global_auto_increment_offset = @@global.auto_increment_offset; -SET @session_auto_increment_offset = @@session.auto_increment_offset; - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating New Table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - ---echo '#--------------------FN_DYNVARS_002_01-------------------------#' -####################################################### -# Setting initial value of auto_increment_offset # -####################################################### - ---echo ## Setting initial value of variable to 5 ## -SET @@auto_increment_increment = 10; -SET @@auto_increment_offset = 5; - - ---echo '#--------------------FN_DYNVARS_002_02-------------------------#' -########################################################################### -# Inserting first value in table to check auto_increment_offset initial -# behavior -########################################################################### - ---echo ## Inserting records in table and verifying variable's behavior ## -INSERT into t1(name) values('Record_1'); -SELECT * from t1; -INSERT into t1(name) values('Record_2'); -SELECT * from t1; - ---echo ## Test behavior of variable after updating value of variable ## -SET @@auto_increment_offset = 24; -SELECT @@auto_increment_offset; -INSERT into t1(name) values('Record_3'); -SELECT * from t1; -INSERT into t1(name) values('Record_4'); -SELECT * from t1; - - ---echo '#--------------------FN_DYNVARS_002_03-------------------------#' -########################################################## -# Test behavior of variable on new connection # 01 # -########################################################## - ---echo ## Changing value of global scope before opening new connection ## - -SET @@global.auto_increment_increment = 15; -SET @@global.auto_increment_offset = 36; - ---echo ## New connection test_con1 ## -CONNECT (test_con1,localhost,root,,); -CONNECTION test_con1; - ---echo ## Value of session & global vairable here should be 10 ## -SELECT @@global.auto_increment_offset = 36; -SELECT @@session.auto_increment_offset = 36; - ---echo ## Verify global value effect of variable by inserting new rows in table ## -INSERT into t1(name) values('Record_5'); -INSERT into t1(name) values('Record_6'); -SELECT * from t1; - ---echo ## Setting session value of variable and inserting data in table ## -SET @@session.auto_increment_offset = 54; -INSERT into t1(name) values('Record_7'); -INSERT into t1(name) values('Record_8'); -SELECT * from t1; - - ---echo '#--------------------FN_DYNVARS_002_04-------------------------#' -###################################################################### -# Test behavior of variable on assigning value to variable that is -# less than last index id -###################################################################### - ---echo ## Setting value of variable less than last insert id ## -SET @@session.auto_increment_offset = 5; -INSERT into t1(name) values('Record_9'); ---echo 'Bug#35367: Random value of id is increasing on assigning value to'; ---echo 'variable that is less than current offset'; -INSERT into t1(name) values('Record_10'); -INSERT into t1(name) values('Record_11'); -INSERT into t1(name) values('Record_12'); -SELECT * from t1; - - - ---echo '#--------------------FN_DYNVARS_002_05-------------------------#' -##################################################################### -# Verify variable's behavior on assigning value greater than -# auto_increment_increment value -##################################################################### - ---echo ## Assigning value to variable greater than auto_increment_incrent value ## -SET @@auto_increment_offset = 140; -SET @@auto_increment_increment = 10; - -INSERT into t1(name) values('Record_13'); -INSERT into t1(name) values('Record_14'); -SELECT * from t1; ---echo 'Bug#35369: Some invalid value of id is increasing on assigning value to'; ---echo 'variable that is greater than auto_increment_increment'; - - ---echo '#--------------------FN_DYNVARS_002_06-------------------------#' -############################################################################### -# Altering table field to different datatypes and checking their behavior # -############################################################################### - ---echo ## Changing datatype of column id with primary key to SmallInt ## -ALTER table t1 modify id SMALLINT NOT NULL auto_increment; -INSERT into t1(name) values('Record_15'); -INSERT into t1(name) values('Record_16'); -SELECT * from t1; - ---echo ## Changing datatype of column id with primary key to BigInt ## -ALTER table t1 modify id BIGINT NOT NULL auto_increment; -INSERT into t1(name) values('Record_17'); -INSERT into t1(name) values('Record_18'); -SELECT * from t1; - ---echo '#--------------------FN_DYNVARS_002_07-------------------------#' -############################################################################### -# Check behavior of variable after assigning invalid values to variable # -############################################################################### - ---echo ## Assigning -ve value to variable ## -SET @@auto_increment_offset = -10; -SELECT @@auto_increment_offset = -10; -INSERT into t1(name) values('Record_17'); -INSERT into t1(name) values('Record_18'); -SELECT * from t1; ---echo 'Bug#35370: Some invalid value of id is increasing on assigning negative'; ---echo ' value in variable'; - ---echo ## Assigning value that is out of range of variable ## -SET @@auto_increment_offset = 65536; -SELECT @@auto_increment_offset; -INSERT into t1(name) values('Record_17'); -INSERT into t1(name) values('Record_18'); -INSERT into t1(name) values('Record_19'); -INSERT into t1(name) values('Record_20'); -SELECT * from t1; - ---echo ## No effect of auto_increment_offset since value of this variable is greater ## ---echo ## than auto_increment_increment ## - -############################################################ -# Disconnecting all connection & dropping table # -############################################################ - ---echo ## Dropping table ## -DROP table if exists t1; - ---echo ## Disconnecting connection ## -DISCONNECT test_con1; - ---echo ## switching to default connection ## -connection default; - -# restore vars -SET @@global.auto_increment_increment = @global_auto_increment_increment; -SET @@session.auto_increment_increment = @session_auto_increment_increment; -SET @@global.auto_increment_offset = @global_auto_increment_offset; -SET @@session.auto_increment_offset = @session_auto_increment_offset; diff --git a/mysql-test/t/autocommit_func-master.opt b/mysql-test/t/autocommit_func-master.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/t/autocommit_func-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/t/autocommit_func.test b/mysql-test/t/autocommit_func.test deleted file mode 100644 index 07e15ce40da..00000000000 --- a/mysql-test/t/autocommit_func.test +++ /dev/null @@ -1,164 +0,0 @@ -############## mysql-test\t\auto_commit_func.test ############################# -# # -# Variable Name: autocommit # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: NA # -# Range: NA # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "autocommit" # -# that checks functionality of this variable # -# # -# Reference: (Not Mentioned on website) # -# # -################################################################################ - ---source include/have_innodb.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name varchar(30) -) ENGINE = INNODB; - ---echo '#--------------------FN_DYNVARS_003_01-------------------------#' -##################################################### -# Setting initial value of auto_commit to zero # -##################################################### - ---echo ## Setting variable's value to 0 i.e false ## -SET @@autocommit = 0; - - ---echo '#--------------------FN_DYNVARS_003_02-------------------------#' -###################################################################### -# Creating 2 different connections & testing behavior of autocommit -# after updating record in 1st connection -###################################################################### - ---echo ## Creating new connection ## -CONNECT (test_con1,localhost,root,,); -CONNECTION test_con1; - ---echo ## Checking value of variable after opening new connection ## - -SELECT @@autocommit; - ---echo ## Setting value of variable to zero and inserting some rows ## -SET @@autocommit = 0; - -INSERT into t1(name) values('Record_1'); -INSERT into t1(name) values('Record_2'); -SELECT * from t1; - ---echo ## Creating another connection and verifying records in table ## - ---echo ## New Connection test_con2 ## -CONNECT (test_con2,localhost,root,,); -CONNECTION test_con2; -SELECT * from t1; - - ---echo '#--------------------FN_DYNVARS_003_03-------------------------#' -###################################################################### -# Creating 2 different connections & testing behavior of autocommit -# after updating record in 1st connection and using COMMIT in first -# connection -###################################################################### - ---echo ## Verifying behavior of variable by commiting rows in test_con1 ## ---echo ## Connecting with connection # 01 ## -CONNECTION test_con1; -SELECT * from t1; -COMMIT; - - ---echo ## New Connection test_con2 ## ---echo ## Now verifying records in table from connection # 02 ## -CONNECTION test_con2; -SELECT * from t1; - ---echo '#--------------------FN_DYNVARS_003_04-------------------------#' -###################################################################### -# Creating 2 different connections & testing behavior of autocommit -# after updating record in 1st connection and using ROLLBACK in -# first connection -###################################################################### - ---echo ## Connecting to connection # 01 ## -CONNECTION test_con1; -SELECT * from t1; - ---echo ## Updating value of first row ## -UPDATE t1 set name = 'Record_12' where name = 'Record_1'; -SELECT * from t1; - ---echo ## Connecting to connecting # 02 and verifying effect of update query ## -CONNECTION test_con2; -SELECT * from t1; - ---echo ## Now connecting with connection # 01 and using ROLLBACK after it ## -CONNECTION test_con1; -ROLLBACK; -SELECT * from t1; - - - ---echo '#--------------------FN_DYNVARS_003_05-------------------------#' -###################################################################### -# Creating 2 different connections & testing behavior of autocommit -# after updating records in 1st connection and setting AUTOCOMMIT -# to 1 in second connection -###################################################################### - - ---echo ## Connecting with connection # 01 ## -CONNECTION test_con1; -INSERT into t1(name) values('Record_3'); - - ---echo ## Connection test_con2 ## ---echo ## Now verifying records in table from connection # 02 and changing value ## ---echo ## of autocommit to true ## -CONNECTION test_con2; -SELECT * from t1; -SET @@autocommit = 1; -INSERT into t1(name) values('Record_4'); -INSERT into t1(name) values('Record_5'); -SELECT * from t1; - ---echo ## Connecting with connection # 01 and inserting few records ## -CONNECTION test_con1; -SELECT * from t1; ---echo 'Bug#35373: Records donot get committed in transaction on switching connections' -INSERT into t1(name) values('Record_6'); -SELECT * from t1; - ---echo ## Now verifying the effect of these new records in second connection ## -CONNECTION test_con2; -SELECT * from t1; - ---echo ## Dropping table t1 ## -DROP table t1; - ---echo ## Disconnecting both connections ## -DISCONNECT test_con1; -DISCONNECT test_con2; - - - diff --git a/mysql-test/t/automatic_sp_privileges_basic.test b/mysql-test/t/automatic_sp_privileges_basic.test deleted file mode 100644 index 74da0904454..00000000000 --- a/mysql-test/t/automatic_sp_privileges_basic.test +++ /dev/null @@ -1,179 +0,0 @@ -############## mysql-test\t\automatic_sp_privileges_basic.test ################# -# # -# Variable Name: automatic_sp_privileges # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: TRUE # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "automatic_sp_privileges" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_automatic_sp_privileges # -# # -################################################################################ - ---source include/load_sysvars.inc - -####################################################################### -# START OF automatic_sp_privileges TESTS # -####################################################################### - - -############################################################################### -# Saving initial value of automatic_sp_privileges in a temporary variable # -############################################################################### - -SET @start_value = @@global.automatic_sp_privileges; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_004_01------------------------#' -############################################################################### -# Display the DEFAULT value of automatic_sp_privileges # -############################################################################### - -SET @@global.automatic_sp_privileges = 0; -SET @@global.automatic_sp_privileges = DEFAULT; -SELECT @@global.automatic_sp_privileges; - - ---echo '#---------------------FN_DYNVARS_004_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.automatic_sp_privileges = @start_value; -SELECT @@global.automatic_sp_privileges = TRUE; - - ---echo '#--------------------FN_DYNVARS_004_03------------------------#' -############################################################################### -# Change the value of automatic_sp_privileges to a valid value # -############################################################################### - -SET @@global.automatic_sp_privileges = 0; -SELECT @@global.automatic_sp_privileges; -SET @@global.automatic_sp_privileges = 1; -SELECT @@global.automatic_sp_privileges; - ---echo '#--------------------FN_DYNVARS_004_04-------------------------#' -############################################################################### -# Change the value of automatic_sp_privileges to invalid value # -############################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.automatic_sp_privileges = ''; - - ---echo '#-------------------FN_DYNVARS_004_05----------------------------#' -########################################################################### -# Test if accessing session automatic_sp_privileges gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.automatic_sp_privileges = 1; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.automatic_sp_privileges; - - ---echo '#----------------------FN_DYNVARS_004_06------------------------#' -############################################################################## -# Check if the value in GLOBAL Tables matches values in variable # -############################################################################## - -SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='automatic_sp_privileges'; -echo 'Bug# 34839: Values in variable and information_schema donot match'; - ---echo '#---------------------FN_DYNVARS_004_07----------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@global.automatic_sp_privileges = OFF; -SELECT @@global.automatic_sp_privileges; -SET @@global.automatic_sp_privileges = ON; -SELECT @@global.automatic_sp_privileges; - ---echo '#---------------------FN_DYNVARS_004_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.automatic_sp_privileges = TRUE; -SELECT @@global.automatic_sp_privileges; -SET @@global.automatic_sp_privileges = FALSE; -SELECT @@global.automatic_sp_privileges; - ---echo '#---------------------FN_DYNVARS_004_09----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@global.automatic_sp_privileges = 1; -SELECT @@automatic_sp_privileges = @@global.automatic_sp_privileges; - ---echo '#---------------------FN_DYNVARS_004_10----------------------#' -############################################################################### -# Check if automatic_sp_privileges can be accessed with and without @@ sign # -############################################################################### ---Error ER_GLOBAL_VARIABLE -SET automatic_sp_privileges = 1; ---Error ER_PARSE_ERROR -SET local.automatic_sp_privileges = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.automatic_sp_privileges; ---Error ER_PARSE_ERROR -SET global.automatic_sp_privileges = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.automatic_sp_privileges; ---Error ER_BAD_FIELD_ERROR -SELECT automatic_sp_privileges = @@session.automatic_sp_privileges; - - - -############################## -# Restore initial value # -############################## - -SET @@global.automatic_sp_privileges = @start_value; -SELECT @@global.automatic_sp_privileges; - - -############################################################# -# END OF automatic_sp_privileges TESTS # -############################################################# diff --git a/mysql-test/t/automatic_sp_privileges_func.test b/mysql-test/t/automatic_sp_privileges_func.test deleted file mode 100644 index ae5edbb078e..00000000000 --- a/mysql-test/t/automatic_sp_privileges_func.test +++ /dev/null @@ -1,150 +0,0 @@ -############# mysql-test\t\automatic_sp_privileges_func.test ############################ -# # -# Variable Name: automatic_sp_privileges # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-03-04 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "automatic_sp_privileges" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_automatic_sp_privileges # -# # -######################################################################################### - -# -# Setup -# - ---source include/not_embedded.inc - ---echo ** Setup ** -SET @global_automatic_sp_privileges = @@GLOBAL.automatic_sp_privileges; - -CREATE TABLE t1 (a varchar(200)); - -INSERT INTO t1 VALUES('Procedure Executed.'); - -# -# Creating test user -# - -CREATE USER 'userTest'@'localhost'; -CREATE USER 'userTest1'@'localhost'; - -# -# Value TRUE -# ---echo ** Connection default ** -connection default; -SET GLOBAL automatic_sp_privileges = TRUE; - ---echo ** Connecting using userTest ** -connect (conUser,localhost,userTest,,); ---echo ** Connection conUser ** -connection conUser; - -delimiter |; - -CREATE PROCEDURE testProc () -BEGIN -SELECT * FROM t1; -END;| - -delimiter ;| - -CALL testProc(); ---echo Expecting SELECT executed - -# -# Value FALSE -# ---echo ** Connection default** -connection default; -SET GLOBAL automatic_sp_privileges = FALSE; - ---echo ** Connecting using userTest1 ** -connect (conUser1,localhost,userTest1,,); ---echo ** Connection conUser1 ** -connection conUser1; - -delimiter |; - -CREATE PROCEDURE testProc1 () -BEGIN -SELECT * FROM t1; -END;| - -delimiter ;| - ---echo ---echo Expected error access denied ---error ER_PROCACCESS_DENIED_ERROR -CALL testProc1(); - ---echo ---echo Expected error access denied ---error ER_PROCACCESS_DENIED_ERROR -ALTER PROCEDURE testProc1 COMMENT 'My Comment'; - ---echo ---echo Expected error access denied ---error ER_PROCACCESS_DENIED_ERROR -DROP PROCEDURE testProc1; - ---echo ** Connection default ** -connection default; - -GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE testProc1 TO 'userTest1'@'localhost'; - ---echo ** Connection conUser1 ** -connection conUser1; - -CALL testProc1(); ---echo Expecting seelect executed - -ALTER PROCEDURE testProc1 COMMENT 'My Comment'; - ---echo -# -# Cleanup -# ---echo ** Cleanup ** ---echo ** Connection default ** -connection default; - ---echo disconnecting connections -disconnect conUser; -disconnect conUser1; - -SET GLOBAL automatic_sp_privileges = @global_automatic_sp_privileges; - -# Disabled due to differences in results: Bug#35384 -#SHOW GRANTS FOR 'userTest'@'localhost'; - -# on Linux (5.1.24) successful, on Windows (5.1.23) error ---error 0,ER_NONEXISTING_PROC_GRANT -REVOKE EXECUTE, ALTER ROUTINE ON PROCEDURE testProc FROM 'userTest'@'localhost'; - ---error 0,ER_NONEXISTING_PROC_GRANT -REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest'@'localhost'; - -REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest1'@'localhost'; - ---disable_warnings -DROP PROCEDURE testProc; ---enable_warnings -DROP PROCEDURE testProc1; - -DROP USER 'userTest'@'localhost'; -DROP USER 'userTest1'@'localhost'; - -DROP TABLE t1; diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index cdbf7b69615..61e80ec682e 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -1,6 +1,6 @@ # The server need to be started in $MYSQLTEST_VARDIR since it -# uses ../std_data_ln/ +# uses ../../std_data/ -- source include/uses_vardir.inc # @@ -16,41 +16,41 @@ drop table if exists t1, t2, t3, t4; --enable_warnings create table t4(n int); --replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -backup table t4 to '../bogus'; -backup table t4 to '../tmp'; +backup table t4 to '../../bogus'; +backup table t4 to '../../tmp'; --replace_result ": 7" ": X" ": 17" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -backup table t4 to '../tmp'; +backup table t4 to '../../tmp'; drop table t4; -restore table t4 from '../tmp'; +restore table t4 from '../../tmp'; select count(*) from t4; create table t1(n int); insert into t1 values (23),(45),(67); -backup table t1 to '../tmp'; +backup table t1 to '../../tmp'; drop table t1; --replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -restore table t1 from '../bogus'; -restore table t1 from '../tmp'; +restore table t1 from '../../bogus'; +restore table t1 from '../../tmp'; select n from t1; create table t2(m int not null primary key); create table t3(k int not null primary key); insert into t2 values (123),(145),(167); insert into t3 values (223),(245),(267); -backup table t2,t3 to '../tmp'; +backup table t2,t3 to '../../tmp'; drop table t1,t2,t3; -restore table t1,t2,t3 from '../tmp'; +restore table t1,t2,t3 from '../../tmp'; select n from t1; select m from t2; select k from t3; drop table t1,t2,t3,t4; -restore table t1 from '../tmp'; +restore table t1 from '../../tmp'; connection con2; rename table t1 to t5; --send lock tables t5 write; connection con1; --send -backup table t5 to '../tmp'; +backup table t5 to '../../tmp'; connection con2; reap; unlock tables; @@ -80,11 +80,11 @@ DROP TABLE IF EXISTS `t+1`; --enable_warnings CREATE TABLE `t+1` (c1 INT); INSERT INTO `t+1` VALUES (1), (2), (3); -BACKUP TABLE `t+1` TO '../tmp'; +BACKUP TABLE `t+1` TO '../../tmp'; DROP TABLE `t+1`; # # Same for restore. -RESTORE TABLE `t+1` FROM '../tmp'; +RESTORE TABLE `t+1` FROM '../../tmp'; SELECT * FROM `t+1`; DROP TABLE `t+1`; diff --git a/mysql-test/t/basedir_basic.test b/mysql-test/t/basedir_basic.test deleted file mode 100644 index 480e46ca8a0..00000000000 --- a/mysql-test/t/basedir_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\basedir_basic.test ############################ -# # -# Variable Name: basedir # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable basedir # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_001_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.basedir); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_001_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.basedir=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.basedir); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_001_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.basedir = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='basedir'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.basedir); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='basedir'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_001_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@basedir = @@GLOBAL.basedir; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_001_05----------------------#' -################################################################################ -# Check if basedir can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@basedir); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.basedir); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.basedir); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.basedir); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT basedir = @@SESSION.basedir; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/big_tables_basic.test b/mysql-test/t/big_tables_basic.test deleted file mode 100644 index 8665895bb19..00000000000 --- a/mysql-test/t/big_tables_basic.test +++ /dev/null @@ -1,179 +0,0 @@ -##################### mysql-test\t\big_tables_basic.test ####################### -# # -# Variable Name: big_tables # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: NA # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "big_tables" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-options.html#option_mysqld_big-tables # -# # -################################################################################ - ---source include/load_sysvars.inc - -########################################################## -# START OF big_tables TESTS # -########################################################## - - -################################################################## -# Saving initial value of big_tables in a temporary variable # -################################################################## - -SET @start_value = @@big_tables; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_005_01------------------------#' -############################################################# -# Display the DEFAULT value of big_tables # -############################################################# - -SET @@big_tables = 1; -SET @@big_tables = DEFAULT; -SELECT @@big_tables; ---echo 'Bug# 34829: No default value for variable and setting default does not raise error'; - - ---echo '#--------------------FN_DYNVARS_005_02------------------------#' -############################################################# -# Change the value of big_tables to a valid value # -############################################################# - -SET @@big_tables = 0; -SELECT @@big_tables; -SET @@big_tables = 1; -SELECT @@big_tables; - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -########################################################################### -# Change the value of big_tables to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@big_tables = ''; - - - ---echo '#-------------------FN_DYNVARS_005_04----------------------------#' -########################################################################### -# Test if accessing global big_tables gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.big_tables = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.big_tables; - - ---echo '#----------------------FN_DYNVARS_005_05------------------------#' -############################################################################## -# Check if the value in SESSION Tables matches values in variable # -############################################################################## - -SELECT @@big_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='big_tables'; ---echo Bug # 34839: Values in variable and information_schema do not match for autocommit - - ---echo '#---------------------FN_DYNVARS_005_06----------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@big_tables = OFF; -SELECT @@big_tables; -SET @@big_tables = ON; -SELECT @@big_tables; - ---echo '#---------------------FN_DYNVARS_005_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@big_tables = TRUE; -SELECT @@big_tables; -SET @@big_tables = FALSE; -SELECT @@big_tables; - - ---echo '#---------------------FN_DYNVARS_005_08----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@big_tables = 0; -SELECT @@big_tables = @@session.big_tables; -SET @@big_tables = 1; -SELECT @@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_tables; - ---echo '#---------------------FN_DYNVARS_005_09----------------------#' -########################################################################## -# Check if big_tables can be accessed with and without @@ sign # -########################################################################## - -SET big_tables = 1; -SELECT @@big_tables; ---Error ER_PARSE_ERROR -SET local.big_tables = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.big_tables; ---Error ER_PARSE_ERROR -SET session.big_tables = 1; ---Error ER_UNKNOWN_TABLE -SELECT session.big_tables; ---Error ER_BAD_FIELD_ERROR -select big_tables; - - -############################## -# Restore initial value # -############################## - -SET @@big_tables = @start_value; -SELECT @@big_tables; - - -####################################################### -# END OF big_tables TESTS # -####################################################### - - diff --git a/mysql-test/t/binlog_format_basic.test b/mysql-test/t/binlog_format_basic.test deleted file mode 100644 index 819ad047c1b..00000000000 --- a/mysql-test/t/binlog_format_basic.test +++ /dev/null @@ -1,120 +0,0 @@ - - -################## mysql-test\t\binlog_format_basic.test ###################### -# # -# Variable Name: binlog_format # -# Scope: Global & Session # -# Access Type: Static # -# Data Type: enumeration # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable binlog_format # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - -################################################################### -# BUG#39812: Make statement replication default for 5.1 (to match 5.0) -# We just verify that the default binlog_format is STATEMENT in 5.1. -# In 6.0, it should be MIXED. -################################################################### -SELECT @@GLOBAL.binlog_format; - ---echo '#---------------------BS_STVARS_002_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.binlog_format); ---echo 1 Expected - -SELECT COUNT(@@SESSION.binlog_format); ---echo 1 Expected - ---echo '#---------------------BS_STVARS_002_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - -#--error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.binlog_format=1; ---echo Expected error 'Read only variable' ---echo Bug: Writeable static variable -SELECT COUNT(@@GLOBAL.binlog_format); ---echo 1 Expected - - - -#--error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@SESSION.binlog_format=1; ---echo Expected error 'Read only variable' ---echo Bug: Writeable static variable -SELECT COUNT(@@SESSION.binlog_format); ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_002_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.binlog_format = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='binlog_format'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.binlog_format); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='binlog_format'; ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_002_04----------------------#' -################################################################# -# Check if the value in SESSION Table matches value in variable # -################################################################# - -SELECT @@SESSION.binlog_format = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='binlog_format'; ---echo 1 Expected - -SELECT COUNT(@@SESSION.binlog_format); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='binlog_format'; ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_002_05----------------------#' -################################################################################ -# Check if binlog_format can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@binlog_format); ---echo 1 Expected -SELECT COUNT(@@local.binlog_format); ---echo 1 Expected -SELECT COUNT(@@SESSION.binlog_format); ---echo 1 Expected -SELECT COUNT(@@GLOBAL.binlog_format); ---echo 1 Expected - - - diff --git a/mysql-test/t/binlog_index.test b/mysql-test/t/binlog_index.test deleted file mode 100644 index 1e44a9b02e2..00000000000 --- a/mysql-test/t/binlog_index.test +++ /dev/null @@ -1,69 +0,0 @@ -# -# testing of purging of binary log files bug#18199/Bug#18453 -# -source include/have_log_bin.inc; -source include/not_embedded.inc; - -# -# testing purge binary logs TO -# - -flush logs; -flush logs; -flush logs; - -source include/show_binary_logs.inc; - -remove_file $MYSQLTEST_VARDIR/log/master-bin.000001; - -# there must be a warning with file names ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -purge binary logs TO 'master-bin.000004'; - ---echo *** must show a list starting from the 'TO' argument of PURGE *** -source include/show_binary_logs.inc; - -# -# testing purge binary logs BEFORE -# - -reset master; - -flush logs; -flush logs; -flush logs; -remove_file $MYSQLTEST_VARDIR/log/master-bin.000001; - ---echo *** must be a warning master-bin.000001 was not found *** -let $date=`select NOW() + INTERVAL 1 MINUTE`; ---disable_query_log ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval purge binary logs BEFORE '$date'; ---enable_query_log - ---echo *** must show one record, of the active binlog, left in the index file after PURGE *** -source include/show_binary_logs.inc; - -# -# testing a fatal error -# Turning a binlog file into a directory must be a portable setup -# - -reset master; - -flush logs; -flush logs; -flush logs; - -remove_file $MYSQLTEST_VARDIR/log/master-bin.000001; -mkdir $MYSQLTEST_VARDIR/log/master-bin.000001; - ---error ER_BINLOG_PURGE_FATAL_ERR -purge binary logs TO 'master-bin.000002'; ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -show warnings; -rmdir $MYSQLTEST_VARDIR/log/master-bin.000001; ---disable_warnings -reset master; ---enable_warnings ---echo End of tests diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index 203ba9b2914..db89269b35d 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -6,6 +6,10 @@ drop table if exists t1; --enable_warnings +# Add the datadir to the bootstrap command +let $MYSQLD_DATADIR= `select @@datadir`; +let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR; + # # Check that --bootstrap reads from stdin # diff --git a/mysql-test/t/change_user-master.opt b/mysql-test/t/change_user-master.opt new file mode 100644 index 00000000000..cef79bc8585 --- /dev/null +++ b/mysql-test/t/change_user-master.opt @@ -0,0 +1 @@ +--force-restart diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index f200c76196c..89f35116a2c 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -45,9 +45,32 @@ SELECT IS_USED_LOCK('bug31418'); # Bug#31222: com_% global status counters behave randomly with # mysql_change_user. # -# Moved to not_embedded_server.test due to Bug#34517: SHOW GLOBAL STATUS does -# not work properly in embedded server. -# -# TODO: move it back when Bug#34517 is fixed (don't forget to add -# --force-restart into change_user-master.opt). -# + +FLUSH STATUS; + +--disable_result_log +--disable_query_log + +let $i = 100; + +while ($i) +{ + dec $i; + + SELECT 1; +} + +--enable_query_log +--enable_result_log + +let $before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1); + +--change_user + +let $after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1); + +if (`select $after != $before`){ + SHOW GLOBAL STATUS LIKE 'com_select'; + die The value of com_select changed during change_user; +} +echo Value of com_select did not change; diff --git a/mysql-test/t/character_set_client_basic.test b/mysql-test/t/character_set_client_basic.test deleted file mode 100644 index 69e4c07dcd8..00000000000 --- a/mysql-test/t/character_set_client_basic.test +++ /dev/null @@ -1,346 +0,0 @@ -############## mysql-test\t\character_set_client_basic.test ################### -# # -# Variable Name: character_set_client # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_client # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc -################################################### -## START OF character_set_client TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.character_set_client; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@character_set_client; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.character_set_client; -SELECT @session_start_value; -# save using default access (session) -SET @session_start_value = @@session.character_set_client; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_010_01------------------#' -############################################################################### -# Test Variable access and assignment with and withoud @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT character_set_client; -# assign value without @@ -SET character_set_client=utf8; -SELECT @@session.character_set_client; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.character_set_client=utf8; -# using another syntax for accessing session variable -SET session character_set_client=utf8; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session character_set_client; -# using another syntax for accessing dynamic variable -SET global character_set_client=utf8; ---Error ER_BAD_FIELD_ERROR -SELECT global character_set_client; - ---echo '#--------------------FN_DYNVARS_010_02-------------------------#' -############################################################################### -# Check the DEFAULT value of character_set_client for session and global # -############################################################################### -SET @@character_set_client = latin5; -SET @@character_set_client = DEFAULT; -SELECT @@character_set_client AS DEFAULT_VALUE; - -SET @@global.character_set_client = latin5; -SET @@global.character_set_client = DEFAULT; -SELECT @@global.character_set_client; - ---echo '#--------------------FN_DYNVARS_010_03-------------------------#' -############################################################################### -# see if setting global value changes session value and vice versa # -############################################################################### -SET @@session.character_set_client = utf8; -SELECT @@session.character_set_client; -SET @@global.character_set_client = latin2; -SELECT @@global.character_set_client; -SELECT @@session.character_set_client AS res_is_utf8; - -SET @@session.character_set_client = latin5; -SELECT @@session.character_set_client; -SELECT @@global.character_set_client AS res_is_latin2; -# composite check -SELECT @@global.character_set_client=@@session.character_set_client -AS res_is_false; - ---echo '#--------------------FN_DYNVARS_010_04-------------------------#' -############################################################################## -# Check if accessing variable with and without session point to session # -# variable # -############################################################################## -SELECT @@character_set_client = @@session.character_set_client AS res; -SELECT @@character_set_client = @@local.character_set_client AS res; - ---echo '#--------------------FN_DYNVARS_010_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@character_set_client = utf8 + latin2; - ---echo '#--------------------FN_DYNVARS_010_06-------------------------#' -############################################################################## -# Change the value of character_set_client to a valid value for session # -############################################################################## -SET @@character_set_client = big5; -SELECT @@character_set_client; -SET @@character_set_client = dec8; -SELECT @@character_set_client; -SET @@character_set_client = cp850; -SELECT @@character_set_client; -SET @@character_set_client = hp8; -SELECT @@character_set_client; -SET @@character_set_client = koi8r; -SELECT @@character_set_client; -SET @@character_set_client = latin1; -SELECT @@character_set_client; -SET @@character_set_client = latin2; -SELECT @@character_set_client; -SET @@character_set_client = swe7; -SELECT @@character_set_client; -SET @@character_set_client = ascii; -SELECT @@character_set_client; -SET @@character_set_client = ujis; -SELECT @@character_set_client; -SET @@character_set_client = sjis; -SELECT @@character_set_client; -SET @@character_set_client = hebrew; -SELECT @@character_set_client; -SET @@character_set_client = tis620; -SELECT @@character_set_client; -SET @@character_set_client = euckr; -SELECT @@character_set_client; -SET @@character_set_client = koi8u; -SELECT @@character_set_client; -SET @@character_set_client = gb2312; -SELECT @@character_set_client; -SET @@character_set_client = greek; -SELECT @@character_set_client; -SET @@character_set_client = cp1250; -SELECT @@character_set_client; -SET @@character_set_client = gbk; -SELECT @@character_set_client; -SET @@character_set_client = latin5; -SELECT @@character_set_client; -SET @@character_set_client = armscii8; -SELECT @@character_set_client; -SET @@character_set_client = utf8; -SELECT @@character_set_client; - -#SET @@character_set_client = ucs2; -#--Error ER_PARSE_ERROR -#SELECT @@session.character_set_client; ---echo 'Bug: Assignment of ucs2 to session character-set does not raise error'; ---echo 'but selecting variable after setting it does.'; ---echo 'Even catching this does not allow any further character-set to be set.'; ---echo 'Offending querry seems to be:'; ---echo 'SET @@character_set_client = ucs2;' - -SET @@character_set_client = cp866; -SELECT @@character_set_client; -SET @@character_set_client = keybcs2; -SELECT @@character_set_client; -SET @@character_set_client = macce; -SELECT @@character_set_client; -SET @@character_set_client = macroman; -SELECT @@character_set_client; -SET @@character_set_client = cp852; -SELECT @@character_set_client; -SET @@character_set_client = latin7; -SELECT @@character_set_client; -SET @@character_set_client = cp1251; -SELECT @@character_set_client; -SET @@character_set_client = cp1256; -SELECT @@character_set_client; -SET @@character_set_client = cp1257; -SELECT @@character_set_client; -SET @@character_set_client = binary; -SELECT @@character_set_client; -SET @@character_set_client = geostd8; -SELECT @@character_set_client; -SET @@character_set_client = cp932; -SELECT @@character_set_client; -SET @@character_set_client = eucjpms; -SELECT @@character_set_client; - ---echo '#--------------------FN_DYNVARS_010_07-------------------------#' -############################################################################### -# Change the value of character_set_client to a valid value for global # -############################################################################### - -let charset_variable = @@global.character_set_client; - ---source include/charset_basic.inc - ---echo '#--------------------FN_DYNVARS_010_08-------------------------#' -################################################################################ -# Change the value of character_set_client to a valid value with uppercase,# -# lowercase and mixedcase # -################################################################################ -SET @@character_set_client = UTF8; -SELECT @@character_set_client; -SET @@character_set_client = utf8; -SELECT @@character_set_client; -SET @@global.character_set_client = uTf8; -SELECT @@global.character_set_client; - ---echo '#--------------------FN_DYNVARS_010_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@character_set_client = 1; -SELECT @@character_set_client; -SET @@character_set_client = 2; -SELECT @@character_set_client; -SET @@character_set_client = 3; -SELECT @@character_set_client; -SET @@character_set_client = 36; -SELECT @@character_set_client; -SET @@character_set_client = 99; -SELECT @@character_set_client; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = 100; - -SET @@global.character_set_client = 1; -SELECT @@global.character_set_client; -SET @@global.character_set_client = 2; -SELECT @@global.character_set_client; -SET @@global.character_set_client = 3; -SELECT @@global.character_set_client; -SET @@global.character_set_client = 36; -SELECT @@global.character_set_client; -SET @@global.character_set_client = 99; -SELECT @@global.character_set_client; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = 100; - - -SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); -SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following'; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround'; ---echo 'several times.'; - ---echo '#--------------------FN_DYNVARS_010_10-------------------------#' -############################################################################### -# Change the value of character_set_client to an invalid value for session # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@character_set_client = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = 'utf'; -SET @@character_set_client = true; -SELECT @@character_set_client AS res_with_true; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_client = ON; - ---echo '#--------------------FN_DYNVARS_010_11-------------------------#' -############################################################################### -# Change the value of character_set_client to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.character_set_client = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = 'utf'; - -SET @@global.character_set_client = true; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_client = ON; - ---echo '#--------------------FN_DYNVARS_010_12-------------------------#' -########################################################################## -# Check if the value in GLOBAL Table matches value in variable # -########################################################################## -SELECT @@global.character_set_client = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_client') AS res; -SET @@global.character_set_client = 1; -SELECT @@global.character_set_client; -SELECT @@global.character_set_client = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_client') AS res; - ---echo '#--------------------FN_DYNVARS_010_13-------------------------#' -############################################################################### -# Check if the value in SESSION Table matches value in variable # -############################################################################### -SELECT @@character_set_client = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_client') AS res; -SELECT @@local.character_set_client = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_client') AS res; -SELECT @@session.character_set_client = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_client') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.character_set_client = @global_start_value; -SELECT @@global.character_set_client; -SET @@session.character_set_client = @session_start_value; -SELECT @@session.character_set_client; - -############################################################# -# END OF character_set_client TESTS # -############################################################# diff --git a/mysql-test/t/character_set_client_func.test b/mysql-test/t/character_set_client_func.test deleted file mode 100644 index 19994672fa4..00000000000 --- a/mysql-test/t/character_set_client_func.test +++ /dev/null @@ -1,84 +0,0 @@ -############## mysql-test\t\character_set_client_func.test ################### -# # -# Variable Name: character_set_client # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_client # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_010_01-------------------------#' -###################################################################### -# Check if setting character_set_client is changed in new connection # -###################################################################### - -# save -SET @global_character_set_client = @@global.character_set_client; -SET @session_character_set_client = @@session.character_set_client; - - -SET @@global.character_set_client = utf8; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.character_set_client; -SELECT @@session.character_set_client; -disconnect con1; - ---echo 'Bug# 35372: session character_set_client is not effected by global character_set_client' - ---echo '#--------------------FN_DYNVARS_010_02-------------------------#' -############################################################# -# Begin the functionality Testing of character_set_client # -############################################################# - ---echo 'connection default' -connection default; - -SHOW VARIABLES like 'character_set_client'; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1(a CHAR(3) character set utf8); - -#============================================================================== ---echo '---verifying character_set_client with a utf8 character----' -#============================================================================== ---echo 'For latin1 characterset'; -SET @@session.character_set_client = latin1; -INSERT INTO t1 values('è'); -SELECT a,CHAR_LENGTH(a) FROM t1; -DELETE FROM t1; - ---echo 'For utf8 characterset'; -SET @@session.character_set_client = utf8; -INSERT INTO t1 values('è'); -SELECT a,CHAR_LENGTH(a) FROM t1; -DELETE FROM t1; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -# restore -SET @@global.character_set_client = @global_character_set_client; -SET @@session.character_set_client = @session_character_set_client; - -############################################################ -# End of functionality Testing for character_set_client # -############################################################ diff --git a/mysql-test/t/character_set_connection_basic.test b/mysql-test/t/character_set_connection_basic.test deleted file mode 100644 index 509f8d0d346..00000000000 --- a/mysql-test/t/character_set_connection_basic.test +++ /dev/null @@ -1,273 +0,0 @@ -############## mysql-test\t\character_set_connection_basic.test ############### -# # -# Variable Name: character_set_connection # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_connection # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc -################################################### -## START OF character_set_connection TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.character_set_connection; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@character_set_connection; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.character_set_connection; -SELECT @session_start_value; -# save using default access (session) -SET @session_start_value = @@session.character_set_connection; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_011_01------------------#' -############################################################################### -# Test Variable access and assignment with and withoud @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT character_set_connection; -# assign value without @@ -SET character_set_connection=utf8; -SELECT @@session.character_set_connection; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.character_set_connection=utf8; -# using another syntax for accessing session variable -SET session character_set_connection=utf8; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session character_set_connection; -# using another syntax for accessing dynamic variable -SET global character_set_connection=utf8; ---Error ER_BAD_FIELD_ERROR -SELECT global character_set_connection; - ---echo '#--------------------FN_DYNVARS_011_02-------------------------#' -############################################################################### -# Check the DEFAULT value of character_set_connection for session and global # -############################################################################### -SET @@character_set_connection = latin5; -SET @@character_set_connection = DEFAULT; -SELECT @@character_set_connection AS DEFAULT_VALUE; - -SET @@global.character_set_connection = latin5; -SET @@global.character_set_connection = DEFAULT; -SELECT @@global.character_set_connection; - ---echo '#--------------------FN_DYNVARS_011_03-------------------------#' -############################################################################### -# see if setting global value changes session value and vice versa # -############################################################################### -SET @@session.character_set_connection = utf8; -SELECT @@session.character_set_connection; -SET @@global.character_set_connection = latin2; -SELECT @@global.character_set_connection; -SELECT @@session.character_set_connection AS res_is_utf8; - -SET @@session.character_set_connection = latin5; -SELECT @@session.character_set_connection; -SELECT @@global.character_set_connection AS res_is_latin2; -# composite check -SELECT @@global.character_set_connection=@@session.character_set_connection -AS res_is_false; - ---echo '#--------------------FN_DYNVARS_011_04-------------------------#' -############################################################################# -# Check if accessing variable with and without session point to # -# session variable # -############################################################################# -SELECT @@character_set_connection = @@session.character_set_connection AS res; -SELECT @@character_set_connection = @@local.character_set_connection AS res; - ---echo '#--------------------FN_DYNVARS_011_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@character_set_connection = utf8 + latin2; - ---echo '#--------------------FN_DYNVARS_011_06-------------------------#' -############################################################################## -# Change the value of character_set_connection to a valid value # -# for session # -############################################################################## - -let charset_variable = @@session.character_set_connection; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_011_07-------------------------#' -############################################################################## -# Change the value of character_set_connection to a valid value for global # -############################################################################## - -let charset_variable = @@global.character_set_connection; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_011_08-------------------------#' -############################################################################## -# Change the value of character_set_connection to a valid value with # -# uppercase,lowercase and mixedcase # -############################################################################## -SET @@character_set_connection = UTF8; -SELECT @@character_set_connection; -SET @@character_set_connection = utf8; -SELECT @@character_set_connection; - -SET @@global.character_set_connection = uTf8; -SELECT @@global.character_set_connection; - ---echo '#--------------------FN_DYNVARS_011_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@character_set_connection = 1; -SELECT @@character_set_connection; -SET @@character_set_connection = 2; -SELECT @@character_set_connection; -SET @@character_set_connection = 3; -SELECT @@character_set_connection; -SET @@character_set_connection = 36; -SELECT @@character_set_connection; -SET @@character_set_connection = 99; -SELECT @@character_set_connection; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = 100; - - -SET @@global.character_set_connection = 1; -SELECT @@global.character_set_connection; -SET @@global.character_set_connection = 2; -SELECT @@global.character_set_connection; -SET @@global.character_set_connection = 3; -SELECT @@global.character_set_connection; -SET @@global.character_set_connection = 36; -SELECT @@global.character_set_connection; -SET @@global.character_set_connection = 99; -SELECT @@global.character_set_connection; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = 100; - -SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); -SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following '; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround'; ---echo 'several times.'; - ---echo '#--------------------FN_DYNVARS_011_10-------------------------#' -################################################################################ -# Change the value of character_set_connection to an invalid value for session # -################################################################################ ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@character_set_connection = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = 'utf8 '; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = 'lätin2'; -SET @@character_set_connection = true; -SELECT @@character_set_connection AS res_with_true; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_connection = ON; - ---echo '#--------------------FN_DYNVARS_011_11-------------------------#' -############################################################################### -# Change the value of character_set_connection to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.character_set_connection = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = 'utf'; - -SET @@global.character_set_connection = true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_connection = ON; - ---echo '#--------------------FN_DYNVARS_011_12-------------------------#' -########################################################################## -# Check if the value in GLOBAL Table matches value in variable # -########################################################################## -SELECT @@global.character_set_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_connection') AS res; -SET @@global.character_set_connection = 1; -SELECT @@global.character_set_connection; -SELECT @@global.character_set_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_connection') AS res; - ---echo '#--------------------FN_DYNVARS_011_13-------------------------#' -############################################################################ -# Check if the value in SESSION Table matches value in variable # -############################################################################ -SELECT @@character_set_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_connection') AS res; -SELECT @@local.character_set_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_connection') AS res; -SELECT @@session.character_set_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_connection') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.character_set_connection = @global_start_value; -SELECT @@global.character_set_connection; -SET @@session.character_set_connection = @session_start_value; -SELECT @@session.character_set_connection; - -############################################################# -# END OF character_set_connection TESTS # -############################################################# diff --git a/mysql-test/t/character_set_connection_func.test b/mysql-test/t/character_set_connection_func.test deleted file mode 100644 index 04883b66544..00000000000 --- a/mysql-test/t/character_set_connection_func.test +++ /dev/null @@ -1,102 +0,0 @@ -############## mysql-test\t\character_set_connection_func.test ############### -# # -# Variable Name: character_set_connection # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_connection # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_011_01-------------------------#' -########################################################################## -# Check if setting character_set_connection is changed in new connection # -########################################################################## - -#save -SET @global_character_set_connection = @@global.character_set_connection; -SET @session_character_set_connection = @@session.character_set_connection; -SET @session_character_set_client = @@session.character_set_client; -SET @session_character_set_results = @@session.character_set_results; - - -SET @@global.character_set_connection = utf8; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.character_set_connection; -SELECT @@session.character_set_connection; -disconnect con1; - ---echo '#--------------------FN_DYNVARS_011_02-------------------------#' -############################################################### -# Begin the functionality Testing of character_set_connection # -############################################################### - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -CREATE TABLE t1(b CHAR(40) character set utf8); -#============================================================================== ---echo '--verify that character_set_connection converts character_set_client--' -#============================================================================== - -SET @@session.character_set_client = utf8; -SET @@session.character_set_results = utf8; - -SET @@session.character_set_connection = latin1; -SELECT 'ÐЂЃЄ' AS utf_text; - -SET @@session.character_set_connection = utf8; -SELECT 'ÐЂЃЄ' AS utf_text; -#============================================================================== ---echo '---now inserting utf8 string with different character_set_connection--' -#============================================================================== -SET @@session.character_set_connection = ascii; -INSERT INTO t1 VALUES('ÐЂЃЄ'); -SELECT * FROM t1; -TRUNCATE TABLE t1; - -#============================================================================== ---echo '--now client & results charset in latin1 & connection charset in ascii-' -#============================================================================== -SET @@session.character_set_connection = ascii; -SET @@session.character_set_client = latin1; -SET @@session.character_set_results = latin1; -INSERT INTO t1 VALUES('ÐЂЃЄ'); -SELECT * FROM t1; -TRUNCATE TABLE t1; - -#============================================================================== -# set names should set character sets [client,connection,results] -#============================================================================== -SET NAMES utf8; -INSERT INTO t1 VALUES('ÐЂЃЄ'); -SELECT * FROM t1; -TRUNCATE TABLE t1; - -#restore -#save -SET @@global.character_set_connection = @global_character_set_connection; -SET @@session.character_set_connection = @session_character_set_connection; -SET @@session.character_set_client = @session_character_set_client; -SET @@session.character_set_results = @session_character_set_results; - -############################################################# -# End of functionality Testing for character_set_connection # -############################################################# diff --git a/mysql-test/t/character_set_database_basic.test b/mysql-test/t/character_set_database_basic.test deleted file mode 100644 index 9690fb84b5a..00000000000 --- a/mysql-test/t/character_set_database_basic.test +++ /dev/null @@ -1,273 +0,0 @@ -############## mysql-test\t\character_set_database_basic.test ################# -# # -# Variable Name: character_set_database # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: latin1 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_database # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc -################################################### -## START OF character_set_database TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.character_set_database; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@character_set_database; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.character_set_database; -SELECT @session_start_value; -# save using default access (session) -SET @session_start_value = @@session.character_set_database; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_012_01------------------#' -############################################################################## -# Test Variable access and assignment with and withoud @@ # -############################################################################## -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT character_set_database; -# assign value without @@ -SET character_set_database=utf8; -SELECT @@session.character_set_database; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.character_set_database=utf8; -# using another syntax for accessing session variable -SET session character_set_database=utf8; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session character_set_database; -# using another syntax for accessing dynamic variable -SET global character_set_database=utf8; ---Error ER_BAD_FIELD_ERROR -SELECT global character_set_database; - ---echo '#--------------------FN_DYNVARS_012_02-------------------------#' -############################################################################### -# Check the DEFAULT value of character_set_database for session and global # -############################################################################### -SET @@character_set_database = latin5; -SET @@character_set_database = DEFAULT; -SELECT @@character_set_database AS DEFAULT_VALUE; - -SET @@global.character_set_database = latin5; -SET @@global.character_set_database = DEFAULT; -SELECT @@global.character_set_database; - ---echo '#--------------------FN_DYNVARS_012_03-------------------------#' -############################################################################## -# see if setting global value changes session value and vice versa # -############################################################################## -SET @@session.character_set_database = utf8; -SELECT @@session.character_set_database; -SET @@global.character_set_database = latin2; -SELECT @@global.character_set_database; -SELECT @@session.character_set_database AS res_is_utf8; - -SET @@session.character_set_database = latin5; -SELECT @@session.character_set_database; -SELECT @@global.character_set_database AS res_is_latin2; -# composite check -SELECT @@global.character_set_database=@@session.character_set_database -AS res_is_false; - ---echo '#--------------------FN_DYNVARS_012_04-------------------------#' -############################################################################## -# Check if accessing variable with and without session point to session # -# variable # -############################################################################## -SELECT @@character_set_database = @@session.character_set_database AS res; -SELECT @@character_set_database = @@local.character_set_database AS res; - ---echo '#--------------------FN_DYNVARS_012_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@character_set_database = utf8 + latin2; - ---echo '#--------------------FN_DYNVARS_012_06-------------------------#' -############################################################################# -# Change the value of character_set_database to a valid value for session # -############################################################################# - -let charset_variable = @@session.character_set_database; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_012_07-------------------------#' -############################################################################## -# Change the value of character_set_database to a valid value for global # -############################################################################## - -let charset_variable = @@global.character_set_database; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_012_08-------------------------#' -############################################################################## -# Change the value of character_set_database to a valid value with uppercase,# -# lowercase and mixedcase # -############################################################################## -SET @@character_set_database = UTF8; -SELECT @@character_set_database; -SET @@character_set_database = utf8; -SELECT @@character_set_database; - -SET @@global.character_set_database = uTf8; -SELECT @@global.character_set_database; - ---echo '#--------------------FN_DYNVARS_012_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@character_set_database = 1; -SELECT @@character_set_database; -SET @@character_set_database = 2; -SELECT @@character_set_database; -SET @@character_set_database = 3; -SELECT @@character_set_database; -SET @@character_set_database = 36; -SELECT @@character_set_database; -SET @@character_set_database = 99; -SELECT @@character_set_database; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_database = 100; - - -SET @@global.character_set_database = 1; -SELECT @@global.character_set_database; -SET @@global.character_set_database = 2; -SELECT @@global.character_set_database; -SET @@global.character_set_database = 3; -SELECT @@global.character_set_database; -SET @@global.character_set_database = 36; -SELECT @@global.character_set_database; -SET @@global.character_set_database = 99; -SELECT @@global.character_set_database; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = 100; - - -SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); -SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following'; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround several times.'; - ---echo '#--------------------FN_DYNVARS_012_10-------------------------#' -############################################################################## -# Change the value of character_set_database to an invalid value for session # -############################################################################## ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_database = "grek"; ---Error ER_PARSE_ERROR -SET @@character_set_database = utf 8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_database = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@character_set_database = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_database = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_database = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_database = 'latin 2'; -SET @@character_set_database = true; -SELECT @@character_set_database AS res_with_true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_database = ON; - ---echo '#--------------------FN_DYNVARS_012_11-------------------------#' -############################################################################### -# Change the value of character_set_database to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.character_set_database = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = 'utf'; - -SET @@global.character_set_database = true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_database = ON; - ---echo '#--------------------FN_DYNVARS_012_12-------------------------#' -############################################################################ -# Check if the value in GLOBAL Table matches value in variable # -############################################################################ -SELECT @@global.character_set_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_database') AS res; -SET @@global.character_set_database = 1; -SELECT @@global.character_set_database; -SELECT @@global.character_set_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_database') AS res; - ---echo '#--------------------FN_DYNVARS_012_13-------------------------#' -############################################################################## -# Check if the value in SESSION Table matches value in variable # -############################################################################## -SELECT @@character_set_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_database') AS res; -SELECT @@local.character_set_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_database') AS res; -SELECT @@session.character_set_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_database') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.character_set_database = @global_start_value; -SELECT @@global.character_set_database; -SET @@session.character_set_database = @session_start_value; -SELECT @@session.character_set_database; - -############################################################# -# END OF character_set_database TESTS # -############################################################# diff --git a/mysql-test/t/character_set_database_func.test b/mysql-test/t/character_set_database_func.test deleted file mode 100644 index b2d2d017d64..00000000000 --- a/mysql-test/t/character_set_database_func.test +++ /dev/null @@ -1,115 +0,0 @@ -############## mysql-test\t\character_set_database_func.test ################# -# # -# Variable Name: character_set_database # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: latin1 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_database # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_utf8.inc - ---echo '#--------------------FN_DYNVARS_008_01-------------------------#' -######################################################################## -# Check if setting character_set_database is changed in new connection # -######################################################################## -#save -SET @global_character_set_database = @@global.character_set_database; -SET @session_character_set_database = @@session.character_set_database; -SET @session_character_set_server = @@session.character_set_server; - -SET @@global.character_set_database = utf8; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.character_set_database; -SELECT @@session.character_set_database; ---echo 'Bug#35356: session character_set_database differ from global character_set_database' -disconnect con1; - ---echo '#--------------------FN_DYNVARS_008_02-------------------------#' -############################################################# -# Begin the functionality Testing of character_set_database # -############################################################# - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -#============================================================================== ---echo '--check if setting session character_set_database effects new databases' -#============================================================================== - -SET @@session.character_set_server = utf8; -SELECT @@session.character_set_database; -SET @@session.character_set_database = latin5; -SELECT @@session.character_set_database; - -CREATE DATABASE db1; -USE db1; -SHOW CREATE DATABASE db1; -CREATE TABLE t1(a INT, b VARCHAR(40)); -SHOW CREATE TABLE t1; -DROP TABLE t1; -DROP DATABASE db1; - ---echo 'Bug#35357: character_set_database does not effects CREATE DATABASE without characater set' - -#============================================================================== ---echo '--ascii character set specified--' -#============================================================================== -CREATE DATABASE db1 CHARACTER SET ascii; -USE db1; -SHOW CREATE DATABASE db1; -CREATE TABLE t1(a INT, b VARCHAR(40)); -SHOW CREATE TABLE t1; -DROP TABLE t1; -DROP DATABASE db1; - -#============================================================================== ---echo '------Check if load data uses character_set_database----------' -#============================================================================== - -USE test; -CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8) ENGINE=MyISAM CHARACTER SET utf8; - ---echo 'Verify with latin'; -SET @@session.character_set_database = latin1; ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1; -SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1; -TRUNCATE TABLE t1; - ---echo 'Verify with utf8'; -SET @@session.character_set_database = utf8; ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/charset_utf8.txt' INTO TABLE t1; -SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -#restore -SET @@global.character_set_database = @global_character_set_database; -SET @@session.character_set_database = @session_character_set_database; -SET @@session.character_set_server = @session_character_set_server; -############################################################ -# End of functionality Testing for character_set_database # -############################################################ diff --git a/mysql-test/t/character_set_filesystem_basic.test b/mysql-test/t/character_set_filesystem_basic.test deleted file mode 100644 index 0117145a06b..00000000000 --- a/mysql-test/t/character_set_filesystem_basic.test +++ /dev/null @@ -1,255 +0,0 @@ -############## mysql-test\t\character_set_filesystem_basic.test ############### -# # -# Variable Name: character_set_filesystem # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: latin5 # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_filesystem # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc - -################################################### -## START OF character_set_filesystem TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.character_set_filesystem; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@character_set_filesystem; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.character_set_filesystem; -SELECT @session_start_value; -# save using default access (session) -SET @session_start_value = @@session.character_set_filesystem; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_008_01------------------#' -############################################################################### -# Test Variable access and assignment with and without @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT character_set_filesystem; -# assign value without @@ -SET character_set_filesystem=utf8; -SELECT @@session.character_set_filesystem; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.character_set_filesystem=utf8; -# using another syntax for accessing session variable -SET session character_set_filesystem=utf8; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session character_set_filesystem; -# using another syntax for accessing dynamic variable -SET global character_set_filesystem=utf8; ---Error ER_BAD_FIELD_ERROR -SELECT global character_set_filesystem; - ---echo '#--------------------FN_DYNVARS_008_02-------------------------#' -############################################################################### -# Check the DEFAULT value of character_set_filesystem for session and global # -############################################################################### -SET @@character_set_filesystem = latin5; -SET @@character_set_filesystem = DEFAULT; -SELECT @@character_set_filesystem AS DEFAULT_VALUE; - -SET @@global.character_set_filesystem = latin5; -SET @@global.character_set_filesystem = DEFAULT; -SELECT @@global.character_set_filesystem AS DEFAULT_VALUE; - ---echo '#--------------------FN_DYNVARS_008_03-------------------------#' -############################################################################ -# see if setting global value changes session value and vice versa # -############################################################################ -SET @@session.character_set_filesystem = utf8; -SELECT @@session.character_set_filesystem; -SET @@global.character_set_filesystem = latin2; -SELECT @@global.character_set_filesystem; -SELECT @@session.character_set_filesystem AS res_is_utf8; - -SET @@session.character_set_filesystem = latin5; -SELECT @@session.character_set_filesystem; -SELECT @@global.character_set_filesystem AS res_is_latin2; -# composite check -SELECT @@global.character_set_filesystem= - @@session.character_set_filesystem AS res_is_false; - ---echo '#--------------------FN_DYNVARS_008_04-------------------------#' -################################################################################ -# Check if accessing variable with & without session point to session variable # -################################################################################ -SELECT @@character_set_filesystem = @@session.character_set_filesystem AS res; -SELECT @@character_set_filesystem = @@local.character_set_filesystem AS res; - ---echo '#--------------------FN_DYNVARS_008_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@character_set_filesystem = utf8 + latin2; - ---echo '#--------------------FN_DYNVARS_008_06-------------------------#' -############################################################################### -# Change the value of character_set_filesystem to a valid value for session # -############################################################################### - -let charset_variable = @@session.character_set_filesystem; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_008_07-------------------------#' -############################################################################## -# Change the value of character_set_filesystem to a valid value for global # -############################################################################## - -let charset_variable = @@global.character_set_filesystem; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_008_08-------------------------#' -######################################################################### -# Change the value of character_set_filesystem to a valid value with # -# uppercase,lowercase and mixedcase # -######################################################################### -SET @@character_set_filesystem = UTF8; -SELECT @@character_set_filesystem; -SET @@character_set_filesystem = utf8; -SELECT @@character_set_filesystem; -SET @@character_set_filesystem = uTf8; -SELECT @@character_set_filesystem; - ---echo '#--------------------FN_DYNVARS_008_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@character_set_filesystem = 1; -SELECT @@character_set_filesystem; -SET @@character_set_filesystem = 2; -SELECT @@character_set_filesystem; -SET @@character_set_filesystem = 3; -SELECT @@character_set_filesystem; -SET @@character_set_filesystem = 36; -SELECT @@character_set_filesystem; -SET @@character_set_filesystem = 99; -SELECT @@character_set_filesystem; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = 100; - -SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); -SELECT @total_charset; -echo 'Bug # 34843: character sets are mapped in such a way that 100 and following '; -echo 'numbers give error, and before 100 the 36 mapped wraps arround several times.'; - ---echo '#--------------------FN_DYNVARS_008_10-------------------------#' -################################################################################ -# Change the value of character_set_filesystem to an invalid value for session # -################################################################################ ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@character_set_filesystem = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = 'utf'; -SET @@character_set_filesystem = true; -SELECT @@character_set_filesystem AS res_with_true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_filesystem = ON; - ---echo '#--------------------FN_DYNVARS_008_11-------------------------#' -################################################################################ -# Change the value of character_set_filesystem to an invalid value for global # -################################################################################ ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_filesystem = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_filesystem = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_filesystem = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.character_set_filesystem = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_filesystem = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_filesystem = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_filesystem = 'utf'; - -SET @@global.character_set_filesystem = true; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_filesystem = ON; - ---echo '#--------------------FN_DYNVARS_008_12-------------------------#' -############################################################################## -# Check if the value in GLOBAL Table matches value in variable # -############################################################################## -SELECT @@global.character_set_filesystem = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_filesystem') AS res; -SET @@global.character_set_filesystem = 1; -SELECT @@global.character_set_filesystem; -SELECT @@global.character_set_filesystem = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_filesystem') AS res; - ---echo '#--------------------FN_DYNVARS_008_13-------------------------#' -############################################################################# -# Check if the value in SESSION Table matches value in variable # -############################################################################# -SELECT @@character_set_filesystem = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_filesystem') AS res; -SELECT @@local.character_set_filesystem = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_filesystem') AS res; -SELECT @@session.character_set_filesystem = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_filesystem') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.character_set_filesystem = @global_start_value; -SELECT @@global.character_set_filesystem; -SET @@session.character_set_filesystem = @session_start_value; -SELECT @@session.character_set_filesystem; - -############################################################# -# END OF character_set_filesystem TESTS # -############################################################# diff --git a/mysql-test/t/character_set_filesystem_func-master.opt b/mysql-test/t/character_set_filesystem_func-master.opt deleted file mode 100644 index 52a49182a53..00000000000 --- a/mysql-test/t/character_set_filesystem_func-master.opt +++ /dev/null @@ -1 +0,0 @@ ---secure-file-priv=$MYSQL_TEST_DIR --innodb diff --git a/mysql-test/t/character_set_results_basic.test b/mysql-test/t/character_set_results_basic.test deleted file mode 100644 index aae05c824d1..00000000000 --- a/mysql-test/t/character_set_results_basic.test +++ /dev/null @@ -1,271 +0,0 @@ -############## mysql-test\t\character_set_results_basic.test ################## -# # -# Variable Name: character_set_results # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_results # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc -################################################ -## START OF character_set_results TESTS ## -################################################ - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.character_set_results; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@character_set_results; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.character_set_results; -SELECT @session_start_value; -# save using default access (session) -SET @session_start_value = @@session.character_set_results; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_013_01------------------#' -############################################################################## -# Test Variable access and assignment with and withoud @@ # -############################################################################## -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT character_set_results; -# assign value without @@ -SET character_set_results=utf8; -SELECT @@session.character_set_results; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.character_set_results=utf8; -# using another syntax for accessing session variable -SET session character_set_results=utf8; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session character_set_results; -# using another syntax for accessing dynamic variable -SET global character_set_results=utf8; ---Error ER_BAD_FIELD_ERROR -SELECT global character_set_results; - ---echo '#--------------------FN_DYNVARS_013_02-------------------------#' -############################################################################### -# Check the DEFAULT value of character_set_results for session and global # -############################################################################### -SET @@character_set_results = latin5; -SET @@character_set_results = DEFAULT; -SELECT @@character_set_results AS DEFAULT_VALUE; - -SET @@global.character_set_results = latin5; -SET @@global.character_set_results = DEFAULT; -SELECT @@global.character_set_results; - ---echo '#--------------------FN_DYNVARS_013_03-------------------------#' -############################################################################### -# see if setting global value changes session value and vice versa # -############################################################################### -SET @@session.character_set_results = utf8; -SELECT @@session.character_set_results; -SET @@global.character_set_results = latin2; -SELECT @@global.character_set_results; -SELECT @@session.character_set_results AS res_is_utf8; - -SET @@session.character_set_results = latin5; -SELECT @@session.character_set_results; -SELECT @@global.character_set_results AS res_is_latin2; -# composite check -SELECT @@global.character_set_results=@@session.character_set_results -AS res_is_false; - ---echo '#--------------------FN_DYNVARS_013_04-------------------------#' -################################################################### -# Check if accessing variable with and without session point to # -# session variable # -################################################################### -SELECT @@character_set_results = @@session.character_set_results AS res; -SELECT @@character_set_results = @@local.character_set_results AS res; - ---echo '#--------------------FN_DYNVARS_013_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@character_set_results = utf8 + latin2; - ---echo '#--------------------FN_DYNVARS_013_06-------------------------#' -############################################################################## -# Change the value of character_set_results to a valid value for session # -############################################################################## - -let charset_variable = @@session.character_set_results; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_013_07-------------------------#' -############################################################################### -# Change the value of character_set_results to a valid value for global # -############################################################################### - -let charset_variable = @@global.character_set_results; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_013_08-------------------------#' -################################################################################ -# Change the value of character_set_results to a valid value with uppercase, # -# lowercase and mixedcase # -################################################################################ -SET @@character_set_results = UTF8; -SELECT @@character_set_results; -SET @@character_set_results = utf8; -SELECT @@character_set_results; - -SET @@global.character_set_results = uTf8; -SELECT @@global.character_set_results; - ---echo '#--------------------FN_DYNVARS_013_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@character_set_results = 1; -SELECT @@character_set_results; -SET @@character_set_results = 2; -SELECT @@character_set_results; -SET @@character_set_results = 3; -SELECT @@character_set_results; -SET @@character_set_results = 36; -SELECT @@character_set_results; -SET @@character_set_results = 99; -SELECT @@character_set_results; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = 100; - -SET @@global.character_set_results = 1; -SELECT @@global.character_set_results; -SET @@global.character_set_results = 2; -SELECT @@global.character_set_results; -SET @@global.character_set_results = 3; -SELECT @@global.character_set_results; -SET @@global.character_set_results = 36; -SELECT @@global.character_set_results; -SET @@global.character_set_results = 99; -SELECT @@global.character_set_results; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = 100; - -SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); -SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following'; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround several times.'; - ---echo '#--------------------FN_DYNVARS_013_10-------------------------#' -############################################################################### -# Change the value of character_set_results to an invalid value for session # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@character_set_results = .1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = ""; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = 'utf'; -SET @@character_set_results = true; -SELECT @@character_set_results AS res_with_true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_results = ON; - ---echo '#--------------------FN_DYNVARS_013_11-------------------------#' -############################################################################### -# Change the value of character_set_results to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = "'latin2'"; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.character_set_results = 0.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = ""; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = 'utf'; - -SET @@global.character_set_results = true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_results = ON; - ---echo '#--------------------FN_DYNVARS_013_12-------------------------#' -############################################################################## -# Check if the value in GLOBAL Table matches value in variable # -############################################################################## -SELECT @@global.character_set_results = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_results') AS res; -SET @@global.character_set_results = 1; -SELECT @@global.character_set_results; -SELECT @@global.character_set_results = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_results') AS res; - ---echo '#--------------------FN_DYNVARS_013_13-------------------------#' -############################################################################## -# Check if the value in SESSION Table matches value in variable # -############################################################################## -SELECT @@character_set_results = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_results') AS res; -SELECT @@local.character_set_results = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_results') AS res; -SELECT @@session.character_set_results = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_results') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.character_set_results = @global_start_value; -SELECT @@global.character_set_results; -SET @@session.character_set_results = @session_start_value; -SELECT @@session.character_set_results; - -############################################################# -# END OF character_set_results TESTS # -############################################################# diff --git a/mysql-test/t/character_set_results_func.test b/mysql-test/t/character_set_results_func.test deleted file mode 100644 index df7437f225f..00000000000 --- a/mysql-test/t/character_set_results_func.test +++ /dev/null @@ -1,102 +0,0 @@ -############## mysql-test\t\character_set_results_func.test ################## -# # -# Variable Name: character_set_results # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_results # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_012_01-------------------------#' -####################################################################### -# Check if setting character_set_results is changed in new connection # -####################################################################### - -# save -SET @global_character_set_results = @@global.character_set_results; -SET @session_character_set_results = @@session.character_set_results; - - -SET @@global.character_set_results = utf8; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.character_set_results; -SELECT @@session.character_set_results; -disconnect con1; - - ---echo '#--------------------FN_DYNVARS_012_02-------------------------#' -############################################################# -# Begin the functionality Testing of character_set_results # -############################################################# - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1(b CHAR(40) character set utf8); -SET NAMES utf8; - -#============================================================================== ---echo '----check string literals against different character_set_results---' -#============================================================================== ---echo check if results are converted to character_set_results -SET @@session.character_set_results = greek; -SELECT 'ÐЂЃЄ' AS utf_text; - ---echo check effect of character_set_results when introducers are used -SET @@session.character_set_results = latin1; -SELECT _latin1'Müller' AS latin1_text; -SET @@session.character_set_results = ascii; -SELECT _latin1'Müller' AS latin1_text; - ---echo check when we dont want any conversion -SET @@session.character_set_results = NULL; -SELECT 'ÐЂЃЄ' AS utf_text; - -#============================================================================== ---echo '---check results from table against different character_set_results--' -#============================================================================== -INSERT INTO t1 VALUES(_utf8'ÐЂЃЄ'); -INSERT INTO t1 VALUES('ФХЦЧШ'); - -SET @@session.character_set_results = NULL; -SELECT b, CHAR_LENGTH(b) FROM t1; - -SET @@session.character_set_results = utf8; -SELECT b, CHAR_LENGTH(b) FROM t1; - -SET @@session.character_set_results = koi8r; -SELECT b, CHAR_LENGTH(b) FROM t1; - -SET @@session.character_set_results = cp1250; -SELECT b, CHAR_LENGTH(b) FROM t1; - -DROP TABLE t1; -# restore ---echo 'connection default;' -connection default; -SET @@global.character_set_results = @global_character_set_results; -SET @@session.character_set_results = @session_character_set_results; - -########################################################## -# End of functionality Testing for character_set_results # -########################################################## - diff --git a/mysql-test/t/character_set_server_basic.test b/mysql-test/t/character_set_server_basic.test deleted file mode 100644 index 2b3c078363a..00000000000 --- a/mysql-test/t/character_set_server_basic.test +++ /dev/null @@ -1,272 +0,0 @@ -############## mysql-test\t\character_set_server_basic.test ################### -# # -# Variable Name: character_set_server # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_server # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc - -################################################### -## START OF character_set_server TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.character_set_server; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@character_set_server; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.character_set_server; -SELECT @session_start_value; -# save using default access (session) -SET @session_start_value = @@session.character_set_server; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_009_01------------------#' -############################################################################### -# Test Variable access and assignment with and withoud @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT character_set_server; -# assign value without @@ -SET character_set_server=utf8; -SELECT @@session.character_set_server; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.character_set_server=utf8; -# using another syntax for accessing session variable -SET session character_set_server=utf8; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session character_set_server; -# using another syntax for accessing dynamic variable -SET global character_set_server=utf8; ---Error ER_BAD_FIELD_ERROR -SELECT global character_set_server; - ---echo '#--------------------FN_DYNVARS_009_02-------------------------#' -############################################################################### -# Check the DEFAULT value of character_set_server for session and global # -############################################################################### -SET @@character_set_server = latin5; -SET @@character_set_server = DEFAULT; -SELECT @@character_set_server AS DEFAULT_VALUE; - -SET @@global.character_set_server = latin5; -SET @@global.character_set_server = DEFAULT; -SELECT @@global.character_set_server; - ---echo '#--------------------FN_DYNVARS_009_03-------------------------#' -############################################################################### -# see if setting global value changes session value and vice versa # -############################################################################### -SET @@session.character_set_server = utf8; -SELECT @@session.character_set_server; -SET @@global.character_set_server = latin2; -SELECT @@global.character_set_server; -SELECT @@session.character_set_server AS res_is_utf8; - -SET @@session.character_set_server = latin5; -SELECT @@session.character_set_server; -SELECT @@global.character_set_server AS res_is_latin2; -# composite check -SELECT @@global.character_set_server=@@session.character_set_server -AS res_is_false; - ---echo '#--------------------FN_DYNVARS_009_04-------------------------#' -############################################################################### -# Check if accessing variable with and without session point # -# to session variable # -############################################################################### -SELECT @@character_set_server = @@session.character_set_server AS res; -SELECT @@character_set_server = @@local.character_set_server AS res; - ---echo '#--------------------FN_DYNVARS_009_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@character_set_server = utf8 + latin2; - ---echo '#--------------------FN_DYNVARS_009_06-------------------------#' -############################################################################### -# Change the value of character_set_server to a valid value for session # -############################################################################### - -let charset_variable = @@session.character_set_server; - ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_009_07-------------------------#' -############################################################################### -# Change the value of character_set_server to a valid value for global # -############################################################################### - -let charset_variable = @@global.character_set_server; ---source include/charset_basic.inc - - ---echo '#--------------------FN_DYNVARS_009_08-------------------------#' -############################################################################### -# Change the value of character_set_server to a valid value with uppercase, # -# lowercase and mixedcase # -############################################################################### -SET @@character_set_server = UTF8; -SELECT @@character_set_server; -SET @@character_set_server = utf8; -SELECT @@character_set_server; - -SET @@global.character_set_server = uTf8; -SELECT @@global.character_set_server; - ---echo '#--------------------FN_DYNVARS_009_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@character_set_server = 1; -SELECT @@character_set_server; -SET @@character_set_server = 2; -SELECT @@character_set_server; -SET @@character_set_server = 3; -SELECT @@character_set_server; -SET @@character_set_server = 36; -SELECT @@character_set_server; -SET @@character_set_server = 99; -SELECT @@character_set_server; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = 100; - -SET @@global.character_set_server = 1; -SELECT @@global.character_set_server; -SET @@global.character_set_server = 2; -SELECT @@global.character_set_server; -SET @@global.character_set_server = 36; -SELECT @@global.character_set_server; -SET @@global.character_set_server = 99; -SELECT @@global.character_set_server; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = 100; - -SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS); -SELECT @total_charset; ---echo 'Bug # 34843: character sets are mapped in such a way that 100 and following '; ---echo 'numbers gives error, and before 100 the 36 mapped wraps arround '; ---echo 'several times.'; - ---echo '#--------------------FN_DYNVARS_009_10-------------------------#' -############################################################################### -# Change the value of character_set_server to an invalid value for session # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@character_set_server = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = 'utf'; -SET @@character_set_server = true; -SELECT @@character_set_server AS res_with_true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@character_set_server = ON; - ---echo '#--------------------FN_DYNVARS_009_11-------------------------#' -############################################################################### -# Change the value of character_set_server to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = abc; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = 1utf8; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.character_set_server = 1.1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = -1; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = ''; ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = 'utf'; - -SET @@global.character_set_server = true; - ---Error ER_UNKNOWN_CHARACTER_SET -SET @@global.character_set_server = ON; - ---echo '#--------------------FN_DYNVARS_009_12-------------------------#' -############################################################################### -# Check if the value in GLOBAL Table matches value in variable # -############################################################################### -SELECT @@global.character_set_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_server') AS res; -SET @@global.character_set_server = 1; -SELECT @@global.character_set_server; -SELECT @@global.character_set_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='character_set_server') AS res; - ---echo '#--------------------FN_DYNVARS_009_13-------------------------#' -############################################################################### -# Check if the value in SESSION Table matches value in variable # -############################################################################### -SELECT @@character_set_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_server') AS res; -SELECT @@local.character_set_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_server') AS res; -SELECT @@session.character_set_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='character_set_server') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.character_set_server = @global_start_value; -SELECT @@global.character_set_server; -SET @@session.character_set_server = @session_start_value; -SELECT @@session.character_set_server; - -############################################################# -# END OF character_set_server TESTS # -############################################################# diff --git a/mysql-test/t/character_set_server_func.test b/mysql-test/t/character_set_server_func.test deleted file mode 100644 index c17568c35ea..00000000000 --- a/mysql-test/t/character_set_server_func.test +++ /dev/null @@ -1,106 +0,0 @@ -############## mysql-test\t\character_set_server_func.test ################### -# # -# Variable Name: character_set_server # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: utf8 (session), latin1 (global) # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable character_set_server # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---echo '#--------------------FN_DYNVARS_009_01-------------------------#' -###################################################################### -# Check if setting character_set_server is changed in new connection # -###################################################################### - -#save -SET @global_character_set_server = @@global.character_set_server; -SET @session_character_set_server = @@session.character_set_server; - - -SET @@global.character_set_server = utf8; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.character_set_server; -SELECT @@session.character_set_server; -disconnect con1; - ---echo '#--------------------FN_DYNVARS_009_02-------------------------#' -############################################################# -# Begin the functionality Testing of character_set_server # -############################################################# - ---echo 'connection default' -connection default; -#The server character set and collation are used as default values if the database -#character set and collation are not specified in CREATE DATABASE statements. - -#============================================================================== ---echo '---global character_set_server should not effects current connection---' -#============================================================================== - -SET @@global.character_set_server = utf8; -CREATE DATABASE db1; -USE db1; -SHOW CREATE DATABASE db1; -DROP DATABASE db1; -select @@character_set_database; - -#============================================================================== ---echo '---session character_set_server should effects current connection---' -#============================================================================== -SET @@session.character_set_server = utf8; -CREATE DATABASE db1; -USE db1; -SHOW CREATE DATABASE db1; -DROP DATABASE db1; -select @@character_set_database; - -#============================================================================== ---echo '----test with new connection----' -#============================================================================== - ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; - -SELECT @@session.character_set_server; - ---echo '----------character set not specified---------' -CREATE DATABASE db1; -USE db1; -SHOW CREATE DATABASE db1; -DROP DATABASE db1; -SELECT @@character_set_database; - ---echo '----------ascii character set specified----------' -CREATE DATABASE db1 character set ascii; -USE db1; -SHOW CREATE DATABASE db1; -DROP DATABASE db1; -select @@character_set_database; - -disconnect con1; - -#restore ---echo 'connection default;' -connection default; -SET @@global.character_set_server = @global_character_set_server; -SET @@session.character_set_server = @session_character_set_server; - -############################################################ -# End of functionality Testing for character_set_server # -############################################################ diff --git a/mysql-test/t/character_set_system_basic.test b/mysql-test/t/character_set_system_basic.test deleted file mode 100644 index 9d59b313efc..00000000000 --- a/mysql-test/t/character_set_system_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\character_set_system_basic.test ############### -# # -# Variable Name: character_set_system # -# Scope: Global # -# Access Type: Static # -# Data Type: string # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable character_set_system # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_003_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.character_set_system); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_003_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.character_set_system=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.character_set_system); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_003_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.character_set_system = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='character_set_system'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.character_set_system); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='character_set_system'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_003_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@character_set_system = @@GLOBAL.character_set_system; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_003_05----------------------#' -################################################################################ -# Check if character_set_system can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@character_set_system); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.character_set_system); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.character_set_system); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.character_set_system); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT character_set_system = @@SESSION.character_set_system; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/collation_connection_basic.test b/mysql-test/t/collation_connection_basic.test deleted file mode 100644 index f3544dd306e..00000000000 --- a/mysql-test/t/collation_connection_basic.test +++ /dev/null @@ -1,265 +0,0 @@ -############## mysql-test\t\collation_connection_basic.test ################### -# # -# Variable Name: collation_connection # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable collation_connection # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc - -################################################### -## START OF collation_connection TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.collation_connection; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@collation_connection; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.collation_connection; -SELECT @session_start_value; -# save using implicit session scope -SET @session_start_value = @@session.collation_connection; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_015_01------------------#' -############################################################################### -# Test Variable access and assignment with and without @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT collation_connection; -# assign value without @@ -SET collation_connection=utf8_unicode_ci; -SELECT @@session.collation_connection; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.collation_connection=utf8_unicode_ci; -# using another syntax for accessing session variable -SET session collation_connection=utf8_unicode_ci; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session collation_connection; -# using another syntax for accessing dynamic variable -SET global collation_connection=utf8_unicode_ci; ---Error ER_BAD_FIELD_ERROR -SELECT global collation_connection; - ---echo '#--------------------FN_DYNVARS_015_02-------------------------#' -############################################################################### -# Check the DEFAULT value of collation_connection for session and global # -############################################################################### -SET @@collation_connection = latin1_bin; -SET @@collation_connection = DEFAULT; -SELECT @@collation_connection AS DEFAULT_VALUE; - -SET @@global.collation_connection = latin1_bin; -SET @@global.collation_connection = DEFAULT; -SELECT @@global.collation_connection; - ---echo '#--------------------FN_DYNVARS_015_03-------------------------#' -############################################################################## -# see if setting global value changes session value and vice versa # -############################################################################## -SET @@session.collation_connection = utf8_polish_ci; -SELECT @@session.collation_connection; -SET @@global.collation_connection = latin7_general_ci; -SELECT @@global.collation_connection; -SELECT @@session.collation_connection AS res_is_utf8_polish_ci; - -SET @@session.collation_connection = latin7_bin; -SELECT @@session.collation_connection; -SELECT @@global.collation_connection AS res_is_latin7_general_ci; -# composite check -SELECT @@global.collation_connection=@@session.collation_connection -AS res_is_false; - ---echo '#--------------------FN_DYNVARS_015_04-------------------------#' -############################################################################### -# Check if accessing variable with and without session point to session # -# variable # -############################################################################### -SELECT @@collation_connection = @@session.collation_connection AS res; -SELECT @@collation_connection = @@local.collation_connection AS res; - ---echo '#--------------------FN_DYNVARS_015_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@collation_connection = latin7_general_ci + latin7_general_cs; - ---echo '#--------------------FN_DYNVARS_015_06-------------------------#' -############################################################################### -# Change the value of collation_connection to a valid value for session # -############################################################################### - -let collation_variable = @@session.collation_connection; ---source include/collation_basic.inc - - ---echo '#--------------------FN_DYNVARS_015_07-------------------------#' -############################################################################### -# Change the value of collation_connection to a valid value for global # -############################################################################### - -let collation_variable = @@global.collation_connection; ---source include/collation_basic.inc - - ---echo '#--------------------FN_DYNVARS_015_08-------------------------#' -############################################################################## -# Change the value of collation_connection to a valid value with uppercase, # -# lowercase and mixedcase # -############################################################################## -SET @@collation_connection = LATIN7_GENERAL_CS; -SELECT @@collation_connection; -SET @@collation_connection = latin7_general_cs; -SELECT @@collation_connection; - -SET @@global.collation_connection = Latin7_GeneRal_cS; -SELECT @@global.collation_connection; - - ---echo '#--------------------FN_DYNVARS_015_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@collation_connection = 1; -SELECT @@collation_connection; -SET @@collation_connection = 2; -SELECT @@collation_connection; -SET @@collation_connection = 3; -SELECT @@collation_connection; -SET @@collation_connection = 99; -SELECT @@collation_connection; ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = 100; - -SET @@global.collation_connection = 1; -SELECT @@global.collation_connection; -SET @@global.collation_connection = 2; -SELECT @@global.collation_connection; -SET @@global.collation_connection = 3; -SELECT @@global.collation_connection; -SET @@global.collation_connection = 99; -SELECT @@global.collation_connection; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = 100; - -SET @total_collations = (SELECT count(*) FROM INFORMATION_SCHEMA.COLLATIONS); -SELECT @total_collations > 120; - ---echo '#--------------------FN_DYNVARS_015_10-------------------------#' -############################################################################### -# Change the value of collation_connection to an invalid value for session # -############################################################################### ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = latin7_binary; ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = 'eucjpms_japanese_cs'; ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@collation_connection = 1.01; ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = -1; ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = ''; ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = ' eucjpms_bin'; -SET @@collation_connection = true; -SELECT @@collation_connection AS res_with_true; - ---Error ER_UNKNOWN_COLLATION -SET @@collation_connection = ON; - ---echo '#--------------------FN_DYNVARS_015_11-------------------------#' -############################################################################### -# Change the value of collation_connection to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = latin7_binary; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = 'eucjpms_japanese_cs'; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.collation_connection = 1.1; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = -1; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = ""; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = ' eucjpms_bin'; - -SET @@global.collation_connection = true; - ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_connection = ON; - ---echo '#--------------------FN_DYNVARS_015_12-------------------------#' -############################################################################## -# Check if the value in GLOBAL Table matches value in variable # -############################################################################## -SELECT @@global.collation_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='collation_connection') AS res; -SET @@global.collation_connection = 1; -SELECT @@global.collation_connection; -SELECT @@global.collation_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='collation_connection') AS res; - ---echo '#--------------------FN_DYNVARS_015_13-------------------------#' -############################################################################### -# Check if the value in SESSION Table matches value in variable # -############################################################################### -SELECT @@collation_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_connection') AS res; -SELECT @@local.collation_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_connection') AS res; -SELECT @@session.collation_connection = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_connection') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.collation_connection = @global_start_value; -SELECT @@global.collation_connection; -SET @@session.collation_connection = @session_start_value; -SELECT @@session.collation_connection; - -############################################################# -# END OF collation_connection TESTS # -############################################################# diff --git a/mysql-test/t/collation_connection_func.test b/mysql-test/t/collation_connection_func.test deleted file mode 100644 index bdb2efd9959..00000000000 --- a/mysql-test/t/collation_connection_func.test +++ /dev/null @@ -1,95 +0,0 @@ -############## mysql-test\t\collation_connection_func.test ################### -# # -# Variable Name: collation_connection # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable collation_connection # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_015_01-------------------------#' -###################################################################### -# Check if setting collation_connection is changed in new connection # -###################################################################### -SET @global_collation_connection = @@global.collation_connection; -SET @session_collation_connection = @@session.collation_connection; - -SET @@global.collation_connection = latin1_danish_ci; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.collation_connection; -SELECT @@session.collation_connection; -disconnect con1; - ---echo '#--------------------FN_DYNVARS_015_02-------------------------#' -########################################################### -# Begin the functionality Testing of collation_connection # -########################################################### - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -#============================================================================== ---echo '----check if collation_connection update character_set_connection---' -#============================================================================== - -SET @@session.collation_connection = utf8_spanish_ci; -SELECT @@collation_connection, @@character_set_database; - -#============================================================================== ---echo '---check if collation_connection works for literal string comparision--' -#============================================================================== -SET @@session.collation_connection = latin1_swedish_ci; -SELECT 'mysql'='MySql'; -SELECT _latin2'mysql' COLLATE latin2_general_ci='MySql'; -SELECT _utf8'mysql'=_utf8'MySql' COLLATE utf8_unicode_ci; - -SET @@session.collation_connection = latin1_general_cs; -SELECT 'mysql'='MySql'; -SELECT _latin2'mysql'COLLATE latin2_general_ci='MySql'; ---Error ER_CANT_AGGREGATE_2COLLATIONS -SELECT _utf8'mysql'COLLATE utf8_danish_ci=_utf8'MySql'COLLATE utf8_unicode_ci; - -#============================================================================== ---echo '---collation_connection does not effect comparision with column---' -#============================================================================== -# fill table with some test data -CREATE TABLE t1(a CHAR(20)CHARACTER SET latin1 COLLATE latin1_german2_ci); -INSERT INTO t1 VALUES('Müller'); - - -SET @@session.collation_connection = latin2_hungarian_ci; -SELECT * FROM t1 WHERE a='Müller'; - -SET @@session.collation_connection = latin1_general_cs; -SELECT * FROM t1 WHERE a='müller'; - ---echo 'check if string literal collation is used'; -SELECT * FROM t1 WHERE a='müller' COLLATE latin1_general_cs; -SELECT * FROM t1 WHERE a='müller' COLLATE latin1_german1_ci; - -# clean up -DROP TABLE t1; -SET @@global.collation_connection = @global_collation_connection; -SET @@session.collation_connection = @session_collation_connection; -######################################################### -# End of functionality Testing for collation_connection # -######################################################### diff --git a/mysql-test/t/collation_database_basic.test b/mysql-test/t/collation_database_basic.test deleted file mode 100644 index c130e276084..00000000000 --- a/mysql-test/t/collation_database_basic.test +++ /dev/null @@ -1,264 +0,0 @@ -############## mysql-test\t\collation_database_basic.test ##################### -# # -# Variable Name: collation_database # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable collation_database # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc - -################################################### -## START OF collation_database TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.collation_database; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@collation_database; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.collation_database; -SELECT @session_start_value; -# save using implicit session scope -SET @session_start_value = @@session.collation_database; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_016_01------------------#' -############################################################################### -# Test Variable access and assignment with and without @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT collation_database; -# assign value without @@ -SET collation_database=utf8_unicode_ci; -SELECT @@session.collation_database; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.collation_database=utf8_unicode_ci; -# using another syntax for accessing session variable -SET session collation_database=utf8_unicode_ci; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session collation_database; -# using another syntax for accessing dynamic variable -SET global collation_database=utf8_unicode_ci; ---Error ER_BAD_FIELD_ERROR -SELECT global collation_database; - ---echo '#--------------------FN_DYNVARS_016_02-------------------------#' -############################################################################## -# Check the DEFAULT value of collation_database for session and global # -############################################################################## -SET @@collation_database = latin1_bin; -SET @@collation_database = DEFAULT; -SELECT @@collation_database AS DEFAULT_VALUE; - -SET @@global.collation_database = latin1_bin; -SET @@global.collation_database = DEFAULT; -SELECT @@global.collation_database; - ---echo '#--------------------FN_DYNVARS_016_03-------------------------#' -############################################################################## -# see if setting global value changes session value and vice versa # -############################################################################## -SET @@session.collation_database = utf8_polish_ci; -SELECT @@session.collation_database; -SET @@global.collation_database = latin7_general_ci; -SELECT @@global.collation_database; -SELECT @@session.collation_database AS res_is_utf8_polish_ci; - -SET @@session.collation_database = latin7_bin; -SELECT @@session.collation_database; -SELECT @@global.collation_database AS res_is_latin7_general_ci; -# composite check -SELECT @@global.collation_database=@@session.collation_database AS res_is_false; - ---echo '#--------------------FN_DYNVARS_016_04-------------------------#' -############################################################################### -# Check if accessing variable with and without session point to session # -# variable # -############################################################################### -SELECT @@collation_database = @@session.collation_database AS res; -SELECT @@collation_database = @@local.collation_database AS res; - ---echo '#--------------------FN_DYNVARS_016_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@collation_database = latin7_general_ci + latin7_general_cs; - ---echo '#--------------------FN_DYNVARS_016_06-------------------------#' -########################################################################### -# Change the value of collation_database to a valid value for session # -########################################################################### - -let collation_variable = @@session.collation_database; ---source include/collation_basic.inc - - ---echo '#--------------------FN_DYNVARS_016_07-------------------------#' -############################################################################### -# Change the value of collation_database to a valid value for global # -############################################################################### - -let collation_variable = @@global.collation_database; ---source include/collation_basic.inc - - ---echo '#--------------------FN_DYNVARS_016_08-------------------------#' -############################################################################# -# Change the value of collation_database to a valid value with uppercase, # -# lowercase and mixedcase # -############################################################################# -SET @@collation_database = LATIN7_GENERAL_CS; -SELECT @@collation_database; -SET @@collation_database = latin7_general_cs; -SELECT @@collation_database; - -SET @@global.collation_database = Latin7_GeneRal_cS; -SELECT @@global.collation_database; - ---echo '#--------------------FN_DYNVARS_016_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@collation_database = 1; -SELECT @@collation_database; -SET @@collation_database = 2; -SELECT @@collation_database; -SET @@collation_database = 3; -SELECT @@collation_database; -SET @@collation_database = 99; -SELECT @@collation_database; ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = 100; - -SET @@global.collation_database = 1; -SELECT @@global.collation_database; -SET @@global.collation_database = 2; -SELECT @@global.collation_database; -SET @@global.collation_database = 3; -SELECT @@global.collation_database; -SET @@global.collation_database = 99; -SELECT @@global.collation_database; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = 100; - -SET @total_collations = (SELECT count(*) FROM INFORMATION_SCHEMA.COLLATIONS); -SELECT @total_collations > 120; - - ---echo '#--------------------FN_DYNVARS_016_10-------------------------#' -############################################################################### -# Change the value of collation_database to an invalid value for session # -############################################################################### ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = latin7_binary; ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = 'eucjpms_japanese_cs'; ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@collation_database = 1.01; ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = -1; ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = ''; ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = ' eucjpms_bin'; -SET @@collation_database = true; -SELECT @@collation_database AS res_with_true; - ---Error ER_UNKNOWN_COLLATION -SET @@collation_database = ON; - ---echo '#--------------------FN_DYNVARS_016_11-------------------------#' -############################################################################### -# Change the value of collation_database to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = latin7_binary; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = 'eucjpms_japanese_cs'; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.collation_database = 1.1; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = -1; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = ""; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = ' eucjpms_bin'; - -SET @@global.collation_database = true; - ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_database = ON; - ---echo '#--------------------FN_DYNVARS_016_12-------------------------#' -############################################################################### -# Check if the value in GLOBAL Table matches value in variable # -############################################################################### -SELECT @@global.collation_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='collation_database') AS res; -SET @@global.collation_database = 1; -SELECT @@global.collation_database; -SELECT @@global.collation_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='collation_database') AS res; - ---echo '#--------------------FN_DYNVARS_016_13-------------------------#' -############################################################################## -# Check if the value in SESSION Table matches value in variable # -############################################################################## -SELECT @@collation_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_database') AS res; -SELECT @@local.collation_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_database') AS res; -SELECT @@session.collation_database = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_database') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.collation_database = @global_start_value; -SELECT @@global.collation_database; -SET @@session.collation_database = @session_start_value; -SELECT @@session.collation_database; - -########################################################### -# END OF collation_database TESTS # -########################################################### diff --git a/mysql-test/t/collation_database_func.test b/mysql-test/t/collation_database_func.test deleted file mode 100644 index ba8fc5a3d5e..00000000000 --- a/mysql-test/t/collation_database_func.test +++ /dev/null @@ -1,138 +0,0 @@ -############## mysql-test\t\collation_database_func.test ##################### -# # -# Variable Name: collation_database # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable collation_database # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - - ---echo '#--------------------FN_DYNVARS_011_01-------------------------#' -#################################################################### -# Check if setting collation_database is changed in new connection # -#################################################################### -SET @global_collation_database = @@global.collation_database; -SET @session_collation_database = @@session.collation_database; -SET @session_collation_server = @@session.collation_server; - - -SET @@global.collation_database = latin1_danish_ci; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.collation_database; -SELECT @@session.collation_database; -disconnect con1; - ---echo 'Bug#35378: New session collation_database is not change by global collation_database' - ---echo '#--------------------FN_DYNVARS_011_02-------------------------#' -######################################################### -# Begin the functionality Testing of collation_database # -######################################################### - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1,t2; ---enable_warnings - - -SELECT @@character_set_server,@@collation_server; -#============================================================================== ---echo '--check if setting collation_database update character_set_database--' -#============================================================================== - -SET @@session.collation_database = utf8_spanish_ci; -SELECT @@collation_database, @@character_set_database; - -#============================================================================== ---echo '--check if collation_database effects database/tables charset/collation' -#============================================================================== -SET @@session.collation_server = utf8_roman_ci; -SET @@session.collation_database = latin2_croatian_ci; -CREATE DATABASE db1; -USE db1; -SHOW CREATE DATABASE db1; ---echo 'Bug#35380: collation_database does not effects CREATE DATABASE without characater set' - -CREATE TABLE t1(a CHAR(20)); -SHOW CREATE TABLE t1; - -#============================================================================== ---echo '---check if updating collation_database effects new table/column---' -#============================================================================== -SET @@session.collation_database = latin7_general_cs; -CREATE TABLE t2(a CHAR(10)); -SHOW CREATE TABLE t2; - -DROP TABLE t1,t2; - - -#============================================================================== ---echo '--check value of collation and character set when current db is dropped' -#============================================================================== -DROP DATABASE db1; -SELECT @@collation_database,@@collation_server,@@character_set_database,@@character_set_server; -USE test; -SELECT @@collation_database,@@collation_server,@@character_set_database,@@character_set_server; - - ---echo 'fill table with some test data'; -CREATE TABLE t1(a CHAR(20))CHARACTER SET=latin1; -INSERT INTO t1 VALUES('Muffler'),('Müller'),('MX Systems'); - -#============================================================================== ---echo '---check if collation_database effects results sort order---' -#============================================================================== - -SET @@session.collation_database = latin1_swedish_ci; -SELECT * FROM t1 ORDER BY a; - -SET @@session.collation_database = latin1_german1_ci; -SELECT * FROM t1 ORDER BY a; - ---echo 'explicit Collate clause should effects results sort order'; - -SELECT * FROM t1 ORDER BY a COLLATE latin1_swedish_ci; -SELECT * FROM t1 ORDER BY a COLLATE latin1_german1_ci; - - -#============================================================================== ---echo '----check if indexing is effected by collation_database---' -#============================================================================== -SET @@session.collation_database = latin1_swedish_ci; -ALTER TABLE t1 ADD PRIMARY KEY (a); -REPAIR TABLE t1; -SELECT * FROM t1 ORDER BY a; - -ALTER TABLE t1 DROP PRIMARY KEY; -SET @@session.collation_database = latin1_german1_ci; -ALTER TABLE t1 ADD PRIMARY KEY (a); -REPAIR TABLE t1; -SELECT * FROM t1 ORDER BY a; - -# clean up -DROP TABLE t1; -SET @@global.collation_database = @global_collation_database; -SET @@session.collation_database = @session_collation_database; -SET @@session.collation_server = @session_collation_server; - -####################################################### -# End of functionality Testing for collation_database # -####################################################### diff --git a/mysql-test/t/collation_server_basic.test b/mysql-test/t/collation_server_basic.test deleted file mode 100644 index c4b469007e5..00000000000 --- a/mysql-test/t/collation_server_basic.test +++ /dev/null @@ -1,266 +0,0 @@ -############## mysql-test\t\collation_server_basic.test ####################### -# # -# Variable Name: collation_server # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable collation_server # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_big5.inc ---source include/have_ujis.inc ---source include/have_sjis.inc ---source include/have_utf8.inc ---source include/have_ucs2.inc - ---source include/load_sysvars.inc - -################################################### -## START OF collation_server TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -SET @global_start_value = @@global.collation_server; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@collation_server; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.collation_server; -SELECT @session_start_value; -# save using implicit session scope -SET @session_start_value = @@session.collation_server; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_014_01------------------#' -############################################################################### -# Test Variable access and assignment with and without @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT collation_server; -# assign value without @@ -SET collation_server=utf8_unicode_ci; -SELECT @@session.collation_server; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.collation_server=utf8_unicode_ci; -# using another syntax for accessing session variable -SET session collation_server=utf8_unicode_ci; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session collation_server; -# using another syntax for accessing dynamic variable -SET global collation_server=utf8_unicode_ci; ---Error ER_BAD_FIELD_ERROR -SELECT global collation_server; - ---echo '#--------------------FN_DYNVARS_014_02-------------------------#' -############################################################################### -# Check the DEFAULT value of collation_server for session and global # -############################################################################### -SET @@collation_server = latin1_bin; -SET @@collation_server = DEFAULT; -SELECT @@collation_server AS DEFAULT_VALUE; - -SET @@global.collation_server = latin1_bin; -SET @@global.collation_server = DEFAULT; -SELECT @@global.collation_server; - ---echo '#--------------------FN_DYNVARS_014_03-------------------------#' -########################################################################### -# Check if setting global value changes session value and vice versa # -########################################################################### -SET @@session.collation_server = utf8_polish_ci; -SELECT @@session.collation_server; -SET @@global.collation_server = latin7_general_ci; -SELECT @@global.collation_server; -SELECT @@session.collation_server AS res_is_utf8_polish_ci; - -SET @@session.collation_server = latin7_bin; -SELECT @@session.collation_server; -SELECT @@global.collation_server AS res_is_latin7_general_ci; -# composite check -SELECT @@global.collation_server=@@session.collation_server AS res_is_false; - ---echo '#--------------------FN_DYNVARS_014_04-------------------------#' -############################################################################# -# Check if accessing variable with and without session point to # -# session variable # -############################################################################# -SELECT @@collation_server = @@session.collation_server AS res; -SELECT @@collation_server = @@local.collation_server AS res; - ---echo '#--------------------FN_DYNVARS_014_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@collation_server = latin7_general_ci + latin7_general_cs; - ---echo '#--------------------FN_DYNVARS_014_06-------------------------#' -############################################################################## -# Change the value of collation_server to a valid value for session # -############################################################################## - -let collation_variable = @@session.collation_server; ---source include/collation_basic.inc - - ---echo '#--------------------FN_DYNVARS_014_07-------------------------#' -############################################################################# -# Change the value of collation_server to a valid value for global # -############################################################################# - -let collation_variable = @@global.collation_server; ---source include/collation_basic.inc - - ---echo '#--------------------FN_DYNVARS_014_08-------------------------#' -############################################################################# -# Change the value of collation_server to a valid value with uppercase, # -# lowercase and mixedcase # -############################################################################# - -SET @@collation_server = LATIN7_GENERAL_CS; -SELECT @@collation_server; -SET @@collation_server = latin7_general_cs; -SELECT @@collation_server; - -SET @@global.collation_server = Latin7_GeneRal_cS; -SELECT @@global.collation_server; - - ---echo '#--------------------FN_DYNVARS_014_09-------------------------#' -############################################################## -# Check if 1,2,3, ... values can be used on variable # -############################################################## -SET @@collation_server = 1; -SELECT @@collation_server; -SET @@collation_server = 2; -SELECT @@collation_server; -SET @@collation_server = 3; -SELECT @@collation_server; -SET @@collation_server = 99; -SELECT @@collation_server; ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = 100; - - -SET @@global.collation_server = 1; -SELECT @@global.collation_server; -SET @@global.collation_server = 2; -SELECT @@global.collation_server; -SET @@global.collation_server = 3; -SELECT @@global.collation_server; -SET @@global.collation_server = 99; -SELECT @@global.collation_server; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = 100; - - -SET @total_collations = (SELECT count(*) FROM INFORMATION_SCHEMA.COLLATIONS); -SELECT @total_collations > 120; - ---echo '#--------------------FN_DYNVARS_014_10-------------------------#' -############################################################################### -# Change the value of collation_server to an invalid value for session # -############################################################################### ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = latin7_binary; ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = 'eucjpms_japanese_cs'; ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@collation_server = 1.01; ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = -1; ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = ''; ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = ' eucjpms_bin'; -SET @@collation_server = true; -SELECT @@collation_server AS res_with_true; ---Error ER_UNKNOWN_COLLATION -SET @@collation_server = ON; - ---echo '#--------------------FN_DYNVARS_014_11-------------------------#' -############################################################################### -# Change the value of collation_server to an invalid value for global # -############################################################################### ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = latin7_binary; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = 'eucjpms_japanese_cs'; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.collation_server = 1.1; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = -1; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = ""; ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = ' eucjpms_bin'; - -SET @@global.collation_server = true; - ---Error ER_UNKNOWN_COLLATION -SET @@global.collation_server = ON; - ---echo '#--------------------FN_DYNVARS_014_12-------------------------#' -############################################################################### -# Check if the value in GLOBAL Table matches value in variable # -############################################################################### -SELECT @@global.collation_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='collation_server') AS res; -SET @@global.collation_server = 1; -SELECT @@global.collation_server; -SELECT @@global.collation_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='collation_server') AS res; - ---echo '#--------------------FN_DYNVARS_014_13-------------------------#' -############################################################################### -# Check if the value in SESSION Table matches value in variable # -############################################################################### -SELECT @@collation_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_server') AS res; -SELECT @@local.collation_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_server') AS res; -SELECT @@session.collation_server = - (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='collation_server') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.collation_server = @global_start_value; -SELECT @@global.collation_server; -SET @@session.collation_server = @session_start_value; -SELECT @@session.collation_server; - -##################################################### -# END OF collation_server TESTS # -##################################################### diff --git a/mysql-test/t/collation_server_func.test b/mysql-test/t/collation_server_func.test deleted file mode 100644 index 045cb5cf720..00000000000 --- a/mysql-test/t/collation_server_func.test +++ /dev/null @@ -1,115 +0,0 @@ -############## mysql-test\t\collation_server_func.test ####################### -# # -# Variable Name: collation_server # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable collation_server # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_014_01-------------------------#' -################################################################## -# Check if setting collation_server is changed in new connection # -################################################################## -#save -SET @global_collation_server = @@global.collation_server; -SET @session_collation_server = @@session.collation_server; - -SET @@global.collation_server = latin1_danish_ci; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.collation_server; -SELECT @@session.collation_server; -disconnect con1; - ---echo '#--------------------FN_DYNVARS_014_02-------------------------#' -####################################################### -# Begin the functionality Testing of collation_server # -####################################################### - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1,t2; ---enable_warnings - -#============================================================================== ---echo '---check if setting collation_server update character_set_server---' -#============================================================================== - -SET @@session.collation_server = utf8_spanish_ci; -SELECT @@collation_server, @@character_set_server; - -#============================================================================== ---echo '--check if collation_server effects database/table charset/collation--' -#============================================================================== -SET @@session.collation_server = latin1_german1_ci; -CREATE DATABASE db1; -USE db1; -SHOW CREATE DATABASE db1; -CREATE TABLE t1(a CHAR(20)); -SHOW CREATE TABLE t1; -#============================================================================== ---echo '---check if updating collation_server effects new table/column---' -#============================================================================== -SET @@session.collation_server = latin1_swedish_ci; -CREATE TABLE t2(a CHAR(10)); -SHOW CREATE TABLE t2; - - -# fill table with some test data -INSERT INTO t1 VALUES('Muffler'),('Müller'),('MX Systems'); - -#============================================================================== ---echo '---check if collation_server effects results sort order---' -#============================================================================== -SET @@session.collation_server = latin1_swedish_ci; -SELECT * FROM t1 ORDER BY a; - -SET @@session.collation_server = latin1_german1_ci; -SELECT * FROM t1 ORDER BY a; - -# explicit Collate clause should effects results sort order - -SELECT * FROM t1 ORDER BY a COLLATE latin1_swedish_ci; -SELECT * FROM t1 ORDER BY a COLLATE latin1_german1_ci; - -#============================================================================== ---echo '---check if indexing is effected by collation_server---' -#============================================================================== -SET @@session.collation_server = latin1_swedish_ci; -ALTER TABLE t1 ADD PRIMARY KEY (a); -REPAIR TABLE t1; -SELECT * FROM t1 ORDER BY a; - -ALTER TABLE t1 DROP PRIMARY KEY; -SET @@session.collation_server = latin1_german1_ci; -ALTER TABLE t1 ADD PRIMARY KEY (a); -REPAIR TABLE t1; -SELECT * FROM t1 ORDER BY a; - - -# clean up -DROP TABLE t1,t2; -DROP DATABASE db1; -#restore -SET @@global.collation_server = @global_collation_server; -SET @@session.collation_server = @session_collation_server; -##################################################### -# End of functionality Testing for collation_server # -##################################################### diff --git a/mysql-test/t/completion_type_basic.test b/mysql-test/t/completion_type_basic.test deleted file mode 100644 index 7ffc1aa593b..00000000000 --- a/mysql-test/t/completion_type_basic.test +++ /dev/null @@ -1,184 +0,0 @@ -############## mysql-test\t\completion_type_basic.test ######################### -# # -# Variable Name: completion_type # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 0 # -# Valid Values: 0,1 & 2 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "completion_type" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_completion_type # -# # -################################################################################ - ---source include/load_sysvars.inc - -############################################################### -# START OF completion_type TESTS # -############################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.completion_type; -SELECT @start_global_value; -SET @start_session_value = @@session.completion_type; -SELECT @start_session_value; - ---echo '#--------------------FN_DYNVARS_017_01-------------------------#' -############################################################### -# Display the DEFAULT value of completion_type # -############################################################### - -SET @@global.completion_type = 2; -SET @@global.completion_type = DEFAULT; -SELECT @@global.completion_type; - -SET @@session.completion_type = 1; -SET @@session.completion_type = DEFAULT; -SELECT @@session.completion_type; - - ---echo '#--------------------FN_DYNVARS_017_02-------------------------#' -############################################################### -# Check the DEFAULT value of completion_type # -############################################################### - -SET @@global.completion_type = @start_global_value; -SELECT @@global.completion_type = 0; - -SET @@session.completion_type = @start_session_value; -SELECT @@session.completion_type = 0; - - ---echo '#--------------------FN_DYNVARS_017_03-------------------------#' -######################################################################### -# Change the value of completion_type to a valid value for GLOBAL Scope # -######################################################################### - -SET @@global.completion_type = 0; -SELECT @@global.completion_type; -SET @@global.completion_type = 1; -SELECT @@global.completion_type; -SET @@global.completion_type = 2; -SELECT @@global.completion_type; - - ---echo '#--------------------FN_DYNVARS_017_04-------------------------#' -########################################################################## -# Change the value of completion_type to a valid value for SESSION Scope # -########################################################################## - -SET @@session.completion_type = 0; -SELECT @@session.completion_type; -SET @@session.completion_type = 1; -SELECT @@session.completion_type; -SET @@session.completion_type = 2; -SELECT @@session.completion_type; - - ---echo '#------------------FN_DYNVARS_017_05-----------------------#' -########################################################### -# Change the value of completion_type to an invalid value # -########################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.completion_type = 10; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.completion_type = -1024; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.completion_type = 2.4; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.completion_type = OFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.completion_type = 10; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.completion_type = -2; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.completion_type = 1.2; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.completion_type = ON; - - ---echo '#------------------FN_DYNVARS_017_06-----------------------#' -############################################################################### -# Check if the value in GLOBAL & SESSION Tables matches value in variable # -############################################################################### - -SELECT @@global.completion_type = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='completion_type'; - -SELECT @@session.completion_type = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='completion_type'; - - ---echo '#------------------FN_DYNVARS_017_07-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.completion_type = TRUE; -SELECT @@global.completion_type; -SET @@global.completion_type = FALSE; -SELECT @@global.completion_type; - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@completion_type = 1; -SELECT @@completion_type = @@local.completion_type; -SELECT @@local.completion_type = @@session.completion_type; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -########################################################################## -# Check if completion_type can be accessed with and without @@ sign # -########################################################################## - -SET completion_type = 1; -SELECT @@completion_type; ---Error ER_PARSE_ERROR -SET local.completion_type = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.completion_type; ---Error ER_PARSE_ERROR -SET session.completion_type = 1; ---Error ER_UNKNOWN_TABLE -SELECT session.completion_type; ---Error ER_BAD_FIELD_ERROR -SELECT completion_type = @@session.completion_type; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.completion_type = @start_global_value; -SELECT @@global.completion_type; -SET @@session.completion_type = @start_session_value; -SELECT @@session.completion_type; - -############################################ -# END OF completion_type TESTS # -############################################ - diff --git a/mysql-test/t/completion_type_func-master.opt b/mysql-test/t/completion_type_func-master.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/t/completion_type_func-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/t/completion_type_func.test b/mysql-test/t/completion_type_func.test deleted file mode 100644 index 4f1ebf6700b..00000000000 --- a/mysql-test/t/completion_type_func.test +++ /dev/null @@ -1,106 +0,0 @@ -############## mysql-test\t\completion_type_func.test ######################### -# # -# Variable Name: completion_type # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 0 # -# Valid Values: 0,1 & 2 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "completion_type" # -# that checks functinality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_completion_type # -# # -################################################################################ - ---source include/have_innodb.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name varchar(30) -) ENGINE = INNODB; - ---echo '#--------------------FN_DYNVARS_017_01-------------------------#' -######################################################### -# Setting initial value of completion_type to zero # -######################################################### - ---echo ## Creating new connection ## -connect (test_con1,localhost,root,,); -connection test_con1; - -INSERT into t1(name) values('Record_1'); -SET @@autocommit = 0; -SELECT * from t1; - ---echo ## Setting value of variable to 0 ## -SET @@session.completion_type = 0; - ---echo ## Here commit & rollback should work normally ## -START TRANSACTION; -SELECT * from t1; -INSERT into t1(name) values('Record_2'); -INSERT into t1(name) values('Record_3'); -SELECT * from t1; -DELETE FROM t1 where id = 2; -SELECT * from t1; - - -START TRANSACTION; -SELECT * from t1; -INSERT into t1(name) values('Record_4'); -INSERT into t1(name) values('Record_5'); -COMMIT; - - ---echo '#--------------------FN_DYNVARS_017_02-------------------------#' -######################################################### -# Setting initial value of completion_type to 2 # -######################################################### - -SET @@session.completion_type = 2; - ---echo ## Here commit should work as COMMIT RELEASE ## -START TRANSACTION; -SELECT * from t1; -INSERT into t1(name) values('Record_6'); -INSERT into t1(name) values('Record_7'); -COMMIT; - ---echo ## Inserting rows should give error here because connection should ## ---echo ## disconnect after using COMMIT ## ---Error 2006,2013,1053 -INSERT into t1(name) values('Record_4'); - ---echo ## Creating new connection test_con2 ## -connect (test_con2,localhost,root,,); -connection test_con2; -SET @@session.completion_type = 2; - ---echo ## Inserting rows and using Rollback which should Rollback & release ## -START TRANSACTION; -SELECT * from t1; -INSERT into t1(name) values('Record_8'); -INSERT into t1(name) values('Record_9'); -ROLLBACK; - ---Error 2006,2013,1053 -INSERT into t1(name) values('Record_4'); - diff --git a/mysql-test/t/concurrent_insert_basic.test b/mysql-test/t/concurrent_insert_basic.test deleted file mode 100644 index bc401ef22a3..00000000000 --- a/mysql-test/t/concurrent_insert_basic.test +++ /dev/null @@ -1,178 +0,0 @@ -############## mysql-test\t\concurrent_insert_basic.test ####################### -# # -# Variable Name: concurrent_insert # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean & Numeric # -# Default Value: 1 # -# Valid Values: 0,1 & 2 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "concurrent_insert" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_concurrent_insert # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################# -# START OF concurrent_insert TESTS # -################################################################# - - -######################################################################### -# Saving initial value of concurrent_insert in a temporary variable # -######################################################################### - -SET @start_value = @@global.concurrent_insert; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_018_01------------------------#' -######################################################################### -# Display the DEFAULT value of concurrent_insert # -######################################################################### - -SET @@global.concurrent_insert = 0; -SET @@global.concurrent_insert = DEFAULT; -SELECT @@global.concurrent_insert; - ---echo '#---------------------FN_DYNVARS_018_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.concurrent_insert = DEFAULT; -SELECT @@global.concurrent_insert = 1; - - ---echo '#--------------------FN_DYNVARS_018_03------------------------#' -######################################################################### -# Change the value of concurrent_insert to a valid value # -######################################################################### - -SET @@global.concurrent_insert = 0; -SELECT @@global.concurrent_insert; -SET @@global.concurrent_insert = 1; -SELECT @@global.concurrent_insert; -SET @@global.concurrent_insert = 2; -SELECT @@global.concurrent_insert; - ---echo '#--------------------FN_DYNVARS_018_04-------------------------#' -########################################################################### -# Change the value of concurrent_insert to invalid value # -########################################################################### - -SET @@global.concurrent_insert = -1; -Select @@global.concurrent_insert; -SET @@global.concurrent_insert = 100; -Select @@global.concurrent_insert; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = TRUEF; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = TRUE_F; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = FALSE0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = OON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = ONN; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = OOFF; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = 0FF; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = ' '; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = " "; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = ''; - - ---echo '#-------------------FN_DYNVARS_018_05----------------------------#' -##################################################################### -# Test if accessing session concurrent_insert gives error # -##################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.concurrent_insert = 1; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.concurrent_insert = 1; - - ---echo '#----------------------FN_DYNVARS_018_06------------------------#' -#################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -#################################################################### - -SELECT @@global.concurrent_insert = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='concurrent_insert'; - - ---echo '#---------------------FN_DYNVARS_018_07----------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = OFF; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.concurrent_insert = ON; - - ---echo '#---------------------FN_DYNVARS_018_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.concurrent_insert = TRUE; -SELECT @@global.concurrent_insert; -SET @@global.concurrent_insert = FALSE; -SELECT @@global.concurrent_insert; - ---echo '#---------------------FN_DYNVARS_018_09----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same global variable # -############################################################################### - -SET @@global.concurrent_insert = 1; -SELECT @@concurrent_insert = @@global.concurrent_insert; - - ---echo '#---------------------FN_DYNVARS_018_10----------------------#' -############################################################################### -# Check if concurrent_insert can be accessed with and without @@ sign # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET concurrent_insert = 1; -SELECT @@concurrent_insert; ---Error ER_PARSE_ERROR -SET global.concurrent_insert = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.concurrent_insert; ---Error ER_BAD_FIELD_ERROR -SELECT concurrent_insert = @@session.concurrent_insert; - -############################## -# Restore initial value # -############################## - -SET @@global.concurrent_insert = @start_value; -SELECT @@global.concurrent_insert; - -####################################################### -# END OF concurrent_insert TESTS # -####################################################### - diff --git a/mysql-test/t/concurrent_insert_func.test b/mysql-test/t/concurrent_insert_func.test deleted file mode 100644 index e6ea7c4304b..00000000000 --- a/mysql-test/t/concurrent_insert_func.test +++ /dev/null @@ -1,140 +0,0 @@ -############## mysql-test\t\concurrent_insert_basic.test ####################### -# # -# Variable Name: concurrent_insert # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean & Numeric # -# Default Value: 1 # -# Valid Values: 0,1 & 2 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "concurrent_insert" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_concurrent_insert # -# # -################################################################################ - - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -name varchar(30) -); - ---echo '#--------------------FN_DYNVARS_018_01-------------------------#' -#################################################################### -# Setting initial value of concurrent_insert to 1 -# concurrent_insert = 1 means Enables concurrent insert -# for MyISAM tables that don't have holes -#################################################################### - ---echo ## Setting initial value of variable to 1 ## -SET @@global.concurrent_insert = 1; -INSERT into t1(name) values('Record_1'); -INSERT into t1(name) values('Record_2'); -INSERT into t1(name) values('Record_3'); - ---echo ## locking table ## -lock table t1 read local; - ---echo ## Creating new connection to insert some rows in table ## -connect (test_con1,localhost,root,,); -connection test_con1; - ---echo ## New records should come at the end of all rows ## -INSERT into t1(name) values('Record_4'); -SELECT * from t1; - - ---echo ## unlocking tables ## -connection default; -unlock tables; - ---echo ## deleting record to create hole in table ## -DELETE from t1 where name ='Record_2'; - - ---echo '#--------------------FN_DYNVARS_018_02-------------------------#' -#################################################################### -# Setting initial value of concurrent_insert to 1 -# concurrent_insert = 1 and trying to insert some values -# in MyISAM tables that have holes -#################################################################### - -# lock table and connect with connection1 -#lock table t1 read local; -#connection test_con1; - -# setting value of concurrent_insert to 1 -#SET @@global.concurrent_insert=1; - -#INSERT into t1(name) values('Record_7'); -#SELECT * from t1; - -#connection default; -#unlock tables; - -#SELECT * from t1; -#INSERT into t1(name) values('Record_6'); - -# On inserting rows in hole while the value of concurrent_insert is 1 -# MySQL server hangs. - - - ---echo '#--------------------FN_DYNVARS_018_03-------------------------#' -############################################################################### -# Setting value of concurrent_insert to 2 to verify values after inserting -# it into table with holes -# concurrent_insert = 2 means Enables concurrent insert -# for MyISAM tables that have holes but inserts values at the end of all rows -############################################################################### - ---echo ## lock table and connect with connection1 ## -lock table t1 read local; -connection test_con1; - ---echo ## setting value of concurrent_insert to 2 ## -SET @@global.concurrent_insert=2; - ---echo ## Inserting record in table, record should go at the end of the table ## -INSERT into t1(name) values('Record_5'); -SELECT * from t1; -SELECT @@concurrent_insert; - ---echo ## Switching to default connection ## -connection default; - ---echo ## Unlocking table ## -unlock tables; - -SELECT * from t1; - ---echo ## Inserting new row, this should go in the hole ## -INSERT into t1(name) values('Record_6'); -SELECT * from t1; - ---echo ## connection test_con1 ## - -DELETE from t1 where name ='Record_3'; -SELECT * from t1; - ---echo ## Dropping table ## -DROP table t1; - ---echo ## Disconnecting connection ## -disconnect test_con1; - diff --git a/mysql-test/t/connect_timeout_basic.test b/mysql-test/t/connect_timeout_basic.test deleted file mode 100644 index 095c85f8295..00000000000 --- a/mysql-test/t/connect_timeout_basic.test +++ /dev/null @@ -1,153 +0,0 @@ -################# mysql-test\t\connect_timeout_basic.test ###################### -# # -# Variable Name: connect_timeout # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 5 # -# Range: 2 - 31536000 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "connect_timeout" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_connect_timeout # -# # -################################################################################ - ---source include/load_sysvars.inc - -############################################################### -# START OF connect_timeout TESTS # -############################################################### - -####################################################################### -# Saving initial value of connect_timeout in a temporary variable # -####################################################################### - -SET @start_value = @@global.connect_timeout; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_019_01------------------------#' -####################################################################### -# Display the DEFAULT value of connect_timeout # -####################################################################### - -SET @@global.connect_timeout = 100; -SET @@global.connect_timeout = DEFAULT; -SELECT @@global.connect_timeout; - - ---echo '#---------------------FN_DYNVARS_019_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.connect_timeout = @start_value; -SELECT @@global.connect_timeout = 5; - - ---echo '#--------------------FN_DYNVARS_019_03------------------------#' -####################################################################### -# Change the value of connect_timeout to a valid value # -####################################################################### - -SET @@global.connect_timeout = 2; -SELECT @@global.connect_timeout; -SET @@global.connect_timeout = 10000; -SELECT @@global.connect_timeout; -SET @@global.connect_timeout = 21221204; -SELECT @@global.connect_timeout; - - ---echo '#--------------------FN_DYNVARS_019_04-------------------------#' -########################################################################## -# Change the value of connect_timeout to invalid value # -########################################################################## - -SET @@global.connect_timeout = 1; -SELECT @@global.connect_timeout; -SET @@global.connect_timeout = -1024; -SELECT @@global.connect_timeout; -SET @@global.connect_timeout = 42949672950; -SELECT @@global.connect_timeout; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.connect_timeout = 21221204.10; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.connect_timeout = ON; - - ---echo '#-------------------FN_DYNVARS_019_05----------------------------#' -########################################################################## -# Test if accessing session connect_timeout gives error # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET @@session.connect_timeout = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.connect_timeout; - - ---echo '#----------------------FN_DYNVARS_019_06------------------------#' -#################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -#################################################################### - -SELECT @@global.connect_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='connect_timeout'; - ---echo '#---------------------FN_DYNVARS_019_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.connect_timeout = TRUE; -SELECT @@global.connect_timeout; -SET @@global.connect_timeout = FALSE; -SELECT @@global.connect_timeout; - - ---echo '#---------------------FN_DYNVARS_019_08----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same global variable # -############################################################################### - -SET @@global.connect_timeout = 5; -SELECT @@connect_timeout = @@global.connect_timeout; - ---echo '#---------------------FN_DYNVARS_019_09----------------------#' -######################################################################### -# Check if connect_timeout can be accessed with and without @@ sign # -######################################################################### - ---Error ER_GLOBAL_VARIABLE -SET connect_timeout = 1; ---Error ER_PARSE_ERROR -SET global.connect_timeout = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.connect_timeout; ---Error ER_BAD_FIELD_ERROR -SELECT connect_timeout = @@session.connect_timeout; - -############################## -# Restore initial value # -############################## - -SET @@global.connect_timeout = @start_value; -SELECT @@global.connect_timeout; - - -######################################################### -# END OF connect_timeout TESTS # -######################################################### - diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test index 4e212d81e66..e3dba58d4df 100644 --- a/mysql-test/t/crash_commit_before.test +++ b/mysql-test/t/crash_commit_before.test @@ -15,7 +15,7 @@ insert into t1 values(9); SET SESSION debug="d,crash_commit_before"; # Write file to make mysql-test-run.pl expect crash and restart ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/master0.expect +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Run the crashing query --error 2013 diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 2eeca1eea90..f9708002ee6 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1418,6 +1418,7 @@ SHOW CREATE TABLE t2; --echo DROP TABLE t2; +DROP TABLE t1; --echo --echo # -- End of test case for Bug#21380. @@ -1532,5 +1533,11 @@ DROP TABLE t1; ########################################################################### +# +# Bug#40104 regression with table names? +# +create table `me:i`(id int); +drop table `me:i`; + --echo --echo End of 5.1 tests diff --git a/mysql-test/t/create_not_windows.test b/mysql-test/t/create_not_windows.test index 56b4002106d..b612e31e3aa 100644 --- a/mysql-test/t/create_not_windows.test +++ b/mysql-test/t/create_not_windows.test @@ -29,7 +29,8 @@ drop table if exists t1; --enable_warnings create table t1(a int) engine=myisam; insert into t1 values(1); ---system rm -f $MYSQLTEST_VARDIR/master-data/test/t1.frm +let $MYSQLD_DATADIR= `select @@datadir`; +remove_file $MYSQLD_DATADIR/test/t1.frm; --echo "We get an error because the table is in the definition cache" --error ER_TABLE_EXISTS_ERROR create table t1(a int, b int); diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index ac628f96a0f..abc161d014c 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1409,7 +1409,8 @@ DROP TABLE test_repair_table; # CREATE TABLE test_repair_table2 ( val integer not null ) ENGINE = CSV; ---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/test_repair_table2.CSM # Should give a warning and perform autorepair. We also disable ps-protocol # here, as mysql-test eats up warnings in ps-protocol mode @@ -1420,15 +1421,15 @@ SELECT * from test_repair_table2; # this should work ok, as the table is already repaired SELECT * from test_repair_table2; # check that the metafile appeared again. ---file_exists $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM +--file_exists $MYSQLD_DATADIR/test/test_repair_table2.CSM CHECK TABLE test_repair_table2; DROP TABLE test_repair_table2; # Corrupt csv file and see if we can repair it CREATE TABLE test_repair_table3 ( val integer not null ) ENGINE = CSV; ---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV ---write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV +--remove_file $MYSQLD_DATADIR/test/test_repair_table3.CSV +--write_file $MYSQLD_DATADIR/test/test_repair_table3.CSV "1" "4" "3 @@ -1447,7 +1448,7 @@ CREATE TABLE test_repair_table4 ( founded char(4) DEFAULT '' NOT NULL ) ENGINE = CSV; ---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table4.CSM +--remove_file $MYSQLD_DATADIR/test/test_repair_table4.CSM --disable_ps_protocol SELECT * FROM test_repair_table4; --enable_ps_protocol @@ -1480,8 +1481,8 @@ CREATE TABLE test_repair_table5 ( ) ENGINE = CSV; # Corrupt a table -- put a file with wrong # of columns ---remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV ---write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV +--remove_file $MYSQLD_DATADIR/test/test_repair_table5.CSV +--write_file $MYSQLD_DATADIR/test/test_repair_table5.CSV "1","101","IBM" EOF @@ -1492,7 +1493,7 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876); SELECT * FROM test_repair_table5; # Corrupt a table -- put a row with wrong # of columns at end of file ---append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV +--append_file $MYSQLD_DATADIR/test/test_repair_table5.CSV "1","101","IBM" EOF @@ -1505,7 +1506,7 @@ INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876); SELECT * FROM test_repair_table5; # Corrupt table again -- put a row with wrong # of columns at end of file ---append_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV +--append_file $MYSQLD_DATADIR/test/test_repair_table5.CSV "1","101","IBM" EOF @@ -1588,14 +1589,14 @@ drop table t1; create table bug15205 (val int(11) not null) engine=csv; create table bug15205_2 (val int(11) not null) engine=csv; ---remove_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV +--remove_file $MYSQLD_DATADIR/test/bug15205.CSV # system error (can't open the datafile) ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' --error 13 select * from bug15205; select * from bug15205_2; # Create empty file ---write_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV +--write_file $MYSQLD_DATADIR/test/bug15205.CSV EOF select * from bug15205; drop table bug15205; @@ -1634,16 +1635,16 @@ insert into bug22080_1 values(2,'string'); insert into bug22080_1 values(3,'string'); # Create first corrupt file as described in bug report ---remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV ---write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV +--remove_file $MYSQLD_DATADIR/test/bug22080_2.CSV +--write_file $MYSQLD_DATADIR/test/bug22080_2.CSV 1,"string" 2","string" 3,"string" EOF # Create second corrupt file as described in bug report ---remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV ---write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV +--remove_file $MYSQLD_DATADIR/test/bug22080_3.CSV +--write_file $MYSQLD_DATADIR/test/bug22080_3.CSV 1,"string" "2",string" 3,"string" @@ -1703,8 +1704,8 @@ check table t1; drop table t1; create table t1(a int not null, b int not null) engine=csv; ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV ---write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV +--remove_file $MYSQLD_DATADIR/test/t1.CSV +--write_file $MYSQLD_DATADIR/test/t1.CSV 1, 1E-2 -2E2, .9 -10E-1, -.9 @@ -1794,8 +1795,8 @@ create table t1 (a int not null) engine=csv; lock tables t1 read; connect (con1,localhost,root,,); --connection con1 ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV ---replace_result $MYSQLTEST_VARDIR . master-data/ '' 13 2 +--remove_file $MYSQLD_DATADIR/test/t1.CSV +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/ ./ MYSQLD_DATADIR/ 13 2 # EE_FILENOTFOUND 29 --error 29 select * from t1; @@ -1804,4 +1805,17 @@ unlock tables; drop table t1; --disconnect con1 +# +# Bug#41441 repair csv table crashes debug server +# +# Note: The test should be removed after Bug#33717 is fixed + +create table t1(a enum ('a') not null) engine=csv; +insert into t1 values (2); +--error ER_CRASHED_ON_USAGE +select * from t1 limit 1; +repair table t1; +select * from t1 limit 1; +drop table t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/csv_not_null.test b/mysql-test/t/csv_not_null.test index bb7b412aa49..03ed566fb22 100644 --- a/mysql-test/t/csv_not_null.test +++ b/mysql-test/t/csv_not_null.test @@ -93,7 +93,6 @@ SELECT * FROM t1; UPDATE t1 set b = 'new_value' where a = 0; --enable_warnings SELECT * FROM t1; ---error ER_BAD_NULL_ERROR UPDATE t1 set b = NULL where b = 'new_value'; SELECT * FROM t1; diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index 5a8a13f2bad..a75fd917052 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -75,12 +75,12 @@ create table t1 (a blob); insert into t1 values (0xEE00); select * into outfile 'test/t1.txt' from t1; delete from t1; ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---eval select hex(load_file('$MYSQLTEST_VARDIR/master-data/test/t1.txt')); +let $MYSQLD_DATADIR= `select @@datadir`; +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--eval select hex(load_file('$MYSQLD_DATADIR/test/t1.txt')); load data infile 't1.txt' into table t1; select hex(a) from t1; ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.txt - +--remove_file $MYSQLD_DATADIR/test/t1.txt drop table t1; --echo End of 5.0 tests diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test index fc6ed0f2579..73a23a751e8 100644 --- a/mysql-test/t/ctype_ldml.test +++ b/mysql-test/t/ctype_ldml.test @@ -21,6 +21,22 @@ insert into t1 values ('a'); select * from t1 where c1='b'; drop table t1; + +# +# Bug#41084 full-text index added to custom UCA collation not working +# +CREATE TABLE t1 ( + col1 varchar(100) character set utf8 collate utf8_test_ci +); +INSERT INTO t1 (col1) VALUES ('abcd'),('efgh'),('ijkl'); +ALTER TABLE t1 ADD FULLTEXT INDEX (col1); +SELECT * FROM t1 where match (col1) against ('abcd'); +SELECT * FROM t1 where match (col1) against ('abcd' IN BOOLEAN MODE); +ALTER TABLE t1 ADD (col2 varchar(100) character set latin1); +UPDATE t1 SET col2=col1; +SELECT * FROM t1 WHERE col1=col2 ORDER BY col1; +DROP TABLE t1; + # # Vietnamese experimental collation # diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index cb371bc0ca6..e247110658b 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -697,4 +697,29 @@ set names latin1; # select hex(char(0x41 using ucs2)); +# +# Bug#37575: UCASE fails on monthname +# +SET character_set_connection=ucs2; +SELECT CHARSET(DAYNAME(19700101)); +SELECT CHARSET(MONTHNAME(19700101)); +SELECT LOWER(DAYNAME(19700101)); +SELECT LOWER(MONTHNAME(19700101)); +SELECT UPPER(DAYNAME(19700101)); +SELECT UPPER(MONTHNAME(19700101)); +SELECT HEX(MONTHNAME(19700101)); +SELECT HEX(DAYNAME(19700101)); +SET LC_TIME_NAMES=ru_RU; +SET NAMES utf8; +SET character_set_connection=ucs2; +SELECT CHARSET(DAYNAME(19700101)); +SELECT CHARSET(MONTHNAME(19700101)); +SELECT LOWER(DAYNAME(19700101)); +SELECT LOWER(MONTHNAME(19700101)); +SELECT UPPER(DAYNAME(19700101)); +SELECT UPPER(MONTHNAME(19700101)); +SELECT HEX(MONTHNAME(19700101)); +SELECT HEX(DAYNAME(19700101)); +SET character_set_connection=latin1; + --echo End of 5.0 tests diff --git a/mysql-test/t/datadir_basic.test b/mysql-test/t/datadir_basic.test deleted file mode 100644 index 7fae68fa55e..00000000000 --- a/mysql-test/t/datadir_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\datadir_basic.test ############################ -# # -# Variable Name: datadir # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable datadir # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_004_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.datadir); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_004_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.datadir=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.datadir); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_004_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.datadir = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='datadir'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.datadir); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='datadir'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_004_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@datadir = @@GLOBAL.datadir; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_004_05----------------------#' -################################################################################ -# Check if datadir can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@datadir); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.datadir); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.datadir); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.datadir); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT datadir = @@SESSION.datadir; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index abf09942d1c..e5dc7ffa53e 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -6,10 +6,15 @@ drop table if exists t1; --enable_warnings ---replace_result ROW <format> STATEMENT <format> MIXED <format> -SHOW GLOBAL VARIABLES LIKE "%e_format"; ---replace_result ROW <format> STATEMENT <format> MIXED <format> -SHOW SESSION VARIABLES LIKE "%e_format"; +SELECT variable_name, variable_value +FROM information_schema.global_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; + +SELECT variable_name, variable_value +FROM information_schema.session_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; # # Test setting a lot of different formats to see which formats are accepted and @@ -36,8 +41,10 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; set datetime_format= '%h:%i:%s %p %Y-%m-%d'; set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; ---replace_result ROW <format> STATEMENT <format> MIXED <format> -SHOW SESSION VARIABLES LIKE "%e_format"; +SELECT variable_name, variable_value +FROM information_schema.session_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; --error 1231 SET time_format='%h:%i:%s'; @@ -121,7 +128,7 @@ SET datetime_format=default; # Test of str_to_date # -# PS doesn't support fraction of a seconds +# PS doesn't support fractions of a second --disable_ps_protocol select str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')); @@ -340,3 +347,15 @@ select str_to_date('04/30 /2004', '%m /%d /%Y'); select str_to_date('04/30/2004 ', '%m/%d/%Y '); --echo "End of 4.1 tests" + +# +# Bug #41470: DATE_FORMAT() crashes the complete server with a valid date +# + +# show that these two do not crash the server: +SELECT DATE_FORMAT("0000-01-01",'%W %d %M %Y') as valid_date; +SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date; +# show that date within the Gregorian range render correct results: (THU) +SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date; + +--echo "End of 5.0 tests" diff --git a/mysql-test/t/default_week_format_basic.test b/mysql-test/t/default_week_format_basic.test deleted file mode 100644 index d8b4a09541f..00000000000 --- a/mysql-test/t/default_week_format_basic.test +++ /dev/null @@ -1,199 +0,0 @@ -############## mysql-test\t\default_week_format_basic.test ##################### -# # -# Variable Name: default_week_format # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 0 # -# Range: 0 - 7 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "default_week_format" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_auto-increment-increment # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################### -# START OF default_week_format TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.default_week_format; -SELECT @start_global_value; -SET @start_session_value = @@session.default_week_format; -SELECT @start_session_value; - ---echo '#--------------------FN_DYNVARS_022_01-------------------------#' -################################################################### -# Display the DEFAULT value of default_week_format # -################################################################### - -SET @@global.default_week_format = 100; -SET @@global.default_week_format = DEFAULT; -SELECT @@global.default_week_format; - -SET @@session.default_week_format = 200; -SET @@session.default_week_format = DEFAULT; -SELECT @@session.default_week_format; - ---echo '#--------------------FN_DYNVARS_022_02-------------------------#' -################################################################### -# Check the DEFAULT value of default_week_format # -################################################################### - -SET @@global.default_week_format = @start_global_value; -SELECT @@global.default_week_format = 0; - -SET @@session.default_week_format = @start_global_value; -SELECT @@session.default_week_format = 0; - ---echo '#--------------------FN_DYNVARS_022_03-------------------------#' -############################################################################# -# Change the value of default_week_format to a valid value for GLOBAL Scope # -############################################################################# - -SET @@global.default_week_format = 1; -SELECT @@global.default_week_format; -SET @@global.default_week_format = 0; -SELECT @@global.default_week_format; -SET @@global.default_week_format = 7; -SELECT @@global.default_week_format; - - ---echo '#--------------------FN_DYNVARS_022_04-------------------------#' -############################################################################## -# Change the value of default_week_format to a valid value for SESSION Scope # -############################################################################## - -SET @@session.default_week_format = 1; -SELECT @@session.default_week_format; -SET @@session.default_week_format = 0; -SELECT @@session.default_week_format; -SET @@session.default_week_format = 7; -SELECT @@session.default_week_format; - - ---echo '#------------------FN_DYNVARS_022_05-----------------------#' -############################################################### -# Change the value of default_week_format to an invalid value # -############################################################### - -SET @@global.default_week_format = 8; -SELECT @@global.default_week_format; -SET @@global.default_week_format = -1024; -SELECT @@global.default_week_format; -SET @@global.default_week_format = 65536; -SELECT @@global.default_week_format; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.default_week_format = 65530.30; -SELECT @@global.default_week_format; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.default_week_format = OFF; -SELECT @@global.default_week_format; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.default_week_format = ON; -SELECT @@session.default_week_format; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.default_week_format = 65530.30; -SELECT @@session.default_week_format; -SET @@session.default_week_format = 10; -SELECT @@session.default_week_format; -SET @@session.default_week_format = -2; -SELECT @@session.default_week_format; -SET @@session.default_week_format = 65550; -SELECT @@session.default_week_format; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---echo '#------------------FN_DYNVARS_022_06-----------------------#' -############################################################################### -# Check if the value in GLOBAL & SESSION Tables matches value in variable # -############################################################################### - -SELECT @@global.default_week_format = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='default_week_format'; - -SELECT @@session.default_week_format = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='default_week_format'; - - ---echo '#------------------FN_DYNVARS_022_07-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.default_week_format = TRUE; -SELECT @@global.default_week_format; -SET @@global.default_week_format = FALSE; -SELECT @@global.default_week_format; - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.default_week_format = 0; -SELECT @@default_week_format = @@global.default_week_format; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@default_week_format = 1; -SELECT @@default_week_format = @@local.default_week_format; -SELECT @@local.default_week_format = @@session.default_week_format; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################################### -# Check if default_week_format can be accessed with and without @@ sign # -################################################################################### - -SET default_week_format = 1; -SELECT @@default_week_format; ---Error ER_PARSE_ERROR -SET local.default_week_format = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.default_week_format; ---Error ER_PARSE_ERROR -SET session.default_week_format = 1; ---Error ER_UNKNOWN_TABLE -SELECT session.default_week_format; ---Error ER_BAD_FIELD_ERROR -SELECT default_week_format = @@session.default_week_format; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.default_week_format = @start_global_value; -SELECT @@global.default_week_format; -SET @@session.default_week_format = @start_session_value; -SELECT @@session.default_week_format; - - -############################################################# -# END OF default_week_format TESTS # -############################################################# - diff --git a/mysql-test/t/default_week_format_func.test b/mysql-test/t/default_week_format_func.test deleted file mode 100644 index c80c49b39fb..00000000000 --- a/mysql-test/t/default_week_format_func.test +++ /dev/null @@ -1,66 +0,0 @@ -############## mysql-test\t\default_week_format_func.test ##################### -# # -# Variable Name: default_week_format # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 0 # -# Range: 0 - 7 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "default_week_format" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_default_week_format # -# # -################################################################################ - ---echo '#--------------------FN_DYNVARS_022_01-------------------------#' -#################################################################### -# Verifying different values of default_week_format -#################################################################### - ---echo ## Setting variable's value to 0 ## -SET @@session.default_week_format = 0; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - ---echo ## Setting variable's value to 1 ## -SET @@session.default_week_format = 1; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - ---echo ## Setting variable's value to 2 ## -SET @@session.default_week_format = 2; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - ---echo ## Setting variable's value to 3 ## -SET @@session.default_week_format = 3; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - ---echo ## Setting variable's value to 4 ## -SET @@session.default_week_format = 4; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - ---echo ## Setting variable's value to 5 ## -SET @@session.default_week_format = 5; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - ---echo ## Setting variable's value to 6 ## -SET @@session.default_week_format = 6; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - ---echo ## Setting variable's value to 7 ## -SET @@session.default_week_format = 7; -SELECT @@session.default_week_format; -SELECT WEEK('2008-01-20'); - diff --git a/mysql-test/t/delay_key_write_basic.test b/mysql-test/t/delay_key_write_basic.test deleted file mode 100644 index faa1cb3cc6e..00000000000 --- a/mysql-test/t/delay_key_write_basic.test +++ /dev/null @@ -1,173 +0,0 @@ -##################### mysql-test\t\delay_key_write_basic.test ################# -# # -# Variable Name: delay_key_write # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: ON # -# Valid Values: ON, OFF & ALL # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable delay_key_write # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF delay_key_write TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of delay_key_write in a temporary variable # -######################################################################## - -SET @start_value = @@global.delay_key_write; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_023_01------------------------#' -######################################################################## -# Display the DEFAULT value of delay_key_write # -######################################################################## - -SET @@global.delay_key_write = OFF; ---Error ER_NO_DEFAULT -SET @@global.delay_key_write = DEFAULT; ---echo 'Bug # 34878: Documentation specifies a DEFAULT value of ON for variable but'; ---echo 'its not supported'; -SELECT @@global.delay_key_write; - - ---echo '#---------------------FN_DYNVARS_023_02-------------------------#' -############################################### -# Check if NULL is accepeted # -############################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = NULL; - - ---echo '#--------------------FN_DYNVARS_023_03------------------------#' -######################################################################## -# Change the value of delay_key_write to a valid value # -######################################################################## - -SET @@global.delay_key_write = ON; -SELECT @@global.delay_key_write; - -SET @@global.delay_key_write = OFF; -SELECT @@global.delay_key_write; - -SET @@global.delay_key_write = ALL; -SELECT @@global.delay_key_write; - - ---echo '#--------------------FN_DYNVARS_023_04-------------------------#' -########################################################################### -# Change the value of delay_key_write to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = 3; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = TRU; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = ERROR; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = ONN; - -SET @@global.delay_key_write = OF; -SELECT @@global.delay_key_write; ---echo 'Bug# 34828: Variable is incorrectly accepting OF as a value' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.delay_key_write = ""; - - ---echo '#-------------------FN_DYNVARS_023_05----------------------------#' -########################################################################### -# Test if accessing session delay_key_write gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@delay_key_write = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.delay_key_write; - - ---echo '#----------------------FN_DYNVARS_023_06------------------------#' -######################################################################## -# Check if the value in GLOBAL Table matches value in variable # -######################################################################## - -SELECT @@delay_key_write = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='delay_key_write'; - - ---echo '#---------------------FN_DYNVARS_023_07-------------------------#' -################################################################### -# Check if numbers can be used on variable # -################################################################### - -SET @@global.delay_key_write = 0; -SELECT @@global.delay_key_write; - -SET @@global.delay_key_write = 1; -SELECT @@global.delay_key_write; - -SET @@global.delay_key_write = 2; -SELECT @@global.delay_key_write; - - - ---echo '#---------------------FN_DYNVARS_023_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.delay_key_write = TRUE; -SELECT @@global.delay_key_write; -SET @@global.delay_key_write = FALSE; -SELECT @@global.delay_key_write; - ---echo '#---------------------FN_DYNVARS_023_09----------------------#' -##################################################################### -# Check if delay_key_write can be accessed with and without @@ sign # -##################################################################### ---Error ER_GLOBAL_VARIABLE -SET delay_key_write = ON; -SELECT @@delay_key_write; - -SET GLOBAL delay_key_write = OFF; -SELECT @@global.delay_key_write; - -############################## -# Restore initial value # -############################## - -SET @@global.delay_key_write = @start_value; -SELECT @@global.delay_key_write; - -######################################################################## -# END OF delay_key_write TESTS # -######################################################################## diff --git a/mysql-test/t/delay_key_write_func-master.opt b/mysql-test/t/delay_key_write_func-master.opt deleted file mode 100644 index a449c0fb964..00000000000 --- a/mysql-test/t/delay_key_write_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---myisam-recover=BACKUP,FORCE - diff --git a/mysql-test/t/delay_key_write_func.test b/mysql-test/t/delay_key_write_func.test deleted file mode 100644 index 3c0319be427..00000000000 --- a/mysql-test/t/delay_key_write_func.test +++ /dev/null @@ -1,149 +0,0 @@ -##################### mysql-test\t\delay_key_write_func.test ################# -# # -# Variable Name: delay_key_write # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: ON # -# Valid Values: ON, OFF & ALL # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable delay_key_write # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_023_01-------------------------#' -####################################################################### -# Check if setting delay_key_write is changed in every new connection # -####################################################################### - - -SET @@global.delay_key_write = ON; -SELECT @@global.delay_key_write; - ---echo 'connect (user1,localhost,root,,,,)' -connect (user1,localhost,root,,,,); ---echo 'connection user1' -connection user1; -SELECT @@global.delay_key_write AS res_is_ON; -SET @@global.delay_key_write = ALL; -disconnect user1; - ---echo 'connect (user1,localhost,root,,,,)' -connect (user1,localhost,root,,,,); ---echo 'connection user1' -connection user1; -SELECT @@global.delay_key_write AS res_is_ALL; - ---echo '#--------------------FN_DYNVARS_023_02-------------------------#' -###################################################### -# Begin the functionality Testing of delay_key_write # -###################################################### - -# create procedure to add rows ---disable_query_log -DELIMITER //; -CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT) -BEGIN - WHILE (var1 < var2) DO - INSERT INTO t1 VALUES(var1,REPEAT('MYSQL',10),100000.0/var1); - SET var1=var1+1; - END WHILE; -END// -DELIMITER ;// ---enable_query_log - -#============================================================================== ---echo '---check when delay_key_write is OFF---' -#============================================================================== - - -SET @@global.delay_key_write = OFF; - - ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -# create a table with delay_key_write enabled -CREATE TABLE t1( -a INT PRIMARY KEY, -b VARCHAR(512), -c DOUBLE -)delay_key_write = 1; ---enable_query_log - - -FLUSH STATUS; - -CALL sp_addRecords(1,10); - -SHOW STATUS LIKE 'Key_reads'; -SHOW STATUS LIKE 'Key_writes'; -SHOW STATUS LIKE 'Key_write_requests'; -select count(*) from t1; - -#============================================================================== ---echo '----check when delay_key_write is ON---' -#============================================================================== - -SET @@global.delay_key_write = ON; - ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -# create a table with delay_key_write enabled -CREATE TABLE t1( -a INT PRIMARY KEY, -b VARCHAR(512), -c DOUBLE -)delay_key_write = 1; ---enable_query_log - -FLUSH STATUS; -CALL sp_addRecords(1,10); - -SHOW STATUS LIKE 'Key_reads'; -SHOW STATUS LIKE 'Key_writes'; -SHOW STATUS LIKE 'Key_write_requests'; -select count(*) from t1; - -#============================================================================== ---echo '----check when delay_key_write is ALL---' -#============================================================================== -SET @@global.delay_key_write = ALL; - ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -# create a table with delay_key_write disabled -CREATE TABLE t1( -a INT PRIMARY KEY, -b VARCHAR(512), -c DOUBLE -)delay_key_write = 0; ---enable_query_log - -FLUSH STATUS; -CALL sp_addRecords(1,10); - -SHOW STATUS LIKE 'Key_reads'; -SHOW STATUS LIKE 'Key_writes'; -SHOW STATUS LIKE 'Key_write_requests'; -select count(*) from t1; - -DROP PROCEDURE sp_addRecords; -DROP TABLE t1; - -#################################################### -# End of functionality testing for delay_key_write # -#################################################### diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index ce57645bd4b..94ad22b80d0 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -285,4 +285,47 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00'); INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); DROP TABLE t1,t2; +# +# Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock, +# even with low_priority_updates +# + +set @old_delayed_updates = @@global.low_priority_updates; +set global low_priority_updates = 1; +select @@global.low_priority_updates; + +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (a int, b int); +insert into t1 values (1,1); +lock table t1 read; +connect (update,localhost,root,,); +connection update; +--echo connection: update +--send insert delayed into t1 values (2,2); +connection default; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where command = "Delayed insert" and state = "upgrading lock"; +--source include/wait_condition.inc +connect (select,localhost,root,,); +--echo connection: select +select * from t1; +connection default; +--echo connection: default +select * from t1; +connection default; +disconnect update; +disconnect select; +unlock tables; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where command = "Delayed insert" and state = "Waiting for INSERT"; +--source include/wait_condition.inc +select * from t1; +drop table t1; + +set global low_priority_updates = @old_delayed_updates; + --echo End of 5.1 tests diff --git a/mysql-test/t/delayed_insert_limit_func.test b/mysql-test/t/delayed_insert_limit_func.test deleted file mode 100644 index 97e1f2daed1..00000000000 --- a/mysql-test/t/delayed_insert_limit_func.test +++ /dev/null @@ -1,229 +0,0 @@ -############# mysql-test\t\sql_low_priority_updates_func.test ########################### -# # -# Variable Name: sql_low_priority_updates # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_low_priority_updates" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -######################################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - ---source include/not_embedded.inc - ---echo Creating connection con0 -connect (con0,localhost,root,,); ---echo Creating connection con1 -connect (con1,localhost,root,,); - -connection default; - -SET @global_delayed_insert_limit = @@GLOBAL.delayed_insert_limit; - -# -# Create Table -# - -CREATE TABLE t1 (a varchar(100)); - ---echo '#--------------------FN_DYNVARS_25_01-------------------------#' -# -# Value less than the provided INSERTS (9) -# - -SET GLOBAL delayed_insert_limit = 9; - ---echo ** Connection con0 ** -connection con0; -SET GLOBAL delayed_insert_limit = 9; ---echo ** Connection con1 ** -connection con1; -SET GLOBAL delayed_insert_limit = 9; ---echo ** Connection default ** -connection default; -SET GLOBAL delayed_insert_limit = 9; - -INSERT INTO t1 VALUES('1'); -INSERT INTO t1 VALUES('2'); -INSERT INTO t1 VALUES('3'); -INSERT INTO t1 VALUES('4'); -INSERT INTO t1 VALUES('5'); -INSERT INTO t1 VALUES('6'); - -LOCK TABLE t1 WRITE; - ---echo ** Connection con1 ** -connection con1; - -delimiter |; - -send -INSERT DELAYED INTO t1 VALUES('7'); -INSERT DELAYED INTO t1 VALUES('8'); -INSERT DELAYED INTO t1 VALUES('9'); -INSERT DELAYED INTO t1 VALUES('10'); -INSERT DELAYED INTO t1 VALUES('11'); -INSERT DELAYED INTO t1 VALUES('12'); -INSERT DELAYED INTO t1 VALUES('13'); -INSERT DELAYED INTO t1 VALUES('14'); -INSERT DELAYED INTO t1 VALUES('15'); -INSERT DELAYED INTO t1 VALUES('16'); -INSERT DELAYED INTO t1 VALUES('17'); -INSERT DELAYED INTO t1 VALUES('18'); -INSERT DELAYED INTO t1 VALUES('19'); -INSERT DELAYED INTO t1 VALUES('20'); -INSERT DELAYED INTO t1 VALUES('21'); -INSERT DELAYED INTO t1 VALUES('22');| - -delimiter ;| - ---echo ** Connection con0 ** -connection con0; - -delimiter |; - -send -SELECT * FROM t1;| - -delimiter ;| - ---echo ** Connection default ** -connection default; - ---echo Waiting for 1 sec ---sleep 1 - -UNLOCK TABLES; - ---echo ** Connection con0 ** -connection con0; -reap; ---echo 'Bug#35386: insert delayed inserts 1 + limit rows instead of just limit rows' - ---echo ** Connection default ** -connection default; - ---echo Waiting for 1 sec ---sleep 1 ---echo Checking if the delayed insert continued afterwards -SELECT * FROM t1; - -DELETE FROM t1; - - ---echo '#--------------------FN_DYNVARS_25_02-------------------------#' -# -# Value 5 -# - -SET GLOBAL delayed_insert_limit = 20; - ---echo ** Connection con0 ** -connection con0; -SET GLOBAL delayed_insert_limit = 20; ---echo ** Connection con1 ** -connection con1; -SET GLOBAL delayed_insert_limit = 20; ---echo ** Connection default ** -connection default; -SET GLOBAL delayed_insert_limit = 20; - -INSERT INTO t1 VALUES('1'); -INSERT INTO t1 VALUES('2'); -INSERT INTO t1 VALUES('3'); -INSERT INTO t1 VALUES('4'); -INSERT INTO t1 VALUES('5'); -INSERT INTO t1 VALUES('6'); - -LOCK TABLE t1 WRITE; - ---echo ** Connection con1 ** -connection con1; - ---echo Asynchronous execute -delimiter |; - -send -INSERT DELAYED INTO t1 VALUES('7'); -INSERT DELAYED INTO t1 VALUES('8'); -INSERT DELAYED INTO t1 VALUES('9'); -INSERT DELAYED INTO t1 VALUES('10'); -INSERT DELAYED INTO t1 VALUES('11'); -INSERT DELAYED INTO t1 VALUES('12'); -INSERT DELAYED INTO t1 VALUES('13'); -INSERT DELAYED INTO t1 VALUES('14'); -INSERT DELAYED INTO t1 VALUES('15'); -INSERT DELAYED INTO t1 VALUES('16'); -INSERT DELAYED INTO t1 VALUES('17'); -INSERT DELAYED INTO t1 VALUES('18'); -INSERT DELAYED INTO t1 VALUES('19'); -INSERT DELAYED INTO t1 VALUES('20'); -INSERT DELAYED INTO t1 VALUES('21'); -INSERT DELAYED INTO t1 VALUES('22');| - -delimiter ;| - ---echo ** Connection con0 ** -connection con0; - ---echo Asynchronous execute -delimiter |; - -send -SELECT * FROM t1;| - -delimiter ;| - ---echo ** Connection default ** -connection default; - ---echo Waiting for 1 sec ---sleep 1 - -UNLOCK TABLES; - ---echo ** Connection con0 ** -connection con0; ---echo Asynchronous execute result -reap; - ---echo ** Connection default** -connection default; - ---echo Waiting for 1 sec ---sleep 1 ---echo Checking if the delayed insert gives the same result afterwards -SELECT * FROM t1; - -DELETE FROM t1; - -# -# Cleanup -# - ---echo Switching to default -connection default; - ---echo Disconnecting from con1, con0 -disconnect con0; -disconnect con1; - -DROP TABLE t1; - -SET @@GLOBAL.delayed_insert_limit = @global_delayed_insert_limit; diff --git a/mysql-test/t/delayed_insert_timeout_basic.test b/mysql-test/t/delayed_insert_timeout_basic.test deleted file mode 100644 index 8bad6b2dfe6..00000000000 --- a/mysql-test/t/delayed_insert_timeout_basic.test +++ /dev/null @@ -1,171 +0,0 @@ -################# mysql-test\t\delayed_insert_timeout_basic.test ############### -# # -# Variable Name: delayed_insert_timeout # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 300 # -# Range: 1 - 4294967286 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "delayed_insert_timeout" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_delayed_insert_timeout # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################# -# START OF delayed_insert_timeout TESTS # -################################################################# - -############################################################################## -# Saving initial value of delayed_insert_timeout in a temporary variable # -############################################################################## - -SET @start_value = @@global.delayed_insert_timeout; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_025_01------------------------#' -############################################################################## -# Display the DEFAULT value of delayed_insert_timeout # -############################################################################## - -SET @@global.delayed_insert_timeout = 100; -SET @@global.delayed_insert_timeout = DEFAULT; -SELECT @@global.delayed_insert_timeout; - - ---echo '#---------------------FN_DYNVARS_025_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.delayed_insert_timeout = @start_value; -SELECT @@global.delayed_insert_timeout = 300; - - ---echo '#--------------------FN_DYNVARS_025_03------------------------#' -############################################################################## -# Change the value of delayed_insert_timeout to a valid value # -############################################################################## - -SET @@global.delayed_insert_timeout = 10000; -SELECT @@global.delayed_insert_timeout; -SET @@global.delayed_insert_timeout = 429; -SELECT @@global.delayed_insert_timeout; -SET @@global.delayed_insert_timeout = 1; -SELECT @@global.delayed_insert_timeout; - - ---echo '#--------------------FN_DYNVARS_025_04-------------------------#' -################################################################################# -# Change the value of delayed_insert_timeout to invalid value # -################################################################################# - -SET @@global.delayed_insert_timeout = 0; -SELECT @@global.delayed_insert_timeout; -SET @@global.delayed_insert_timeout = -1024; -SELECT @@global.delayed_insert_timeout; -SET @@global.delayed_insert_timeout = 42949672950; -SELECT @@global.delayed_insert_timeout; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.delayed_insert_timeout = 429496729.5; -SELECT @@global.delayed_insert_timeout; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.delayed_insert_timeout = ON; -SELECT @@global.delayed_insert_timeout; - - ---echo '#-------------------FN_DYNVARS_025_05----------------------------#' -################################################################################# -# Test if accessing session delayed_insert_timeout gives error # -################################################################################# - ---Error 1229 -SET @@session.delayed_insert_timeout = 0; ---Error 1193 -SELECT @@session.dalayed_insert_timeout; - ---echo '#----------------------FN_DYNVARS_025_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.delayed_insert_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='delayed_insert_timeout'; - -SELECT @@delayed_insert_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='delayed_insert_timeout'; - - ---echo '#---------------------FN_DYNVARS_025_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.delayed_insert_timeout = TRUE; -SELECT @@global.delayed_insert_timeout; -SET @@global.delayed_insert_timeout = FALSE; -SELECT @@global.delayed_insert_timeout; - - ---echo '#---------------------FN_DYNVARS_025_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.delayed_insert_timeout = 1; -SELECT @@delayed_insert_timeout = @@global.delayed_insert_timeout; - - ---echo '#---------------------FN_DYNVARS_025_09----------------------#' -################################################################################ -# Check if delayed_insert_timeout can be accessed with and without @@ sign # -################################################################################ - ---Error 1229 -SET delayed_insert_timeout = 1; -SELECT @@delayed_insert_timeout; ---Error 1064 -SET local.delayed_insert_timeout = 1; ---Error 1109 -SELECT local.delayed_insert_timeout; ---Error 1064 -SET global.delayed_insert_timeout = 1; ---Error 1109 -SELECT global.delayed_insert_timeout; ---Error 1054 -SELECT delayed_insert_timeout = @@session.delayed_insert_timeout; -# Restore initial value -SET @@global.delayed_insert_timeout = @start_value; -SELECT @@global.delayed_insert_timeout; - - -############################## -# Restore initial value # -############################## - -SET @@global.delayed_insert_timeout = @start_value; -SELECT @@global.delayed_insert_timeout; - - -################################################################ -# END OF delayed_insert_timeout TESTS # -################################################################ - diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 5de0a435ba5..f61090102ff 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -9,7 +9,6 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -federated_transactions : Bug#29523 Transactions do not work -log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows -slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions -wait_timeout_func : Bug #41225 joro wait_timeout_func fails +kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild. +query_cache_28249 : Bug#41098 Query Cache returns wrong result with concurrent insert +innodb_bug39438 : BUG#42383 2009-01-28 lsoares "This fails in embedded and on windows. Note that this test is not run on windows and on embedded in PB for main trees currently" diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 5be8d911881..a77d1136840 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -440,7 +440,6 @@ SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a; DROP TABLE t1; #Bug #20836: Selecting into variables results in wrong results being returned - --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -488,14 +487,14 @@ CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20) default NULL); SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE -'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE'; -LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2; +'../../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE'; +LOAD DATA INFILE '../../tmp/data1.tmp' INTO TABLE t2; --error 0,1 --remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE -'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE'; -LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2; +'../../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE'; +LOAD DATA INFILE '../../tmp/data2.tmp' INTO TABLE t2; --remove_file $MYSQLTEST_VARDIR/tmp/data2.tmp SELECT @v19, @v20; diff --git a/mysql-test/t/div_precision_increment_basic.test b/mysql-test/t/div_precision_increment_basic.test deleted file mode 100644 index 40497e829df..00000000000 --- a/mysql-test/t/div_precision_increment_basic.test +++ /dev/null @@ -1,209 +0,0 @@ -############## mysql-test\t\div_precision_increment_basic.test ################# -# # -# Variable Name: div_precision_increment # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 4 # -# Range: 0 - 30 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "div_precision_increment" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_div_precision_increment # -# # -################################################################################ - ---source include/load_sysvars.inc - -####################################################################### -# START OF div_precision_increment TESTS # -####################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.div_precision_increment; -SELECT @start_global_value; -SET @start_session_value = @@session.div_precision_increment; -SELECT @start_session_value; - ---echo '#--------------------FN_DYNVARS_027_01-------------------------#' -####################################################################### -# Display the DEFAULT value of div_precision_increment # -####################################################################### - -SET @@global.div_precision_increment = 100; -SET @@global.div_precision_increment = DEFAULT; -SELECT @@global.div_precision_increment; - -SET @@session.div_precision_increment = 200; -SET @@session.div_precision_increment = DEFAULT; -SELECT @@session.div_precision_increment; - ---echo '#--------------------FN_DYNVARS_027_02-------------------------#' -####################################################################### -# Check the DEFAULT value of div_precision_increment # -####################################################################### - -SET @@global.div_precision_increment = @start_global_value; -SELECT @@global.div_precision_increment = 4; - -SET @@session.div_precision_increment = @start_session_value; -SELECT @@session.div_precision_increment = 4; - ---echo '#--------------------FN_DYNVARS_027_03-------------------------#' -################################################################################# -# Change the value of div_precision_increment to a valid value for GLOBAL Scope # -################################################################################# - -SET @@global.div_precision_increment = 1; -SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = 0; -SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = 10; -SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = 30; -SELECT @@global.div_precision_increment; - - ---echo '#--------------------FN_DYNVARS_027_04-------------------------#' -################################################################################## -# Change the value of div_precision_increment to a valid value for SESSION Scope # -################################################################################## - -SET @@session.div_precision_increment = 1; -SELECT @@session.div_precision_increment; -SET @@session.div_precision_increment = 0; -SELECT @@session.div_precision_increment; -SET @@session.div_precision_increment = 7; -SELECT @@session.div_precision_increment; -SET @@session.div_precision_increment = 30; -SELECT @@session.div_precision_increment; - - ---echo '#------------------FN_DYNVARS_027_05-----------------------#' -################################################################### -# Change the value of div_precision_increment to an invalid value # -################################################################### - -SET @@global.div_precision_increment = 31; -SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = 40; -SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = -1024; -SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = 65536; -SELECT @@global.div_precision_increment; -SET @@session.div_precision_increment = 40; -SELECT @@session.div_precision_increment; -SET @@session.div_precision_increment = 31; -SELECT @@session.div_precision_increment; -SET @@session.div_precision_increment = -2; -SELECT @@session.div_precision_increment; -SET @@session.div_precision_increment = 65550; -SELECT @@session.div_precision_increment; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.div_precision_increment = 65530.30; -SELECT @@global.div_precision_increment; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.div_precision_increment = OFF; -SELECT @@global.div_precision_increment; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.div_precision_increment = ON; -SELECT @@session.div_precision_increment; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.div_precision_increment = 65530.30; -SELECT @@session.div_precision_increment; - - ---echo '#------------------FN_DYNVARS_027_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SELECT @@global.div_precision_increment = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='div_precision_increment'; - ---echo '#------------------FN_DYNVARS_027_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.div_precision_increment = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='div_precision_increment'; - - -# FN_DYNVARS_027_07 - Check if TRUE and FALSE values can be used on variable -SET @@global.div_precision_increment = TRUE; -SELECT @@global.div_precision_increment; -SET @@global.div_precision_increment = FALSE; -SELECT @@global.div_precision_increment; - - ---echo '#---------------------FN_DYNVARS_027_08----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.div_precision_increment = 0; -SELECT @@div_precision_increment = @@global.div_precision_increment; - - ---echo '#---------------------FN_DYNVARS_027_09----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@div_precision_increment = 1; -SELECT @@div_precision_increment = @@local.div_precision_increment; -SELECT @@local.div_precision_increment = @@session.div_precision_increment; - - ---echo '#---------------------FN_DYNVARS_027_10----------------------#' -################################################################################## -# Check if div_precision_increment can be accessed with and without @@ sign # -################################################################################## - -SET div_precision_increment = 1; -SELECT @@div_precision_increment; ---Error ER_PARSE_ERROR -SET local.div_precision_increment = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.div_precision_increment; ---Error ER_PARSE_ERROR -SET session.div_precision_increment = 1; ---Error ER_UNKNOWN_TABLE -SELECT session.div_precision_increment; ---Error ER_BAD_FIELD_ERROR -SELECT div_precision_increment = @@session.div_precision_increment; - - - -#################################### -# Restore initial value # -#################################### - -SET @@global.div_precision_increment = @start_global_value; -SELECT @@global.div_precision_increment; -SET @@session.div_precision_increment = @start_session_value; -SELECT @@session.div_precision_increment; - - -####################################################### -# END OF div_precision_increment TESTS # -####################################################### - diff --git a/mysql-test/t/div_precision_increment_func.test b/mysql-test/t/div_precision_increment_func.test deleted file mode 100644 index aebca88abf9..00000000000 --- a/mysql-test/t/div_precision_increment_func.test +++ /dev/null @@ -1,129 +0,0 @@ -############## mysql-test\t\div_precision_increment_func.test ################# -# # -# Variable Name: div_precision_increment # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 4 # -# Range: 0 - 30 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "div_precision_increment" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_div_precision_increment # -# # -################################################################################ - -let $save_div_precision_increment = `SELECT @@global.div_precision_increment` - -#SET @save_div_precision_increment = @@global.div_precision_increment; - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30), -salary LONG -); - ---echo '#--------------------FN_DYNVARS_027_01-------------------------#' -#################################################################### -# Setting initial value of div_precision_increment to 1 -# to check whether it is working with columns or not. -#################################################################### - ---echo ## Setting initial session value of variable to 3 ## -SET @@session.div_precision_increment = 3; - ---echo ## Inserting some rows in table ## -INSERT into t1(name, salary) values('Record_1', 100011); -INSERT into t1(name, salary) values('Record_2', 501); -INSERT into t1(name, salary) values('Record_3', 210); - -SELECT name, salary, ((salary * 2.5)/1000) AS INCOME from t1; ---echo 'Bug#35374: div_precision is not working with table column' - ---echo ## Verifying variable's behavior with direct division ## -SELECT 1/7; - ---echo '#--------------------FN_DYNVARS_027_02-------------------------#' -#################################################################### -# Verifying div_precision_increment behavior by inserting rows -# to check whether it is working with columns or not. -#################################################################### - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30), -salary LONG, -income_tax FLOAT -); - ---echo ## Creating new connection test_con1 ## -connect (test_con1, localhost, root,,); -connection test_con1; - ---echo ## Setting global & session scope value of variable ## -SET @@global.div_precision_increment = 2; -SET @@session.div_precision_increment = 1; -SELECT @@global.div_precision_increment; -SELECT @@session.div_precision_increment; - ---echo ## Inserting some data and verifying behavior of variable ## -INSERT into t1(name, salary, income_tax) values('Record_1', 100011, 100011*2.5/1000); -INSERT into t1(name, salary, income_tax) values('Record_2', 501, 501*2.5/1000); -INSERT into t1(name, salary, income_tax) values('Record_3', 210, 210*2.5/1000); -SELECT * from t1; - ---echo ## Creating new connection ## -connect (test_con2, localhost, root,,); -connection test_con2; - ---echo ## Verifying session & global value of variable ## -SELECT @@global.div_precision_increment = 2; -SELECT @@session.div_precision_increment = 2; - ---echo ## Verifying behavior of variable by inserting some rows in table ## -INSERT into t1(name, salary, income_tax) values('Record_4', 100011, 100011*2.5/1000); -INSERT into t1(name, salary, income_tax) values('Record_5', 501, 501*2.5/1000); -INSERT into t1(name, salary, income_tax) values('Record_6', 210, 210*2.5/1000); -SELECT * from t1; - ---echo ## Dropping table t1 ## -drop table t1; - ---echo ## Disconnection both the connections ## -disconnect test_con1; -disconnect test_con2; - -connection default; -eval SET @@global.div_precision_increment = $save_div_precision_increment; - - - - diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index 2c490b51afc..4f0777922b8 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -131,7 +131,8 @@ create table mysql_test.t1(f1 int); create table mysql_test.`#sql-347f_7` (f1 int); create table mysql_test.`#sql-347f_8` (f1 int); drop table mysql_test.`#sql-347f_8`; -copy_file $MYSQLTEST_VARDIR/master-data/mysql_test/t1.frm $MYSQLTEST_VARDIR/master-data/mysql_test/#sql-347f_6.frm; +let $MYSQLD_DATADIR= `select @@datadir`; +copy_file $MYSQLD_DATADIR/mysql_test/t1.frm $MYSQLD_DATADIR/mysql_test/#sql-347f_6.frm; drop database mysql_test; ########################################################################### @@ -148,17 +149,18 @@ DROP DATABASE IF EXISTS mysql_test; CREATE DATABASE mysql_test; ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI +let $MYSQLD_DATADIR= `select @@datadir`; +--copy_file $MYSQLD_DATADIR/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm +--copy_file $MYSQLD_DATADIR/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD +--copy_file $MYSQLD_DATADIR/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI DROP TABLE mysql.proc; DROP DATABASE mysql_test; ---copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm ---copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD ---copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI +--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.frm $MYSQLD_DATADIR/mysql/proc.frm +--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYD $MYSQLD_DATADIR/mysql/proc.MYD +--copy_file $MYSQLTEST_VARDIR/tmp/bug29958.proc.MYI $MYSQLD_DATADIR/mysql/proc.MYI --echo --echo # -- diff --git a/mysql-test/t/engine_condition_pushdown_basic.test b/mysql-test/t/engine_condition_pushdown_basic.test deleted file mode 100644 index ee781159d6a..00000000000 --- a/mysql-test/t/engine_condition_pushdown_basic.test +++ /dev/null @@ -1,227 +0,0 @@ -############## mysql-test\t\engine_condition_pushdown_basic.test ############## -# # -# Variable Name: engine_condition_pushdown # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: OFF # -# Valid Values: ON, OFF # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable engine_condition_pushdown# -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF engine_condition_pushdown TESTS # -######################################################################## - - -############################################################################### -# Saving initial value of engine_condition_pushdown in a temporary variable # -############################################################################### - -SET @session_start_value = @@session.engine_condition_pushdown; -SELECT @session_start_value; - -SET @global_start_value = @@global.engine_condition_pushdown; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_028_01------------------------#' -######################################################################## -# Display the DEFAULT value of engine_condition_pushdown # -######################################################################## - -SET @@session.engine_condition_pushdown = 0; -SET @@session.engine_condition_pushdown = DEFAULT; -SELECT @@session.engine_condition_pushdown; - -SET @@global.engine_condition_pushdown = 0; -SET @@global.engine_condition_pushdown = DEFAULT; -SELECT @@global.engine_condition_pushdown; - ---echo '#---------------------FN_DYNVARS_028_02-------------------------#' -############################################################################### -# Check if engine_condition_pushdown can be accessed with and without @@ sign # -############################################################################### - -SET engine_condition_pushdown = 1; -SELECT @@engine_condition_pushdown; - ---Error ER_UNKNOWN_TABLE -SELECT session.engine_condition_pushdown; - ---Error ER_UNKNOWN_TABLE -SELECT local.engine_condition_pushdown; - ---Error ER_UNKNOWN_TABLE -SELECT global.engine_condition_pushdown; - -SET session engine_condition_pushdown = 0; -SELECT @@session.engine_condition_pushdown; - -SET global engine_condition_pushdown = 0; -SELECT @@global.engine_condition_pushdown; - - ---echo '#--------------------FN_DYNVARS_028_03------------------------#' -########################################################################## -# change the value of engine_condition_pushdown to a valid value # -########################################################################## - -SET @@session.engine_condition_pushdown = 0; -SELECT @@session.engine_condition_pushdown; -SET @@session.engine_condition_pushdown = 1; -SELECT @@session.engine_condition_pushdown; - - -SET @@global.engine_condition_pushdown = 0; -SELECT @@global.engine_condition_pushdown; -SET @@global.engine_condition_pushdown = 1; -SELECT @@global.engine_condition_pushdown; - - ---echo '#--------------------FN_DYNVARS_028_04-------------------------#' -########################################################################### -# Change the value of engine_condition_pushdown to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.engine_condition_pushdown = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.engine_condition_pushdown = 1.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.engine_condition_pushdown = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.engine_condition_pushdown = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.engine_condition_pushdown = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.engine_condition_pushdown = ÕN; - -SET @@session.engine_condition_pushdown = OF; -SELECT @@session.engine_condition_pushdown; ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.engine_condition_pushdown = ÓFF; - - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.engine_condition_pushdown = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.engine_condition_pushdown = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.engine_condition_pushdown = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.engine_condition_pushdown = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.engine_condition_pushdown = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.engine_condition_pushdown = ÕN; - -SET @@global.engine_condition_pushdown = OF; -SELECT @@global.engine_condition_pushdown; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.engine_condition_pushdown = ÓFF; - - ---echo '#-------------------FN_DYNVARS_028_05----------------------------#' -########################################################################### -# Test if changing global variable effects session and vice versa # -########################################################################### - -SET @@global.engine_condition_pushdown = 0; -SET @@session.engine_condition_pushdown = 1; -SELECT @@global.engine_condition_pushdown AS res_is_0; - -SET @@global.engine_condition_pushdown = 0; -SELECT @@session.engine_condition_pushdown AS res_is_1; - ---echo '#----------------------FN_DYNVARS_028_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.engine_condition_pushdown = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='engine_condition_pushdown'; -SELECT @@global.engine_condition_pushdown; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='engine_condition_pushdown'; - ---echo '#----------------------FN_DYNVARS_028_07------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@session.engine_condition_pushdown = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='engine_condition_pushdown'; -SELECT @@session.engine_condition_pushdown; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='engine_condition_pushdown'; - - ---echo '#---------------------FN_DYNVARS_028_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.engine_condition_pushdown = OFF; -SELECT @@session.engine_condition_pushdown; -SET @@session.engine_condition_pushdown = ON; -SELECT @@session.engine_condition_pushdown; - -SET @@global.engine_condition_pushdown = OFF; -SELECT @@global.engine_condition_pushdown; -SET @@global.engine_condition_pushdown = ON; -SELECT @@global.engine_condition_pushdown; - ---echo '#---------------------FN_DYNVARS_028_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.engine_condition_pushdown = TRUE; -SELECT @@session.engine_condition_pushdown; -SET @@session.engine_condition_pushdown = FALSE; -SELECT @@session.engine_condition_pushdown; - -SET @@global.engine_condition_pushdown = TRUE; -SELECT @@global.engine_condition_pushdown; -SET @@global.engine_condition_pushdown = FALSE; -SELECT @@global.engine_condition_pushdown; - -############################## -# Restore initial value # -############################## - -SET @@session.engine_condition_pushdown = @session_start_value; -SELECT @@session.engine_condition_pushdown; - -SET @@global.engine_condition_pushdown = @global_start_value; -SELECT @@global.engine_condition_pushdown; - -############################################################### -# END OF engine_condition_pushdown TESTS # -############################################################### diff --git a/mysql-test/t/error_count_basic.test b/mysql-test/t/error_count_basic.test deleted file mode 100644 index 14001874c22..00000000000 --- a/mysql-test/t/error_count_basic.test +++ /dev/null @@ -1,97 +0,0 @@ - - -################## mysql-test\t\error_count_basic.test ######################## -# # -# Variable Name: error_count # -# Scope: Session # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable error_count # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_005_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### - -SELECT COUNT(@@SESSION.error_count); ---echo 1 Expected - ---echo '#---------------------BS_STVARS_005_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@SESSION.error_count=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@SESSION.error_count); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_005_03----------------------#' -################################################################# -# Check if the value in SESSION Table matches value in variable # -################################################################# - -SELECT @@SESSION.error_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='error_count'; ---echo 1 Expected - -SELECT COUNT(@@SESSION.error_count); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='error_count'; ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_005_04----------------------#' -################################################################################ -# Check if accessing variable with and without SESSION point to same variable # -################################################################################ -SELECT @@error_count = @@SESSION.error_count; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_005_05----------------------#' -################################################################################ -# Check if error_count can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@error_count); ---echo 1 Expected -SELECT COUNT(@@local.error_count); ---echo 1 Expected -SELECT COUNT(@@SESSION.error_count); ---echo 1 Expected - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@GLOBAL.error_count); ---echo Expected error 'Variable is a SESSION variable' - ---error ER_BAD_FIELD_ERROR -SELECT COUNT(error_count = @@GLOBAL.error_count); ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/error_simulation-master.opt b/mysql-test/t/error_simulation-master.opt deleted file mode 100644 index edb77cfa85e..00000000000 --- a/mysql-test/t/error_simulation-master.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-debug=d,raise_error diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test index 2f6ea5eac87..f730c95208e 100644 --- a/mysql-test/t/error_simulation.test +++ b/mysql-test/t/error_simulation.test @@ -21,10 +21,15 @@ INSERT INTO t1 VALUES set tmp_table_size=1024; +# Set debug flag so an error is returned when +# tmp table in query is converted from heap to myisam +set session debug="d,raise_error"; + --replace_regex /in table '[^']+'/in table 'tmp_table'/ --error ER_DUP_KEY SELECT MAX(a) FROM t1 GROUP BY a,b; set tmp_table_size=default; - DROP TABLE t1; + + diff --git a/mysql-test/t/event_scheduler_basic.test b/mysql-test/t/event_scheduler_basic.test deleted file mode 100644 index f7045651613..00000000000 --- a/mysql-test/t/event_scheduler_basic.test +++ /dev/null @@ -1,175 +0,0 @@ -#################### mysql-test\t\event_scheduler_basic.test ################### -# # -# Variable Name: event_scheduler # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Enumeration # -# Default Value: OFF # -# Valid Values: ON, OFF, DISABLED # -# # -# # -# Creation Date: 2008-03-14 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "event_scheduler" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-options.html#option_mysqld_event-scheduler # -# # -################################################################################ ---source include/not_embedded.inc ---source include/load_sysvars.inc - -############################################################### -# START OF event_scheduler TESTS # -############################################################### - - -####################################################################### -# Saving initial value of event_scheduler in a temporary variable # -####################################################################### - -SET @start_value = @@global.event_scheduler; -SELECT @start_value; - - ---echo '#---------------------FN_DYNVARS_004_01-------------------------#' -############################################### -# Verify default value of variable # -############################################### - ---Error ER_NO_DEFAULT -SET @@global.event_scheduler = DEFAULT; -#SELECT @@global.event_scheduler = OFF; ---echo 'Bug# 34878: According to documentation the default value of variable is OFF'; - ---echo '#--------------------FN_DYNVARS_004_02------------------------#' -####################################################################### -# Change the value of event_scheduler to a valid value # -####################################################################### - -SET @@global.event_scheduler = ON; -SELECT @@global.event_scheduler; -SET @@global.event_scheduler = OFF; -SELECT @@global.event_scheduler; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = DISABLED; -SELECT @@global.event_scheduler; - - ---echo '#--------------------FN_DYNVARS_004_03-------------------------#' -####################################################################### -# Change the value of event_scheduler to invalid value # -####################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.event_scheduler = ''; - - ---echo '#-------------------FN_DYNVARS_004_04----------------------------#' -################################################################### -# Test if accessing session event_scheduler gives error # -################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.event_scheduler = OFF; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.event_scheduler; - - ---echo '#----------------------FN_DYNVARS_004_05------------------------#' -############################################################################## -# Check if the value in GLOBAL Tables matches values in variable # -############################################################################## - -SELECT @@global.event_scheduler = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='event_scheduler'; - - ---echo '#---------------------FN_DYNVARS_004_06----------------------#' -################################################################### -# Check if 0 and 1 values can be used on variable # -################################################################### - -SET @@global.event_scheduler = 0; -SELECT @@global.event_scheduler; -SET @@global.event_scheduler = 1; -SELECT @@global.event_scheduler; - ---echo '#---------------------FN_DYNVARS_004_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.event_scheduler = TRUE; -SELECT @@global.event_scheduler; -SET @@global.event_scheduler = FALSE; -SELECT @@global.event_scheduler; - ---echo '#---------------------FN_DYNVARS_004_08----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@global.event_scheduler = ON; -SELECT @@event_scheduler = @@global.event_scheduler; - ---echo '#---------------------FN_DYNVARS_004_09----------------------#' -####################################################################### -# Check if event_scheduler can be accessed with and without @@ sign # -####################################################################### ---Error ER_GLOBAL_VARIABLE -SET event_scheduler = ON; ---Error ER_PARSE_ERROR -SET local.event_scheduler = OFF; ---Error ER_UNKNOWN_TABLE -SELECT local.event_scheduler; ---Error ER_PARSE_ERROR -SET global.event_scheduler = ON; ---Error ER_UNKNOWN_TABLE -SELECT global.event_scheduler; ---Error ER_BAD_FIELD_ERROR -SELECT event_scheduler = @@session.event_scheduler; - - - -############################## -# Restore initial value # -############################## - -SET @@global.event_scheduler = @start_value; -SELECT @@global.event_scheduler; - - -##################################################### -# END OF event_scheduler TESTS # -##################################################### diff --git a/mysql-test/t/event_scheduler_func.test b/mysql-test/t/event_scheduler_func.test deleted file mode 100644 index f727b2b6833..00000000000 --- a/mysql-test/t/event_scheduler_func.test +++ /dev/null @@ -1,91 +0,0 @@ -############## mysql-test\t\event_scheduler_func.test ########################## -# # -# Variable Name: event_scheduler # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: OFF # -# Valid Values: ON, OFF & DISABLED # -# # -# # -# Creation Date: 2008-03-17 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "event_scheduler" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_event_scheduler # -# # -################################################################################ - --- source include/not_embedded.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - ---echo '#--------------------FN_DYNVARS_018_01-------------------------#' -#################################################################### -# Setting initial value of event_scheduler to ON and verifying -# its behavior -#################################################################### - ---echo ## Setting initial value of variable to ON ## -SET @@global.event_scheduler = ON; -SELECT @@event_scheduler; - ---echo ## Creating new event ## -CREATE EVENT test_event_1 -ON SCHEDULE EVERY 3 SECOND -DO - INSERT into t1(name) values('Record_1'); - ---sleep 4 - -SELECT * from t1; - -DROP EVENT test_event_1; - ---sleep 1 -DELETE from t1; -select * from t1; - - ---echo '#--------------------FN_DYNVARS_018_02-------------------------#' -#################################################################### -# Setting initial value of event_scheduler to OFF and verifying -# its behavior -#################################################################### - ---echo ## Setting value of variable to OFF ## -SET @@global.event_scheduler = OFF; -SELECT @@event_scheduler; - ---echo ## Creating new event ## -CREATE EVENT test_event_1 -ON SCHEDULE EVERY 3 SECOND -DO - INSERT into t1(name) values('Record_2'); - ---sleep 4 - ---echo ## Table should be empty ## -SELECT * from t1; - -DROP EVENT test_event_1; ---echo ## Dropping table ## -DROP table t1; - diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index e86734c167c..69e2f681aa2 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1,40 +1,133 @@ #### t/events_bugs.test # # Last change: -# 2008-10-16 mleich +# 2009-01-08 mleich # - Fix for -# Bug#39848 events_bugs fails sporadically on pushbuild -# (missing rows in table event_log) -# Bug#39863 events_bugs fails sporadically on pushbuild (extra processes -# in I_S.PROCESSLIST) -# Bug#39978 main.events_bugs does not clean up -# Bug#39569 events_bugs fails sporadically on pushbuild (should have -# failed with errno 1539) -# - Minor improvements of formatting -# -# -# Outcome of some experiments (mleich): -# 1. SET GLOBAL event_scheduler = 'ON'; -# Immediate observation of the processlist. -# Effects: -# 1. There is no guarantee to find immediate the user 'event_scheduler' -# within information_schema.processlist. -# 2. Some states of the user 'event_scheduler' found in PROCESSLIST: -# USER HOST DB COMMAND TIME STATE INFO -# event_scheduler localhost NULL Daemon 0 Waiting on empty queue NULL -# event_scheduler localhost NULL Daemon 0 Initialized NULL +# Bug#41111 events_bugs fails sporadically on pushbuild +# - Avoid effects of +# Bug#41925 Warning 1366 Incorrect string value: ... for column processlist.info +# +# Please set $ +let $fixed_bug41925= 0; +# +# Dear maintainer of this test. Please do NOT remove the next big comment. +# The tests for events were quite unstable over a significant time because the +# effects of events in general and their representation within the processlist +# were partially not known. Therefore I had to make excessive experiments. +# The comment with the outcome of these experiments will be moved into a README +# file as soon as the tests for events get their own testsuite. +# +# Outcome of some experiments (mleich, mysql-5.1 2008-12): +# -------------------------------------------------------- +# 0. Most time used setup: +# High parallel I/O load +# set global event_scheduler= off; +# sleep 3; +# use events_test; +# create event e_16407 on schedule every 2 second do +# begin +# select 'FIRST COMMAND', sleep(0.5); +# select 'SECOND COMMAND'; +# end| +# set global event_scheduler= on; +# Start observation of the processlist +# +# +# 1. SET GLOBAL event_scheduler = 'ON' and immediate observation of the processlist. +# 1.1 Effects around event scheduler: +# 1.1.1 First phase (very short) +# No user 'event_scheduler' within information_schema.processlist. +# 1.1.2 Second phase observed (independend of probably existing events and very short) was +# USER HOST DB COMMAND TIME STATE INFO +# event_scheduler localhost NULL Daemon 0 Initialized NULL +# 1.1.3 Third phase observed: +# 1.1.3.1 Case we do not have existing events (rather long) +# USER HOST DB COMMAND TIME STATE INFO +# event_scheduler localhost NULL Daemon 0 Waiting on empty queue NULL +# 1.1.3.2 Case there exists already an event +# 1.1.3.2.1 Event executor is not visible in processlist but comes up soon +# USER HOST DB COMMAND TIME STATE INFO +# event_scheduler localhost NULL Daemon 0 NULL +# or +# event_scheduler localhost NULL Daemon 0 NULL NULL +# 1.1.3.2.2 A bit later, at least one event executor is or was visible in processlist +# The states mentioned in 3.2.1 or a bit later +# USER HOST DB COMMAND TIME STATE INFO +# event_scheduler localhost NULL Daemon 0 Waiting for next activation NULL +# 1.2 Effects around event executor: +# Typical processlist content: +# USER evtest1 -- Definer of event +# DB events_test -- DB during time of event creation (use DB is not allowed in events) +# COMMAND Connect +# STATE NULL +# INFO SET @evname = 'ev_sched_1823' -- Part of the event code +# +# State before "User sleep select 'FIRST COMMAND', sleep(0.5);" +# ID USER HOST DB COMMAND TIME STATE INFO +# 7 event_scheduler localhost NULL Connect 0 NULL NULL +# !! The user is not the event creator and the DB is different. !! +# !! This means that we must get later a change of the identity. !! +# or +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 checking permissions +# or +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 checking permissions CREATE PROCEDURE .... +# or +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 NULL select 'FIRST COMMAND', sleep(0.5) +# or +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 checking permissions select 'FIRST COMMAND'... +# or +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 Opening table select 'FIRST COMMAND', sleep(0.5) +# or +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 Locked select 'FIRST COMMAND', sleep(0.5) +# or +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 executing select 'FIRST COMMAND', sleep(0.5) +# +# State "User sleep select 'FIRST COMMAND', sleep(0.5);" reached +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 User sleep select 'FIRST COMMAND', sleep(0.5) +# +# State at end (! It looks like a slow CREATE PROC !) of event code execution was sometimes +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 logging slow query CREATE PROCEDURE `e_16407`... +# +# State after running some event code was sometimes +# USER HOST DB COMMAND TIME STATE INFO +# root localhost events_test Connect 0 logging slow query select 'SECOND COMMAND' +# +# State somewhere (I guess just before the event executor disappears) +# USER HOST DB COMMAND TIME STATE INFO +# Event thread fin <empty> events_test Connect 0 Clearing NULL +# +# # 2. SET GLOBAL event_scheduler = 'OFF'; # Immediate observation of the processlist. # Effects: # 1. I never found the user 'event_scheduler' within the processlist. # 2. Events just during execution could be found within the processlist # = It does not look like "SET GLOBAL event_scheduler = 'OFF'" stops them. -# 3. An event gets executed -# USER evtest1 (Definer of event) -# DB events_test (DB during time of event creation) -# COMMAND Connect -# STATE NULL -# INFO SET @evname = 'ev_sched_1823' (Part of the event code) +# ==> Everything mentioned in 1.2 above could be observed. +# +# Several subtests were weak because they showed random result set differences after issuing +# "SET GLOBAL EVENT_SCHEDULER= off;". +# 1. Reason one: There were already event executors +# Fix: Wait till there is no event executor active ==> no session WHERE +# - command IN ('Connect') +# There must be no parallel session being just in "Connect" phase! +# or +# - user = <who created the maybe current running events> +# There must be no parallel session of this person. +# or user = 'event_scheduler' with command = 'Connect' +# The session which will soon change its identity to event creator. +# +# 2. Reason two: If an event modifies a MyISAM table than a delayed visibilty of changes +# might occur (concurrent_inserts=on or delayed inserts ...). # # Can't test with embedded server that doesn't support grants @@ -47,6 +140,10 @@ drop database if exists mysqltest_db2; --enable_warnings create database events_test; use events_test; +# We use MyISAM tables and must avoid effects (visibility of changes might be +# delayed) caused by concurrent_insert on (default). +set @concurrent_insert= @@global.concurrent_insert; +set @@global.concurrent_insert = 0; # # START: Bug #31332 --event-scheduler option misbehaving @@ -56,8 +153,11 @@ use events_test; # option with no argument in events_bugs-master.opt turns the scheduler on. select * from information_schema.global_variables where variable_name like 'event_scheduler'; +# Check that the event_scheduler is really running +--source include/running_event_scheduler.inc SET GLOBAL event_scheduler = 'OFF'; +--source include/check_events_off.inc # # END: Bug #31332 @@ -132,8 +232,10 @@ create event e_55 on schedule every 10 hour starts 10000101000000 do drop table # Start - 16407: Events: Changes in sql_mode won't be taken into account # set global event_scheduler=off; +--source include/check_events_off.inc delete from mysql.event; set global event_scheduler= on; +--source include/running_event_scheduler.inc set @old_sql_mode:=@@sql_mode; set sql_mode=ansi; select get_lock('test_bug16407', 60); @@ -148,13 +250,13 @@ delimiter ;| # We wait till one event runs and hangs when trying to get the user lock. let $wait_condition= select count(*) > 0 from information_schema.processlist - where info = 'select get_lock(\'test_bug16407\', 60)'; + where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)'; --source include/wait_condition.inc --echo "Now if everything is fine the event has compiled and is locked" # Expect to see one session in events_test waiting for the user lock. select /*1*/ user, host, db, info from information_schema.processlist -where info = 'select get_lock(\'test_bug16407\', 60)'; +where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)'; select release_lock('test_bug16407'); # Try to avoid # Bug#39863 events_bugs fails sporadically on pushbuild (extra processes in I_S.PROCESSLIST) @@ -162,23 +264,27 @@ select release_lock('test_bug16407'); # Bug#32782 User lock hash fails to find lock # "various issues related to missing or incorrect return results # from release_lock()." -# Therefore we check here if the event executing session disappeared or +# Therefore we check here if the event executor is no more locked or # we waited >= 5 seconds for this to happen. let $wait_timeout= 5; let $wait_condition= select count(*) = 0 from information_schema.processlist - where info = 'select get_lock(\'test_bug16407\', 60)'; + where state = 'User lock' and info = 'select get_lock(\'test_bug16407\', 60)'; --source include/wait_condition.inc if (!`$wait_condition`) { - --echo ERROR: There must be no session with info = 'select get_lock('test_bug16407', 60) within the processlist. + --echo ERROR: There must be no session with + --echo state = 'User lock' and info = 'select get_lock('test_bug16407', 60) + --echo within the processlist. --echo We probably hit Bug#32782 User lock hash fails to find lock - eval select * from information_schema.processlist; + SELECT * FROM information_schema.processlist; --echo Abort exit; } set global event_scheduler= off; +# Wait till the event scheduler and all event executors have finished their work. +--source include/check_events_off.inc select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name; --echo "Let's check whether we change the sql_mode on ALTER EVENT" @@ -191,9 +297,10 @@ set sql_mode="ansi"; select get_lock('ee_16407_2', 60); set global event_scheduler= 1; +--source include/running_event_scheduler.inc --echo "Another sql_mode test" set sql_mode="traditional"; -create table events_smode_test(ev_name char(10), a date) engine=myisam; +create table events_smode_test(ev_name char(10), a date); --echo "This should never insert something" delimiter |; create event ee_16407_2 on schedule every 60 second do @@ -203,7 +310,7 @@ begin insert into events_test.events_smode_test values('ee_16407_2','1980-19-02'); end| --error ER_TRUNCATED_WRONG_VALUE -insert into events_smode_test values ('test','1980-19-02')| +insert into events_test.events_smode_test values ('test','1980-19-02')| --echo "This is ok" create event ee_16407_3 on schedule every 60 second do begin @@ -223,13 +330,20 @@ end| delimiter ;| select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name; +# We wait till we have three event executors waiting for the removal of the lock. let $wait_condition= select count(*) = 3 from information_schema.processlist - where info = 'select get_lock(\'ee_16407_2\', 60)'; + where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)'; --source include/wait_condition.inc +# There is an extreme low risk that an additional event execution is just coming +# up because +# - the events have to be started every 60 seconds. +# - we are just after event creation + waiting for seeing 3 locked +# We expect to see three event executors in state 'User lock'. select /*2*/ user, host, db, info from information_schema.processlist -where info = 'select get_lock(\'ee_16407_2\', 60)'; +where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)'; + select release_lock('ee_16407_2'); # Try to avoid @@ -244,13 +358,37 @@ let $wait_timeout= 5; let $wait_condition= select count(*) = 0 from information_schema.processlist - where info = 'select get_lock(\'ee_16407_2\', 60)'; + where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)'; --source include/wait_condition.inc +if (!`$wait_condition`) +{ + --echo ERROR: There must be no session with + --echo state = 'User lock' and info = 'select get_lock('test_bug16407_2', 60) + --echo within the processlist. + --echo We probably hit Bug#32782 User lock hash fails to find lock + SELECT * FROM information_schema.processlist; + --echo Abort + exit; +} +# We expect to see no event executors in state 'User lock'. +if(!$fixed_bug41925) +{ + --disable_warnings +} select /*3*/ user, host, db, info from information_schema.processlist -where info = 'select get_lock(\'ee_16407_2\', 60)'; +where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)'; +if(!$fixed_bug41925) +{ + --enable_warnings +} + set global event_scheduler= off; -select * from events_smode_test order by ev_name, a; +# Wait till the event scheduler and all event executors have finished their work. +# Without this the next queries will give unstable results. +--source include/check_events_off.inc + +select * from events_test.events_smode_test order by ev_name, a; --echo "OK, last check before we drop them" select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name; drop event ee_16407_2; @@ -259,11 +397,12 @@ drop event ee_16407_4; --echo "And now one last test regarding sql_mode and call of SP from an event" -delete from events_smode_test; +delete from events_test.events_smode_test; set sql_mode='ansi'; select get_lock('ee_16407_5', 60); set global event_scheduler= on; +--source include/running_event_scheduler.inc set sql_mode='traditional'; delimiter |; @@ -286,34 +425,46 @@ delimiter ;| let $wait_condition= select count(*) = 2 from information_schema.processlist - where info = 'select get_lock(\'ee_16407_5\', 60)'; + where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)'; --source include/wait_condition.inc --echo "Should have 2 locked processes" select /*4*/ user, host, db, info from information_schema.processlist -where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') -order by info; +where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)'; + select release_lock('ee_16407_5'); let $wait_condition= - select count(*) = 1 and user = 'event_scheduler' and info is null - from information_schema.processlist - where (command!='Daemon' || user='event_scheduler') - and (info is null or info not like '%processlist%'); + select count(*) = 0 from information_schema.processlist + where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)'; --source include/wait_condition.inc --echo "Should have 0 processes locked" +if(!$fixed_bug41925) +{ + --disable_warnings +} select /*5*/ user, host, db, info from information_schema.processlist -where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') -order by info; -select * from events_smode_test order by ev_name, a; +where state = 'User lock' and info = 'select get_lock(\'ee_16407_5\', 60)'; +if(!$fixed_bug41925) +{ + --enable_warnings +} + +# Wait till all event executors have finished their work, so that we can be sure +# that their changes to events_smode_test are done. +--source include/no_running_events.inc + +select * from events_test.events_smode_test order by ev_name, a; --echo "And here we check one more time before we drop the events" select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name; + drop event ee_16407_5; drop event ee_16407_6; drop procedure ee_16407_5_pendant; drop procedure ee_16407_6_pendant; set global event_scheduler= off; +--source include/check_events_off.inc drop table events_smode_test; set sql_mode=@old_sql_mode; # @@ -324,6 +475,7 @@ set sql_mode=@old_sql_mode; # START - 18897: Events: unauthorized action possible with alter event rename # set global event_scheduler=off; +--source include/check_events_off.inc --disable_warnings delete from mysql.user where User like 'mysqltest_%'; delete from mysql.db where User like 'mysqltest_%'; @@ -409,6 +561,7 @@ create function f22830 () returns int return 5; select get_lock('ee_22830', 60); set global event_scheduler=on; +--source include/running_event_scheduler.inc delimiter |; create procedure p22830_wait() @@ -456,6 +609,7 @@ let $wait_condition= --source include/wait_condition.inc set global event_scheduler=off; +--source include/check_events_off.inc select event_name, event_definition, interval_value, interval_field from information_schema.events order by event_name; drop procedure p22830_wait; drop function f22830; @@ -537,6 +691,7 @@ DROP USER mysqltest_u1@localhost; # For the actual tests of time zones please see events_time_zone.test # SET GLOBAL EVENT_SCHEDULER= OFF; +--source include/check_events_off.inc SET @save_time_zone= @@TIME_ZONE; #---------------------------------------------------------------------- @@ -749,6 +904,7 @@ let $engine=MyISAM; USE test; SHOW GRANTS FOR CURRENT_USER; SET GLOBAL event_scheduler = ON; +--source include/running_event_scheduler.inc eval CREATE TABLE events_test.event_log (id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp) @@ -817,12 +973,14 @@ disconnect e1; DROP EVENT events_test.ev_sched_1823; DROP TABLE events_test.event_log; SET GLOBAL event_scheduler = OFF; +--source include/check_events_off.inc # # Bug#28641 CREATE EVENT with '2038.01.18 03:00:00' let server crash. # SET GLOBAL event_scheduler= ON; +--source include/running_event_scheduler.inc DELIMITER |; CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00' DO BEGIN @@ -831,6 +989,7 @@ END;| DELIMITER ;| SET GLOBAL event_scheduler= OFF; +--source include/check_events_off.inc DROP EVENT bug28641; ########################################################################### @@ -955,6 +1114,7 @@ SET GLOBAL READ_ONLY = 1; --echo SET GLOBAL EVENT_SCHEDULER = ON; +--source include/running_event_scheduler.inc --echo @@ -980,6 +1140,7 @@ let $wait_condition = --echo SET GLOBAL EVENT_SCHEDULER = OFF; +--source include/check_events_off.inc --echo @@ -1056,14 +1217,15 @@ drop event e1; # ########################################################################### -let $wait_condition= - select count(*) = 0 from information_schema.processlist - where db='events_test' and command = 'Connect' and user=current_user(); ---source include/wait_condition.inc +# Ensure that all event executors have finished their work and cannot harm +# the next test. +--source include/no_running_events.inc DROP DATABASE events_test; -# Restore the original state (option with no argument in events_bugs-master.opt -# turns the scheduler on). -SET GLOBAL event_scheduler = 'ON'; +# Restore the original state i.e to how it was when test started +# (option with no argument in events_bugs-master.opt turns the scheduler on). +SET GLOBAL event_scheduler= 'ON'; +--source include/running_event_scheduler.inc +SET @@global.concurrent_insert= @concurrent_insert; # THIS MUST BE THE LAST LINE in this file. diff --git a/mysql-test/t/events_restart-master.opt b/mysql-test/t/events_restart-master.opt new file mode 100644 index 00000000000..f93413a61e5 --- /dev/null +++ b/mysql-test/t/events_restart-master.opt @@ -0,0 +1 @@ +--event-scheduler diff --git a/mysql-test/t/events_restart.test b/mysql-test/t/events_restart.test new file mode 100644 index 00000000000..e155fe2ea16 --- /dev/null +++ b/mysql-test/t/events_restart.test @@ -0,0 +1,106 @@ +# Can't test with embedded server that doesn't support grants +-- source include/not_embedded.inc + +# +# Test that when the server is restarted, it checks mysql.event table, +# and disables the scheduler if it's not up to date. +# + +# Switch off the scheduler for now. +set global event_scheduler=off; + +--disable_warnings +drop database if exists events_test; +--enable_warnings +create database events_test; +use events_test; +create table execution_log(name char(10)); + +create event abc1 on schedule every 1 second do + insert into execution_log value('abc1'); +create event abc2 on schedule every 1 second do + insert into execution_log value('abc2'); +create event abc3 on schedule every 1 second do + insert into execution_log value('abc3'); +# +# There are various conditions when a server would regard mysql.event +# table as damaged: +# - the table has more column than specified in the compiled in value, but +# the version of the server which created the table is the same +# - the column count in the table is less than the compiled in value +# - some column has an incompatible type specification (for what is an +# incompatible type specification please refer to the comments in the source +# +# Unfortunately, in order to test a condition, we need to restart the +# server. Therefore, here we test only one simple case: changing the data +# type of the 'body' field to blob. +# +# First, let's do a backup to not depend on actual definition of mysql.event +create table event_like like mysql.event; +insert into event_like select * from mysql.event; +# Now let's alter the table and restart the server +alter table mysql.event + change column body body longtext character set utf8 collate utf8_bin; +--echo "Now we restart the server" + +--source include/restart_mysqld.inc + +use events_test; +# Event scheduler should be disabled: the system tables are damaged +select @@event_scheduler; +# Try various Event Scheduler operation and check the output. +--error ER_EVENTS_DB_ERROR +show events; +--error ER_EVENTS_DB_ERROR +select event_name from information_schema.events; +--error ER_EVENTS_DB_ERROR +show create event intact_check; +--error ER_EVENTS_DB_ERROR +drop event no_such_event; +--error ER_EVENTS_DB_ERROR +create event intact_check_1 on schedule every 5 hour do select 5; +--error ER_EVENTS_DB_ERROR +alter event intact_check_1 on schedule every 8 hour do select 8; +--error ER_EVENTS_DB_ERROR +alter event intact_check_1 rename to intact_check_2; +--error ER_EVENTS_DB_ERROR +drop event intact_check_1; +--error ER_EVENTS_DB_ERROR +drop event intact_check_2; +--error ER_EVENTS_DB_ERROR +drop event intact_check; +--error ER_EVENTS_DB_ERROR +set global event_scheduler=on; +--error ER_EVENTS_DB_ERROR +set global event_scheduler=off; +show variables like 'event_scheduler'; +--echo Make sure that we still can create and drop databases, +--echo and no warnings are produced. +drop database if exists mysqltest_database_not_exists; +create database mysqltest_db1; +drop database mysqltest_db1; +--echo Restore the original mysql.event table +drop table mysql.event; +rename table event_like to mysql.event; +--echo Now let's restart the server again + +--source include/restart_mysqld.inc + +# We need this file primarily to make sure that the scheduler is restarted +# and enabled after we have restored mysql.event table. +# This is the final step of the "cleanup". +# +# Make sure also that events are executed OK after restart, just in case. +use events_test; +# Make sure the scheduler was started successfully +select @@event_scheduler; +let $wait_condition=select count(distinct name)=3 from execution_log; +--source include/wait_condition.inc +drop table execution_log; +# Will drop all events +drop database events_test; + +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where db='events_test' and command = 'Connect' and user=current_user(); +--source include/wait_condition.inc diff --git a/mysql-test/t/events_restart_phase1.test b/mysql-test/t/events_restart_phase1.test deleted file mode 100644 index 6a94ef12222..00000000000 --- a/mysql-test/t/events_restart_phase1.test +++ /dev/null @@ -1,43 +0,0 @@ -# Can't test with embedded server that doesn't support grants --- source include/not_embedded.inc -# -# Test that when the server is restarted, it checks mysql.event table, -# and disables the scheduler if it's not up to date. -# - -# Switch off the scheduler for now. -set global event_scheduler=off; - ---disable_warnings -drop database if exists events_test; ---enable_warnings -create database events_test; -use events_test; -create table execution_log(name char(10)); - -create event abc1 on schedule every 1 second do - insert into execution_log value('abc1'); -create event abc2 on schedule every 1 second do - insert into execution_log value('abc2'); -create event abc3 on schedule every 1 second do - insert into execution_log value('abc3'); -# -# There are various conditions when a server would regard mysql.event -# table as damaged: -# - the table has more column than specified in the compiled in value, but -# the version of the server which created the table is the same -# - the column count in the table is less than the compiled in value -# - some column has an incompatible type specification (for what is an -# incompatible type specification please refer to the comments in the source -# -# Unfortunately, in order to test a condition, we need to restart the -# server. Therefore, here we test only one simple case: changing the data -# type of the 'body' field to blob. -# -# First, let's do a backup to not depend on actual definition of mysql.event -create table event_like like mysql.event; -insert into event_like select * from mysql.event; -# Now let's alter the table and restart the server -alter table mysql.event - change column body body longtext character set utf8 collate utf8_bin; ---echo "Now we restart the server" diff --git a/mysql-test/t/events_restart_phase2-master.opt b/mysql-test/t/events_restart_phase2-master.opt deleted file mode 100644 index 673e87f4357..00000000000 --- a/mysql-test/t/events_restart_phase2-master.opt +++ /dev/null @@ -1 +0,0 @@ ---event-scheduler=on diff --git a/mysql-test/t/events_restart_phase2.test b/mysql-test/t/events_restart_phase2.test deleted file mode 100644 index c3f799634b3..00000000000 --- a/mysql-test/t/events_restart_phase2.test +++ /dev/null @@ -1,41 +0,0 @@ -# Can't test with embedded server that doesn't support grants --- source include/not_embedded.inc - -use events_test; -# Event scheduler should be disabled: the system tables are damaged -select @@event_scheduler; -# Try various Event Scheduler operation and check the output. ---error ER_EVENTS_DB_ERROR -show events; ---error ER_EVENTS_DB_ERROR -select event_name from information_schema.events; ---error ER_EVENTS_DB_ERROR -show create event intact_check; ---error ER_EVENTS_DB_ERROR -drop event no_such_event; ---error ER_EVENTS_DB_ERROR -create event intact_check_1 on schedule every 5 hour do select 5; ---error ER_EVENTS_DB_ERROR -alter event intact_check_1 on schedule every 8 hour do select 8; ---error ER_EVENTS_DB_ERROR -alter event intact_check_1 rename to intact_check_2; ---error ER_EVENTS_DB_ERROR -drop event intact_check_1; ---error ER_EVENTS_DB_ERROR -drop event intact_check_2; ---error ER_EVENTS_DB_ERROR -drop event intact_check; ---error ER_EVENTS_DB_ERROR -set global event_scheduler=on; ---error ER_EVENTS_DB_ERROR -set global event_scheduler=off; -show variables like 'event_scheduler'; ---echo Make sure that we still can create and drop databases, ---echo and no warnings are produced. -drop database if exists mysqltest_database_not_exists; -create database mysqltest_db1; -drop database mysqltest_db1; ---echo Restore the original mysql.event table -drop table mysql.event; -rename table event_like to mysql.event; ---echo Now let's restart the server again diff --git a/mysql-test/t/events_restart_phase3-master.opt b/mysql-test/t/events_restart_phase3-master.opt deleted file mode 100644 index 656b9e1b017..00000000000 --- a/mysql-test/t/events_restart_phase3-master.opt +++ /dev/null @@ -1 +0,0 @@ ---event-scheduler=1 diff --git a/mysql-test/t/events_restart_phase3.test b/mysql-test/t/events_restart_phase3.test deleted file mode 100644 index 04d879e50ec..00000000000 --- a/mysql-test/t/events_restart_phase3.test +++ /dev/null @@ -1,21 +0,0 @@ -# Can't test with embedded server that doesn't support grants --- source include/not_embedded.inc -# -# We need this file primarily to make sure that the scheduler is restarted -# and enabled after we have restored mysql.event table. -# This is the final step of the "cleanup". -# -# Make sure also that events are executed OK after restart, just in case. -use events_test; -# Make sure the scheduler was started successfully -select @@event_scheduler; -let $wait_condition=select count(distinct name)=3 from execution_log; ---source include/wait_condition.inc -drop table execution_log; -# Will drop all events -drop database events_test; - -let $wait_condition= - select count(*) = 0 from information_schema.processlist - where db='events_test' and command = 'Connect' and user=current_user(); ---source include/wait_condition.inc diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index 87cfa42e283..041a2def490 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -58,8 +58,6 @@ ON COMPLETION PRESERVE DO INSERT INTO table_4 VALUES (1); -# Wait for the events to fire and check the data afterwards - # Let event_1 insert at least 4 records into the table let $wait_condition=select count(*) >= 4 from table_1; --source include/wait_condition.inc @@ -85,25 +83,13 @@ let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_4' and status='enabled'; --source include/wait_condition.inc -let $wait_condition=SELECT SUM(a) >= 4 FROM table_1; -source include/wait_condition.inc; -SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1; - -# In case of a testing box under heavy load it cannot be guaranteed that -# it is really often enough checked if event_2 has to be executed. -# -> Bug#39854 events_scheduling fails sporadically on pushbuild -# Therefore we lowered here the original expectation of 5 to 4. -let $wait_condition=SELECT SUM(a) >= 4 FROM table_2; -source include/wait_condition.inc; -SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_2; - -let $wait_condition=SELECT SUM(a) >= 1 FROM table_3; -source include/wait_condition.inc; -SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_3; - -let $wait_condition=SELECT SUM(a) >= 1 FROM table_4; -source include/wait_condition.inc; -SELECT IF(SUM(a) >= 1, 'OK', 'ERROR') FROM table_4; +# +# On a busy system the scheduler may skip execution of events, +# we can't reliably expect that the data in a table to be modified +# by an event will be exact. Thus we do not SELECT from the tables +# in this test. See also +# Bug#39854 events_scheduling fails sporadically on pushbuild +# SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR') FROM INFORMATION_SCHEMA.EVENTS diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test index 4930164d3fa..e61d79f5249 100644 --- a/mysql-test/t/execution_constants.test +++ b/mysql-test/t/execution_constants.test @@ -41,12 +41,19 @@ while ($i) error 0,1436 // eval $query_head 0 $query_tail// - if ($mysql_errno != 1436) + if ($mysql_errno) { # We reached the place where we reported an error about the stack limit, # and we successfully returned the error. That means that at the stack # limit, we still have enough space reserved to report an error. let $i = 1// + + # Check that mysql_errno is 1436 + if (`select $mysql_errno != 1436`) + { + die Wrong error triggered, expected 1436 but got $mysql_errno// + } + } # Multiplying by three stack frames should be fine enough resolution. diff --git a/mysql-test/t/expire_logs_days_basic.test b/mysql-test/t/expire_logs_days_basic.test deleted file mode 100644 index 02448d1fd11..00000000000 --- a/mysql-test/t/expire_logs_days_basic.test +++ /dev/null @@ -1,179 +0,0 @@ -############## mysql-test\t\expire_logs_days_basic.test ############### -# # -# Variable Name: expire_logs_days # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:0 # -# Range: 0-99 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable expire_logs_days # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -######################################################################## -# START OF expire_logs_days TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of expire_logs_days in a temporary variable # -######################################################################## - -SET @start_value = @@global.expire_logs_days; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_029_01------------------------#' -######################################################################## -# Display the DEFAULT value of expire_logs_days # -######################################################################## - -SET @@global.expire_logs_days = 99; -SET @@global.expire_logs_days = DEFAULT; -SELECT @@global.expire_logs_days; - - ---echo '#---------------------FN_DYNVARS_029_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.expire_logs_days = @start_value; -SELECT @@global.expire_logs_days = 0; - - ---echo '#--------------------FN_DYNVARS_029_03------------------------#' -######################################################################## -# Change the value of expire_logs_days to a valid value # -######################################################################## - -SET @@global.expire_logs_days = 0; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = 99; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = 10; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = 21; -SELECT @@global.expire_logs_days; - - ---echo '#--------------------FN_DYNVARS_029_04-------------------------#' -########################################################################### -# Change the value of expire_logs_days to invalid value # -########################################################################### - -SET @@global.expire_logs_days = -1; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = 100; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = 1024; -SELECT @@global.expire_logs_days; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.expire_logs_days = 10000.01; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = -1024; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = 42949672950; -SELECT @@global.expire_logs_days; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.expire_logs_days = ON; -SELECT @@global.expire_logs_days; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.expire_logs_days = 'test'; -SELECT @@global.expire_logs_days; - - ---echo '#-------------------FN_DYNVARS_029_05----------------------------#' -########################################################################### -# Test if accessing session expire_logs_days gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.expire_logs_days = 0; -SELECT @@expire_logs_days; - - ---echo '#----------------------FN_DYNVARS_029_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.expire_logs_days = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='expire_logs_days'; - -SELECT @@expire_logs_days = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='expire_logs_days'; - - - ---echo '#---------------------FN_DYNVARS_029_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.expire_logs_days = TRUE; -SELECT @@global.expire_logs_days; -SET @@global.expire_logs_days = FALSE; -SELECT @@global.expire_logs_days; - - ---echo '#---------------------FN_DYNVARS_029_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.expire_logs_days = 1; -SELECT @@expire_logs_days = @@global.expire_logs_days; - - ---echo '#---------------------FN_DYNVARS_029_09----------------------#' -########################################################################## -# Check if expire_logs_days can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET expire_logs_days = 1; -SELECT @@expire_logs_days; ---Error ER_PARSE_ERROR -SET local.expire_logs_days = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.expire_logs_days; ---Error ER_PARSE_ERROR -SET global.expire_logs_days = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.expire_logs_days; ---Error ER_BAD_FIELD_ERROR -SELECT expire_logs_days = @@session.expire_logs_days; - - -############################## -# Restore initial value # -############################## - -SET @@global.expire_logs_days = @start_value; -SELECT @@global.expire_logs_days; - - -######################################################################## -# END OF expire_logs_days TESTS # -######################################################################## diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test deleted file mode 100644 index f45bff2597f..00000000000 --- a/mysql-test/t/federated.test +++ /dev/null @@ -1,1958 +0,0 @@ -# Note: This test is tricky. It reuses the prerequisites generated for -# replication tests (master+slave server and connections) for its -# own purposes. But the replication feature itself is stopped. -# - - -# should work with embedded server after mysqltest is fixed ---source include/not_embedded.inc ---source include/federated.inc - -connection default; - -# Disable concurrent inserts to avoid test failures when reading -# data from concurrent connections (insert might return before -# the data is actually in the table). -SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; -SET @@GLOBAL.CONCURRENT_INSERT= 0; - -connection slave; -SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; -SET @@GLOBAL.CONCURRENT_INSERT= 0; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `group` int NOT NULL default 0, - `a\\b` int NOT NULL default 0, - `a\\` int NOT NULL default 0, - `name` varchar(32) NOT NULL default '' - ) - DEFAULT CHARSET=latin1; - -connection master; -DROP TABLE IF EXISTS federated.t1; -# test too many items (malformed) in the comment string url ---error ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `group` int NOT NULL default 0, - `a\\b` inT NOT NULL default 0, - `a\\` int NOT NULL default 0, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:@/too/many/items/federated/t1'; - -# test not enough items (malformed) in the comment string url ---error ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `group` int NOT NULL default 0, - `a\\b` iNt NOT NULL default 0, - `a\\` int NOT NULL default 0, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1'; - -# test non-existant table ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `group` int NOT NULL default 0, - `a\\\\b` iNT NOT NULL default 0, - `a\\\\` int NOT NULL default 0, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t3'; ---error ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST -SELECT * FROM federated.t1; -DROP TABLE federated.t1; - -# test bad user/password ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `group` int NOT NULL default 0, - `a\\\\b` Int NOT NULL default 0, - `a\\\\` int NOT NULL default 0, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://user:pass@127.0.0.1:$SLAVE_MYPORT/federated/t1'; ---error ER_CONNECT_TO_FOREIGN_DATA_SOURCE -SELECT * FROM federated.t1; -DROP TABLE federated.t1; - -# # correct connection, same named tables ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `group` int NOT NULL default 0, - `a\\\\b` InT NOT NULL default 0, - `a\\\\` int NOT NULL default 0, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (id, name) VALUES (1, 'foo'); -INSERT INTO federated.t1 (id, name) VALUES (2, 'fee'); -INSERT INTO federated.t1 (id, `group`) VALUES (3, 42); -INSERT INTO federated.t1 (id, `a\\b`) VALUES (4, 23); -INSERT INTO federated.t1 (id, `a\\`) VALUES (5, 1); - ---sorted_result -SELECT * FROM federated.t1; -DELETE FROM federated.t1; -DROP TABLE federated.t1; - -# correct connection, differently named tables -DROP TABLE IF EXISTS federated.t2; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t2 ( - `id` int(20) NOT NULL, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval SHOW CREATE TABLE federated.t2; - -INSERT INTO federated.t2 (id, name) VALUES (1, 'foo'); -INSERT INTO federated.t2 (id, name) VALUES (2, 'fee'); - -SELECT * FROM federated.t2 ORDER BY id, name; -DROP TABLE federated.t2; - -connection slave; -DROP TABLE IF EXISTS federated.t1; - -DROP TABLE IF EXISTS federated.`t1%`; -CREATE TABLE federated.`t1%` ( - `id` int(20) NOT NULL, - `name` varchar(32) NOT NULL default '' - ) - DEFAULT CHARSET=latin1; - -connection master; -DROP TABLE IF EXISTS federated.t1; - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1%'; - -INSERT INTO federated.t1 (id, name) VALUES (1, 'foo'); -INSERT INTO federated.t1 (id, name) VALUES (2, 'fee'); - -SELECT * FROM federated.t1 ORDER BY id,name; -DELETE FROM federated.t1; -DROP TABLE IF EXISTS federated.t1; - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.`t1%` ( - `id` int(20) NOT NULL, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1%'; - -INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo'); -INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee'); - -SELECT * FROM federated.`t1%` ORDER BY id, name; -DELETE FROM federated.`t1%`; -DROP TABLE IF EXISTS federated.`t1%`; - -connection slave; -DROP TABLE IF EXISTS federated.`t1%`; - -# I wanted to use timestamp, but results will fail if so!!! -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32) NOT NULL default '', - `other` int(20) NOT NULL default '0', - `created` datetime default '2004-04-04 04:04:04', - PRIMARY KEY (`id`)) - DEFAULT CHARSET=latin1; - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32) NOT NULL default '', - `other` int(20) NOT NULL default '0', - `created` datetime default '2004-04-04 04:04:04', - PRIMARY KEY (`id`)) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111); -INSERT INTO federated.t1 (name, other) VALUES ('Second Name', 22222); -INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333); -INSERT INTO federated.t1 (name, other) VALUES ('Fourth Name', 44444); -INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555); -INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666); -INSERT INTO federated.t1 (name, other) VALUES ('Seventh Name', 77777); -INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888); -INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999); -INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010); - -# basic select ---sorted_result -SELECT * FROM federated.t1; -# with PRIMARY KEY index_read_idx -SELECT * FROM federated.t1 WHERE id = 5; -SELECT * FROM federated.t1 WHERE name = 'Sixth Name'; -SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name'; -SELECT * FROM federated.t1 WHERE name = 'Sixth Name' AND other = 44444; ---sorted_result -SELECT * FROM federated.t1 WHERE name like '%th%'; -UPDATE federated.t1 SET name = '3rd name' WHERE id = 3; -SELECT * FROM federated.t1 WHERE name = '3rd name'; -UPDATE federated.t1 SET name = 'Third name' WHERE name = '3rd name'; -SELECT * FROM federated.t1 WHERE name = 'Third name'; -# rnd_post, ::position -SELECT * FROM federated.t1 ORDER BY id DESC; -SELECT * FROM federated.t1 ORDER BY name; -SELECT * FROM federated.t1 ORDER BY name DESC; -SELECT * FROM federated.t1 ORDER BY name ASC; -SELECT * FROM federated.t1 GROUP BY other; - -# ::delete_row -DELETE FROM federated.t1 WHERE id = 5; -SELECT * FROM federated.t1 WHERE id = 5; - -# ::delete_all_rows -DELETE FROM federated.t1; -SELECT * FROM federated.t1 WHERE id = 5; - -# previous test, but this time with indexes -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32) NOT NULL default '', - `other` int(20) NOT NULL default '0', - `created` datetime NOT NULL, - PRIMARY KEY (`id`), - key name(`name`), - key other(`other`), - key created(`created`)) - DEFAULT CHARSET=latin1; - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32) NOT NULL default '', - `other` int(20) NOT NULL default '0', - `created` datetime NOT NULL, - PRIMARY KEY (`id`), - key name(`name`), - key other(`other`), - key created(`created`)) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (name, other, created) - VALUES ('First Name', 11111, '2004-01-01 01:01:01'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Second Name', 22222, '2004-01-23 02:43:00'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Third Name', 33333, '2004-02-14 02:14:00'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Fourth Name', 44444, '2003-04-05 00:00:00'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Fifth Name', 55555, '2001-02-02 02:02:02'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Sixth Name', 66666, '2005-06-06 15:30:00'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Seventh Name', 77777, '2003-12-12 18:32:00'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Eigth Name', 88888, '2005-03-12 11:00:00'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Ninth Name', 99999, '2005-03-12 11:00:01'); -INSERT INTO federated.t1 (name, other, created) - VALUES ('Tenth Name', 101010, '2005-03-12 12:00:01'); - -# basic select ---sorted_result -SELECT * FROM federated.t1; -# with PRIMARY KEY index_read_idx -SELECT * FROM federated.t1 WHERE id = 5; -# with regular key index_read -> index_read_idx -# regular and PRIMARY KEY index_read_idx -SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name'; -# with regular key index_read -> index_read_idx -SELECT * FROM federated.t1 WHERE other = 44444; ---sorted_result -SELECT * FROM federated.t1 WHERE name like '%th%'; -# update - update_row, index_read_idx -UPDATE federated.t1 SET name = '3rd name' WHERE id = 3; -SELECT * FROM federated.t1 WHERE name = '3rd name'; -# update - update_row, index_read -> index_read_idx -UPDATE federated.t1 SET name = 'Third name' WHERE name = '3rd name'; -SELECT * FROM federated.t1 WHERE name = 'Third name'; -# rnd_post, ::position -SELECT * FROM federated.t1 ORDER BY id DESC; -SELECT * FROM federated.t1 ORDER BY name; -SELECT * FROM federated.t1 ORDER BY name DESC; -SELECT * FROM federated.t1 ORDER BY name ASC; -SELECT * FROM federated.t1 GROUP BY other; - -# ::delete_row -DELETE FROM federated.t1 WHERE id = 5; -SELECT * FROM federated.t1 WHERE id = 5; - -# ::delete_all_rows -DELETE FROM federated.t1; -SELECT * FROM federated.t1 WHERE id = 5; -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32), - `other` varchar(20), - PRIMARY KEY (`id`) ); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32), - `other` varchar(20), - PRIMARY KEY (`id`) ) - ENGINE="FEDERATED" - DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111); -INSERT INTO federated.t1 (name, other) VALUES ('Second Name', NULL); -INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333); -INSERT INTO federated.t1 (name, other) VALUES (NULL, NULL); -INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555); -INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666); -INSERT INTO federated.t1 (name) VALUES ('Seventh Name'); -INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888); -INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999); -INSERT INTO federated.t1 (other) VALUES ('fee fie foe fum'); - ---sorted_result -SELECT * FROM federated.t1 WHERE other IS NULL; ---sorted_result -SELECT * FROM federated.t1 WHERE name IS NULL; -SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL; ---sorted_result -SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL; - -UPDATE federated.t1 -SET name = 'Fourth Name', other = 'four four four' -WHERE name IS NULL AND other IS NULL; - -UPDATE federated.t1 SET other = 'two two two two' WHERE name = 'Second Name'; -UPDATE federated.t1 SET other = 'seven seven' WHERE name like 'Sev%'; -UPDATE federated.t1 SET name = 'Tenth Name' WHERE other like 'fee fie%'; -SELECT * FROM federated.t1 WHERE name IS NULL OR other IS NULL ; ---sorted_result -SELECT * FROM federated.t1; - -# test multi-keys -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32) NOT NULL DEFAULT '', - `other` varchar(20) NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - KEY nameoth (name, other) ); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `name` varchar(32) NOT NULL DEFAULT '', - `other` varchar(20) NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - KEY nameoth (name, other)) - ENGINE="FEDERATED" DEFAULT - CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (name, other) VALUES ('First Name', '1111'); -INSERT INTO federated.t1 (name, other) VALUES ('Second Name', '2222'); -INSERT INTO federated.t1 (name, other) VALUES ('Third Name', '3333'); -SELECT * FROM federated.t1 WHERE name = 'Second Name'; -SELECT * FROM federated.t1 WHERE other = '2222'; -SELECT * FROM federated.t1 WHERE name = 'Third Name'; -SELECT * FROM federated.t1 WHERE name = 'Third Name' AND other = '3333'; - -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int NOT NULL auto_increment, - `name` char(32) NOT NULL DEFAULT '', - `bincol` binary(1) NOT NULL, - `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, - `other` int NOT NULL DEFAULT 0, - PRIMARY KEY (id), - KEY nameoth(name, other), - KEY bincol(bincol), - KEY floatval(floatval)); - -# test other types of indexes -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int NOT NULL auto_increment, - `name` char(32) NOT NULL DEFAULT '', - `bincol` binary(1) NOT NULL, - `floatval` decimal(5,2) NOT NULL DEFAULT 0.0, - `other` int NOT NULL DEFAULT 0, - PRIMARY KEY (id), - KEY nameoth(name,other), - KEY bincol(bincol), - KEY floatval(floatval)) - ENGINE="FEDERATED" - DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (name, bincol, floatval, other) - VALUES ('first', 0x65, 11.11, 1111); -INSERT INTO federated.t1 (name, bincol, floatval, other) - VALUES ('second', 0x66, 22.22, 2222); -INSERT INTO federated.t1 (name, bincol, floatval, other) - VALUES ('third', 'g', 22.22, 2222); ---sorted_result -SELECT * FROM federated.t1; -SELECT * FROM federated.t1 WHERE name = 'second'; -SELECT * FROM federated.t1 WHERE bincol= 'f'; -SELECT * FROM federated.t1 WHERE bincol= 0x66; -SELECT * FROM federated.t1 WHERE bincol= 0x67; -SELECT * FROM federated.t1 WHERE bincol= 'g'; -SELECT * FROM federated.t1 WHERE floatval=11.11; -SELECT * FROM federated.t1 WHERE name='third'; ---sorted_result -SELECT * FROM federated.t1 WHERE other=2222; -SELECT * FROM federated.t1 WHERE name='third' and other=2222; - -# more multi-column indexes, in the primary key -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int NOT NULL auto_increment, - `col1` int(10) NOT NULL DEFAULT 0, - `col2` varchar(64) NOT NULL DEFAULT '', - `col3` int(20) NOT NULL, - `col4` int(40) NOT NULL, - primary key (`id`, `col1`, `col2`, `col3`, `col4`), - key col1(col1), - key col2(col2), - key col3(col3), - key col4(col4)); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int NOT NULL auto_increment, - `col1` int(10) NOT NULL DEFAULT 0, - `col2` varchar(64) NOT NULL DEFAULT '', - `col3` int(20) NOT NULL, - `col4` int(40) NOT NULL, - primary key (`id`, `col1`, `col2`, `col3`, `col4`), - key col1(col1), - key col2(col2), - key col3(col3), - key col4(col4)) - ENGINE="FEDERATED" - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (1, 'one One', 11, 1111); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (2, 'Two two', 22, 2222); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (3, 'three Three', 33, 33333); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (4, 'fourfourfour', 444, 4444444); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (5, 'five 5 five five 5', 5, 55555); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (6, 'six six Sixsix', 6666, 6); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (7, 'seven Sevenseven', 77777, 7777); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (8, 'eight eight eight', 88888, 88); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (9, 'nine Nine', 999999, 999999); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES (10, 'Tenth ten TEN', 1010101, 1010); - -SELECT * FROM federated.t1 WHERE col2 = 'two two'; -SELECT * FROM federated.t1 WHERE col2 = 'two Two'; -SELECT * FROM federated.t1 WHERE id = 3; -SELECT * FROM federated.t1 WHERE id = 3 AND col1 = 3; -SELECT * FROM federated.t1 WHERE id = 4 AND col1 = 4 AND col2 = 'Two two'; -SELECT * FROM federated.t1 WHERE id = 4 AND col1 = 4 AND col2 = 'fourfourfour'; -SELECT * FROM federated.t1 WHERE id = 5 AND col2 = 'five 5 five five 5' - AND col3 = 5; -SELECT * FROM federated.t1 WHERE id = 5 AND col2 = 'five 5 five five 5' - AND col3 = 5 - AND col4 = 55555; -SELECT * FROM federated.t1 WHERE id = 5 - AND col2 = 'Two two' AND col3 = 22 - AND col4 = 33; -SELECT * FROM federated.t1 WHERE id = 5 - AND col2 = 'five 5 five five 5' AND col3 = 5 - AND col4 = 55555; ---sorted_result -SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'five 5 five five 5') - OR (col2 = 'three Three' AND col3 = 33); -SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'Two two') - OR (col2 = 444 AND col3 = 4444444); ---sorted_result -SELECT * FROM federated.t1 WHERE id = 1 - OR col1 = 10 - OR col2 = 'Two two' - OR col3 = 33 - OR col4 = 4444444; ---sorted_result -SELECT * FROM federated.t1 WHERE id > 5; ---sorted_result -SELECT * FROM federated.t1 WHERE id >= 5; ---sorted_result -SELECT * FROM federated.t1 WHERE id < 5; ---sorted_result -SELECT * FROM federated.t1 WHERE id <= 5; ---sorted_result -SELECT * FROM federated.t1 WHERE id != 5; ---sorted_result -SELECT * FROM federated.t1 WHERE id > 3 AND id < 7; ---sorted_result -SELECT * FROM federated.t1 WHERE id > 3 AND id <= 7; ---sorted_result -SELECT * FROM federated.t1 WHERE id >= 3 AND id <= 7; -SELECT * FROM federated.t1 WHERE id < 3 AND id <= 7; -SELECT * FROM federated.t1 WHERE id < 3 AND id > 7; ---sorted_result -SELECT * FROM federated.t1 WHERE id < 3 OR id > 7; -SELECT * FROM federated.t1 WHERE col2 = 'three Three'; ---sorted_result -SELECT * FROM federated.t1 WHERE col2 > 'one'; ---sorted_result -SELECT * FROM federated.t1 WHERE col2 LIKE 's%'; -SELECT * FROM federated.t1 WHERE col2 LIKE 'si%'; -SELECT * FROM federated.t1 WHERE col2 LIKE 'se%'; ---sorted_result -SELECT * FROM federated.t1 WHERE col2 NOT LIKE 'e%'; ---sorted_result -SELECT * FROM federated.t1 WHERE col2 <> 'one One'; - -# more multi-column indexes, in the primary key -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `col1` varchar(8) NOT NULL DEFAULT '', - `col2` varchar(128) NOT NULL DEFAULT '', - `col3` varchar(20) NOT NULL DEFAULT '', - `col4` varchar(40) NOT NULL DEFAULT '', - primary key (`col1`, `col2`, `col3`, `col4`), - key 3key(`col2`,`col3`,`col4`), - key 2key (`col3`,`col4`), - key col4(col4)); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `col1` varchar(8) NOT NULL DEFAULT '', - `col2` varchar(128) NOT NULL DEFAULT '', - `col3` varchar(20) NOT NULL DEFAULT '', - `col4` varchar(40) NOT NULL DEFAULT '', - primary key (`col1`, `col2`, `col3`, `col4`), - key 3key(`col2`,`col3`,`col4`), - key 2key (`col3`,`col4`), - key col4(col4)) - ENGINE="FEDERATED" - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('aaaa', 'aaaaaaaaaaaaaaaaaaa', 'ababababab', 'acacacacacacacac'); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('bbbb', 'bbbbbbbbbbbbbbbbbbb', 'bababababa', 'bcbcbcbcbcbcbcbc'); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('cccc', 'ccccccccccccccccccc', 'cacacacaca', 'cbcbcbcbcbcbcbcb'); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('dddd', 'ddddddddddddddddddd', 'dadadadada', 'dcdcdcdcdcdcdcdc'); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('eeee', 'eeeeeeeeeeeeeeeeeee', 'eaeaeaeaea', 'ecececececececec'); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('ffff', 'fffffffffffffffffff', 'fafafafafa', 'fcfcfcfcfcfcfcfc'); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('gggg', 'ggggggggggggggggggg', 'gagagagaga', 'gcgcgcgcgcgcgcgc'); -INSERT INTO federated.t1 (col1, col2, col3, col4) - VALUES ('hhhh', 'hhhhhhhhhhhhhhhhhhh', 'hahahahaha', 'hchchchchchchchc'); - -SELECT * FROM federated.t1 WHERE col1 = 'cccc'; -SELECT * FROM federated.t1 WHERE col2 = 'eeeeeeeeeeeeeeeeeee'; -SELECT * FROM federated.t1 WHERE col3 = 'bababababa'; -SELECT * FROM federated.t1 WHERE col1 = 'gggg' AND col2 = 'ggggggggggggggggggg'; -SELECT * FROM federated.t1 WHERE col1 = 'gggg' AND col3 = 'gagagagaga'; -SELECT * FROM federated.t1 WHERE col1 = 'ffff' AND col4 = 'fcfcfcfcfcfcfcfc'; ---sorted_result -SELECT * FROM federated.t1 WHERE col1 > 'bbbb'; ---sorted_result -SELECT * FROM federated.t1 WHERE col1 >= 'bbbb'; -SELECT * FROM federated.t1 WHERE col1 < 'bbbb'; ---sorted_result -SELECT * FROM federated.t1 WHERE col1 <= 'bbbb'; ---sorted_result -SELECT * FROM federated.t1 WHERE col1 <> 'bbbb'; -SELECT * FROM federated.t1 WHERE col1 LIKE 'b%'; ---sorted_result -SELECT * FROM federated.t1 WHERE col4 LIKE '%b%'; ---sorted_result -SELECT * FROM federated.t1 WHERE col1 NOT LIKE 'c%'; -SELECT * FROM federated.t1 WHERE col4 NOT LIKE '%c%'; -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `col1` varchar(8) NOT NULL DEFAULT '', - `col2` int(8) NOT NULL DEFAULT 0, - `col3` varchar(8) NOT NULL DEFAULT '', - primary key (`col1`, `col2`, `col3`)); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `col1` varchar(8) NOT NULL DEFAULT '', - `col2` varchar(8) NOT NULL DEFAULT '', - `col3` varchar(8) NOT NULL DEFAULT '', - primary key (`col1`, `col2`, `col3`)) - ENGINE="FEDERATED" - DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 VALUES ('a00', '110', 'cc0'); -INSERT INTO federated.t1 VALUES ('aaa', '111', 'ccc'); -INSERT INTO federated.t1 VALUES ('bbb', '222', 'yyy'); -INSERT INTO federated.t1 VALUES ('ccc', '111', 'zzz'); -INSERT INTO federated.t1 VALUES ('ccd', '112', 'zzzz'); - -# let's see what the foreign database says -connection slave; ---sorted_result -SELECT col3 FROM federated.t1 WHERE ( -(col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND -(col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111')); - -connection master; ---sorted_result -SELECT col3 FROM federated.t1 WHERE ( -(col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND -(col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111')); - -# test NULLs -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int, - `name` varchar(32), - `floatval` float, - `other` int) -DEFAULT CHARSET=latin1; - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int, - `name` varchar(32), - `floatval` float, - `other` int) -ENGINE="FEDERATED" -DEFAULT CHARSET=latin1 -CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -# these both should be the same -INSERT INTO federated.t1 values (NULL, NULL, NULL, NULL); -INSERT INTO federated.t1 values (); -INSERT INTO federated.t1 (id) VALUES (1); -INSERT INTO federated.t1 (name, floatval, other) - VALUES ('foo', 33.33333332, NULL); -INSERT INTO federated.t1 (name, floatval, other) - VALUES (0, 00.3333, NULL); ---sorted_result -SELECT * FROM federated.t1; -SELECT count(*) FROM federated.t1 -WHERE id IS NULL -AND name IS NULL -AND floatval IS NULL -AND other IS NULL; - -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `blurb_id` int NOT NULL DEFAULT 0, - `blurb` text default '', - PRIMARY KEY (blurb_id)) - DEFAULT CHARSET=latin1; - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `blurb_id` int NOT NULL DEFAULT 0, - `blurb` text default '', - PRIMARY KEY (blurb_id)) - ENGINE="FEDERATED" - DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values."); -INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE."); -INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. "); -INSERT INTO federated.t1 VALUES(4, "Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:"); ---sorted_result -SELECT * FROM federated.t1; - -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `a` int NOT NULL, - `b` int NOT NULL, - `c` int NOT NULL, - PRIMARY KEY (a),key(b)); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `a` int NOT NULL, - `b` int NOT NULL, - `c` int NOT NULL, - PRIMARY KEY (a), - KEY (b)) - ENGINE="FEDERATED" - DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 VALUES (3,3,3),(1,1,1),(2,2,2),(4,4,4); - -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8 -int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17 -int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int, -i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34 -int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int, -i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51 -int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int, -i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68 -int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int, -i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85 -int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int, -i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102 -int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110 -int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118 -int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126 -int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134 -int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142 -int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150 -int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158 -int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166 -int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174 -int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182 -int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190 -int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198 -int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206 -int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214 -int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222 -int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230 -int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238 -int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246 -int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254 -int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262 -int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270 -int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278 -int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286 -int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294 -int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302 -int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310 -int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318 -int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326 -int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334 -int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342 -int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350 -int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358 -int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366 -int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374 -int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382 -int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390 -int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398 -int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406 -int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414 -int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422 -int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430 -int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438 -int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446 -int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454 -int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462 -int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470 -int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478 -int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486 -int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494 -int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502 -int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510 -int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518 -int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526 -int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534 -int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542 -int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550 -int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558 -int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566 -int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574 -int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582 -int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590 -int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598 -int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606 -int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614 -int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622 -int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630 -int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638 -int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646 -int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654 -int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662 -int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670 -int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678 -int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686 -int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694 -int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702 -int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710 -int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718 -int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726 -int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734 -int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742 -int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750 -int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758 -int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766 -int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774 -int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782 -int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790 -int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798 -int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806 -int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814 -int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822 -int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830 -int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838 -int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846 -int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854 -int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862 -int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870 -int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878 -int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886 -int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894 -int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902 -int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910 -int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918 -int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926 -int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934 -int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942 -int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950 -int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958 -int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966 -int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974 -int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982 -int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990 -int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998 -int, i999 int, i1000 int, b varchar(256)) row_format=dynamic; - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 -(i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8 -int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, -i17 int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int, -i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34 -int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int, -i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51 -int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int, -i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68 -int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int, -i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85 -int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int, -i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102 -int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110 -int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118 -int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126 -int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134 -int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142 -int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150 -int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158 -int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166 -int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174 -int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182 -int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190 -int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198 -int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206 -int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214 -int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222 -int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230 -int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238 -int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246 -int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254 -int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262 -int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270 -int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278 -int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286 -int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294 -int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302 -int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310 -int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318 -int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326 -int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334 -int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342 -int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350 -int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358 -int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366 -int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374 -int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382 -int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390 -int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398 -int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406 -int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414 -int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422 -int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430 -int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438 -int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446 -int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454 -int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462 -int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470 -int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478 -int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486 -int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494 -int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502 -int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510 -int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518 -int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526 -int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534 -int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542 -int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550 -int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558 -int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566 -int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574 -int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582 -int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590 -int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598 -int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606 -int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614 -int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622 -int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630 -int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638 -int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646 -int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654 -int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662 -int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670 -int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678 -int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686 -int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694 -int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702 -int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710 -int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718 -int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726 -int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734 -int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742 -int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750 -int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758 -int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766 -int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774 -int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782 -int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790 -int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798 -int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806 -int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814 -int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822 -int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830 -int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838 -int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846 -int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854 -int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862 -int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870 -int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878 -int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886 -int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894 -int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902 -int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910 -int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918 -int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926 -int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934 -int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942 -int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950 -int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958 -int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966 -int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974 -int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982 -int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990 -int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998 -int, i999 int, i1000 int, b varchar(256)) -row_format=dynamic -ENGINE="FEDERATED" -DEFAULT CHARSET=latin1 -CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 -values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "PatrickG"); -UPDATE federated.t1 SET b=repeat('a',256); -UPDATE federated.t1 SET i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0, i10=0; -SELECT * FROM federated.t1 WHERE i9=0 and i10=0; -UPDATE federated.t1 SET i50=20; -SELECT * FROM federated.t1; -DELETE FROM federated.t1 WHERE i51=20; -SELECT * FROM federated.t1; -DELETE FROM federated.t1 WHERE i50=20; -SELECT * FROM federated.t1; - -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', PRIMARY KEY(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1; - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - id int NOT NULL auto_increment, - code char(20) NOT NULL, - fileguts blob NOT NULL, - creation_date datetime, - entered_time datetime default '2004-04-04 04:04:04', - PRIMARY KEY(id), - index(code), - index(fileguts(10))) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; -INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03'); -INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04'); -INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04'); ---sorted_result -SELECT * FROM federated.t1; -# test blob indexes -SELECT * FROM federated.t1 WHERE fileguts = 'jimbob'; - -# test blob with binary -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 (`a` BLOB); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `a` BLOB) -ENGINE="FEDERATED" -CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 VALUES (0x00); -INSERT INTO federated.t1 VALUES (0x0001); -INSERT INTO federated.t1 VALUES (0x0100); ---sorted_result -SELECT HEX(a) FROM federated.t1; - -# # simple tests for cyrillic, given to me by -# DROP TABLE IF EXISTS federated.t1; -# --replace_result $SLAVE_MYPORT SLAVE_PORT -# eval CREATE TABLE federated.t1 -# (a char(20)) charset=cp1251 -# ENGINE="FEDERATED" CONNECTION="mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1"; -# # -# connection slave; -# DROP TABLE IF EXISTS federated.t1; -# CREATE TABLE federated.t1 (a char(20)) charset=cp1251; -# # -# connection master; -# INSERT INTO federated.t1 values (_cp1251'�-���-1'); -# INSERT INTO federated.t1 values (_cp1251'�-���-2'); -# SELECT * FROM federated.t1; -# SET names cp1251; -# INSERT INTO federated.t1 values ('�-���-3'); -# INSERT INTO federated.t1 values ('�-Ũ�-4'); -# SELECT * FROM federated.t1; -# SELECT hex(a) from federated.t1; -# SELECT hex(a) from federated.t1 ORDER BY a desc; -# UPDATE federated.t1 SET a='�-���-1�����' WHERE a='�-���-1'; -# SELECT * FROM federated.t1; -# DELETE FROM federated.t1 WHERE a='�-Ũ�-4'; -# SELECT * FROM federated.t1; -# DELETE FROM federated.t1 WHERE a>'�-'; -# SELECT * FROM federated.t1; -# SET names default; -# DROP TABLE IF EXISTS federated.t1; - -# -# DROP TABLE IF EXISTS federated.t1; -# - -# test joins with non-federated table -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `country_id` int(20) NOT NULL DEFAULT 0, - `name` varchar(32), - `other` varchar(20), - PRIMARY KEY (`id`), - key (country_id)); - -connection master; -DROP TABLE IF EXISTS federated.countries; -CREATE TABLE federated.countries ( - `id` int(20) NOT NULL auto_increment, - `country` varchar(32), - PRIMARY KEY (id)); -INSERT INTO federated.countries (country) VALUES ('India'); -INSERT INTO federated.countries (country) VALUES ('Germany'); -INSERT INTO federated.countries (country) VALUES ('Italy'); -INSERT INTO federated.countries (country) VALUES ('Finland'); -INSERT INTO federated.countries (country) VALUES ('Ukraine'); - -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - `country_id` int(20) NOT NULL DEFAULT 0, - `name` varchar(32), - `other` varchar(20), - PRIMARY KEY (`id`), - KEY (country_id) ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 (name, country_id, other) VALUES ('Kumar', 1, 11111); -INSERT INTO federated.t1 (name, country_id, other) VALUES ('Lenz', 2, 22222); -INSERT INTO federated.t1 (name, country_id, other) VALUES ('Marizio', 3, 33333); -INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333); -INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333); - -#inner join ---sorted_result -SELECT federated.t1.name AS name, federated.t1.country_id AS country_id, -federated.t1.other AS other, federated.countries.country AS country -FROM federated.t1, federated.countries WHERE -federated.t1.country_id = federated.countries.id; - -SELECT federated.t1.name AS name, federated.t1.country_id AS country_id, -federated.t1.other AS other, federated.countries.country AS country -FROM federated.t1 INNER JOIN federated.countries ON -federated.t1.country_id = federated.countries.id; - -SELECT federated.t1.name AS name, federated.t1.country_id AS country_id, -federated.t1.other AS other, federated.countries.country AS country -FROM federated.t1 INNER JOIN federated.countries ON -federated.t1.country_id = federated.countries.id -WHERE federated.t1.name = 'Monty'; - -#left join -SELECT federated.t1.*, federated.countries.country -FROM federated.t1 LEFT JOIN federated.countries -ON federated.t1.country_id = federated.countries.id -ORDER BY federated.countries.id; - -SELECT federated.t1.*, federated.countries.country -FROM federated.t1 LEFT JOIN federated.countries -ON federated.t1.country_id = federated.countries.id -ORDER BY federated.countries.country; - -#right join -SELECT federated.t1.*, federated.countries.country -FROM federated.t1 RIGHT JOIN federated.countries -ON federated.t1.country_id = federated.countries.id -ORDER BY federated.t1.country_id; - -DROP TABLE federated.countries; - -#BEGIN optimize and repair tests -OPTIMIZE TABLE federated.t1; -REPAIR TABLE federated.t1; -REPAIR TABLE federated.t1 QUICK; -REPAIR TABLE federated.t1 EXTENDED; -REPAIR TABLE federated.t1 USE_FRM; -#END optimize and repair tests - - -# BEGIN ALTER TEST -connection slave; ---disable_warnings -DROP TABLE IF EXISTS federated.normal_table; ---enable_warnings - -CREATE TABLE federated.normal_table ( - `id` int(4) NOT NULL, - `name` varchar(10) default NULL - ) DEFAULT CHARSET=latin1; - -connection master; ---disable_warnings -DROP TABLE IF EXISTS federated.alter_me; ---enable_warnings - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.alter_me ( - `id` int(4) NOT NULL, - `name` varchar(10) default NULL, - PRIMARY KEY (`id`) - ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/normal_table'; - -INSERT INTO federated.alter_me (id, name) VALUES (1, 'Monty'); -INSERT INTO federated.alter_me (id, name) VALUES (2, 'David'); - -SELECT * FROM federated.alter_me; - ---error ER_ILLEGAL_HA -ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL; - -SELECT * FROM federated.alter_me; - -DROP TABLE federated.alter_me; -connection slave; -DROP TABLE federated.normal_table; -# END ALTER TEST - -# -# Test BUG #14532 - bit columns broken in federated -# storage engine -# ---disable_warnings -DROP TABLE IF EXISTS federated.t1; ---enable_warnings -CREATE TABLE federated.t1 ( - `bitty` bit(3) -) DEFAULT CHARSET=latin1; - -connection master; - ---disable_warnings -DROP TABLE IF EXISTS federated.t1; ---enable_warnings - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `bitty` bit(3) -) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 VALUES (b'001'); -INSERT INTO federated.t1 VALUES (b'010'); -INSERT INTO federated.t1 VALUES (b'011'); -INSERT INTO federated.t1 VALUES (b'100'); -INSERT INTO federated.t1 VALUES (b'101'); -INSERT INTO federated.t1 VALUES (b'110'); -INSERT INTO federated.t1 VALUES (b'111'); -select * FROM federated.t1; -drop table federated.t1; - -connection slave; -drop table federated.t1; - -# -# BUG# 14768 test auto_increment last_insert_id() -# -connection slave; -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - PRIMARY KEY (`id`)); - -connection master; -DROP TABLE IF EXISTS federated.t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL auto_increment, - PRIMARY KEY (`id`) - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -INSERT INTO federated.t1 VALUES (); -SELECT LAST_INSERT_ID(); -INSERT INTO federated.t1 VALUES (); -SELECT LAST_INSERT_ID(); -INSERT INTO federated.t1 VALUES (); -SELECT LAST_INSERT_ID(); -INSERT INTO federated.t1 VALUES (); -SELECT LAST_INSERT_ID(); -INSERT INTO federated.t1 VALUES (); -SELECT LAST_INSERT_ID(); -SELECT * FROM federated.t1; -DROP TABLE federated.t1; - -connection slave; -DROP TABLE federated.t1; - -# -# Bug#17377 Federated Engine returns wrong Data, always the rows -# with the highest ID -# - -connection slave; - ---disable_warnings -DROP TABLE IF EXISTS federated.bug_17377_table; ---enable_warnings - -CREATE TABLE federated.bug_17377_table ( -`fld_cid` bigint(20) NOT NULL auto_increment, -`fld_name` varchar(255) NOT NULL default '', -`fld_parentid` bigint(20) NOT NULL default '0', -`fld_delt` int(1) NOT NULL default '0', -PRIMARY KEY (`fld_cid`), -KEY `fld_parentid` (`fld_parentid`), -KEY `fld_delt` (`fld_delt`), -KEY `fld_cid` (`fld_cid`) -) ENGINE=MyISAM; - -# Insert some test-data -insert into federated.bug_17377_table( fld_name ) -values -("Mats"), ("Sivert"), ("Sigvard"), ("Torgny"), ("Torkel"); - -connection master; ---disable_warnings -DROP TABLE IF EXISTS federated.t1; ---enable_warnings - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( -`fld_cid` bigint(20) NOT NULL auto_increment, -`fld_name` varchar(255) NOT NULL default '', -`fld_parentid` bigint(20) NOT NULL default '0', -`fld_delt` int(1) NOT NULL default '0', -PRIMARY KEY (`fld_cid`), -KEY `fld_parentid` (`fld_parentid`), -KEY `fld_delt` (`fld_delt`), -KEY `fld_cid` (`fld_cid`) -) ENGINE=FEDERATED -CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/bug_17377_table'; - -select * from federated.t1 where fld_parentid=0 and fld_delt=0 -order by fld_name; - -select * from federated.t1 where fld_parentid=0 and fld_delt=0; - -DROP TABLE federated.t1; -connection slave; -DROP TABLE federated.bug_17377_table; - -# -# Test multi updates and deletes without keys -# - -# The following can be enabled when bug #19773 has been fixed ---disable_parsing -connection slave; -create table federated.t1 (i1 int, i2 int, i3 int); -create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)); -connection master; -eval create table federated.t1 (i1 int, i2 int, i3 int) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; -eval create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2'; -insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2); -insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test"); -select * from federated.t1 order by i1; -select * from federated.t2; -update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -drop table federated.t1, federated.t2; -connection slave; -drop table federated.t1, federated.t2; -connection master; - -# Test multi updates and deletes with keys - -connection slave; -create table federated.t1 (i1 int, i2 int, i3 int, primary key (i1)); -create table federated.t2 (id int, c1 varchar(20), c2 varchar(20), primary key (id)); -connection master; -eval create table federated.t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; -eval create table federated.t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2'; -insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2); -insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test"); -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -drop table federated.t1, federated.t2; -connection slave; -drop table federated.t1, federated.t2; -connection master; ---enable_parsing - -# -# BUG #18764: Delete conditions causing inconsistencies in Federated tables -# -connection slave; ---disable_warnings -DROP TABLE IF EXISTS federated.test; ---enable_warnings -CREATE TABLE federated.test ( - `id` int(11) NOT NULL, - `val1` varchar(255) NOT NULL, - `val2` varchar(255) NOT NULL, - PRIMARY KEY (`id`) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -connection master; ---disable_warnings -DROP TABLE IF EXISTS federated.test_local; -DROP TABLE IF EXISTS federated.test_remote; ---enable_warnings -CREATE TABLE federated.test_local ( - `id` int(11) NOT NULL, - `val1` varchar(255) NOT NULL, - `val2` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -INSERT INTO federated.test_local VALUES (1, 'foo', 'bar'), -(2, 'bar', 'foo'); - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.test_remote ( - `id` int(11) NOT NULL, - `val1` varchar(255) NOT NULL, - `val2` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=FEDERATED DEFAULT CHARSET=latin1 -CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/test'; - -insert into federated.test_remote select * from federated.test_local; - -select * from federated.test_remote; - -delete from federated.test_remote where id in (1,2); - -insert into federated.test_remote select * from federated.test_local; - -select * from federated.test_remote; ---disable_warnings -DROP TABLE federated.test_local; -DROP TABLE federated.test_remote; ---enable_warnings -connection slave; ---disable_warnings -DROP TABLE federated.test; ---enable_warnings - -# -# Additional test for bug#18437 "Wrong values inserted with a before -# update trigger on NDB table". SQL-layer didn't properly inform -# handler about fields which were read and set in triggers. In some -# cases this resulted in incorrect (garbage) values of OLD variables -# and lost changes to NEW variables. -# Since for federated engine only operation which is affected by wrong -# fields mark-up is handler::write_row() this file constains coverage -# for ON INSERT triggers only. Tests for other types of triggers reside -# in ndb_trigger.test. -# -connection slave; ---disable_warnings -drop table if exists federated.t1; ---enable_warnings -create table federated.t1 (a int, b int, c int); -connection master; ---disable_warnings -drop table if exists federated.t1; -drop table if exists federated.t2; ---enable_warnings ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t1 (a int, b int, c int) engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; -create trigger federated.t1_bi before insert on federated.t1 for each row set new.c= new.a * new.b; -create table federated.t2 (a int, b int); -insert into federated.t2 values (13, 17), (19, 23); -# Each of three statements should correctly set values for all three fields -# insert -insert into federated.t1 (a, b) values (1, 2), (3, 5), (7, 11); -select * from federated.t1 order by a; -delete from federated.t1; -# insert ... select -insert into federated.t1 (a, b) select * from federated.t2; -select * from federated.t1 order by a; -delete from federated.t1; -# load -load data infile '../std_data_ln/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b); -select * from federated.t1 order by a; -drop tables federated.t1, federated.t2; - -connection slave; -drop table federated.t1; - -# -# BUG 19773 Crash when using multi-table updates, deletes -# with federated tables -# -connection slave; -create table federated.t1 (i1 int, i2 int, i3 int); -create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)); - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t1 (i1 int, i2 int, i3 int) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2'; -insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2); -insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test"); -select * from federated.t1 order by i1; -select * from federated.t2; -update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -delete federated.t1.*,federated.t2.* from federated.t1,federated.t2 where t1.i2=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -drop table federated.t1, federated.t2; -connection slave; -drop table federated.t1, federated.t2; - -# Test multi updates and deletes with keys -connection slave; -create table federated.t1 (i1 int, i2 int, i3 int, primary key (i1)); -create table federated.t2 (id int, c1 varchar(20), c2 varchar(20), primary key (id)); - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2'; -insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2); -insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test"); -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -delete federated.t1.*,federated.t2.* from federated.t1,federated.t2 where t1.i2=t2.id; -select * from federated.t1 order by i1; -select * from federated.t2 order by id; -drop table federated.t1, federated.t2; - -connection slave; -drop table federated.t1, federated.t2; -# -# Bug #16494: Updates that set a column to NULL fail sometimes -# -connection slave; -create table t1 (id int not null auto_increment primary key, val int); -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table t1 - (id int not null auto_increment primary key, val int) engine=federated - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; -insert into t1 values (1,0),(2,0); -update t1 set val = NULL where id = 1; -select * from t1; -connection slave; -select * from t1; -drop table t1; -connection master; -drop table t1; - -# -# Bug #17608: String literals lost during INSERT query on FEDERATED table -# -connection slave; -create table t1 (a longblob not null); -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table t1 - (a longblob not null) engine=federated - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; -insert into t1 values (repeat('a',5000)); -select length(a) from t1; -connection slave; -select length(a) from t1; -drop table t1; -connection master; -drop table t1; - -# -# BUG #15133: unique index with nullable value not accepted in federated table -# - -connection slave; ---disable_warnings -DROP TABLE IF EXISTS federated.test; -CREATE TABLE federated.test ( - `i` int(11) NOT NULL, - `j` int(11) NOT NULL, - `c` varchar(30) default NULL, - PRIMARY KEY (`i`,`j`), - UNIQUE KEY `i` (`i`,`c`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---enable_warnings - -connection master; ---disable_warnings -DROP TABLE IF EXISTS federated.test1; -DROP TABLE IF EXISTS federated.test2; ---enable_warnings - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.test1 ( - i int not null, - j int not null, - c varchar(30), - primary key (i,j), - unique key (i, c)) -engine = federated -connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/test'; - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.test2 ( - i int default null, - j int not null, - c varchar(30), - key (i)) -engine = federated -connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/test'; -drop table federated.test1, federated.test2; - -connection slave; -drop table federated.test; - -# -# BUG# 17044 Federated Storage Engine not UTF8 clean -# -connection slave; -set names utf8; -create table federated.t1 (a varchar(64)) DEFAULT CHARSET=utf8; - -insert into federated.t1 values (0x6DC3A56E6164); -select hex(a) from federated.t1; - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t1 (a varchar(64)) -ENGINE=FEDERATED -connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1' -DEFAULT CHARSET=utf8; -set names utf8; -select hex(a) from federated.t1; -insert into federated.t1 values (0xC3A4C3B6C3BCC39F); -insert into federated.t1 values (0xD18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E); -select hex(a) from federated.t1; - -connection slave; -select hex(a) from federated.t1; - -connection master; -drop table federated.t1; - -connection slave; -drop table federated.t1; - -# -# Bug#26909: Specified key was too long; max key length is 255 bytes -# when creating a table -# -connection slave; -CREATE TABLE federated.t1 ( - categoryId int(11) NOT NULL AUTO_INCREMENT, - domainId varchar(745) NOT NULL DEFAULT '', - categoryName varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (categoryId), - UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName), - KEY idx_category_domainId (domainId) - ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - categoryId int(11) NOT NULL AUTO_INCREMENT, - domainId varchar(745) NOT NULL DEFAULT '', - categoryName varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (categoryId), - UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName), - KEY idx_category_domainId (domainId) - ) ENGINE=FEDERATED DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - - -insert into federated.t1 (domainId, categoryName) values ( '1231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231231 300', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 250'); -insert into federated.t1 (domainId, categoryName) values ( '12312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312312 301', '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 250'); -insert into federated.t1 (domainId, categoryName) values ('a', 'b'); - -select categoryId from federated.t1 order by domainId, categoryName; -select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId; -select categoryId from federated.t1 where domainId='a' and categoryName='b' order by categoryId; -select categoryId from federated.t1 where domainId<>'a' and categoryName<>'b' order by categoryId; - -drop table federated.t1; - -connection slave; -drop table federated.t1; - -# -# BUG#21019 Federated Engine does not support REPLACE/INSERT IGNORE/UPDATE IGNORE -# -connection slave; -create table federated.t1 (a int primary key, b varchar(64)) - DEFAULT CHARSET=utf8; -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t1 (a int primary key, b varchar(64)) - ENGINE=FEDERATED - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1' - DEFAULT CHARSET=utf8; - -insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); -select * from federated.t1; - -truncate federated.t1; -replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); -select * from federated.t1; - -update ignore federated.t1 set a=a+1; -select * from federated.t1; - -drop table federated.t1; -connection slave; -drop table federated.t1; - -# -# BUG#25511 Federated Insert failures. -# -# When the user performs a INSERT...ON DUPLICATE KEY UPDATE, we want -# it to fail if a duplicate key exists instead of ignoring it. -# -connection slave; -create table federated.t1 (a int primary key, b varchar(64)) - DEFAULT CHARSET=utf8; -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t1 (a int primary key, b varchar(64)) - ENGINE=FEDERATED - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1' - DEFAULT CHARSET=utf8; - ---error ER_DUP_KEY -insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe") -on duplicate key update a=a+100; -select * from federated.t1; - -drop table federated.t1; -connection slave; -drop table federated.t1; - ---echo ---echo Bug#18287 create federated table always times out, error 1159 ' ' ---echo ---echo Test that self-references work ---echo -connection slave; -create table federated.t1 (a int primary key); ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t2 (a int primary key) - ENGINE=FEDERATED - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; -insert into federated.t1 (a) values (1); -select * from federated.t2; -drop table federated.t1, federated.t2; - -# -# BUG#29875 Disable support for transactions -# -connection slave; -CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8; -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 (a INT PRIMARY KEY) - ENGINE=FEDERATED - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1' - DEFAULT CHARSET=utf8; - -SELECT transactions FROM information_schema.engines WHERE engine="FEDERATED"; -INSERT INTO federated.t1 VALUES (1); -SET autocommit=0; -INSERT INTO federated.t1 VALUES (2); -ROLLBACK; -SET autocommit=1; -SELECT * FROM federated.t1; - -DROP TABLE federated.t1; -connection slave; -DROP TABLE federated.t1; - -# -# Bug #32374 crash with filesort when selecting from federated table and view -# -connection slave; -create table t1 (a varchar(256)); ---disable_warnings -drop view if exists v1; ---enable_warnings -create view v1 as select a from t1; ---disable_query_log -let $n= 100; -while ($n) -{ - insert into t1 values (repeat('a',200)); - dec $n; -} ---enable_query_log - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table t1 - (a varchar(256)) engine=federated - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/v1'; - -select 1 from t1 order by a; -drop table t1; -connection slave; -drop table t1; -drop view v1; - -# -# BUG#33946 - Join on Federated tables with Unique index gives error 1430 -# from storage engine -# -connection slave; -CREATE TABLE t1 (a INT, b INT, KEY(a,b)); -INSERT INTO t1 VALUES(NULL,1),(1,NULL),(NULL,NULL),(1,1),(2,2); - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE t1 (a INT, b INT, KEY(a,b)) ENGINE=federated -CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; -SELECT * FROM t1 WHERE a IS NULL; -SELECT * FROM t1 WHERE a IS NOT NULL; -SELECT * FROM t1 WHERE a=1 AND b=1; -SELECT * FROM t1 WHERE a IS NULL AND b=1; -SELECT * FROM t1 WHERE a IS NOT NULL AND b=1; -DROP TABLE t1; - -connection slave; -DROP TABLE t1; - -# -# BUG#34788 - malformed federated connection url is not handled correctly - -# crashes server ! -# -# also tests -# -# BUG#35509 - Federated leaks memory when connecting to localhost/default -# port -# -CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://'; -DROP TABLE t1; - - -# -# Bug #34779: crash in checksum table on federated tables with blobs -# containing nulls -# -connection slave; -CREATE TABLE t1 (a LONGBLOB, b LONGBLOB); -INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL); -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE t1 - (a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; -CHECKSUM TABLE t1; -connection slave; -DROP TABLE t1; -connection master; -DROP TABLE t1; - - -# -# Bug #34774 key prefix on text field in federated tables can cause -# server to crash! -# -connection slave; -CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1))); -INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL); -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE t1 - (a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; -SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b; -connection slave; -DROP TABLE t1; -connection master; -DROP TABLE t1; - -connection default; - ---echo End of 5.0 tests - -create server 's1' foreign data wrapper 'mysql' options (port 3306); -drop server 's1'; - ---echo End of 5.1 tests -SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT; -connection slave; -SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT; - -connection default; -source include/federated_cleanup.inc; diff --git a/mysql-test/t/federated_archive.test b/mysql-test/t/federated_archive.test deleted file mode 100644 index f8df5f1c51a..00000000000 --- a/mysql-test/t/federated_archive.test +++ /dev/null @@ -1,60 +0,0 @@ -# should work with embedded server after mysqltest is fixed --- source include/not_embedded.inc -source include/have_archive.inc; -source include/federated.inc; - - -connection slave; ---disable_warnings -DROP TABLE IF EXISTS federated.archive_table; ---enable_warnings - -CREATE TABLE federated.archive_table ( - `id` int(4) NOT NULL, - `name` varchar(54) default NULL - ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; - - -connection master; ---disable_warnings -DROP TABLE IF EXISTS federated.t1; ---enable_warnings - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(4) NOT NULL, - `name` varchar(54) default NULL, - PRIMARY KEY (`id`) - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/archive_table'; - -INSERT INTO federated.t1 (id, name) VALUES (1, 'foo'); -INSERT INTO federated.t1 (id, name) VALUES (2, 'bar'); - -SELECT * FROM federated.t1; - ---error 1296 -DELETE FROM federated.t1 WHERE id = 1; - -SELECT * FROM federated.t1; - - ---error 1296 -UPDATE federated.t1 SET name='baz' WHERE id = 1; - -SELECT * FROM federated.t1; - - -# --error 1296 -# TRUNCATE federated.t1; -# -# SELECT * from federated.t1; - -DROP TABLE federated.t1; -connection slave; -DROP TABLE federated.archive_table; - - -source include/federated_cleanup.inc; - diff --git a/mysql-test/t/federated_bug_13118.test b/mysql-test/t/federated_bug_13118.test deleted file mode 100644 index e429a660489..00000000000 --- a/mysql-test/t/federated_bug_13118.test +++ /dev/null @@ -1,44 +0,0 @@ -# should work with embedded server after mysqltest is fixed --- source include/not_embedded.inc -source include/federated.inc; - - -connection slave; ---disable_warnings -DROP TABLE IF EXISTS federated.bug_13118_table; ---enable_warnings - -CREATE TABLE federated.bug_13118_table ( - `foo` integer, - `bar` integer - ); - - -connection master; ---disable_warnings -DROP TABLE IF EXISTS federated.t1; ---enable_warnings - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `foo` integer, - `bar` integer - ) ENGINE="FEDERATED" - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/bug_13118_table'; - -SELECT * from federated.t1; - -INSERT INTO federated.t1 VALUES (1,1); -SELECT * FROM federated.t1; - -INSERT INTO federated.t1 VALUES (1,1); -SELECT * FROM federated.t1; - - -DROP TABLE federated.t1; -connection slave; -DROP TABLE federated.bug_13118_table; - - -source include/federated_cleanup.inc; - diff --git a/mysql-test/t/federated_bug_25714.test b/mysql-test/t/federated_bug_25714.test deleted file mode 100644 index 6d112cae5b8..00000000000 --- a/mysql-test/t/federated_bug_25714.test +++ /dev/null @@ -1,58 +0,0 @@ ---source include/have_bug25714.inc -source include/federated.inc; - -connection master; -# Disable concurrent inserts to avoid test failures when reading -# data from concurrent connections (insert might return before -# the data is actually in the table). -SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; -SET @@GLOBAL.CONCURRENT_INSERT= 0; - -connection slave; -SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; -SET @@GLOBAL.CONCURRENT_INSERT= 0; ---disable_warnings -DROP TABLE IF EXISTS federated.bug_13118_table; ---enable_warnings - -CREATE TABLE federated.t1 ( - `id` int auto_increment primary key, - `value` int - ) ENGINE=MyISAM; -INSERT INTO federated.t1 SET value=1; -INSERT INTO federated.t1 SET value=2; -INSERT INTO federated.t1 SET value=2; - -connection master; ---disable_warnings -DROP TABLE IF EXISTS federated.t1; ---enable_warnings - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int auto_increment primary key, - `value` int - ) ENGINE=FEDERATED - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -SELECT * from federated.t1; - -INSERT INTO federated.t1 SET value=4; - -SELECT LAST_INSERT_ID(); - ---exec $MYSQL_BUG25714 $SLAVE_MYPORT ---exec $MYSQL_BUG25714 $MASTER_MYPORT - -SELECT * from federated.t1; - -DROP TABLE federated.t1; -SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT; -connection slave; -DROP TABLE federated.t1; -SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT; - - -source include/federated_cleanup.inc; - - diff --git a/mysql-test/t/federated_innodb-slave.opt b/mysql-test/t/federated_innodb-slave.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/t/federated_innodb-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/t/federated_innodb.test b/mysql-test/t/federated_innodb.test deleted file mode 100644 index 0617cb15d97..00000000000 --- a/mysql-test/t/federated_innodb.test +++ /dev/null @@ -1,39 +0,0 @@ -# NOTE: Keep any include/ files that will kill / skip a test BEFORE any others -# having federated.inc before have_innodb.inc allows for an orphaned database -# that can cause other tests to fail. -# See Bug #40645 Test main.federated_innodb does not always clean up after itself - -source include/have_innodb.inc; -source include/federated.inc; - -# -# Bug#25513 Federated transaction failures -# -connection slave; -create table federated.t1 (a int primary key, b varchar(64)) - engine=myisam; -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create table federated.t1 (a int primary key, b varchar(64)) - engine=federated - connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - ---error ER_DUP_KEY -insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); -select * from federated.t1; - -connection slave; -truncate federated.t1; -alter table federated.t1 engine=innodb; -connection master; - ---error ER_DUP_KEY -insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); -select * from federated.t1; - -drop table federated.t1; -connection slave; -drop table federated.t1; - - -source include/federated_cleanup.inc; diff --git a/mysql-test/t/federated_server.test b/mysql-test/t/federated_server.test deleted file mode 100644 index 444285ac045..00000000000 --- a/mysql-test/t/federated_server.test +++ /dev/null @@ -1,337 +0,0 @@ -# WL #3031 This test tests the new servers table as well as -# if federated can utilise the servers table -# should work with embedded server after mysqltest is fixed --- source include/not_embedded.inc --- source include/federated.inc --- source include/big_test.inc - -connection slave; -create database first_db; -create database second_db; - -use first_db; - -DROP TABLE IF EXISTS first_db.t1; -CREATE TABLE first_db.t1 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - DEFAULT CHARSET=latin1; - -DROP TABLE IF EXISTS first_db.t2; -CREATE TABLE first_db.t2 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - DEFAULT CHARSET=latin1; - -use second_db; -DROP TABLE IF EXISTS second_db.t1; -CREATE TABLE second_db.t1 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - DEFAULT CHARSET=latin1; - -DROP TABLE IF EXISTS second_db.t2; -CREATE TABLE second_db.t2 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - DEFAULT CHARSET=latin1; - -connection master; - -drop server if exists 'server_one'; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create server 'server_one' foreign data wrapper 'mysql' options - (HOST '127.0.0.1', - DATABASE 'first_db', - USER 'root', - PASSWORD '', - PORT $SLAVE_MYPORT, - SOCKET '', - OWNER 'root'); - -drop server if exists 'server_two'; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create server 'server_two' foreign data wrapper 'mysql' options - (HOST '127.0.0.1', - DATABASE 'second_db', - USER 'root', - PASSWORD '', - PORT $SLAVE_MYPORT, - SOCKET '', - OWNER 'root'); - ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval select * from mysql.servers; - -DROP TABLE IF EXISTS federated.old; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.old ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/first_db/t1'; - -INSERT INTO federated.old (id, name) values (1, 'federated.old-> first_db.t1, url format'); - -SELECT * FROM federated.old; - -DROP TABLE IF EXISTS federated.old2; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.old2 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/first_db/t2'; - -INSERT INTO federated.old2 (id, name) values (1, 'federated.old2-> first_db.t2, url format'); -SELECT * FROM federated.old2; - -DROP TABLE IF EXISTS federated.urldb2t1; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.urldb2t1 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t1'; -INSERT INTO federated.urldb2t1 (id, name) values (1, 'federated.urldb2t1 -> second_db.t1, url format'); -SELECT * FROM federated.urldb2t1; - -DROP TABLE IF EXISTS federated.urldb2t2; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.urldb2t2 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/second_db/t2'; -INSERT INTO federated.urldb2t2 (id, name) values (1, 'federated.urldb2t2 -> second_db.t2, url format'); -SELECT * FROM federated.urldb2t2; - -DROP TABLE IF EXISTS federated.t1; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='server_one'; - -INSERT INTO federated.t1 (id, name) values (1, 'server_one, new scheme, first_db.t1'); - -SELECT * FROM federated.t1; - -DROP TABLE IF EXISTS federated.whatever; -CREATE TABLE federated.whatever ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='server_one/t1'; -INSERT INTO federated.whatever (id, name) values (1, 'server_one, new scheme, whatever, first_db.t1'); -SELECT * FROM federated.whatever; - -ALTER SERVER 'server_one' options(DATABASE 'second_db'); - -# FLUSH TABLES is now unneccessary - -INSERT INTO federated.t1 (id, name) values (1, 'server_two, new scheme, second_db.t1'); -SELECT * FROM federated.t1; - -INSERT INTO federated.whatever (id, name) values (1, 'server_two, new scheme, whatever, second_db.t1'); -SELECT * FROM federated.whatever; - -drop table federated.t1; - -drop server 'server_one'; -drop server 'server_two'; -select * from mysql.servers; - -connection slave; -drop table first_db.t1; -drop table second_db.t1; -drop database first_db; -drop database second_db; - -# -# Bug#25671 - CREATE/DROP/ALTER SERVER should require privileges -# -# Changes to SERVER declarations should require SUPER privilege. -# Based upon test case by Giuseppe Maxia - -create database db_legitimate; -create database db_bogus; - -use db_legitimate; -CREATE TABLE db_legitimate.t1 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ); -INSERT INTO db_legitimate.t1 VALUES ('1','this is legitimate'); - -use db_bogus; -CREATE TABLE db_bogus.t1 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) - ; -INSERT INTO db_bogus.t1 VALUES ('2','this is bogus'); - -connection master; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create server 's1' foreign data wrapper 'mysql' options - (HOST '127.0.0.1', - DATABASE 'db_legitimate', - USER 'root', - PASSWORD '', - PORT $SLAVE_MYPORT, - SOCKET '', - OWNER 'root'); - -create user guest_select@localhost; -grant select on federated.* to guest_select@localhost; - -create user guest_super@localhost; -grant select,SUPER,RELOAD on *.* to guest_super@localhost; - -create user guest_usage@localhost; -grant usage on *.* to guest_usage@localhost; - -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `name` varchar(64) NOT NULL default '' - ) ENGINE = FEDERATED CONNECTION = 's1'; - -select * from federated.t1; - -connect (conn_select,127.0.0.1,guest_select,,federated,$MASTER_MYPORT); -connect (conn_usage,127.0.0.1,guest_usage,,,$MASTER_MYPORT); -connect (conn_super,127.0.0.1,guest_super,,,$MASTER_MYPORT); - -connection conn_select; ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -alter server s1 options (database 'db_bogus'); - -connection master; -flush tables; -select * from federated.t1; - -connection conn_usage; ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -alter server s1 options (database 'db_bogus'); - -connection master; -flush tables; -select * from federated.t1; - -connection conn_super; -alter server s1 options (database 'db_bogus'); - -connection master; -flush tables; -select * from federated.t1; - -connection conn_select; ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -drop server if exists 's1'; ---replace_result $SLAVE_MYPORT SLAVE_PORT ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -eval create server 's1' foreign data wrapper 'mysql' options - (HOST '127.0.0.1', - DATABASE 'db_legitimate', - USER 'root', - PASSWORD '', - PORT $SLAVE_MYPORT, - SOCKET '', - OWNER 'root'); - -connection conn_super; -drop server 's1'; ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval create server 's1' foreign data wrapper 'mysql' options - (HOST '127.0.0.1', - DATABASE 'db_legitimate', - USER 'root', - PASSWORD '', - PORT $SLAVE_MYPORT, - SOCKET '', - OWNER 'root'); - -connection master; -flush tables; -select * from federated.t1; - -# clean up test -connection slave; -drop database db_legitimate; -drop database db_bogus; - -disconnect conn_select; -disconnect conn_usage; -disconnect conn_super; - -connection master; -drop user guest_super@localhost; -drop user guest_usage@localhost; -drop user guest_select@localhost; -drop table federated.t1; -drop server 's1'; - -# -# Bug#30671 - ALTER SERVER causes the server to crash -# -create server 's1' foreign data wrapper 'mysql' options (port 3306); -alter server 's1' options - (host 'localhost', database '', user '', - password '', socket '', owner '', port 3306); -# The next statement would crash unpatched server -alter server 's1' options - (host 'localhost', database 'database1', user '', - password '', socket '', owner '', port 3306); -drop server 's1'; - ---echo # End of 5.1 tests - - -# -# Bug#25721 - deadlock with ALTER/CREATE SERVER -# -connect (other,localhost,root,,); -connection master; -use test; -delimiter //; -create procedure p1 () -begin - DECLARE v INT DEFAULT 0; - DECLARE e INT DEFAULT 0; - DECLARE i INT; - DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; - SET i = sleep(5); - WHILE v < 10000 do - CREATE SERVER s - FOREIGN DATA WRAPPER mysql - OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); - ALTER SERVER s OPTIONS (USER 'Remote'); - DROP SERVER s; - SET v = v + 1; - END WHILE; - SELECT e > 0; -END// -delimiter ;// -connection other; -use test; -send call p1(); -connection master; -call p1(); -connection other; -reap; -drop procedure p1; -drop server if exists s; - - -source include/federated_cleanup.inc; diff --git a/mysql-test/t/federated_transactions-slave.opt b/mysql-test/t/federated_transactions-slave.opt deleted file mode 100644 index 48457b17309..00000000000 --- a/mysql-test/t/federated_transactions-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-innodb diff --git a/mysql-test/t/federated_transactions.test b/mysql-test/t/federated_transactions.test deleted file mode 100644 index 2fc737730bf..00000000000 --- a/mysql-test/t/federated_transactions.test +++ /dev/null @@ -1,40 +0,0 @@ -# should work with embedded server after mysqltest is fixed --- source include/not_embedded.inc -source include/have_innodb.inc; -source include/federated.inc; - -connection slave; -DROP TABLE IF EXISTS federated.t1; -#SHOW ENGINES; -CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `name` varchar(32) NOT NULL default '' - ) - DEFAULT CHARSET=latin1 ENGINE=innodb; - -connection master; -DROP TABLE IF EXISTS federated.t1; -# # correct connection, same named tables ---replace_result $SLAVE_MYPORT SLAVE_PORT -eval CREATE TABLE federated.t1 ( - `id` int(20) NOT NULL, - `name` varchar(32) NOT NULL default '' - ) - ENGINE="FEDERATED" DEFAULT CHARSET=latin1 - CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; - -set autocommit=0; -INSERT INTO federated.t1 (id, name) VALUES (1, 'foo'); -INSERT INTO federated.t1 (id, name) VALUES (2, 'fee'); -COMMIT; -INSERT INTO federated.t1 (id, name) VALUES (3, 'fie'); -INSERT INTO federated.t1 (id, name) VALUES (4, 'fum'); -ROLLBACK; -set autocommit=1; -INSERT INTO federated.t1 (id, name) VALUES (5, 'foe'); -INSERT INTO federated.t1 (id, name) VALUES (6, 'fig'); - -SELECT * FROM federated.t1; -DELETE FROM federated.t1; - -source include/federated_cleanup.inc; diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test index 3051fd88076..c7cd500f8d2 100644 --- a/mysql-test/t/fix_priv_tables.test +++ b/mysql-test/t/fix_priv_tables.test @@ -51,7 +51,8 @@ echo; -- disable_query_log # Run the mysql_fix_privilege_tables.sql using "mysql --force" ---exec $MYSQL --force mysql < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/log/fix_priv_tables.log 2>&1 +--exec $MYSQL --force mysql < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/tmp/fix_priv_tables.log 2>&1 +--remove_file $MYSQLTEST_VARDIR/tmp/fix_priv_tables.log -- enable_query_log -- enable_result_log diff --git a/mysql-test/t/flush_basic.test b/mysql-test/t/flush_basic.test deleted file mode 100644 index f5f6665562e..00000000000 --- a/mysql-test/t/flush_basic.test +++ /dev/null @@ -1,172 +0,0 @@ -############## mysql-test\t\flush_basic.test ################################## -# # -# Variable Name: flush # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: OFF # -# Range: # -# # -# # -# Creation Date: 2008-02-09 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable flush # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-options.html#option_mysqld_flush # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF flush TESTS # -######################################################################## - - -############################################################# -# Saving initial value of flush in a temporary variable # -############################################################# - -SET @start_value = @@global.flush; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_030_01------------------------#' -############################################################# -# Display the DEFAULT value of flush # -############################################################# - -SET @@global.flush = ON; ---Error ER_NO_DEFAULT -SET @@global.flush = DEFAULT; ---echo 'Bug# 34878: FN_DYNVARS_002_01 - Default value is off according to Documentation of MySQL'; -SELECT @@global.flush; - - ---echo '#---------------------FN_DYNVARS_030_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.flush = @start_value; -SELECT @@global.flush; - - ---echo '#--------------------FN_DYNVARS_030_03------------------------#' -############################################################# -# Change the value of flush to a valid value # -############################################################# - -SET @@global.flush = ON; -SELECT @@global.flush; -SET @@global.flush = OFF; -SELECT @@global.flush; -SET @@global.flush = 0; -SELECT @@global.flush; -SET @@global.flush = 1; -SELECT @@global.flush; - - ---echo '#--------------------FN_DYNVARS_030_04-------------------------#' -########################################################################### -# Change the value of flush to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.flush = ''; - - ---echo '#-------------------FN_DYNVARS_030_05----------------------------#' -########################################################################### -# Test if accessing session flush gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.flush = 1; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.flush; - - ---echo '#----------------------FN_DYNVARS_030_06------------------------#' -#################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -#################################################################### - -SELECT @@global.flush = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='flush'; - - ---echo '#---------------------FN_DYNVARS_030_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.flush = TRUE; -SELECT @@global.flush; -SET @@global.flush = FALSE; -SELECT @@global.flush; - - ---echo '#---------------------FN_DYNVARS_030_08----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same global variable # -############################################################################### - -SET @@global.flush = 1; -SELECT @@flush = @@global.flush; - ---echo '#---------------------FN_DYNVARS_030_09----------------------#' -########################################################################## -# Check if flush can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET flush = 1; ---Error ER_PARSE_ERROR -SET global.flush = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.flush; ---Error ER_BAD_FIELD_ERROR -SELECT flush = @@session.flush; - - -############################## -# Restore initial value # -############################## - -SET @@global.flush = @start_value; -SELECT @@global.flush; - - -############################################################# -# END OF flush TESTS # -############################################################# diff --git a/mysql-test/t/foreign_key_checks_basic.test b/mysql-test/t/foreign_key_checks_basic.test deleted file mode 100644 index 54d94aca971..00000000000 --- a/mysql-test/t/foreign_key_checks_basic.test +++ /dev/null @@ -1,172 +0,0 @@ -############## mysql-test\t\foreign_key_checks_basic.test ##################### -# # -# Variable Name: foreign_key_checks # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: NA # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable foreign_key_checks # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF foreign_key_checks TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of foreign_key_checks in a temporary variable # -################################################################################ - -SET @session_start_value = @@session.foreign_key_checks; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_032_01------------------------#' -######################################################################## -# Display the DEFAULT value of foreign_key_checks # -######################################################################## - -SET @@session.foreign_key_checks = 1; -SET @@session.foreign_key_checks = DEFAULT; -SELECT @@session.foreign_key_checks; - ---echo 'Bug# 34878: No DEFAULT value for variable. Also setting DEFAULT does not give error' - ---echo '#---------------------FN_DYNVARS_032_02-------------------------#' -############################################################################# -# Check if foreign_key_checks can be accessed with and without @@ sign # -############################################################################# - -SET foreign_key_checks = 1; -SELECT @@foreign_key_checks; - ---Error ER_UNKNOWN_TABLE -SELECT session.foreign_key_checks; - ---Error ER_UNKNOWN_TABLE -SELECT local.foreign_key_checks; - -SET session foreign_key_checks = 0; -SELECT @@session.foreign_key_checks; - - ---echo '#--------------------FN_DYNVARS_032_03------------------------#' -######################################################################## -# change the value of foreign_key_checks to a valid value # -######################################################################## - -SET @@session.foreign_key_checks = 0; -SELECT @@session.foreign_key_checks; -SET @@session.foreign_key_checks = 1; -SELECT @@session.foreign_key_checks; - - ---echo '#--------------------FN_DYNVARS_032_04-------------------------#' -########################################################################### -# Change the value of foreign_key_checks to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = ÕN; - -SET @@session.foreign_key_checks = OF; -SELECT @@session.foreign_key_checks; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.foreign_key_checks = NO; - - ---echo '#-------------------FN_DYNVARS_032_05----------------------------#' -########################################################################### -# Test if accessing global foreign_key_checks gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.foreign_key_checks = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.foreign_key_checks; - ---echo '#----------------------FN_DYNVARS_032_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='foreign_key_checks'; - ---echo '#----------------------FN_DYNVARS_032_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.foreign_key_checks = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='foreign_key_checks'; -SELECT @@session.foreign_key_checks; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='foreign_key_checks'; - - ---echo '#---------------------FN_DYNVARS_032_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.foreign_key_checks = OFF; -SELECT @@session.foreign_key_checks; -SET @@session.foreign_key_checks = ON; -SELECT @@session.foreign_key_checks; - ---echo '#---------------------FN_DYNVARS_032_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.foreign_key_checks = TRUE; -SELECT @@session.foreign_key_checks; -SET @@session.foreign_key_checks = FALSE; -SELECT @@session.foreign_key_checks; - -############################## -# Restore initial value # -############################## - -SET @@session.foreign_key_checks = @session_start_value; -SELECT @@session.foreign_key_checks; - -############################################################### -# END OF foreign_key_checks TESTS # -############################################################### diff --git a/mysql-test/t/foreign_key_checks_func.test b/mysql-test/t/foreign_key_checks_func.test deleted file mode 100644 index 4d2c63bbce6..00000000000 --- a/mysql-test/t/foreign_key_checks_func.test +++ /dev/null @@ -1,139 +0,0 @@ -############## mysql-test\t\foreign_key_checks_func.test ##################### -# # -# Variable Name: foreign_key_checks # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: NA # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable foreign_key_checks # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#--------------------FN_DYNVARS_032_01-------------------------#' -#################################################################### -# Check if setting foreign_key_checks is changed in new connection # -#################################################################### - -SET @@session.foreign_key_checks = 0; -# con1 will be default connection from now on ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@session.foreign_key_checks; -SET @@session.foreign_key_checks = 1; ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); ---echo 'connection con2' -connection con2; -SELECT @@session.foreign_key_checks; -disconnect con2; - ---echo '#--------------------FN_DYNVARS_032_02-------------------------#' -################################################################# -# Begin the functionality Testing of foreign_key_checks # -################################################################# - ---echo 'connection con1' -connection con1; - ---disable_warnings -DROP TABLE IF EXISTS t1,t2; ---enable_warnings - -CREATE TABLE t1(a INT PRIMARY KEY)ENGINE = INNODB; -CREATE TABLE t2(a INT PRIMARY KEY,b INT)ENGINE = INNODB; - -ALTER TABLE t2 -ADD CONSTRAINT fk FOREIGN KEY (b) REFERENCES t1 (a); - -#=========================================================== ---echo '---Check when foreign_key_checks is enabled---' -#=========================================================== - - -SET @@session.foreign_key_checks = 1; - -INSERT INTO t1 values (1),(2),(3); - -INSERT INTO t2 values (10,1); ---Error ER_NO_REFERENCED_ROW_2 -INSERT INTO t2 values (20,22); - -#=========================================================== ---echo '---Check when foreign_key_checks is disabled---' -#=========================================================== - ---Error ER_ROW_IS_REFERENCED_2 -TRUNCATE t1; - -SET @@session.foreign_key_checks = 0; - -TRUNCATE t1; -TRUNCATE t2; - -INSERT INTO t1 values (1),(2),(3); - -INSERT INTO t2 values (10,1); -INSERT INTO t2 values (20,4); - ---echo 'try enabling foreign_key_checks again'; -SET @@session.foreign_key_checks = 1; - -UPDATE t2 SET b=4 where a=20; ---echo 'Bug#35358: Updating an incorrect foreign key(inserted by disabling ' ---echo 'foreign_key_checks)to the same value does not raise error after ' ---echo 'enabling foreign_key_checks' - -#============================================================================== ---echo 'Check when foreign_key_checks is enabled and FK constraint is re-created' -#============================================================================== - -SET @@session.foreign_key_checks = 0; -TRUNCATE t2; -TRUNCATE t1; - -INSERT INTO t1 values (1),(2),(3); -INSERT INTO t2 values (10,1),(20,4); - -ALTER TABLE t2 DROP FOREIGN KEY fk; - -SET @@session.foreign_key_checks = 1; - -# Test disabled as error description is different. The resulting description has -# difference in code #sql-xxx_2 where xxx is different for each run. -#--Error ER_NO_REFERENCED_ROW_2 -#ALTER TABLE t2 -#ADD CONSTRAINT fk FOREIGN KEY (b) REFERENCES t1 (a); - -# delete all rows with incorrect reference -DELETE FROM t2 WHERE b not in (SELECT a from t1); - -ALTER TABLE t2 -ADD CONSTRAINT fk FOREIGN KEY (b) REFERENCES t1 (a); - -INSERT INTO t2 values (20,2); - -SELECT * from t2; - ---disable_warnings -DROP TABLE IF EXISTS t2; -DROP TABLE IF EXISTS t1; ---enable_warnings - -########################################################## -# End of functionality Testing for foreign_key_checks # -########################################################## - diff --git a/mysql-test/t/ft_boolean_syntax_basic.test b/mysql-test/t/ft_boolean_syntax_basic.test deleted file mode 100644 index 4117605c452..00000000000 --- a/mysql-test/t/ft_boolean_syntax_basic.test +++ /dev/null @@ -1,162 +0,0 @@ -############## mysql-test\t\ft_boolean_syntax_basic.test ###################### -# # -# Variable Name: ft_boolean_syntax # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: +-><()~*:""& # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable ft_boolean_syntax # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################### -## START OF ft_boolean_syntax TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# -# save using implicit session scope -SET @global_start_value = @@global.ft_boolean_syntax; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_033_01------------------#' -############################################################################### -# Test Variable access and assignment with and without @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT ft_boolean_syntax; -# access using no scope specified -SELECT @@ft_boolean_syntax; -# assign value without @@ -SET @@global.ft_boolean_syntax='+ -><()~*:""&|'; -SELECT @@global.ft_boolean_syntax; -# using another syntax for accessing session variable -SET global ft_boolean_syntax='$ -><()`*:""&|'; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT global ft_boolean_syntax; - ---echo '#--------------------FN_DYNVARS_033_02-------------------------#' -####################################################################### -# Check the DEFAULT value of ft_boolean_syntax for global # -####################################################################### -SET @@global.ft_boolean_syntax = '# -><()!*:""&|'; -SET @@global.ft_boolean_syntax = DEFAULT; -SELECT @@global.ft_boolean_syntax; - ---echo '#--------------------FN_DYNVARS_033_03-------------------------#' -###################################################################### -# see if it is accessable using session scope # -###################################################################### ---Error ER_GLOBAL_VARIABLE -SET @@session.ft_boolean_syntax = '# -><()!*:""&|'; ---Error ER_GLOBAL_VARIABLE -SET @@ft_boolean_syntax = '# -><()!*:""&|'; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.ft_boolean_syntax; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@local.ft_boolean_syntax; - ---echo '#--------------------FN_DYNVARS_033_04-------------------------#' -############################################################################## -# Change the value of ft_boolean_syntax to a valid value # -############################################################################## - -SET @@global.ft_boolean_syntax='+ -><()~*:""&|'; -SELECT @@global.ft_boolean_syntax; - -SET @@global.ft_boolean_syntax=' +-><()~*:""&|'; -SELECT @@global.ft_boolean_syntax; - -SET @@global.ft_boolean_syntax=' -+()<>~*:``&|'; -SELECT @@global.ft_boolean_syntax; - -SET @@global.ft_boolean_syntax='+ -><()~*:""@!'; -SELECT @@global.ft_boolean_syntax; - -SET @@global.ft_boolean_syntax=" +-><()~*:''&|"; -SELECT @@global.ft_boolean_syntax; - -SET @@global.ft_boolean_syntax=' ~/!@#$%^&*()-'; -SELECT @@global.ft_boolean_syntax; - ---echo '#--------------------FN_DYNVARS_033_05-------------------------#' -############################################################################### -# Change the value of ft_boolean_syntax to an invalid value for global # -############################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = '+-> <()~*:""&|'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = '0'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = '1 -><()~*:11&|'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = '# -><()~*:11&1'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = '1234567890ABCD'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.ft_boolean_syntax = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = '+-> <((~*:".&|'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = ON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.ft_boolean_syntax = true; ---Error ER_PARSE_ERROR -SET @@global.ft_boolean_syntax = + -><()~*:""&|; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = ENABLE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = 'IGNORE'; - ---echo '#--------------------FN_DYNVARS_033_06-------------------------#' -############################################################################# -# Check if the value in GLOBAL Table matches value in variable # -############################################################################# -SELECT @@global.ft_boolean_syntax = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ft_boolean_syntax') AS res; - - ---echo '#--------------------FN_DYNVARS_033_07-------------------------#' -############################################################################# -# Assigning value from a temporary variable # -############################################################################# -# Content of initial variable -SELECT @global_start_value; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.ft_boolean_syntax = @global_start_value; ---echo 'Bug# 34883: ft_boolean_syntax cant be assigned values from session temporary'; ---echo 'variables'; - -#################################### -# Restore Default value # -#################################### -#restoring to default as we cant assign the initial value -SET @@global.ft_boolean_syntax = DEFAULT; -SELECT @@global.ft_boolean_syntax; - -########################################################## -# END OF ft_boolean_syntax TESTS # -########################################################## diff --git a/mysql-test/t/ft_boolean_syntax_func.test b/mysql-test/t/ft_boolean_syntax_func.test deleted file mode 100644 index 4ea28b015cb..00000000000 --- a/mysql-test/t/ft_boolean_syntax_func.test +++ /dev/null @@ -1,126 +0,0 @@ -############## mysql-test\t\ft_boolean_syntax_func.test ###################### -# # -# Variable Name: ft_boolean_syntax # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: + -><()~*:""& # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable ft_boolean_syntax # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---echo '#--------------------FN_DYNVARS_033_01-------------------------#' -################################################################### -# Check if setting ft_boolean_syntax is changed in new connection # -################################################################### - -SET @@global.ft_boolean_syntax = ' -+()<>~*:``&|'; -# con1 will be default connection from now on ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.ft_boolean_syntax; -SET @@global.ft_boolean_syntax = '+ -><()~*:""&|'; ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); ---echo 'connection con2' -connection con2; -SELECT @@global.ft_boolean_syntax; -disconnect con2; -disconnect con1; - ---echo '#--------------------FN_DYNVARS_033_02-------------------------#' -######################################################### -# Begin the functionality Testing of ft_boolean_syntax # -######################################################### - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE articles ( - id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, - title VARCHAR(200), - body TEXT, - FULLTEXT (title,body) -); - -INSERT INTO articles (title,body) VALUES -('MySQL Tutorial','DBMS stands for DataBase ...'), -('How To',''), -('How To Use MySQL Well','After you went through a ...'), -('Optimizing MySQL','In this tutorial we will show .... Run command line ...'), -('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), -('100 Tips for Myisam','1. Myisam is faster than innodb 2. Tricks and Tips for Myisam...'), -('MySQL vs. YourSQL','In the following database comparison ...'), -('MySQL Security','When configured properly, MySQL ...'), -('Database Security','Configuring MySQL for ...'); - -SET @@global.ft_boolean_syntax = DEFAULT; - -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE); - -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('+MySQL +YourSQL' IN BOOLEAN MODE); - -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('MySQL' IN BOOLEAN MODE); - -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('mysql tutorial dbms' IN BOOLEAN MODE); - -SELECT id,title,body, (MATCH (title,body) -AGAINST ('+security configuring' IN BOOLEAN MODE)) AS relevance -FROM articles WHERE MATCH (title,body) -AGAINST ('+security configuring' IN BOOLEAN MODE); - -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('"faster than"' IN BOOLEAN MODE); - -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('+run ~line' IN BOOLEAN MODE); - ---Echo 'Bug#35359: ~ is not working correctly. Its behaving like -' - -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('10*' IN BOOLEAN MODE); - ---Echo 'Bug#35360: * is not working correctly. Not all rows are returned' - -SELECT id,title,body, (MATCH (title,body) -AGAINST ('+MySQL +(>show <dbms)' IN BOOLEAN MODE)) AS relevance -FROM articles WHERE MATCH (title,body) -AGAINST ('+MySQL +(>show <dbms)' IN BOOLEAN MODE) -ORDER BY relevance DESC; - -#============================================================================== ---echo '---try setting different operators. Default '+ -><()~*:""&|'--' -#============================================================================== -SET @@global.ft_boolean_syntax='~ /!@#$%^&*()-'; -SELECT * FROM articles WHERE MATCH (title,body) -AGAINST ('~mySQL /yourSQL' IN BOOLEAN MODE); - ---echo 'Bug#35361: Different syntax does not produce result as default operators' - -#restore default -SET @@global.ft_boolean_syntax=DEFAULT; - -######################################################### -# End of functionality Testing for ft_boolean_syntax # -######################################################### -DROP TABLE articles; - diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 21b06ca0882..852369fd568 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -445,3 +445,12 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(b) WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; DROP TABLE t1; + +# +# BUG#37245 - Full text search problem +# +CREATE TABLE t1(a CHAR(10)); +INSERT INTO t1 VALUES('aaa15'); +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1; +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/fulltext_plugin-master.opt b/mysql-test/t/fulltext_plugin-master.opt new file mode 100644 index 00000000000..a2554caa20b --- /dev/null +++ b/mysql-test/t/fulltext_plugin-master.opt @@ -0,0 +1 @@ +$SIMPLE_PARSER_OPT diff --git a/mysql-test/t/fulltext_plugin.test b/mysql-test/t/fulltext_plugin.test new file mode 100644 index 00000000000..31978dadc51 --- /dev/null +++ b/mysql-test/t/fulltext_plugin.test @@ -0,0 +1,10 @@ +--source include/have_simple_parser.inc + +# +# BUG#39746 - Debug flag breaks struct definition (server crash) +# +INSTALL PLUGIN simple_parser SONAME 'mypluglib.so'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser); +ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser; +DROP TABLE t1; +UNINSTALL PLUGIN simple_parser; diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 7f17fd2180f..0a3a3823fee 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -49,6 +49,9 @@ set @@global.max_allowed_packet=1048576*100; # reconnect to make the new max packet size take effect --connect (newconn, localhost, root,,) eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null; +disconnect newconn; +connection default; +set @@global.max_allowed_packet=default; # # Bug #18643: problem with null values diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 8da10f36cbe..4efea8e195e 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -150,4 +150,18 @@ FROM t1; DROP TABLE t1; +# +# Bug #40761: Assert on sum func on IF(..., CAST(longtext AS UNSIGNED), signed) +# (was: LEFT JOIN on inline view crashes server) +# + +CREATE TABLE t1 (c LONGTEXT); +INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890'); + +SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te; +SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te; + +DROP TABLE t1; + + --echo End of 5.0 tests diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index d0d4dea0713..3fc1697f146 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -426,4 +426,17 @@ select * from t1 where NOT id in (select null union all select 1); select * from t1 where NOT id in (null, 1); drop table t1; +# +# Bug #41363: crash of mysqld on windows with aggregate in case +# + +CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER); +INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1); + +SELECT CASE AVG (c0) WHEN c1 * c2 THEN 1 END FROM t1; +SELECT CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END FROM t1; +SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1; + +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 61bf285c364..eb243d38238 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -445,6 +445,15 @@ select @my_uuid_date - @my_uuid_synthetic; set @@session.time_zone=@save_tz; + +# +# Bug#42014: Crash, name_const with collate +# +CREATE TABLE t1 (a DATE); +SELECT * FROM t1 WHERE a = NAME_CONST('reportDate', + _binary'2009-01-09' COLLATE 'binary'); +DROP TABLE t1; + --echo End of 5.0 tests # diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index f37ee0c39f0..1292c475732 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -151,4 +151,22 @@ select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00'); SELECT CAST(time('-73:42:12') AS DECIMAL); + +# +# Bug#42525 - TIMEDIFF function +# + +SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq, + TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq1, + TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq2, + TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))= '00:00:00' AS 2Eq, + TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq1, + TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq2, + TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME(0) AS 3Eq, + TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME(0) AS 3NEq1, + TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME(0) AS 3NEq2, + TIME(0) AS Time0, TIME('00:00:00') AS Time00, '00:00:00' AS Literal0000, + TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')), + TIMEDIFF(TIME('17:00:00'),TIME('17:59:00')); + # End of 5.0 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 5a5f4024bc4..5d77c678d52 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1263,4 +1263,14 @@ CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1; SELECT HEX(c1) from v1; DROP VIEW v1; +# +# Bug #35558 Wrong server metadata blows up the client +# +create table t1(a float); +insert into t1 values (1.33); +--enable_metadata +select format(a, 2) from t1; +--disable_metadata +drop table t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index c417e9a02bf..b9da946a55f 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -304,6 +304,15 @@ select unix_timestamp('1970-01-01 03:00:01'); # check bad date, close to the boundary (we cut them off in the very end) select unix_timestamp('2038-01-19 07:14:07'); +# +# Bug #28759: DAYNAME() and MONTHNAME() return binary string +# + +SELECT CHARSET(DAYNAME(19700101)); +SELECT CHARSET(MONTHNAME(19700101)); +SELECT LOWER(DAYNAME(19700101)); +SELECT LOWER(MONTHNAME(19700101)); +SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01')); # # Test types from + INTERVAL @@ -606,6 +615,7 @@ select time_format('100:00:00', '%H %k %h %I %l'); # Bug #12562: Make SYSDATE behave like it does in Oracle: always the current # time, regardless of magic to make NOW() always the same for the # entirety of a statement. +SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; create table t1 (a timestamp default '2005-05-05 01:01:01', @@ -656,6 +666,7 @@ end; delimiter ;// call t_sysdate(); drop procedure t_sysdate; +SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; # # Bug #13534: timestampdiff() returned incorrect results across leap years diff --git a/mysql-test/t/general_log_basic.test b/mysql-test/t/general_log_basic.test deleted file mode 100644 index 82f3be45bc9..00000000000 --- a/mysql-test/t/general_log_basic.test +++ /dev/null @@ -1,169 +0,0 @@ -######################## mysql-test\t\general_log_basic.test ################### -# # -# Variable Name: general_log # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: OFF # -# Valid Values: ON, OFF # -# # -# # -# Creation Date: 2008-03-14 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "general_log" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-options.html#option_mysqld_event-scheduler # -# # -################################################################################ - - -########################################################### -# START OF general_log TESTS # -########################################################### - - -################################################################### -# Saving initial value of general_log in a temporary variable # -################################################################### - -SET @start_value = @@global.general_log; -SELECT @start_value; - - ---echo '#---------------------FN_DYNVARS_004_01-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.general_log = DEFAULT; -SELECT @@global.general_log = 0; - - ---echo '#--------------------FN_DYNVARS_004_02------------------------#' -####################################################################### -# Change the value of general_log to a valid value # -####################################################################### - -SET @@global.general_log = ON; -SELECT @@global.general_log; -SET @@global.general_log = OFF; -SELECT @@global.general_log; - ---echo '#--------------------FN_DYNVARS_004_03-------------------------#' -####################################################################### -# Change the value of general_log to invalid value # -####################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.general_log = ''; - - ---echo '#-------------------FN_DYNVARS_004_04----------------------------#' -################################################################### -# Test if accessing session general_log gives error # -################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.general_log = OFF; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.general_log; - - ---echo '#----------------------FN_DYNVARS_004_05------------------------#' -############################################################################## -# Check if the value in GLOBAL Tables matches values in variable # -############################################################################## - -SELECT @@global.general_log = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='general_log'; - - ---echo '#---------------------FN_DYNVARS_004_06----------------------#' -################################################################### -# Check if 0 and 1 values can be used on variable # -################################################################### - -SET @@global.general_log = 0; -SELECT @@global.general_log; -SET @@global.general_log = 1; -SELECT @@global.general_log; - ---echo '#---------------------FN_DYNVARS_004_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.general_log = TRUE; -SELECT @@global.general_log; -SET @@global.general_log = FALSE; -SELECT @@global.general_log; - ---echo '#---------------------FN_DYNVARS_004_08----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@global.general_log = ON; -SELECT @@general_log = @@global.general_log; - ---echo '#---------------------FN_DYNVARS_004_09----------------------#' -####################################################################### -# Check if general_log can be accessed with and without @@ sign # -####################################################################### ---Error ER_GLOBAL_VARIABLE -SET general_log = ON; ---Error ER_PARSE_ERROR -SET local.general_log = OFF; ---Error ER_UNKNOWN_TABLE -SELECT local.general_log; ---Error ER_PARSE_ERROR -SET global.general_log = ON; ---Error ER_UNKNOWN_TABLE -SELECT global.general_log; ---Error ER_BAD_FIELD_ERROR -SELECT general_log = @@session.general_log; - - - -############################## -# Restore initial value # -############################## - -SET @@global.general_log = @start_value; -SELECT @@global.general_log; - - -##################################################### -# END OF general_log TESTS # -##################################################### diff --git a/mysql-test/t/general_log_file_basic-master.opt b/mysql-test/t/general_log_file_basic-master.opt deleted file mode 100644 index 8482f8cbbc3..00000000000 --- a/mysql-test/t/general_log_file_basic-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log=test.log diff --git a/mysql-test/t/general_log_file_basic.test b/mysql-test/t/general_log_file_basic.test deleted file mode 100644 index 639e6619ef9..00000000000 --- a/mysql-test/t/general_log_file_basic.test +++ /dev/null @@ -1,73 +0,0 @@ -################### mysql-test\t\general_log_file_basic.test ################### -# # -# Variable Name: general_log_file # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Filename # -# Default Value: host_name.log # -# Valid Values: # -# # -# # -# Creation Date: 2008-03-16 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "general_log_file" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_general_log_file # -# # -################################################################################ - ---source include/load_sysvars.inc - -########################################################### -# START OF general_log_file TESTS # -########################################################### - - -######################################################################## -# Saving initial value of general_log_file in a temporary variable # -######################################################################## - -SET @start_value = @@global.general_log_file; -SELECT @start_value; - - ---echo '#---------------------FN_DYNVARS_004_01-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.general_log_file = DEFAULT; -SELECT RIGHT(@@global.general_log_file,10) AS log_file; - - ---echo '#--------------------FN_DYNVARS_004_02------------------------#' -####################################################################### -# Change the value of general_log_file to a invalid value # -####################################################################### - -# Assumed text if no quotes or numbers. -SET @@global.general_log_file = mytest.log; ---error ER_WRONG_TYPE_FOR_VAR -SET @@global.general_log_file = 12; - - ---echo '#----------------------FN_DYNVARS_004_03------------------------#' -############################################################################## -# Check if the value in GLOBAL Tables matches values in variable # -############################################################################## - -SELECT @@global.general_log_file = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='general_log_file'; - - -##################################################### -# END OF general_log_file TESTS # -##################################################### diff --git a/mysql-test/t/general_log_file_func-master.opt b/mysql-test/t/general_log_file_func-master.opt deleted file mode 100644 index 3652d715f5f..00000000000 --- a/mysql-test/t/general_log_file_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---log=mysql-test.log - diff --git a/mysql-test/t/general_log_file_func.test b/mysql-test/t/general_log_file_func.test deleted file mode 100644 index eeea3f75d26..00000000000 --- a/mysql-test/t/general_log_file_func.test +++ /dev/null @@ -1,57 +0,0 @@ -############## mysql-test\t\general_log_file_func.test ######################### -# # -# Variable Name: general_log_file # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: filename # -# Valid Values: # -# # -# # -# Creation Date: 2008-03-17 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "general_log_file" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_general_log_file # -# # -################################################################################ - - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - ---echo '#--------------------FN_DYNVARS_018_01-------------------------#' -#################################################################### -# Verifying general log as we have initialized in opt file # -#################################################################### - - -SELECT @@general_log_file; - -INSERT into t1(name) values('Record_1'); -INSERT into t1(name) values('Record_2'); -INSERT into t1(name) values('Record_3'); -INSERT into t1(name) values('Record_4'); - ---echo ## Verifying general log file ## ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---file_exists $MYSQLTEST_VARDIR/master-data/mysql-test.log - ---echo ## Dropping table ## -DROP TABLE t1; diff --git a/mysql-test/t/general_log_func.test b/mysql-test/t/general_log_func.test deleted file mode 100644 index 39ce964a105..00000000000 --- a/mysql-test/t/general_log_func.test +++ /dev/null @@ -1,87 +0,0 @@ -################# mysql-test\t\general_log_func.test ########################### -# # -# Variable Name: general_log # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: OFF # -# Valid Values: ON, OFF # -# # -# # -# Creation Date: 2008-03-17 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "general_log" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_general_log # -# # -################################################################################ - - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - ---echo '#--------------------FN_DYNVARS_018_01-------------------------#' -#################################################################### -# Setting initial value of general_log to OFF and verifying -# its behavior -#################################################################### - ---echo ## Setting initial value of variable to OFF ## -SET @@global.general_log = OFF; -SELECT @@general_log; - ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test.log - ---echo ## Inserting some Records & Verifying output in log ## -INSERT into t1(name) values('Record_1'); -INSERT into t1(name) values('Record_2'); - ---echo ## There should be no difference, case should pass ## ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---diff_files $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test.log - - ---echo '#--------------------FN_DYNVARS_018_01-------------------------#' -#################################################################### -# Setting initial value of general_log to ON and verifying -# its behavior -#################################################################### - ---echo ## Setting initial value of variable to OFF ## -SET @@global.general_log = ON; -SELECT @@general_log; - ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---copy_file $MYSQLTEST_VARDIR/log/master.log $MYSQLTEST_VARDIR/log/master-test-1.log - ---echo ## Inserting some Records & Verifying output in log ## -INSERT into t1(name) values('Record_3'); -INSERT into t1(name) values('Record_4'); - - ---echo ## There should be no difference, case should pass ## -#--diff_files var/log/master.log var/log/master-test-1.log - ---echo ## This case is failing which shows that mysql is writing in general ## ---echo ## log when we set general_log to ON ## - ---echo ## Dropping tables ## -DROP TABLE t1; - diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index e6b8b91783c..f8b8b0e17a7 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -386,7 +386,7 @@ drop table t1; create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b)); alter table t1 disable keys; --error 1263 -load data infile '../std_data_ln/bad_gis_data.dat' into table t1; +load data infile '../../std_data/bad_gis_data.dat' into table t1; alter table t1 enable keys; drop table t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 3fac767468e..a9491dc2736 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -3,6 +3,7 @@ # Grant tests not performed with embedded server -- source include/not_embedded.inc +SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; # Cleanup @@ -1294,6 +1295,13 @@ drop view v1; drop table test; drop function test_function; +# +# Bug#41456 SET PASSWORD hates CURRENT_USER() +# +SELECT CURRENT_USER(); +SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin"); +SET PASSWORD FOR CURRENT_USER() = PASSWORD(""); + --echo End of 5.0 tests # @@ -1468,4 +1476,4 @@ use test; DROP DATABASE dbbug33464; ---echo End of 5.1 tests +SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index d91592f6bb6..54cdf8d6cc1 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -1,6 +1,10 @@ # Grant tests not performed with embedded server -- source include/not_embedded.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + + SET NAMES binary; # @@ -27,7 +31,7 @@ create user mysqltest_2@localhost; connect (user_a,localhost,mysqltest_1,,); connection user_a; grant select on `my\_1`.* to mysqltest_2@localhost; ---error 1132 +--error ER_PASSWORD_NOT_ALLOWED grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass'; disconnect user_a; connection default; @@ -61,7 +65,7 @@ connect (user1,localhost,mysqltest_1,,); connection user1; select current_user(); grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option; ---error 1044 +--error ER_DBACCESS_DENIED_ERROR grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option; # @@ -72,7 +76,7 @@ select @@sql_mode; # # GRANT without IDENTIFIED BY does not create new users # ---error 1133 +--error ER_PASSWORD_NO_MATCH grant select on `my\_1`.* to mysqltest_4@localhost with grant option; grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass' with grant option; @@ -80,7 +84,7 @@ disconnect user1; connection default; show grants for mysqltest_1@localhost; show grants for mysqltest_2@localhost; ---error 1141 +--error ER_NONEXISTING_GRANT show grants for mysqltest_3@localhost; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; @@ -95,7 +99,7 @@ connect (user2,localhost,mysqltest_1,,); connection user2; select current_user(); show databases; ---error 1044 +--error ER_DBACCESS_DENIED_ERROR grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option; disconnect user2; connection default; @@ -106,8 +110,8 @@ drop database mysqltest_1; flush privileges; # -# Bug #6173: One can circumvent missing UPDATE privilege if he has SELECT -# and INSERT privilege for table with primary key +# Bug#6173 One can circumvent missing UPDATE privilege if he has SELECT and +# INSERT privilege for table with primary key # create database mysqltest; grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost; @@ -119,10 +123,10 @@ connect (mrbad, localhost, mysqltest_1,,mysqltest); connection mrbad; show grants for current_user(); insert into t1 values (1, 'I can''t change it!'); ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR update t1 set data='I can change it!' where id = 1; # This should not be allowed since it too require UPDATE privilege. ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!'; select * from t1; disconnect mrbad; @@ -138,9 +142,9 @@ create table t1 (a int, b int); grant select (a) on t1 to mysqltest_1@localhost with grant option; connect (mrugly, localhost, mysqltest_1,,mysqltest); connection mrugly; ---error 1143 +--error ER_COLUMNACCESS_DENIED_ERROR grant select (a,b) on t1 to mysqltest_2@localhost; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR grant select on t1 to mysqltest_3@localhost; disconnect mrugly; @@ -157,7 +161,7 @@ use test; # -# Bug #15775: "drop user" command does not refresh acl_check_hosts +# Bug#15775 "drop user" command does not refresh acl_check_hosts # # Create some test users @@ -188,15 +192,15 @@ disconnect con9; connection default; # -# Bug# 16180 - Setting SQL_LOG_OFF without SUPER privilege is silently ignored +# Bug#16180 Setting SQL_LOG_OFF without SUPER privilege is silently ignored # create database mysqltest_1; grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost; connect (con10,localhost,mysqltest_1,,); connection con10; ---error 1227 +--error ER_SPECIFIC_ACCESS_DENIED_ERROR set sql_log_off = 1; ---error 1227 +--error ER_SPECIFIC_ACCESS_DENIED_ERROR set sql_log_bin = 0; disconnect con10; connection default; @@ -217,7 +221,7 @@ create table t2(c1 int, c2 int); # # Three forms of CREATE USER create user 'mysqltest_1'; ---error 1396 +--error ER_CANNOT_USER create user 'mysqltest_1'; create user 'mysqltest_2' identified by 'Mysqltest-2'; create user 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff'; @@ -238,7 +242,7 @@ select host,user,password from mysql.user where user like 'mysqltest_%' order by select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user; select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name; select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name; ---error 1141 +--error ER_NONEXISTING_GRANT show grants for 'mysqltest_1'; # # Rename @@ -249,7 +253,7 @@ select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name; show grants for 'mysqltest_1'; drop user 'mysqltest_1', 'mysqltest_3'; ---error 1396 +--error ER_CANNOT_USER drop user 'mysqltest_1'; # # Cleanup @@ -258,9 +262,9 @@ drop table t1, t2; # Add a stray record insert into mysql.db set user='mysqltest_1', db='%', host='%'; flush privileges; ---error 1141 +--error ER_NONEXISTING_GRANT show grants for 'mysqltest_1'; ---error 1269 +--error ER_REVOKE_GRANTS revoke all privileges, grant option from 'mysqltest_1'; drop user 'mysqltest_1'; select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user; @@ -268,7 +272,7 @@ select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,us # Add a stray record insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1'; flush privileges; ---error 1141 +--error ER_NONEXISTING_GRANT show grants for 'mysqltest_1'; drop user 'mysqltest_1'; select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' order by host,db,user,table_name; @@ -276,7 +280,7 @@ select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' # Add a stray record insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1'; flush privileges; ---error 1141 +--error ER_NONEXISTING_GRANT show grants for 'mysqltest_1'; drop user 'mysqltest_1'; select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' order by host,db,user,table_name,column_name; @@ -286,23 +290,23 @@ create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; create user 'mysqltest_1', 'mysqltest_2' identified by 'Mysqltest-2', 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff'; rename user 'mysqltest_1' to 'mysqltest_1a', 'mysqltest_2' TO 'mysqltest_2a', 'mysqltest_3' TO 'mysqltest_3a'; ---error 1396 +--error ER_CANNOT_USER drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; drop user 'mysqltest_1a', 'mysqltest_2a', 'mysqltest_3a'; # # Let one of multiple users fail create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; ---error 1396 +--error ER_CANNOT_USER create user 'mysqltest_1a', 'mysqltest_2', 'mysqltest_3a'; ---error 1396 +--error ER_CANNOT_USER rename user 'mysqltest_1a' to 'mysqltest_1b', 'mysqltest_2a' TO 'mysqltest_2b', 'mysqltest_3a' TO 'mysqltest_3b'; drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; ---error 1396 +--error ER_CANNOT_USER drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b'; # # Obsolete syntax has been dropped create user 'mysqltest_2' identified by 'Mysqltest-2'; ---error 1064 +--error ER_PARSE_ERROR drop user 'mysqltest_2' identified by 'Mysqltest-2'; drop user 'mysqltest_2'; # @@ -312,7 +316,7 @@ show grants for '%@b'@'b'; grant select on mysql.* to '%@b'@'b'; show grants for '%@b'@'b'; rename user '%@b'@'b' to '%@a'@'a'; ---error 1141 +--error ER_NONEXISTING_GRANT show grants for '%@b'@'b'; show grants for '%@a'@'a'; drop user '%@a'@'a'; @@ -323,7 +327,7 @@ create user mysqltest_2@localhost; grant create user on *.* to mysqltest_2@localhost; connect (user3,localhost,mysqltest_2,,); connection user3; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; create user mysqltest_A@'%'; rename user mysqltest_A@'%' to mysqltest_B@'%'; @@ -338,7 +342,7 @@ grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost; connect (user4,localhost,mysqltest_3,,); connection user4; show grants; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password; insert into mysql.user set host='%', user='mysqltest_B'; create user mysqltest_A@'%'; @@ -349,7 +353,7 @@ disconnect user4; connection default; drop user mysqltest_3@localhost; # -# Bug #3309: Test IP addresses with netmask +# Bug#3309 Test IP addresses with netmask set @@sql_mode=''; create database mysqltest_1; create table mysqltest_1.t1 (i int); @@ -367,7 +371,8 @@ flush privileges; drop table mysqltest_1.t1; # -# Bug #12302: 'SET PASSWORD = ...' didn't work if connecting hostname != +# Bug#12302 Hostname resolution preventing password changes +# 'SET PASSWORD = ...' didn't work if connecting hostname != # hostname the current user is authenticated as. Note that a test for this # was also added to the test above. # @@ -400,7 +405,7 @@ drop database mysqltest_1; # But anonymous users can't change their password connect (n5,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connection n5; ---error 1044 +--error ER_DBACCESS_DENIED_ERROR set password = password("changed"); disconnect n5; connection default; @@ -408,7 +413,7 @@ connection default; --source include/delete_anonymous_users.inc -# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in +# Bug#12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in # multi-threaded environment". We should be able to execute FLUSH # PRIVILEGES and SET PASSWORD simultaneously with other account # management commands (such as GRANT and REVOKE) without causing @@ -471,12 +476,13 @@ connect (con1,localhost,mysqltest_1,password,TESTDB); # The user mysqltest_1 should only be allowed access to # database TESTDB, not TEStdb -# On system with "lowercase names" we get error "1007: Can't create db..." ---error 1044, 1007 +# On system with "lowercase names" we get error "ER_DB_CREATE_EXISTS: Can't create db..." +--error ER_DBACCESS_DENIED_ERROR, ER_DB_CREATE_EXISTS create database TEStdb; # Clean-up connection default; +disconnect con1; delete from mysql.user; delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB'; insert into mysql.user select * from t1; @@ -485,38 +491,39 @@ drop database TESTDB; flush privileges; # -# BUG#13310 incorrect user parsing by SP +# Bug#13310 incorrect user parsing by SP # +SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; -grant all privileges on test.* to `a@`@localhost; -grant execute on * to `a@`@localhost; +GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost; +GRANT EXECUTE ON * TO `a@`@localhost; connect (bug13310,localhost,'a@',,test); connection bug13310; -create table t2 (s1 int); -insert into t2 values (1); +CREATE TABLE t2 (s1 INT); +INSERT INTO t2 VALUES (1); --disable_warnings -drop function if exists f2; +DROP FUNCTION IF EXISTS f2; --enable_warnings delimiter //; -create function f2 () returns int -begin declare v int; select s1 from t2 into v; return v; end// +CREATE FUNCTION f2 () RETURNS INT +BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END// delimiter ;// -select f2(); -drop function f2; -drop table t2; -disconnect bug13310; +SELECT f2(); +DROP FUNCTION f2; +DROP TABLE t2; +disconnect bug13310; connection default; REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost; -drop user `a@`@localhost; +DROP USER `a@`@localhost; -SET GLOBAL log_bin_trust_function_creators = 0; +SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; # -# Bug#25578 "CREATE TABLE LIKE does not require any privileges on source table" +# Bug#25578 CREATE TABLE LIKE does not require any privileges on source table # --disable_warnings drop database if exists mysqltest_1; @@ -535,7 +542,7 @@ create table t1 (i int); connect (user1,localhost,mysqltest_u1,,mysqltest_1); connection user1; # As expected error is emitted ---error ER_TABLEACCESS_DENIED_ERROR +--error ER_TABLEACCESS_DENIED_ERROR show create table mysqltest_2.t1; # This should emit error as well --error ER_TABLEACCESS_DENIED_ERROR @@ -550,14 +557,16 @@ create table t1 like mysqltest_2.t1; # Clean-up connection default; +disconnect user1; use test; drop database mysqltest_1; drop database mysqltest_2; drop user mysqltest_u1@localhost; + # # Bug#18660 Can't grant any privileges on single table in database -# with underscore char +# with underscore char # grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option; grant usage on *.* to mysqltest_2@localhost; @@ -571,7 +580,7 @@ grant create on `mysqltest\_1`.* to mysqltest_2@localhost; grant select on mysqltest_1.t1 to mysqltest_2@localhost; connect (con3,localhost,mysqltest_2,,); connection con3; ---error 1044 +--error ER_DBACCESS_DENIED_ERROR create database mysqltest_3; use mysqltest_1; create table t2(f1 int); @@ -579,6 +588,9 @@ select * from t1; connection default; drop database mysqltest_1; +connection default; +disconnect con3; +disconnect con18600_1; revoke all privileges, grant option from mysqltest_1@localhost; revoke all privileges, grant option from mysqltest_2@localhost; drop user mysqltest_1@localhost; @@ -586,7 +598,7 @@ drop user mysqltest_2@localhost; # -# Bug #30468: column level privileges not respected when joining tables +# Bug#30468 column level privileges not respected when joining tables # CREATE DATABASE db1; @@ -597,7 +609,7 @@ INSERT INTO t1 VALUES (1,1),(2,2); CREATE TABLE t2 (b INT, c INT); INSERT INTO t2 VALUES (1,100),(2,200); -GRANT SELECT ON t1 TO mysqltest1@localhost; +GRANT SELECT ON t1 TO mysqltest1@localhost; GRANT SELECT (b) ON t2 TO mysqltest1@localhost; connect (conn1,localhost,mysqltest1,,); @@ -612,6 +624,7 @@ SELECT * FROM t1 JOIN t2 USING (b); connection default; disconnect conn1; +USE test; DROP TABLE db1.t1, db1.t2; DROP USER mysqltest1@localhost; DROP DATABASE db1; @@ -619,3 +632,5 @@ DROP DATABASE db1; --echo End of 5.0 tests +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test index 8eceb851c29..9a635048774 100644 --- a/mysql-test/t/grant3.test +++ b/mysql-test/t/grant3.test @@ -1,6 +1,10 @@ -# Can't run with embedded server +# Can't run with embedded server because we use GRANT -- source include/not_embedded.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + + # Test of GRANT commands SET NAMES binary; @@ -23,10 +27,11 @@ grant create user on *.* to mysqltest_1@localhost; grant select on `my\_1`.* to mysqltest_1@localhost with grant option; connect (user_a,localhost,mysqltest_1,,); connection user_a; ---error 1410 +--error ER_CANT_CREATE_USER_WITH_GRANT grant select on `my\_1`.* to mysqltest_2@localhost; create user mysqltest_2@localhost; disconnect user_a; +disconnect master; connection default; delete from mysql.user where user like 'mysqltest\_%'; @@ -36,7 +41,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; # -# Bug: #19828 Case sensitivity in Grant/Revoke +# Bug#19828 Case sensitivity in Grant/Revoke # grant select on test.* to CUser@localhost; @@ -137,7 +142,7 @@ DROP USER CUser2@LOCALHOST; # -# Bug#31194: Privilege ordering does not order properly for wildcard values +# Bug#31194 Privilege ordering does not order properly for wildcard values # CREATE DATABASE mysqltest_1; @@ -160,3 +165,6 @@ DROP DATABASE mysqltest_1; --echo End of 5.0 tests + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/grant_cache_no_prot.test b/mysql-test/t/grant_cache_no_prot.test index 1f6a9aeb9ed..31209f343b9 100644 --- a/mysql-test/t/grant_cache_no_prot.test +++ b/mysql-test/t/grant_cache_no_prot.test @@ -18,7 +18,7 @@ if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) { - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled + --skip Need normal protocol } # The main testing script diff --git a/mysql-test/t/grant_cache_ps_prot.test b/mysql-test/t/grant_cache_ps_prot.test index 7b579f869e9..27b3f23de3f 100644 --- a/mysql-test/t/grant_cache_ps_prot.test +++ b/mysql-test/t/grant_cache_ps_prot.test @@ -17,7 +17,7 @@ if (`SELECT $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0 OR $PS_PROTOCOL = 0`) { - --skip Test requires: ps-protocol enabled, other protocols disabled + --skip Need ps-protocol } # The main testing script diff --git a/mysql-test/t/greedy_optimizer.test b/mysql-test/t/greedy_optimizer.test index b73f70c6a3e..5131c97f122 100644 --- a/mysql-test/t/greedy_optimizer.test +++ b/mysql-test/t/greedy_optimizer.test @@ -311,3 +311,76 @@ explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and show status like 'Last_query_cost'; drop table t1,t2,t3,t4,t5,t6,t7; + + +# +# Bug # 38795: Automatic search depth and nested join's results in server +# crash +# + +CREATE TABLE t1 (a int, b int, d int, i int); INSERT INTO t1 VALUES (1,1,1,1); +CREATE TABLE t2 (b int, c int, j int); INSERT INTO t2 VALUES (1,1,1); +CREATE TABLE t2_1 (j int); INSERT INTO t2_1 VALUES (1); +CREATE TABLE t3 (c int, f int); INSERT INTO t3 VALUES (1,1); +CREATE TABLE t3_1 (f int); INSERT INTO t3_1 VALUES (1); +CREATE TABLE t4 (d int, e int, k int); INSERT INTO t4 VALUES (1,1,1); +CREATE TABLE t4_1 (k int); INSERT INTO t4_1 VALUES (1); +CREATE TABLE t5 (g int, d int, h int, l int); INSERT INTO t5 VALUES (1,1,1,1); +CREATE TABLE t5_1 (l int); INSERT INTO t5_1 VALUES (1); + +SET optimizer_search_depth = 3; + +SELECT 1 +FROM t1 +LEFT JOIN ( + t2 JOIN t3 ON t3.c = t2.c +) ON t2.b = t1.b +LEFT JOIN ( + t4 JOIN t5 ON t5.d = t4.d +) ON t4.d = t1.d +; + +SELECT 1 +FROM t1 +LEFT JOIN ( + t2 LEFT JOIN (t3 JOIN t3_1 ON t3.f = t3_1.f) ON t3.c = t2.c +) ON t2.b = t1.b +LEFT JOIN ( + t4 JOIN t5 ON t5.d = t4.d +) ON t4.d = t1.d +; + +SELECT 1 +FROM t1 +LEFT JOIN ( + (t2 JOIN t2_1 ON t2.j = t2_1.j) JOIN t3 ON t3.c = t2.c +) ON t2.b = t1.b +LEFT JOIN ( + t4 JOIN t5 ON t5.d = t4.d +) ON t4.d = t1.d +; + +SELECT 1 +FROM t1 +LEFT JOIN ( + t2 JOIN t3 ON t3.c = t2.c +) ON t2.b = t1.b +LEFT JOIN ( + (t4 JOIN t4_1 ON t4.k = t4_1.k) LEFT JOIN t5 ON t5.d = t4.d +) ON t4.d = t1.d +; + +SELECT 1 +FROM t1 +LEFT JOIN ( + t2 JOIN t3 ON t3.c = t2.c +) ON t2.b = t1.b +LEFT JOIN ( + t4 LEFT JOIN (t5 JOIN t5_1 ON t5.l = t5_1.l) ON t5.d = t4.d +) ON t4.d = t1.d +; + +SET optimizer_search_depth = DEFAULT; +DROP TABLE t1,t2,t2_1,t3,t3_1,t4,t4_1,t5,t5_1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 36aef981f21..e3cf3ca856d 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1091,6 +1091,7 @@ EXPLAIN SELECT b from t2 GROUP BY b; SELECT b from t2 GROUP BY b; DROP TABLE t1; +DROP TABLE t2; # # Bug #31797: error while parsing subqueries -- WHERE is parsed as HAVING diff --git a/mysql-test/t/group_concat_max_len_basic.test b/mysql-test/t/group_concat_max_len_basic.test deleted file mode 100644 index 1bc707f4b5d..00000000000 --- a/mysql-test/t/group_concat_max_len_basic.test +++ /dev/null @@ -1,206 +0,0 @@ -############## mysql-test\t\group_concat_max_len_basic.test ############### -# # -# Variable Name: group_concat_max_len # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1024 # -# Minimum value: 4 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable group_concat_max_len # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF group_concat_max_len TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.group_concat_max_len; -SELECT @start_global_value; -SET @start_session_value = @@session.group_concat_max_len; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_034_01-------------------------#' -######################################################################## -# Display the DEFAULT value of group_concat_max_len # -######################################################################## - -SET @@global.group_concat_max_len = 100; -SET @@global.group_concat_max_len = DEFAULT; -SELECT @@global.group_concat_max_len; - -SET @@session.group_concat_max_len = 200; -SET @@session.group_concat_max_len = DEFAULT; -SELECT @@session.group_concat_max_len; - - ---echo '#--------------------FN_DYNVARS_034_02-------------------------#' -######################################################################## -# Check the DEFAULT value of group_concat_max_len # -######################################################################## - -SET @@global.group_concat_max_len = DEFAULT; -SELECT @@global.group_concat_max_len = 1; - -SET @@session.group_concat_max_len = DEFAULT; -SELECT @@session.group_concat_max_len = 1; - - ---echo '#--------------------FN_DYNVARS_034_03-------------------------#' -################################################################################## -# Change the value of group_concat_max_len to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.group_concat_max_len = 1; -SELECT @@global.group_concat_max_len; -SET @@global.group_concat_max_len = 60020; -SELECT @@global.group_concat_max_len; -SET @@global.group_concat_max_len = 65535; -SELECT @@global.group_concat_max_len; - - ---echo '#--------------------FN_DYNVARS_034_04-------------------------#' -################################################################################### -# Change the value of group_concat_max_len to a valid value for SESSION Scope # -################################################################################### - -SET @@session.group_concat_max_len = 1; -SELECT @@session.group_concat_max_len; -SET @@session.group_concat_max_len = 50050; -SELECT @@session.group_concat_max_len; -SET @@session.group_concat_max_len = 65535; -SELECT @@session.group_concat_max_len; - - ---echo '#------------------FN_DYNVARS_034_05-----------------------#' -#################################################################### -# Change the value of group_concat_max_len to an invalid value # -#################################################################### - -SET @@global.group_concat_max_len = 0; -SELECT @@global.group_concat_max_len; -SET @@global.group_concat_max_len = -1024; -SELECT @@global.group_concat_max_len; -SET @@global.group_concat_max_len = 65536; -SELECT @@global.group_concat_max_len; ---Error ER_PARSE_ERROR -SET @@global.group_concat_max_len = 65530.34.; -SELECT @@global.group_concat_max_len; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.group_concat_max_len = test; -SELECT @@global.group_concat_max_len; - -SET @@session.group_concat_max_len = 0; -SELECT @@session.group_concat_max_len; -SET @@session.group_concat_max_len = -2; -SELECT @@session.group_concat_max_len; ---Error ER_PARSE_ERROR -SET @@session.group_concat_max_len = 65530.34.; -SET @@session.group_concat_max_len = 65550; -SELECT @@session.group_concat_max_len; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.group_concat_max_len = test; -SELECT @@session.group_concat_max_len; - - ---echo '#------------------FN_DYNVARS_034_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.group_concat_max_len = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='group_concat_max_len'; - ---echo '#------------------FN_DYNVARS_034_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.group_concat_max_len = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='group_concat_max_len'; - - ---echo '#------------------FN_DYNVARS_034_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.group_concat_max_len = TRUE; -SELECT @@global.group_concat_max_len; -SET @@global.group_concat_max_len = FALSE; -SELECT @@global.group_concat_max_len; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.group_concat_max_len = 10; -SELECT @@group_concat_max_len = @@global.group_concat_max_len; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@group_concat_max_len = 100; -SELECT @@group_concat_max_len = @@local.group_concat_max_len; -SELECT @@local.group_concat_max_len = @@session.group_concat_max_len; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -################################################################################### -# Check if group_concat_max_len can be accessed with and without @@ sign # -################################################################################### - -SET group_concat_max_len = 1; -SELECT @@group_concat_max_len; ---Error ER_UNKNOWN_TABLE -SELECT local.group_concat_max_len; ---Error ER_UNKNOWN_TABLE -SELECT session.group_concat_max_len; ---Error ER_BAD_FIELD_ERROR -SELECT group_concat_max_len = @@session.group_concat_max_len; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.group_concat_max_len = @start_global_value; -SELECT @@global.group_concat_max_len; -SET @@session.group_concat_max_len = @start_session_value; -SELECT @@session.group_concat_max_len; - - -############################################################# -# END OF group_concat_max_len TESTS # -############################################################# - diff --git a/mysql-test/t/group_concat_max_len_func.test b/mysql-test/t/group_concat_max_len_func.test deleted file mode 100644 index 29a4ff5becb..00000000000 --- a/mysql-test/t/group_concat_max_len_func.test +++ /dev/null @@ -1,140 +0,0 @@ -############## mysql-test\t\group_concat_max_len_func.test #################### -# # -# Variable Name: group_concat_max_len # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1024 # -# Minimum value: 4 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Last modification: # -# 2008-11-14 mleich Fix Bug#40644 main.group_concat_max_len_func random # -# failures # -# + minor improvements # -# # -# Description: Test Cases of Dynamic System Variable group_concat_max_len # -# that checks the functionality of this variable # -# # -# Reference: # -# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # -# # -############################################################################### - -SET @save = @@global.group_concat_max_len; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table t1 ## -CREATE TABLE t1 -( -id INT NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id), -rollno INT NOT NULL, -name VARCHAR(30) -); - ---echo '#--------------------FN_DYNVARS_034_01-------------------------#' -######################################################################## -# Setting initial value of group_concat_max_len, inserting some rows -# & creating 2 new connections -######################################################################## - ---echo ## Setting initial value of variable to 4 ## -SET @@global.group_concat_max_len = 4; - ---echo ## Inserting some rows in table ## -INSERT INTO t1(rollno, name) VALUES(1, 'Record_1'); -INSERT INTO t1(rollno, name) VALUES(2, 'Record_2'); -INSERT INTO t1(rollno, name) VALUES(1, 'Record_3'); -INSERT INTO t1(rollno, name) VALUES(3, 'Record_4'); -INSERT INTO t1(rollno, name) VALUES(1, 'Record_5'); -INSERT INTO t1(rollno, name) VALUES(3, 'Record_6'); -INSERT INTO t1(rollno, name) VALUES(4, 'Record_7'); -INSERT INTO t1(rollno, name) VALUES(4, 'Record_8'); -# The following "auxiliary" select ensures that all records are on disk -# = result sets got by parallel sessions cannot suffer from effects -# caused by the MyISAM feature "concurrent_inserts". -SELECT * FROM t1 ORDER BY id; - ---echo ## Creating two new connections ## -connect (test_con1,localhost,root,,); -connect (test_con2,localhost,root,,); - - ---echo '#--------------------FN_DYNVARS_034_02-------------------------#' -############################################################################### -# Verifying initial behavior of variable by concatinating values greater than 4 -############################################################################### - ---echo ## Connecting with test_con1 ## -connection test_con1; - ---echo ## Accessing data and using group_concat on column whose value is greater than 4 ## -SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno; - ---echo ## Changing session value of variable and verifying its behavior, ## ---echo ## warning should come here ## - -SET @@session.group_concat_max_len = 10; -SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno; - - ---echo '#--------------------FN_DYNVARS_034_03-------------------------#' -############################################################################## -# Verifying behavior of variable by increasing session value of variable # -############################################################################## - ---echo ## Connecting with new connection test_con2 ## -connection test_con2; - ---echo ## Verifying initial value of variable. It should be 4 ## -SELECT @@session.group_concat_max_len = 4; - ---echo ## Setting session value of variable to 20 and verifying variable is concating ## ---echo ## column's value to 20 or not ## -SET @@session.group_concat_max_len = 20; - ---echo ## Verifying value of name column, it should not me more than 20 characters ## ---echo ## Warning should come here ## -SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno; - - ---echo '#--------------------FN_DYNVARS_034_04-------------------------#' -############################################################################### -# Verifying behavior of variable by increasing session value of variable # -# greater than the maximum concat length of name column # -############################################################################### - ---echo ## Setting session value of variable to 26. No warning should appear here ## ---echo ## because the value after concatination is less than 30 ## -SET @@session.group_concat_max_len = 26; - ---echo ## Verifying value of name column, it should not give warning now ## -SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno; - - -############################################################ -# Disconnecting all connection & dropping table # -############################################################ - ---echo ## Dropping table t1 ## -DROP TABLE t1; - ---echo ## Disconnecting both the connection ## -disconnect test_con2; -disconnect test_con1; - -connection default; - -SET @@global.group_concat_max_len = @save; - diff --git a/mysql-test/t/have_compress_basic.test b/mysql-test/t/have_compress_basic.test deleted file mode 100644 index f704ae67a1c..00000000000 --- a/mysql-test/t/have_compress_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_compress_basic.test ###################### -# # -# Variable Name: have_compress # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_compress # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_006_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_compress); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_006_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_compress=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_compress); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_006_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_compress = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_compress'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_compress); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_compress'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_006_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_compress = @@GLOBAL.have_compress; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_006_05----------------------#' -################################################################################ -# Check if have_compress can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_compress); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_compress); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_compress); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_compress); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_compress = @@SESSION.have_compress; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_crypt_basic.test b/mysql-test/t/have_crypt_basic.test deleted file mode 100644 index 7ca193d83bd..00000000000 --- a/mysql-test/t/have_crypt_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_crypt_basic.test ######################### -# # -# Variable Name: have_crypt # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_crypt # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_007_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_crypt); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_007_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_crypt=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_crypt); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_007_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_crypt = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_crypt'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_crypt); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_crypt'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_007_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_crypt = @@GLOBAL.have_crypt; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_007_05----------------------#' -################################################################################ -# Check if have_crypt can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_crypt); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_crypt); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_crypt); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_crypt); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_crypt = @@SESSION.have_crypt; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_csv_basic.test b/mysql-test/t/have_csv_basic.test deleted file mode 100644 index 12081ff270e..00000000000 --- a/mysql-test/t/have_csv_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_csv_basic.test ########################### -# # -# Variable Name: have_csv # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_csv # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_008_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_csv); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_008_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_csv=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_csv); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_008_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_csv = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_csv'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_csv); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_csv'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_008_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_csv = @@GLOBAL.have_csv; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_008_05----------------------#' -################################################################################ -# Check if have_csv can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_csv); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_csv); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_csv); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_csv); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_csv = @@SESSION.have_csv; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_dynamic_loading_basic.test b/mysql-test/t/have_dynamic_loading_basic.test deleted file mode 100644 index 3e13664752a..00000000000 --- a/mysql-test/t/have_dynamic_loading_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_dynamic_loading_basic.test ############### -# # -# Variable Name: have_dynamic_loading # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_dynamic_loading # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_009_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_dynamic_loading); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_009_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_dynamic_loading=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_dynamic_loading); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_009_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_dynamic_loading = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_dynamic_loading'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_dynamic_loading); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_dynamic_loading'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_009_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_dynamic_loading = @@GLOBAL.have_dynamic_loading; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_009_05----------------------#' -################################################################################ -# Check if have_dynamic_loading can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_dynamic_loading); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_dynamic_loading); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_dynamic_loading); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_dynamic_loading); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_dynamic_loading = @@SESSION.have_dynamic_loading; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_geometry_basic.test b/mysql-test/t/have_geometry_basic.test deleted file mode 100644 index 3ec0690bd16..00000000000 --- a/mysql-test/t/have_geometry_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_geometry_basic.test ###################### -# # -# Variable Name: have_geometry # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_geometry # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_010_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_geometry); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_010_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_geometry=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_geometry); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_010_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_geometry = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_geometry'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_geometry); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_geometry'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_010_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_geometry = @@GLOBAL.have_geometry; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_010_05----------------------#' -################################################################################ -# Check if have_geometry can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_geometry); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_geometry); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_geometry); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_geometry); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_geometry = @@SESSION.have_geometry; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_innodb_basic.test b/mysql-test/t/have_innodb_basic.test deleted file mode 100644 index 9ae1bb0d443..00000000000 --- a/mysql-test/t/have_innodb_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_innodb_basic.test ######################## -# # -# Variable Name: have_innodb # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_innodb # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_011_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_innodb); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_011_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_innodb=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_innodb); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_011_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_innodb = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_innodb'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_innodb); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_innodb'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_011_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_innodb = @@GLOBAL.have_innodb; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_011_05----------------------#' -################################################################################ -# Check if have_innodb can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_innodb); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_innodb); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_innodb); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_innodb); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_innodb = @@SESSION.have_innodb; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_ndbcluster_basic.test b/mysql-test/t/have_ndbcluster_basic.test deleted file mode 100644 index 1ac341ff62e..00000000000 --- a/mysql-test/t/have_ndbcluster_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_ndbcluster_basic.test #################### -# # -# Variable Name: have_ndbcluster # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_ndbcluster # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_012_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_ndbcluster); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_012_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_ndbcluster=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_ndbcluster); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_012_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_ndbcluster = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_ndbcluster'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_ndbcluster); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_ndbcluster'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_012_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_ndbcluster = @@GLOBAL.have_ndbcluster; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_012_05----------------------#' -################################################################################ -# Check if have_ndbcluster can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_ndbcluster); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_ndbcluster); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_ndbcluster); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_ndbcluster); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_ndbcluster = @@SESSION.have_ndbcluster; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_openssl_basic.test b/mysql-test/t/have_openssl_basic.test deleted file mode 100644 index 037c8f4cbe6..00000000000 --- a/mysql-test/t/have_openssl_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_openssl_basic.test ####################### -# # -# Variable Name: have_openssl # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_openssl # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_013_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_openssl); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_013_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_openssl=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_openssl); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_013_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_openssl = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_openssl'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_openssl); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_openssl'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_013_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_openssl = @@GLOBAL.have_openssl; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_013_05----------------------#' -################################################################################ -# Check if have_openssl can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_openssl); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_openssl); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_openssl); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_openssl); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_openssl = @@SESSION.have_openssl; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_partitioning_basic.test b/mysql-test/t/have_partitioning_basic.test deleted file mode 100644 index b37abdb1498..00000000000 --- a/mysql-test/t/have_partitioning_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_partitioning_basic.test ################## -# # -# Variable Name: have_partitioning # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_partitioning # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_014_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_partitioning); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_014_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_partitioning=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_partitioning); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_014_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_partitioning = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_partitioning'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_partitioning); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_partitioning'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_014_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_partitioning = @@GLOBAL.have_partitioning; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_014_05----------------------#' -################################################################################ -# Check if have_partitioning can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_partitioning); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_partitioning); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_partitioning); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_partitioning); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_partitioning = @@SESSION.have_partitioning; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_query_cache_basic.test b/mysql-test/t/have_query_cache_basic.test deleted file mode 100644 index 1c32300dec9..00000000000 --- a/mysql-test/t/have_query_cache_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_query_cache_basic.test ################### -# # -# Variable Name: have_query_cache # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_query_cache # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_015_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_query_cache); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_015_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_query_cache=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_query_cache); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_015_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_query_cache = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_query_cache'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_query_cache); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_query_cache'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_015_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_query_cache = @@GLOBAL.have_query_cache; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_015_05----------------------#' -################################################################################ -# Check if have_query_cache can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_query_cache); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_query_cache); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_query_cache); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_query_cache); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_query_cache = @@SESSION.have_query_cache; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_rtree_keys_basic.test b/mysql-test/t/have_rtree_keys_basic.test deleted file mode 100644 index 493c45530a6..00000000000 --- a/mysql-test/t/have_rtree_keys_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_rtree_keys_basic.test #################### -# # -# Variable Name: have_rtree_keys # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_rtree_keys # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_016_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_rtree_keys); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_016_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_rtree_keys=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_rtree_keys); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_016_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_rtree_keys = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_rtree_keys'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_rtree_keys); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_rtree_keys'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_016_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_rtree_keys = @@GLOBAL.have_rtree_keys; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_016_05----------------------#' -################################################################################ -# Check if have_rtree_keys can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_rtree_keys); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_rtree_keys); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_rtree_keys); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_rtree_keys); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_rtree_keys = @@SESSION.have_rtree_keys; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_ssl_basic.test b/mysql-test/t/have_ssl_basic.test deleted file mode 100644 index c92219d2252..00000000000 --- a/mysql-test/t/have_ssl_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_ssl_basic.test ########################### -# # -# Variable Name: have_ssl # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_ssl # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_017_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_ssl); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_017_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_ssl=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_ssl); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_017_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_ssl = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_ssl'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_ssl); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_ssl'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_017_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_ssl = @@GLOBAL.have_ssl; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_017_05----------------------#' -################################################################################ -# Check if have_ssl can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_ssl); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_ssl); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_ssl); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_ssl); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_ssl = @@SESSION.have_ssl; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/have_symlink_basic.test b/mysql-test/t/have_symlink_basic.test deleted file mode 100644 index 924da7c7a9f..00000000000 --- a/mysql-test/t/have_symlink_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\have_symlink_basic.test ####################### -# # -# Variable Name: have_symlink # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable have_symlink # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_018_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.have_symlink); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_018_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.have_symlink=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.have_symlink); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_018_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.have_symlink = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_symlink'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.have_symlink); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='have_symlink'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_018_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@have_symlink = @@GLOBAL.have_symlink; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_018_05----------------------#' -################################################################################ -# Check if have_symlink can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@have_symlink); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.have_symlink); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.have_symlink); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.have_symlink); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT have_symlink = @@SESSION.have_symlink; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 683abfd3783..af9af4fe1fc 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -432,3 +432,14 @@ select f1 from t1 having max(f1)=f1; select f1 from t1 group by f1 having max(f1)=f1; set session sql_mode=''; drop table t1; + + +# +# Bug #38637: COUNT DISTINCT prevents NULL testing in HAVING clause +# +CREATE TABLE t1 ( a INT, b INT); +INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL); +SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/hostname_basic.test b/mysql-test/t/hostname_basic.test deleted file mode 100644 index 9f1dff756e2..00000000000 --- a/mysql-test/t/hostname_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\hostname_basic.test ########################### -# # -# Variable Name: hostname # -# Scope: Global # -# Access Type: Static # -# Data Type: string # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable hostname # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_019_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.hostname); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_019_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.hostname=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.hostname); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_019_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.hostname = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='hostname'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.hostname); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='hostname'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_019_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@hostname = @@GLOBAL.hostname; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_019_05----------------------#' -################################################################################ -# Check if hostname can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@hostname); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.hostname); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.hostname); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.hostname); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT hostname = @@SESSION.hostname; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/identity_basic.test b/mysql-test/t/identity_basic.test deleted file mode 100644 index fa5fc807414..00000000000 --- a/mysql-test/t/identity_basic.test +++ /dev/null @@ -1,189 +0,0 @@ -############## mysql-test\t\identity_basic.test ############### -# # -# Variable Name: identity # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: - # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable identity # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################ -# START OF identity TESTS # -################################################################ - - -################################################################ -# Saving initial value of identity in a temporary variable # -################################################################ - -SET @start_value = @@session.identity; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_035_01------------------------#' -######################################################################## -# Display the DEFAULT value of identity # -######################################################################## - -SET @@session.identity = 99; -# SET @@session.identity = DEFAULT; ---echo 'Variable is giving error on assigning Default value'; -SELECT @@session.identity; - - ---echo '#---------------------FN_DYNVARS_035_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@session.identity = @start_value; -SELECT @@session.identity = 0; - - ---echo '#--------------------FN_DYNVARS_035_03------------------------#' -######################################################################## -# Change the value of identity to a valid value # -######################################################################## - -SET @@session.identity = 0; -SELECT @@session.identity; -SET @@session.identity = 1099; -SELECT @@session.identity; -SET @@session.identity = 1800; -SELECT @@session.identity; -SET @@session.identity = 65535; -SELECT @@session.identity; - - ---echo '#--------------------FN_DYNVARS_035_04-------------------------#' -########################################################################### -# Change the value of identity to invalid value # -########################################################################### - -SET @@session.identity = -1; -SELECT @@session.identity; -SET @@session.identity = 100000000000; -SELECT @@session.identity; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.identity = 10000.01; -SELECT @@session.identity; -SET @@session.identity = -1024; -SELECT @@session.identity; -SET @@session.identity = 42949672950; -SELECT @@session.identity; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.identity = ON; -SELECT @@session.identity; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.identity = 'test'; -SELECT @@session.identity; - - ---echo '#-------------------FN_DYNVARS_035_05----------------------------#' -########################################################################### -# Test if accessing global identity gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.identity = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.identity; - - ---echo '#----------------------FN_DYNVARS_035_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.identity = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='identity'; - -SELECT @@session.identity = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='identity'; - - ---echo '#-------------------FN_DYNVARS_035_07----------------------------#' -###################################################################### -# Test if accessing GLOBAL identity gives error # -###################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.identity = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.identity; - ---echo '#---------------------FN_DYNVARS_035_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.identity = TRUE; -SELECT @@session.identity; -SET @@session.identity = FALSE; -SELECT @@session.identity; - - ---echo '#---------------------FN_DYNVARS_035_09----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@session.identity = 1; -SELECT @@identity = @@session.identity; -SELECT @@session.identity = @@local.identity; - - ---echo '#---------------------FN_DYNVARS_035_10----------------------#' -########################################################################## -# Check if identity can be accessed with and without @@ sign # -########################################################################## - - -SET identity = 1; -SELECT @@identity; ---Error ER_PARSE_ERROR -SET local.identity = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.identity; ---Error ER_PARSE_ERROR -SET session.identity = 1; ---Error ER_UNKNOWN_TABLE -SELECT session.identity; ---Error ER_BAD_FIELD_ERROR -SELECT identity = @@session.identity; - - -############################## -# Restore initial value # -############################## - -SET @@session.identity = @start_value; -SELECT @@session.identity; - - -######################################################################## -# END OF identity TESTS # -######################################################################## diff --git a/mysql-test/t/identity_func-master.opt b/mysql-test/t/identity_func-master.opt deleted file mode 100644 index 66f581b56d0..00000000000 --- a/mysql-test/t/identity_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---innodb - diff --git a/mysql-test/t/identity_func.test b/mysql-test/t/identity_func.test deleted file mode 100644 index ff93607a2cd..00000000000 --- a/mysql-test/t/identity_func.test +++ /dev/null @@ -1,144 +0,0 @@ -#################### mysql-test\t\identity_func.test ########################## -# # -# Variable Name: identity # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: - # -# Range: - # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable identity # -# that checks the functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---disable_warnings -drop table if exists t1; -drop table if exists t2; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table t1 ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -) ENGINE = INNODB; - ---echo ## Creating another new table t2 ## -CREATE TABLE t2 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -) ENGINE = INNODB; - ---echo '#--------------------FN_DYNVARS_035_01-------------------------#' -############################################### -# Verifying initial value of identity. # -############################################### - ---echo ## It should be zero ## -SELECT @@identity = 0; - ---echo ## Creating and connecting with new connection test_con1 ## -connect (test_con1, localhost, root,,); -connection test_con1; -SET @@autocommit = 0; - ---echo ## Inserting rows in table t1 ## -INSERT into t1(name) values('Record_1'); -INSERT into t1(name) values('Record_2'); -INSERT into t1(name) values('Record_3'); - ---echo ## Verifying total values in t1 ## -SELECT @@identity from t1; - - ---echo ## Now inserting some data in table t2 ## -INSERT into t2(name) values('Record_1'); - ---echo ## Verifying total values in t2 ## -SELECT @@identity from t2; - - ---echo '#--------------------FN_DYNVARS_035_02-------------------------#' -########################################################## -# Verifying value of identity with new connection # -########################################################## - ---echo ## Creating and connecting with new connection test_con2 ## -connect (test_con2, localhost, root,,); -connection test_con2; -SELECT * from t1; - ---echo ## Verifying total values in t1 ## -SELECT @@identity from t1; - ---echo ## Verifying total values in t2 ## -SELECT @@identity from t2; - ---echo ## Inserting some more records in table t1 ## -INSERT into t1(name) values('Record_1_1'); -INSERT into t1(name) values('Record_1_2'); - ---echo ## Verifying total values in t1 ## -SELECT @@identity from t1; - ---echo ## Inserting row in table t2 ## -INSERT into t2(name) values('Record_1_3'); - ---echo ## Verifying total values in t2 ## -SELECT @@identity from t2; - - ---echo '#--------------------FN_DYNVARS_035_03-------------------------#' -################################################################### -# Verifying identity value by using commit in connectio # 01 # -################################################################### - ---echo ## Switching to connection test_con1 ## -connection test_con1; - ---echo ## Commiting rows added in test_con1 ## -COMMIT; - ---echo ## Verifying records in both tables ## -SELECT * from t1; -SELECT * from t2; - ---echo ## Verifying total values in t1 after commiting data ## -SELECT @@identity from t1; - ---echo ## Verifying total values in t2 after commiting data ## -SELECT @@identity from t2; - -INSERT into t1(name) values('Record_4'); - ---echo ## Now verifying value of variable after inserting 1 row in this connection ## -SELECT @@identity from t1; - ---echo ## Dropping tables t1 & t2 ## -drop table t1, t2; - ---echo ## Disconnecting both the connections ## -disconnect test_con1; -disconnect test_con2; - - - - - diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index bcb22c44076..7105d7e04f0 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -37,7 +37,11 @@ create table t3(a int, KEY a_data (a)); create table mysqltest.t4(a int); create table t5 (id int auto_increment primary key); insert into t5 values (10); -create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status'; +create view v1 (c) as + SELECT table_name FROM information_schema.TABLES + WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND + table_name<>'ndb_binlog_index' AND + table_name<>'ndb_apply_status'; select * from v1; select c,table_name from v1 @@ -133,25 +137,25 @@ delimiter ;| # Bug#7222 information_schema: errors in "routines" # select parameter_style, sql_data_access, dtd_identifier -from information_schema.routines; +from information_schema.routines where routine_schema='test'; --replace_column 5 # 6 # -show procedure status; +show procedure status where db='test'; --replace_column 5 # 6 # -show function status; +show function status where db='test'; select a.ROUTINE_NAME from information_schema.ROUTINES a, information_schema.SCHEMATA b where -a.ROUTINE_SCHEMA = b.SCHEMA_NAME; +a.ROUTINE_SCHEMA = b.SCHEMA_NAME AND b.SCHEMA_NAME='test'; --replace_column 3 # explain select a.ROUTINE_NAME from information_schema.ROUTINES a, information_schema.SCHEMATA b where a.ROUTINE_SCHEMA = b.SCHEMA_NAME; select a.ROUTINE_NAME, b.name from information_schema.ROUTINES a, -mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) order by 1; -select count(*) from information_schema.ROUTINES; +mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8) AND a.ROUTINE_SCHEMA='test' order by 1; +select count(*) from information_schema.ROUTINES where routine_schema='test'; -create view v1 as select routine_schema, routine_name from information_schema.routines +create view v1 as select routine_schema, routine_name from information_schema.routines where routine_schema='test' order by routine_schema, routine_name; select * from v1; drop view v1; @@ -528,7 +532,7 @@ flush privileges; # Bug #9404 information_schema: Weird error messages # with SELECT SUM() ... GROUP BY queries # -SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA; +SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA; # @@ -557,7 +561,7 @@ begin end| delimiter ;| show triggers; -select * from information_schema.triggers; +select * from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest'); drop trigger trg1; drop trigger trg2; @@ -727,7 +731,7 @@ BEGIN SELECT 'foo' FROM DUAL; END | delimiter ;| -select ROUTINE_NAME from routines; +select ROUTINE_NAME from routines where ROUTINE_SCHEMA='information_schema'; # # Bug #10734 Grant of privileges other than 'select' and 'create view' should fail on schema # @@ -827,7 +831,7 @@ use mysql; INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL', 'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03', '2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a'); -select routine_name from information_schema.routines; +select routine_name from information_schema.routines where ROUTINE_SCHEMA='test'; delete from proc where name=''; use test; @@ -874,13 +878,13 @@ CREATE USER mysql_bug20230@localhost; GRANT EXECUTE ON PROCEDURE p1 TO mysql_bug20230@localhost; GRANT EXECUTE ON FUNCTION f1 TO mysql_bug20230@localhost; -SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES; +SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test'; SHOW CREATE PROCEDURE p1; SHOW CREATE FUNCTION f1; connect (conn1, localhost, mysql_bug20230,,); -SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES; +SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test'; SHOW CREATE PROCEDURE p1; SHOW CREATE FUNCTION f1; CALL p1(); @@ -931,10 +935,10 @@ SELECT t.table_name, c1.column_name # INFORMARTION_SCHEMA.TABLES # -SELECT MAX(table_name) FROM information_schema.tables; +SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test'); SELECT table_name from information_schema.tables WHERE table_name=(SELECT MAX(table_name) - FROM information_schema.tables); + FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test')); # # Bug #23037: Bug in field "Default" of query "SHOW COLUMNS FROM table" # @@ -1383,4 +1387,11 @@ select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_ where a.VARIABLE_NAME = b.VARIABLE_NAME; drop table t0; +# +# Bug#35275 INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS omits KEY_BLOCK_SIZE +# +CREATE TABLE t1(a INT) KEY_BLOCK_SIZE=1; +SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1'; +DROP TABLE t1; + --echo End of 5.1 tests. diff --git a/mysql-test/t/information_schema_chmod.test b/mysql-test/t/information_schema_chmod.test index 51e67a0c956..39e2f680bb8 100644 --- a/mysql-test/t/information_schema_chmod.test +++ b/mysql-test/t/information_schema_chmod.test @@ -17,7 +17,8 @@ # create database mysqltest; create table mysqltest.t1(a int); -chmod 0000 $MYSQLTEST_VARDIR/master-data/mysqltest; +let $MYSQLD_DATADIR= `select @@datadir`; +chmod 0000 $MYSQLD_DATADIR/mysqltest; select table_schema from information_schema.tables where table_schema='mysqltest'; -chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest; +chmod 0777 $MYSQLD_DATADIR/mysqltest; drop database mysqltest; diff --git a/mysql-test/t/init_connect_basic.test b/mysql-test/t/init_connect_basic.test deleted file mode 100644 index 8557dfbf4fc..00000000000 --- a/mysql-test/t/init_connect_basic.test +++ /dev/null @@ -1,151 +0,0 @@ -############## mysql-test\t\init_connect_basic.test ########################### -# # -# Variable Name: init_connect # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable init_connect # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -############################################## -## START OF init_connect TESTS ## -############################################## - -############################################################# -# Save initial value # -############################################################# -# save using implicit session scope -SET @global_start_value = @@global.init_connect; -SELECT @global_start_value AS INIT_VALUE; - ---echo '#--------------------FN_DYNVARS_036_01------------------#' -############################################################################### -# Test Variable access and assignment with and without @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT init_connect; -# access using no scope specified -SELECT @@init_connect; -# assign value without @@ -SET @@global.init_connect='SET autocomit=0'; -SELECT @@global.init_connect; -# using another syntax for accessing session variable -SET global init_connect='SET autocomit=0'; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT global init_connect; ---Error ER_PARSE_ERROR -SELECT @@global init_connect; - - ---echo '#--------------------FN_DYNVARS_036_02-------------------------#' -################################################################## -# Check the DEFAULT value of init_connect for global # -################################################################## -SET @@global.init_connect = 'SET join_buffer_size=8200'; -SET @@global.init_connect = DEFAULT; -SELECT @@global.init_connect; - ---echo '#--------------------FN_DYNVARS_036_03-------------------------#' -###################################################################### -# see if it is accessable using session scope # -###################################################################### ---Error ER_GLOBAL_VARIABLE -SET @@session.init_connect = ''; ---Error ER_GLOBAL_VARIABLE -SET @@init_connect = ''; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.init_connect; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@local.init_connect; - ---echo '#--------------------FN_DYNVARS_036_04-------------------------#' -######################################################################### -# Change the value of init_connect to a valid value # -######################################################################### - -SET @@global.init_connect=""; -SELECT @@global.init_connect; - -SET @@global.init_connect='SELECT 1,"abc"'; -SELECT @@global.init_connect; - -SET @@global.init_connect='SET @yoursql="mysql"'; -SELECT @@global.init_connect; - -SET @@global.init_connect="SET autocomit=0;REVOKE ALL ON INFORMATION_SCHEMA.*"; -SELECT @@global.init_connect; - -SET @@global.init_connect='SHOW VARIABLES'; -SELECT @@global.init_connect; - -SET @@global.init_connect = NULL; -SELECT @@global.init_connect; - -#any string is accepted as valid value as its is not verified until runtime -SET @@global.init_connect='abc 123 +-*/'; -SELECT @@global.init_connect; - -SET @@global.init_connect=this_will_give_syntax_error; -SELECT @@global.init_connect; - -SET @@global.init_connect = init_slave; -SELECT @@global.init_connect; - ---echo '#--------------------FN_DYNVARS_036_05-------------------------#' -########################################################################### -# Change the value of init_connect to an invalid value for global # -########################################################################### - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_connect = true; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_connect = false; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_connect = 1.1; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_connect = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_connect = 1; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_connect = -1; - -SET @@global.init_connect = ON; -SELECT @@global.init_connect; - ---echo '#--------------------FN_DYNVARS_036_06-------------------------#' -############################################################################## -# Check if the value in GLOBAL Table matches value in variable # -############################################################################## - -SELECT @@global.init_connect = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='init_connect') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.init_connect = @global_start_value; -SELECT @@global.init_connect; - -##################################################### -# END OF init_connect TESTS # -##################################################### diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test index 7c580afadda..ceb5cae9743 100644 --- a/mysql-test/t/init_file.test +++ b/mysql-test/t/init_file.test @@ -13,7 +13,8 @@ INSERT INTO init_file.startup VALUES ( NOW() ); SELECT * INTO @X FROM init_file.startup limit 0,1; SELECT * INTO @Y FROM init_file.startup limit 1,1; SELECT YEAR(@X)-YEAR(@Y); -DROP DATABASE init_file; +# Enable this DROP DATABASE only after resolving bug #42507 +# DROP DATABASE init_file; --echo ok --echo end of 4.1 tests @@ -26,4 +27,5 @@ select * from t1; # Expected: # 30, 3, 11, 13 select * from t2; -drop table t1, t2; +# Enable this DROP TABLE only after resolving bug #42507 +#drop table t1, t2; diff --git a/mysql-test/t/init_slave_basic.test b/mysql-test/t/init_slave_basic.test deleted file mode 100644 index b137a525090..00000000000 --- a/mysql-test/t/init_slave_basic.test +++ /dev/null @@ -1,153 +0,0 @@ -###################### mysql-test\t\init_slave_basic.test ##################### -# # -# Variable Name: init_slave # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable init_slave # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -############################################ -## START OF init_slave TESTS ## -############################################ - -############################################################# -# Save initial value # -############################################################# -# save using implicit session scope -SET @global_start_value = @@global.init_slave; -SELECT @global_start_value AS INIT_VALUE; - ---echo '#--------------------FN_DYNVARS_037_01------------------#' -############################################################################### -# Test Variable access and assignment with and without @@ # -############################################################################### -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT init_slave; -# access using no scope specified -SELECT @@init_slave; -# assign value without @@ -SET @@global.init_slave='SET autocomit=0'; -SELECT @@global.init_slave; -# using another syntax for accessing session variable -SET global init_slave='SET autocomit=0'; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT global init_slave; ---Error ER_PARSE_ERROR -SELECT @@global init_slave; - - ---echo '#--------------------FN_DYNVARS_037_02-------------------------#' -################################################################ -# Check the DEFAULT value of init_slave for global # -################################################################ -SET @@global.init_slave = 'SET join_buffer_size=8200'; -SET @@global.init_slave = DEFAULT; -SELECT @@global.init_slave; - ---echo '#--------------------FN_DYNVARS_037_03-------------------------#' -###################################################################### -# see if it is accessable using session scope # -###################################################################### ---Error ER_GLOBAL_VARIABLE -SET @@session.init_slave = ''; ---Error ER_GLOBAL_VARIABLE -SET @@init_slave = ""; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.init_slave; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@local.init_slave; - ---echo '#--------------------FN_DYNVARS_037_04-------------------------#' -####################################################################### -# Change the value of init_slave to a valid value # -####################################################################### - -SET @@global.init_slave=""; -SELECT @@global.init_slave; - -SET @@global.init_slave='SELECT 1,"abc"'; -SELECT @@global.init_slave; - -SET @@global.init_slave='SET @a="b"'; -SELECT @@global.init_slave; - -SET @@global.init_slave="SET autocomit=1;REVOKE ALL ON INFORMATION_SCHEMA.*"; -SELECT @@global.init_slave; - -SET @@global.init_slave='SHOW VARIABLES'; -SELECT @@global.init_slave; - -SET @@global.init_slave = NULL; -SELECT @@global.init_slave; - -#any string is accepted as valid value as its is not verified/compiled -# untill runtime -SET @@global.init_slave='abc 123 +-*/'; -SELECT @@global.init_slave; - -SET @@global.init_slave=this_will_give_syntax_error; -SELECT @@global.init_slave; - -SET @@global.init_slave = init_slave; -SELECT @@global.init_slave; - ---echo '#--------------------FN_DYNVARS_037_05-------------------------#' -######################################################################### -# Change the value of init_slave to an invalid value for global # -######################################################################### - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_slave = true; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_slave = false; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_slave = 1.1; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_slave = 0; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_slave = 1; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.init_slave = -1; - -SET @@global.init_slave = ON; -SELECT @@global.init_slave; - - ---echo '#--------------------FN_DYNVARS_037_06-------------------------#' -############################################################################## -# Check if the value in GLOBAL Table matches value in variable # -############################################################################## - -SELECT @@global.init_slave = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='init_slave') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.init_slave = @global_start_value; -SELECT @@global.init_slave; - -################################################### -# END OF init_slave TESTS # -################################################### diff --git a/mysql-test/t/innodb-autoinc-optimize.test b/mysql-test/t/innodb-autoinc-optimize.test index c7e22a8ff40..0f0cb57f92f 100644 --- a/mysql-test/t/innodb-autoinc-optimize.test +++ b/mysql-test/t/innodb-autoinc-optimize.test @@ -14,3 +14,6 @@ insert into t1 set a = -1; # NOTE: The database needs to be shutdown and restarted (here) for # the test to work. It's included for reference only. optimize table t1; + +--echo ==== clean up ==== +DROP TABLE t1; diff --git a/mysql-test/t/innodb-autoinc.test b/mysql-test/t/innodb-autoinc.test index aa464e42627..e6b804c4fff 100644 --- a/mysql-test/t/innodb-autoinc.test +++ b/mysql-test/t/innodb-autoinc.test @@ -23,7 +23,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (127, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -31,7 +30,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (255, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -41,7 +39,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (32767, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -49,7 +46,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (65535, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -59,7 +55,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (8388607, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -67,7 +62,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (16777215, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -77,7 +71,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (2147483647, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -94,7 +87,6 @@ DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; INSERT INTO t1 VALUES (9223372036854775807, null); -- error ER_DUP_ENTRY,1062 --- warning ER_WARN_DATA_OUT_OF_RANGE,1264 INSERT INTO t1 (c2) VALUES ('innodb'); SELECT * FROM t1; DROP TABLE t1; @@ -139,3 +131,262 @@ SELECT c1 FROM t1; SHOW CREATE TABLE t1; DROP TABLE t1; +# +# Bug 38839 +# Reset the last value generated at end of statement +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL, 1); +DELETE FROM t1 WHERE c1 = 1; +INSERT INTO t1 VALUES (2,1); +INSERT INTO t1 VALUES (NULL,8); +SELECT * FROM t1; +DROP TABLE t1; +# Bug 38839 -- same as above but for multi value insert +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL, 1); +DELETE FROM t1 WHERE c1 = 1; +INSERT INTO t1 VALUES (2,1), (NULL, 8); +INSERT INTO t1 VALUES (NULL,9); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Test changes to AUTOINC next value calculation +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL),(5),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with SIGNED INT column, by inserting a 0 for the first column value +# 0 is treated in the same was NULL. +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(0); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +SET @@INSERT_ID=400; +# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with SIGNED INT column +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with UNSIGNED INT column, single insert +# The sign in the value is ignored and a new column value is generated +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (-2); +INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (250); +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# Test with UNSIGNED INT column, multi-value inserts +# The sign in the value is ignored and a new column value is generated +# Reset the AUTOINC session variables +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(-1); +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL); +INSERT INTO t1 VALUES (250),(NULL); +SELECT * FROM t1; +INSERT INTO t1 VALUES (1000); +SET @@INSERT_ID=400; +# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL +-- error ER_DUP_ENTRY,1062 +INSERT INTO t1 VALUES(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Check for overflow handling when increment is > 1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should just fit +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +SELECT * FROM t1; +DROP TABLE t1; + +# +# Check for overflow handling when increment and offser are > 1 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should fail because of overflow but it doesn't, it seems to be +# a MySQL server bug. It wraps around to 0 for the last value. +# See MySQL Bug# 39828 +# +# Instead of wrapping around, it asserts when MySQL is compiled --with-debug +# (see sql/handler.cc:handler::update_auto_increment()). Don't test for +# overflow until Bug #39828 is fixed. +# +# Since this asserts when compiled --with-debug, we can't properly test this +# until Bug #39828 is fixed. For now, this test is meaningless. +#if Bug #39828 is fixed +#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +#else +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +#endif +SELECT * FROM t1; +DROP TABLE t1; + +# +# Check for overflow handling when increment and offset are odd numbers +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should fail because of overflow but it doesn't. It fails with +# a duplicate entry message because of a MySQL server bug, it wraps +# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace +# the ER_DUP_ENTRY, 1062 below with the appropriate error message +# +# Since this asserts when compiled --with-debug, we can't properly test this +# until Bug #39828 is fixed. For now, this test is meaningless. +#if Bug #39828 is fixed +# Still need to fix this error code, error should mention overflow +#-- error ER_DUP_ENTRY,1062 +#INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +#else +INSERT INTO t1 VALUES (NULL),(NULL); +#endif +SELECT * FROM t1; +DROP TABLE t1; + +# Check for overflow handling when increment and offset are odd numbers +# and check for large -ve numbers +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES(-9223372036854775806); #-- -2^63 + 2 +INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1 +INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3; +SHOW VARIABLES LIKE "%auto_inc%"; +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +SELECT * FROM t1; +DROP TABLE t1; +# +# Check for overflow handling when increment and offset are very +# large numbers 2^60 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; +SET @@INSERT_ID=1; +SHOW VARIABLES LIKE "%auto_inc%"; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; +# TODO: Fix the autoinc init code +# We have to do this because of a bug in the AUTOINC init code. +INSERT INTO t1 VALUES(NULL); +INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 +SELECT * FROM t1; +SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; +SHOW VARIABLES LIKE "%auto_inc%"; +# This should fail because of overflow but it doesn't. It wraps around +# and the autoinc values look bogus too. +# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error +# code expected test. +# -- error ER_AUTOINC_READ_FAILED,1467 +# +# Since this asserts when compiled --with-debug, we can't properly test this +# until Bug #39828 is fixed. For now, this test is meaningless. +#if Bug #39828 is fixed +#-- error ER_AUTOINC_READ_FAILED,1467 +#INSERT INTO t1 VALUES (NULL),(NULL); +#else +INSERT INTO t1 VALUES (NULL); +#endif +SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/innodb-semi-consistent-master.opt b/mysql-test/t/innodb-semi-consistent-master.opt index 2746e4e184e..e76299453d3 100644 --- a/mysql-test/t/innodb-semi-consistent-master.opt +++ b/mysql-test/t/innodb-semi-consistent-master.opt @@ -1 +1 @@ ---innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=2 +--innodb_lock_wait_timeout=2 diff --git a/mysql-test/t/innodb-semi-consistent.test b/mysql-test/t/innodb-semi-consistent.test index a3496625e95..6d3020bb560 100644 --- a/mysql-test/t/innodb-semi-consistent.test +++ b/mysql-test/t/innodb-semi-consistent.test @@ -11,7 +11,7 @@ connect (a,localhost,root,,); connect (b,localhost,root,,); connection a; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; insert into t1 values (1),(2),(3),(4),(5),(6),(7); set autocommit=0; @@ -19,13 +19,15 @@ set autocommit=0; select * from t1 where a=3 lock in share mode; connection b; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; set autocommit=0; -- error ER_LOCK_WAIT_TIMEOUT update t1 set a=10 where a=5; connection a; commit; connection b; +# perform a semi-consisent read (and unlock non-matching rows) +set session transaction isolation level read committed; update t1 set a=10 where a=5; connection a; -- error ER_LOCK_WAIT_TIMEOUT @@ -33,6 +35,7 @@ select * from t1 where a=2 for update; # this should lock the records (1),(2) select * from t1 where a=2 limit 1 for update; connection b; +# semi-consistent read will skip non-matching locked rows a=1, a=2 update t1 set a=11 where a=6; -- error ER_LOCK_WAIT_TIMEOUT update t1 set a=12 where a=2; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 339be87419a..b0353ed5268 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1163,7 +1163,7 @@ drop table t2; # Test error handling # Embedded server doesn't chdir to data directory ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' --error ER_WRONG_FK_DEF create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; @@ -1317,6 +1317,7 @@ set global innodb_sync_spin_loops=20; show variables like "innodb_sync_spin_loops"; # Test for innodb_thread_concurrency variable +SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency; show variables like "innodb_thread_concurrency"; set global innodb_thread_concurrency=1001; show variables like "innodb_thread_concurrency"; @@ -1324,6 +1325,7 @@ set global innodb_thread_concurrency=0; show variables like "innodb_thread_concurrency"; set global innodb_thread_concurrency=16; show variables like "innodb_thread_concurrency"; +SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency; # Test for innodb_concurrency_tickets variable show variables like "innodb_concurrency_tickets"; @@ -1356,7 +1358,7 @@ source include/varchar.inc; # # Embedded server doesn't chdir to data directory ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' create table t1 (v varchar(65530), key(v)); drop table t1; create table t1 (v varchar(65536)); @@ -1631,7 +1633,7 @@ disconnect b; set foreign_key_checks=0; create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; # Embedded server doesn't chdir to data directory ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' -- error 1005 create table t1(a char(10) primary key, b varchar(20)) engine = innodb; set foreign_key_checks=1; @@ -1643,7 +1645,7 @@ drop table t2; set foreign_key_checks=0; create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; # Embedded server doesn't chdir to data directory ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' -- error 1005 create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; set foreign_key_checks=1; @@ -1674,7 +1676,7 @@ set foreign_key_checks=0; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8; # Embedded server doesn't chdir to data directory ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' -- error 1025 rename table t3 to t1; set foreign_key_checks=1; @@ -2314,7 +2316,7 @@ ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL; # mysqltest first does replace_regex, then replace_result --replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/ # Embedded server doesn't chdir to data directory ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' --error 1025 ALTER TABLE t2 MODIFY a INT NOT NULL; DELETE FROM t1; @@ -2475,6 +2477,7 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2'; DROP TABLE t2; DROP TABLE t1; # End 34920 test +# # Bug #29507 TRUNCATE shows to many rows effected # CONNECTION default; @@ -2491,6 +2494,36 @@ TRUNCATE TABLE t1; --disable_info DROP TABLE t1; # +# Bug#35537 Innodb doesn't increment handler_update and handler_delete. +# +-- disable_query_log +-- disable_result_log + +CONNECT (c1,localhost,root,,); + +DROP TABLE IF EXISTS bug35537; +CREATE TABLE bug35537 ( + c1 int +) ENGINE=InnoDB; + +INSERT INTO bug35537 VALUES (1); + +-- enable_result_log + +SHOW SESSION STATUS LIKE 'Handler_update%'; +SHOW SESSION STATUS LIKE 'Handler_delete%'; + +UPDATE bug35537 SET c1 = 2 WHERE c1 = 1; +DELETE FROM bug35537 WHERE c1 = 2; + +SHOW SESSION STATUS LIKE 'Handler_update%'; +SHOW SESSION STATUS LIKE 'Handler_delete%'; + +DROP TABLE bug35537; + +DISCONNECT c1; +CONNECTION default; + ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/mysql-test/t/innodb_additional_mem_pool_size_basic.test b/mysql-test/t/innodb_additional_mem_pool_size_basic.test deleted file mode 100644 index ffb1046ed32..00000000000 --- a/mysql-test/t/innodb_additional_mem_pool_size_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_additional_mem_pool_size_basic.test #### -# # -# Variable Name: innodb_additional_mem_pool_size # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_additional_mem_pool_size# -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_020_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_020_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_additional_mem_pool_size=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_020_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_additional_mem_pool_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_additional_mem_pool_size'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_additional_mem_pool_size'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_020_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_additional_mem_pool_size = @@GLOBAL.innodb_additional_mem_pool_size; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_020_05----------------------#' -################################################################################ -# Check if innodb_additional_mem_pool_size can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_additional_mem_pool_size); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_additional_mem_pool_size); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_additional_mem_pool_size); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_additional_mem_pool_size = @@SESSION.innodb_additional_mem_pool_size; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_autoextend_increment_basic.test b/mysql-test/t/innodb_autoextend_increment_basic.test deleted file mode 100644 index 86f8c7aa7a4..00000000000 --- a/mysql-test/t/innodb_autoextend_increment_basic.test +++ /dev/null @@ -1,160 +0,0 @@ -################# mysql-test\t\innodb_autoextend_increment _basic.test ################### -# # -# Variable Name: innodb_autoextend_increment # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 8 # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description:Test Cases of Dynamic System Variable innodb_autoextend_increment# -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_autoextend_increment TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of innodb_autoextend_increment in a temporary variable# -################################################################################ - - -SET @global_start_value = @@global.innodb_autoextend_increment ; -SELECT @global_start_value; - - - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_autoextend_increment # -######################################################################## - - - -SET @@global.innodb_autoextend_increment = 0; -SET @@global.innodb_autoextend_increment = DEFAULT; -SELECT @@global.innodb_autoextend_increment ; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -#################################################################################### -# Check if innodb_autoextend_increment can be accessed with and without @@ sign # -#################################################################################### - ---Error ER_GLOBAL_VARIABLE -SET innodb_autoextend_increment = 1; -SELECT @@innodb_autoextend_increment ; - - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_autoextend_increment ; - - -SET global innodb_autoextend_increment = 0; -SELECT @@global.innodb_autoextend_increment ; - - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_autoextend_increment to a valid value # -########################################################################## - - - -SET @@global.innodb_autoextend_increment = 1; -SELECT @@global.innodb_autoextend_increment ; -SET @@global.innodb_autoextend_increment = 1000; -SELECT @@global.innodb_autoextend_increment ; - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_autoextend_increment to invalid value # -########################################################################### - - - - -SET @@global.innodb_autoextend_increment = -1; -SELECT @@global.innodb_autoextend_increment; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_autoextend_increment = "T"; -SELECT @@global.innodb_autoextend_increment; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_autoextend_increment = "Y"; -SELECT @@global.innodb_autoextend_increment; - - -SET @@global.innodb_autoextend_increment = 1001; -SELECT @@global.innodb_autoextend_increment; - - - - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_autoextend_increment '; -SELECT @@global.innodb_autoextend_increment ; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_autoextend_increment '; - - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_autoextend_increment = OFF; -SELECT @@global.innodb_autoextend_increment ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_autoextend_increment = ON; -SELECT @@global.innodb_autoextend_increment ; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - - -SET @@global.innodb_autoextend_increment = TRUE; -SELECT @@global.innodb_autoextend_increment ; -SET @@global.innodb_autoextend_increment = FALSE; -SELECT @@global.innodb_autoextend_increment ; - -############################## -# Restore initial value # -############################## - - -#SET @@global.innodb_autoextend_increment = @global_start_value; -#SELECT @@global.innodb_autoextend_increment ; - -############################################################### -# END OF innodb_autoextend_increment TESTS # -############################################################### diff --git a/mysql-test/t/innodb_autoinc_lock_mode_basic.test b/mysql-test/t/innodb_autoinc_lock_mode_basic.test deleted file mode 100644 index 5b6fa943bbe..00000000000 --- a/mysql-test/t/innodb_autoinc_lock_mode_basic.test +++ /dev/null @@ -1,90 +0,0 @@ -################# mysql-test\t\innodb_autoinc_lock_mode_basic.test ############ -# # -# Variable Name: innodb_autoinc_lock_mode # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 0,1,2 # -# # -# # -# Creation Date: 2008-02-20 # -# Author: Sharique Abdullah # -# # -#Description:Test Cases of Dynamic System Variable innodb_autoextend_increment# -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_autoinc_lock_mode TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of innodb_autoinc_lock_mode in a temporary variable# -################################################################################ - - -SET @global_start_value = @@global.innodb_autoinc_lock_mode; -SELECT @global_start_value; - - - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_autoinc_lock_mode # -######################################################################## - - ---ERROR ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@global.innodb_autoinc_lock_mode = 0; ---ERROR ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@global.innodb_autoinc_lock_mode = DEFAULT; -SELECT @@global.innodb_autoinc_lock_mode; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -#################################################################################### -# Check if innodb_autoinc_lock_mode can be accessed with and without @@ sign # -#################################################################################### - - -SELECT @@innodb_autoinc_lock_mode; - - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_autoinc_lock_mode; - - - -SELECT @@global.innodb_autoinc_lock_mode; - - - ---echo '#----------------------FN_DYNVARS_046_03------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_autoinc_lock_mode = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_autoinc_lock_mode'; -SELECT @@global.innodb_autoinc_lock_mode; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_autoinc_lock_mode'; - - -############################################################### -# END OF innodb_autoinc_lock_mode TESTS # -############################################################### diff --git a/mysql-test/t/innodb_autoinc_lock_mode_func-master.opt b/mysql-test/t/innodb_autoinc_lock_mode_func-master.opt deleted file mode 100644 index ab9fcb75678..00000000000 --- a/mysql-test/t/innodb_autoinc_lock_mode_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---innodb-autoinc-lock-mode=1 - diff --git a/mysql-test/t/innodb_autoinc_lock_mode_func.test b/mysql-test/t/innodb_autoinc_lock_mode_func.test deleted file mode 100644 index 1ff7868ce87..00000000000 --- a/mysql-test/t/innodb_autoinc_lock_mode_func.test +++ /dev/null @@ -1,56 +0,0 @@ -################# mysql-test\t\innodb_autoinc_lock_mode_func.test ############ -# # -# Variable Name: innodb_autoinc_lock_mode # -# Scope: GLOBAL # -# Access Type: Readonly # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 0,1,2 # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan Maredia # -# # -#Description:Test Cases of Dynamic System Variable innodb_autoextend_increment# -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_039_01-------------------------#' -################################################################ -# Begin the functionality Testing of innodb_autoinc_lock_mode # -################################################################ ---source include/have_innodb.inc - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET global innodb_autoinc_lock_mode = 1; - -#======================================================== ---echo '--innodb_autoinc_lock_mode is 1 (consecutive)--' -#======================================================== - - -# innodb_autoinc_lock_mode is 1 in opt file -SELECT @@global.innodb_autoinc_lock_mode; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1( -a INT AUTO_INCREMENT PRIMARY KEY, -b CHAR -)ENGINE=INNODB, AUTO_INCREMENT=100; - -INSERT INTO t1 (a,b) VALUES (5,'a'), (NULL,'b'), (1,'c'), (NULL,'d'); -INSERT INTO t1 (a,b) VALUES (NULL,'e'); ---echo 'the new auto incremented value should be 104' -SELECT * from t1; - -############################################################### -# End of functionality Testing for innodb_autoinc_lock_mode # -############################################################### - diff --git a/mysql-test/t/innodb_buffer_pool_size_basic.test b/mysql-test/t/innodb_buffer_pool_size_basic.test deleted file mode 100644 index 190b2d19bc4..00000000000 --- a/mysql-test/t/innodb_buffer_pool_size_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_buffer_pool_size_basic.test ############ -# # -# Variable Name: innodb_buffer_pool_size # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_buffer_pool_size # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_022_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_022_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_buffer_pool_size=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_022_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_buffer_pool_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_buffer_pool_size'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_buffer_pool_size'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_022_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_buffer_pool_size = @@GLOBAL.innodb_buffer_pool_size; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_022_05----------------------#' -################################################################################ -# Check if innodb_buffer_pool_size can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_buffer_pool_size); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_buffer_pool_size); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_buffer_pool_size); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_buffer_pool_size = @@SESSION.innodb_buffer_pool_size; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_bug30919-master.opt b/mysql-test/t/innodb_bug30919-master.opt new file mode 100644 index 00000000000..8636d2d8734 --- /dev/null +++ b/mysql-test/t/innodb_bug30919-master.opt @@ -0,0 +1 @@ +--innodb --innodb_autoinc_lock_mode=0 diff --git a/mysql-test/t/innodb_bug30919.test b/mysql-test/t/innodb_bug30919.test new file mode 100644 index 00000000000..56b2c7bc03d --- /dev/null +++ b/mysql-test/t/innodb_bug30919.test @@ -0,0 +1,68 @@ +--source include/have_innodb.inc +--source include/have_partition.inc +--vertical_results +let $engine_type= 'innodb'; + +######## Creat Table Section ######### +use test; + +eval CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, + dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, + fkid MEDIUMINT, filler VARCHAR(255), + PRIMARY KEY(id)) ENGINE=$engine_type + PARTITION BY RANGE(id) + SUBPARTITION BY hash(id) subpartitions 2 + (PARTITION pa3 values less than (42), + PARTITION pa6 values less than (60), + PARTITION pa7 values less than (70), + PARTITION pa8 values less than (80), + PARTITION pa9 values less than (90), + PARTITION pa10 values less than (100), + PARTITION pa11 values less than MAXVALUE); + +######## Create SPs, Functions, Views and Triggers Section ############## + +delimiter |; + +CREATE PROCEDURE test.proc_part() +BEGIN + DECLARE ins_count INT DEFAULT 1000; + DECLARE del_count INT; + DECLARE cur_user VARCHAR(255); + DECLARE local_uuid VARCHAR(255); + DECLARE local_time TIMESTAMP; + + SET local_time= NOW(); + SET cur_user= CURRENT_USER(); + SET local_uuid= UUID(); + + WHILE ins_count > 0 DO + INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(), + ins_count,'Going to test MBR for MySQL'); + SET ins_count = ins_count - 1; + END WHILE; + SELECT MAX(id) FROM test.part_tbl INTO del_count; + WHILE del_count > 0 DO + DELETE FROM test.part_tbl WHERE id = del_count; + select count(*) as internal_count, del_count -- these two lines are for + FROM test.part_tbl; -- debug to show the problem + SET del_count = del_count - 2; + END WHILE; +END| + +delimiter ;| + +############ Finish Setup Section ################### + +############ Test Section ################### +--horizontal_results + +CALL test.proc_part(); + +select count(*) as Part from test.part_tbl; + +###### CLEAN UP SECTION ############## + +DROP PROCEDURE test.proc_part; +DROP TABLE test.part_tbl; + diff --git a/mysql-test/t/innodb_bug34300.test b/mysql-test/t/innodb_bug34300.test index 114bcf98c25..432ddd03547 100644 --- a/mysql-test/t/innodb_bug34300.test +++ b/mysql-test/t/innodb_bug34300.test @@ -21,6 +21,7 @@ CREATE TABLE bug34300 ( INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz'); +-- enable_query_log -- enable_result_log SELECT f4, f8 FROM bug34300; @@ -30,3 +31,7 @@ ALTER TABLE bug34300 ADD COLUMN (f10 INT); SELECT f4, f8 FROM bug34300; DROP TABLE bug34300; + +disconnect newconn; +connection default; +SET @@global.max_allowed_packet=default; diff --git a/mysql-test/t/innodb_bug38231.test b/mysql-test/t/innodb_bug38231.test new file mode 100644 index 00000000000..b3fcd89f371 --- /dev/null +++ b/mysql-test/t/innodb_bug38231.test @@ -0,0 +1,75 @@ +# +# Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK +# http://bugs.mysql.com/38231 +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we care only that the following SQL commands do not crash the server +-- disable_query_log +-- disable_result_log + +DROP TABLE IF EXISTS bug38231; +CREATE TABLE bug38231 (a INT); + +-- connect (con1,localhost,root,,) +-- connect (con2,localhost,root,,) + +-- connection con1 +SET autocommit=0; +LOCK TABLE bug38231 WRITE; + +-- connection con2 +SET autocommit=0; +-- send +LOCK TABLE bug38231 WRITE; + +-- connection default +-- send +TRUNCATE TABLE bug38231; + +-- connection con1 +# give time to TRUNCATE and others to be executed; without sleep, sometimes +# UNLOCK executes before TRUNCATE +# TODO: Replace with wait_condition once possible under embedded server. +-- sleep 0.2 +# this crashes the server if the bug is present +UNLOCK TABLES; + +# clean up + +-- connection con2 +-- reap +UNLOCK TABLES; + +-- connection default +-- reap +-- disconnect con1 +-- disconnect con2 + +# test that TRUNCATE works with with row-level locks + +-- enable_query_log +-- enable_result_log + +INSERT INTO bug38231 VALUES (1), (10), (300); + +-- connect (con4,localhost,root,,) + +-- connection con4 +SET autocommit=0; +SELECT * FROM bug38231 FOR UPDATE; + +-- connection default +TRUNCATE TABLE bug38231; + +-- connection con4 +COMMIT; + +-- connection default + +-- disconnect con4 + +DROP TABLE bug38231; diff --git a/mysql-test/t/innodb_bug39438-master.opt b/mysql-test/t/innodb_bug39438-master.opt new file mode 100644 index 00000000000..43fac202fd4 --- /dev/null +++ b/mysql-test/t/innodb_bug39438-master.opt @@ -0,0 +1 @@ +--innodb-file-per-table=1 diff --git a/mysql-test/t/innodb_bug39438.test b/mysql-test/t/innodb_bug39438.test new file mode 100644 index 00000000000..4dc3d957c39 --- /dev/null +++ b/mysql-test/t/innodb_bug39438.test @@ -0,0 +1,27 @@ +# +# Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch +# http://bugs.mysql.com/39438 +# +# This test must be run with innodb_file_per_table=1 because the crash +# only occurs if that option is turned on and DISCARD TABLESPACE only +# works with innodb_file_per_table. +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we care only that the following SQL commands do not crash the server +-- disable_query_log +-- disable_result_log + +DROP TABLE IF EXISTS bug39438; + +CREATE TABLE bug39438 (id INT) ENGINE=INNODB; + +ALTER TABLE bug39438 DISCARD TABLESPACE; + +# this crashes the server if the bug is present +SHOW TABLE STATUS; + +DROP TABLE bug39438; diff --git a/mysql-test/t/innodb_checksums_basic.test b/mysql-test/t/innodb_checksums_basic.test deleted file mode 100644 index 89daad9ce0a..00000000000 --- a/mysql-test/t/innodb_checksums_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_checksums_basic.test ################### -# # -# Variable Name: innodb_checksums # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_checksums # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_023_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_checksums); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_023_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_checksums=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_checksums); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_023_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_checksums = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_checksums'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_checksums); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_checksums'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_023_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_checksums = @@GLOBAL.innodb_checksums; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_023_05----------------------#' -################################################################################ -# Check if innodb_checksums can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_checksums); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_checksums); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_checksums); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_checksums); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_checksums = @@SESSION.innodb_checksums; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_commit_concurrency_basic.test b/mysql-test/t/innodb_commit_concurrency_basic.test deleted file mode 100644 index 1ef69e34999..00000000000 --- a/mysql-test/t/innodb_commit_concurrency_basic.test +++ /dev/null @@ -1,147 +0,0 @@ -################# mysql-test\t\innodb_commit_concurrency_basic.test ########### -# # -# Variable Name: innodb_commit_concurrency # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 0 # -# Range: 0-1000 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description:Test Cases of Dynamic System Variable innodb_commit_concurrency # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_commit_concurrency TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of innodb_commit_concurrency in a temporary variable# -############################################################################## - -SET @global_start_value = @@global.innodb_commit_concurrency; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_commit_concurrency # -######################################################################## - -SET @@global.innodb_commit_concurrency = 0; -SET @@global.innodb_commit_concurrency = DEFAULT; -SELECT @@global.innodb_commit_concurrency; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -################################################################################ -# Check if innodb_commit_concurrency can be accessed with and without @@ sign# -################################################################################ - ---Error ER_GLOBAL_VARIABLE -SET innodb_commit_concurrency = 1; -SELECT @@innodb_commit_concurrency; - - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_commit_concurrency; - -SET global innodb_commit_concurrency = 0; - -SELECT @@global.innodb_commit_concurrency; - - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_commit_concurrency to a valid value # -########################################################################## - - -SET @@global.innodb_commit_concurrency = 0; -SELECT @@global.innodb_commit_concurrency; - -SET @@global.innodb_commit_concurrency = 1; -SELECT @@global.innodb_commit_concurrency; -SET @@global.innodb_commit_concurrency = 1000; -SELECT @@global.innodb_commit_concurrency; - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_commit_concurrency to invalid value # -########################################################################### - -SET @@global.innodb_commit_concurrency = -1; -SELECT @@global.innodb_commit_concurrency; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_commit_concurrency = "T"; -SELECT @@global.innodb_commit_concurrency; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_commit_concurrency = "Y"; -SELECT @@global.innodb_commit_concurrency; - -SET @@global.innodb_commit_concurrency = 1001; -SELECT @@global.innodb_commit_concurrency; - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_commit_concurrency = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_commit_concurrency'; -SELECT @@global.innodb_commit_concurrency; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_commit_concurrency'; - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_commit_concurrency = OFF; -SELECT @@global.innodb_commit_concurrency; - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_commit_concurrency = ON; -SELECT @@global.innodb_commit_concurrency; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - - -SET @@global.innodb_commit_concurrency = TRUE; -SELECT @@global.innodb_commit_concurrency; -SET @@global.innodb_commit_concurrency = FALSE; -SELECT @@global.innodb_commit_concurrency; - -############################## -# Restore initial value # -############################## - - -SET @@global.innodb_commit_concurrency = @global_start_value; -SELECT @@global.innodb_commit_concurrency; - -############################################################### -# END OF innodb_commit_concurrency TESTS # -############################################################### diff --git a/mysql-test/t/innodb_data_file_path_basic.test b/mysql-test/t/innodb_data_file_path_basic.test deleted file mode 100644 index 1d88c47b1bb..00000000000 --- a/mysql-test/t/innodb_data_file_path_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_data_file_path_basic.test ############## -# # -# Variable Name: innodb_data_file_path # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_data_file_path # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_024_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_data_file_path); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_024_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_data_file_path=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_data_file_path); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_024_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_data_file_path = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_data_file_path'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_data_file_path); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_data_file_path'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_024_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_data_file_path = @@GLOBAL.innodb_data_file_path; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_024_05----------------------#' -################################################################################ -# Check if innodb_data_file_path can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_data_file_path); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_data_file_path); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_data_file_path); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_data_file_path); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_data_file_path = @@SESSION.innodb_data_file_path; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_data_home_dir_basic.test b/mysql-test/t/innodb_data_home_dir_basic.test deleted file mode 100644 index f3b02edf83b..00000000000 --- a/mysql-test/t/innodb_data_home_dir_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_data_home_dir_basic.test ############### -# # -# Variable Name: innodb_data_home_dir # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_data_home_dir # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_025_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_data_home_dir); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_025_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_data_home_dir=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_data_home_dir); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_025_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_data_home_dir = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_data_home_dir'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_data_home_dir); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_data_home_dir'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_025_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_data_home_dir = @@GLOBAL.innodb_data_home_dir; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_025_05----------------------#' -################################################################################ -# Check if innodb_data_home_dir can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_data_home_dir); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_data_home_dir); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_data_home_dir); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_data_home_dir); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_data_home_dir = @@SESSION.innodb_data_home_dir; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_doublewrite_basic.test b/mysql-test/t/innodb_doublewrite_basic.test deleted file mode 100644 index 4a0460bb4bc..00000000000 --- a/mysql-test/t/innodb_doublewrite_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_doublewrite_basic.test ################# -# # -# Variable Name: innodb_doublewrite # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_doublewrite # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_026_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_doublewrite); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_026_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_doublewrite=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_doublewrite); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_026_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_doublewrite = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_doublewrite'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_doublewrite); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_doublewrite'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_026_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_doublewrite = @@GLOBAL.innodb_doublewrite; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_026_05----------------------#' -################################################################################ -# Check if innodb_doublewrite can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_doublewrite); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_doublewrite); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_doublewrite); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_doublewrite); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_doublewrite = @@SESSION.innodb_doublewrite; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_fast_shutdown_basic.test b/mysql-test/t/innodb_fast_shutdown_basic.test deleted file mode 100644 index 5e108708716..00000000000 --- a/mysql-test/t/innodb_fast_shutdown_basic.test +++ /dev/null @@ -1,193 +0,0 @@ -############## mysql-test\t\innodb_fast_shutdown_basic.test ################### -# # -# Variable Name: innodb_fast_shutdown # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Valid Values: 0,1 # -# # -# # -# Creation Date: 2008-02-20 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable innodb_fast_shutdown # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_fast_shutdown TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of innodb_fast_shutdown in a temporary variable # -############################################################################## - - - -SET @global_start_value = @@global.innodb_fast_shutdown; -SELECT @@global.innodb_fast_shutdown; - - ---echo '#--------------------FN_DYNVARS_042_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_fast_shutdown # -######################################################################## - -SET @@global.innodb_fast_shutdown = 0; -SET @@global.innodb_fast_shutdown = DEFAULT; -SELECT @@global.innodb_fast_shutdown; - - - ---echo '#---------------------FN_DYNVARS_042_02-------------------------#' -############################################################################# -# Check if innodb_fast_shutdown can be accessed with and without @@ sign # -############################################################################# - - ---ERROR ER_GLOBAL_VARIABLE -SET innodb_fast_shutdown = 1; -SELECT @@innodb_fast_shutdown; - ---Error ER_UNKNOWN_TABLE -SELECT global.innodb_fast_shutdown; - -SET global innodb_fast_shutdown = 1; -SELECT @@global.innodb_fast_shutdown; - - ---echo '#--------------------FN_DYNVARS_042_03------------------------#' -######################################################################## -# Change the value of innodb_fast_shutdown to a valid value # -######################################################################## - -SET @@global.innodb_fast_shutdown = 0; -SELECT @@global.innodb_fast_shutdown; - -SET @@global.innodb_fast_shutdown = 1; -SELECT @@global.innodb_fast_shutdown; -## a value of 2 is used to just flush logs and then shutdown cold. Not supported on Netware - -SET @@global.innodb_fast_shutdown = 2; -SELECT @@global.innodb_fast_shutdown; - ---echo '#--------------------FN_DYNVARS_042_04-------------------------#' -########################################################################### -# Change the value of innodb_fast_shutdown to invalid value # -########################################################################### - - -SET @@global.innodb_fast_shutdown = -1; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = TRU; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = TRUE_F; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = FALS; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = OON; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = ONN; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = OOFF; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = 0FF; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = '1'; -SELECT @@global.innodb_fast_shutdown; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = "0"; -SELECT @@global.innodb_fast_shutdown; - - - ---echo '#-------------------FN_DYNVARS_042_05----------------------------#' -########################################################################### -# Test if accessing session innodb_fast_shutdown gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.innodb_fast_shutdown = 0; - ---Error ER_GLOBAL_VARIABLE -SET @@innodb_fast_shutdown = 0; ---Error ER_GLOBAL_VARIABLE -SET @@local.innodb_fast_shutdown = 0; - - - ---echo '#----------------------FN_DYNVARS_042_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) AS res_is_0 -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='innodb_fast_shutdown'; - - ---echo '#----------------------FN_DYNVARS_042_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_fast_shutdown = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_fast_shutdown'; - - ---echo '#---------------------FN_DYNVARS_042_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = OFF; -SELECT @@global.innodb_fast_shutdown; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_fast_shutdown = ON; -SELECT @@global.innodb_fast_shutdown; - ---echo '#---------------------FN_DYNVARS_042_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.innodb_fast_shutdown = TRUE; -SELECT @@global.innodb_fast_shutdown; -SET @@global.innodb_fast_shutdown = FALSE; -SELECT @@global.innodb_fast_shutdown; - -############################## -# Restore initial value # -############################## - -#SET @@innodb_fast_shutdown = @global_start_value; -#SELECT @@innodb_fast_shutdown; - -######################################################################## -# END OF innodb_fast_shutdown TESTS # -######################################################################## diff --git a/mysql-test/t/innodb_file_io_threads_basic.test b/mysql-test/t/innodb_file_io_threads_basic.test deleted file mode 100644 index 32cdd0beac4..00000000000 --- a/mysql-test/t/innodb_file_io_threads_basic.test +++ /dev/null @@ -1,144 +0,0 @@ - - -################## mysql-test\t\innodb_file_io_threads_basic.test ############# -# # -# Variable Name: innodb_file_io_threads # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_file_io_threads # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_027_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_read_io_threads); ---echo 1 Expected -SELECT COUNT(@@GLOBAL.innodb_write_io_threads); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_027_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_read_io_threads=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_read_io_threads); ---echo 1 Expected - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_write_io_threads=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_write_io_threads); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_027_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_read_io_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_read_io_threads'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_read_io_threads); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_read_io_threads'; ---echo 1 Expected - -SELECT @@GLOBAL.innodb_write_io_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_write_io_threads'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_write_io_threads); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_write_io_threads'; ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_027_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_read_io_threads = @@GLOBAL.innodb_read_io_threads; ---echo 1 Expected - -SELECT @@innodb_write_io_threads = @@GLOBAL.innodb_write_io_threads; ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_027_05----------------------#' -################################################################################ -# Check if innodb_read_io_threads can be accessed with and without @@ sign # -# Check if innodb_write_io_threads can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_read_io_threads); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_read_io_threads); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_read_io_threads); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_read_io_threads); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_read_io_threads = @@SESSION.innodb_read_io_threads; ---echo Expected error 'Readonly variable' - -SELECT COUNT(@@innodb_write_io_threads); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_write_io_threads); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_write_io_threads); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_write_io_threads); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_write_io_threads = @@SESSION.innodb_write_io_threads; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_file_per_table_basic.test b/mysql-test/t/innodb_file_per_table_basic.test deleted file mode 100644 index bc0e34c484e..00000000000 --- a/mysql-test/t/innodb_file_per_table_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_file_per_table_basic.test ############## -# # -# Variable Name: innodb_file_per_table # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_file_per_table # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_028_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_file_per_table); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_028_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_file_per_table=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_file_per_table); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_028_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_file_per_table = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_file_per_table'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_file_per_table); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_file_per_table'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_028_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_file_per_table = @@GLOBAL.innodb_file_per_table; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_028_05----------------------#' -################################################################################ -# Check if innodb_file_per_table can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_file_per_table); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_file_per_table); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_file_per_table); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_file_per_table); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_flush_log_at_trx_commit_basic.test b/mysql-test/t/innodb_flush_log_at_trx_commit_basic.test deleted file mode 100644 index 90da929d199..00000000000 --- a/mysql-test/t/innodb_flush_log_at_trx_commit_basic.test +++ /dev/null @@ -1,151 +0,0 @@ -################# mysql-test\t\innodb_flush_log_at_trx_commit_basic.test ###### -# # -# Variable Name: innodb_flush_log_at_trx_commit # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 0-2 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description: Test Cases of Dynamic System Variable # -# innodb_flush_log_at_trx_commit that checks the behavior of # -# this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_flush_log_at_trx_commit TESTS # -######################################################################## - - -############################################################################# -# Saving initial value of innodb_flush_log_at_trx_commit # -############################################################################# - - -SET @global_start_value = @@global.innodb_flush_log_at_trx_commit; -SELECT @global_start_value; - - - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -########################################################################## -# Display the DEFAULT value of innodb_flush_log_at_trx_commit # -########################################################################## - -SET @@global.innodb_flush_log_at_trx_commit = 0; -SET @@global.innodb_flush_log_at_trx_commit = DEFAULT; -SELECT @@global.innodb_flush_log_at_trx_commit; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -############################################################################### -# Check if variable can be accessed with and without @@ sign # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET innodb_flush_log_at_trx_commit = 1; -SELECT @@innodb_flush_log_at_trx_commit; - - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_flush_log_at_trx_commit; - - -SET global innodb_flush_log_at_trx_commit = 0; -SELECT @@global.innodb_flush_log_at_trx_commit; - - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -############################################################################# -# change the value of innodb_flush_log_at_trx_commit to a valid value # -############################################################################# - - -SET @@global.innodb_flush_log_at_trx_commit = 0; -SELECT @@global.innodb_flush_log_at_trx_commit; - -SET @@global.innodb_flush_log_at_trx_commit = 1; -SELECT @@global.innodb_flush_log_at_trx_commit; -SET @@global.innodb_flush_log_at_trx_commit = 2; -SELECT @@global.innodb_flush_log_at_trx_commit; - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -############################################################################### -# Change the value of innodb_flush_log_at_trx_commit to invalid value # -############################################################################### - -SET @@global.innodb_flush_log_at_trx_commit = -1; -SELECT @@global.innodb_flush_log_at_trx_commit; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_flush_log_at_trx_commit = "T"; -SELECT @@global.innodb_flush_log_at_trx_commit; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_flush_log_at_trx_commit = "Y"; -SELECT @@global.innodb_flush_log_at_trx_commit; - -SET @@global.innodb_flush_log_at_trx_commit = 1001; -SELECT @@global.innodb_flush_log_at_trx_commit; - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_flush_log_at_trx_commit = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_flush_log_at_trx_commit'; -SELECT @@global.innodb_flush_log_at_trx_commit; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_flush_log_at_trx_commit'; - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_flush_log_at_trx_commit = OFF; -SELECT @@global.innodb_flush_log_at_trx_commit; - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_flush_log_at_trx_commit = ON; -SELECT @@global.innodb_flush_log_at_trx_commit; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - - -SET @@global.innodb_flush_log_at_trx_commit = TRUE; -SELECT @@global.innodb_flush_log_at_trx_commit; -SET @@global.innodb_flush_log_at_trx_commit = FALSE; -SELECT @@global.innodb_flush_log_at_trx_commit; - -############################## -# Restore initial value # -############################## - - -SET @@global.innodb_flush_log_at_trx_commit = @global_start_value; -SELECT @@global.innodb_flush_log_at_trx_commit; - -############################################################### -# END OF innodb_flush_log_at_trx_commit TESTS # -############################################################### diff --git a/mysql-test/t/innodb_flush_method_basic.test b/mysql-test/t/innodb_flush_method_basic.test deleted file mode 100644 index 531df4a2464..00000000000 --- a/mysql-test/t/innodb_flush_method_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_flush_method_basic.test ################ -# # -# Variable Name: innodb_flush_method # -# Scope: Global # -# Access Type: Static # -# Data Type: enumeration # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_flush_method # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_029_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_flush_method); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_029_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_flush_method=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_flush_method); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_029_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_flush_method = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_flush_method'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_flush_method); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_flush_method'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_029_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_flush_method = @@GLOBAL.innodb_flush_method; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_029_05----------------------#' -################################################################################ -# Check if innodb_flush_method can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_flush_method); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_flush_method); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_flush_method); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_flush_method); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_flush_method = @@SESSION.innodb_flush_method; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_force_recovery_basic.test b/mysql-test/t/innodb_force_recovery_basic.test deleted file mode 100644 index f5aa769f09f..00000000000 --- a/mysql-test/t/innodb_force_recovery_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_force_recovery_basic.test ############## -# # -# Variable Name: innodb_force_recovery # -# Scope: Global # -# Access Type: Static # -# Data Type: enumeration # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_force_recovery # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_030_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_force_recovery); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_030_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_force_recovery=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_force_recovery); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_030_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_force_recovery = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_force_recovery'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_force_recovery); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_force_recovery'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_030_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_force_recovery = @@GLOBAL.innodb_force_recovery; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_030_05----------------------#' -################################################################################ -# Check if innodb_force_recovery can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_force_recovery); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_force_recovery); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_force_recovery); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_force_recovery); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_force_recovery = @@SESSION.innodb_force_recovery; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_ignore_builtin-master.opt b/mysql-test/t/innodb_ignore_builtin-master.opt new file mode 100644 index 00000000000..f7289eed20e --- /dev/null +++ b/mysql-test/t/innodb_ignore_builtin-master.opt @@ -0,0 +1 @@ +--ignore_builtin_innodb diff --git a/mysql-test/t/innodb_ignore_builtin.test b/mysql-test/t/innodb_ignore_builtin.test new file mode 100644 index 00000000000..6f987bcf891 --- /dev/null +++ b/mysql-test/t/innodb_ignore_builtin.test @@ -0,0 +1,8 @@ +# +# Bug #42610: Dynamic plugin broken in 5.1.31 +# +show variables like 'ignore_builtin_innodb'; +select PLUGIN_NAME from information_schema.plugins +where PLUGIN_NAME = "InnoDb"; +select ENGINE from information_schema.engines +where ENGINE = "InnoDB"; diff --git a/mysql-test/t/innodb_lock_wait_timeout_basic.test b/mysql-test/t/innodb_lock_wait_timeout_basic.test deleted file mode 100644 index ed31fc9eb6b..00000000000 --- a/mysql-test/t/innodb_lock_wait_timeout_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_lock_wait_timeout_basic.test ########### -# # -# Variable Name: innodb_lock_wait_timeout # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_lock_wait_timeout # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_032_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_032_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_lock_wait_timeout=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_032_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_lock_wait_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_lock_wait_timeout'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_lock_wait_timeout'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_032_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_lock_wait_timeout = @@GLOBAL.innodb_lock_wait_timeout; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_032_05----------------------#' -################################################################################ -# Check if innodb_lock_wait_timeout can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_lock_wait_timeout); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_lock_wait_timeout); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_lock_wait_timeout); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test b/mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test deleted file mode 100644 index 63835113770..00000000000 --- a/mysql-test/t/innodb_locks_unsafe_for_binlog_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_locks_unsafe_for_binlog_basic.test ##### -# # -# Variable Name: innodb_locks_unsafe_for_binlog # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_locks_unsafe_for_binlog# -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_031_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_031_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_locks_unsafe_for_binlog=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_031_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_locks_unsafe_for_binlog = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_031_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_locks_unsafe_for_binlog = @@GLOBAL.innodb_locks_unsafe_for_binlog; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_031_05----------------------#' -################################################################################ -# Check if innodb_locks_unsafe_for_binlog can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_locks_unsafe_for_binlog); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_locks_unsafe_for_binlog); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_locks_unsafe_for_binlog); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_locks_unsafe_for_binlog = @@SESSION.innodb_locks_unsafe_for_binlog; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_log_buffer_size_basic.test b/mysql-test/t/innodb_log_buffer_size_basic.test deleted file mode 100644 index 74c1aeab87a..00000000000 --- a/mysql-test/t/innodb_log_buffer_size_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_log_buffer_size_basic.test ############# -# # -# Variable Name: innodb_log_buffer_size # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_log_buffer_size # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_033_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_log_buffer_size); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_033_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_log_buffer_size=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_log_buffer_size); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_033_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_log_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_buffer_size'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_log_buffer_size); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_buffer_size'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_033_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_log_buffer_size = @@GLOBAL.innodb_log_buffer_size; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_033_05----------------------#' -################################################################################ -# Check if innodb_log_buffer_size can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_log_buffer_size); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_log_buffer_size); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_log_buffer_size); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_log_buffer_size); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_log_buffer_size = @@SESSION.innodb_log_buffer_size; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_log_file_size_basic.test b/mysql-test/t/innodb_log_file_size_basic.test deleted file mode 100644 index 08925b73957..00000000000 --- a/mysql-test/t/innodb_log_file_size_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_log_file_size_basic.test ############### -# # -# Variable Name: innodb_log_file_size # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_log_file_size # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_035_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_log_file_size); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_035_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_log_file_size=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_log_file_size); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_035_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_log_file_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_file_size'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_log_file_size); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_file_size'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_035_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_log_file_size = @@GLOBAL.innodb_log_file_size; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_035_05----------------------#' -################################################################################ -# Check if innodb_log_file_size can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_log_file_size); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_log_file_size); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_log_file_size); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_log_file_size); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_log_file_size = @@SESSION.innodb_log_file_size; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_log_files_in_group_basic.test b/mysql-test/t/innodb_log_files_in_group_basic.test deleted file mode 100644 index 67978efe76a..00000000000 --- a/mysql-test/t/innodb_log_files_in_group_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_log_files_in_group_basic.test ########## -# # -# Variable Name: innodb_log_files_in_group # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_log_files_in_group # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_034_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_log_files_in_group); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_034_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_log_files_in_group=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_log_files_in_group); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_034_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_log_files_in_group = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_files_in_group'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_log_files_in_group); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_files_in_group'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_034_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_log_files_in_group = @@GLOBAL.innodb_log_files_in_group; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_034_05----------------------#' -################################################################################ -# Check if innodb_log_files_in_group can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_log_files_in_group); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_log_files_in_group); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_log_files_in_group); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_log_files_in_group); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_log_files_in_group = @@SESSION.innodb_log_files_in_group; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_log_group_home_dir_basic.test b/mysql-test/t/innodb_log_group_home_dir_basic.test deleted file mode 100644 index 7e3969c6bd7..00000000000 --- a/mysql-test/t/innodb_log_group_home_dir_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_log_group_home_dir_basic.test ########## -# # -# Variable Name: innodb_log_group_home_dir # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_log_group_home_dir # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_036_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_log_group_home_dir); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_036_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_log_group_home_dir=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_log_group_home_dir); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_036_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_log_group_home_dir = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_group_home_dir'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_log_group_home_dir); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_log_group_home_dir'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_036_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_log_group_home_dir = @@GLOBAL.innodb_log_group_home_dir; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_036_05----------------------#' -################################################################################ -# Check if innodb_log_group_home_dir can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_log_group_home_dir); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_log_group_home_dir); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_log_group_home_dir); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_log_group_home_dir); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_log_group_home_dir = @@SESSION.innodb_log_group_home_dir; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_max_dirty_pages_pct_basic.test b/mysql-test/t/innodb_max_dirty_pages_pct_basic.test deleted file mode 100644 index 38c3acd92a2..00000000000 --- a/mysql-test/t/innodb_max_dirty_pages_pct_basic.test +++ /dev/null @@ -1,142 +0,0 @@ -################# mysql-test\t\innodb_max_dirty_pages_pct_basic.test ########## -# # -# Variable Name: innodb_max_dirty_pages_pct # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 90 # -# Range: 0-1000 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description: Test Cases of Dynamic System Variable # -# innodb_max_dirty_pages_pct that checks the behavior of # -# this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### ---source include/have_innodb.inc ---source include/load_sysvars.inc - -###################################################################### -# START OF innodb_max_dirty_pages_pct TESTS # -###################################################################### - - -################################################################################ -# Saving initial value of innodb_max_dirty_pages_pct in a temporary variable # -################################################################################ - -SET @global_start_value = @@global.innodb_max_dirty_pages_pct; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_max_dirty_pages_pct # -######################################################################## - -SET @@global.innodb_max_dirty_pages_pct = 0; -SET @@global.innodb_max_dirty_pages_pct = DEFAULT; -SELECT @@global.innodb_max_dirty_pages_pct; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -################################################################################ -# check if innodb_max_dirty_pages_pct can be accessed with and without @@ sign # -################################################################################ - ---Error ER_GLOBAL_VARIABLE -SET innodb_max_dirty_pages_pct = 1; -SELECT @@innodb_max_dirty_pages_pct; - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_max_dirty_pages_pct; - -SET global innodb_max_dirty_pages_pct = 0; -SELECT @@global.innodb_max_dirty_pages_pct; - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_max_dirty_pages_pct to a valid value # -########################################################################## - -SET @@global.innodb_max_dirty_pages_pct = 0; -SELECT @@global.innodb_max_dirty_pages_pct; - -SET @@global.innodb_max_dirty_pages_pct = 1; -SELECT @@global.innodb_max_dirty_pages_pct; -SET @@global.innodb_max_dirty_pages_pct = 99; -SELECT @@global.innodb_max_dirty_pages_pct; - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_max_dirty_pages_pct to invalid value # -########################################################################### - -SET @@global.innodb_max_dirty_pages_pct = -1; -SELECT @@global.innodb_max_dirty_pages_pct; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_dirty_pages_pct = "T"; -SELECT @@global.innodb_max_dirty_pages_pct; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_dirty_pages_pct = "Y"; -SELECT @@global.innodb_max_dirty_pages_pct; - -SET @@global.innodb_max_dirty_pages_pct = 1001; -SELECT @@global.innodb_max_dirty_pages_pct; - - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_max_dirty_pages_pct = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct'; -SELECT @@global.innodb_max_dirty_pages_pct; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct'; - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_dirty_pages_pct = OFF; -SELECT @@global.innodb_max_dirty_pages_pct; - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_dirty_pages_pct = ON; -SELECT @@global.innodb_max_dirty_pages_pct; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.innodb_max_dirty_pages_pct = TRUE; -SELECT @@global.innodb_max_dirty_pages_pct; -SET @@global.innodb_max_dirty_pages_pct = FALSE; -SELECT @@global.innodb_max_dirty_pages_pct; - -############################## -# Restore initial value # -############################## - -SET @@global.innodb_max_dirty_pages_pct = @global_start_value; -SELECT @@global.innodb_max_dirty_pages_pct; - -############################################################### -# END OF innodb_max_dirty_pages_pct TESTS # -############################################################### diff --git a/mysql-test/t/innodb_max_dirty_pages_pct_func.test b/mysql-test/t/innodb_max_dirty_pages_pct_func.test deleted file mode 100644 index 5d7b9754843..00000000000 --- a/mysql-test/t/innodb_max_dirty_pages_pct_func.test +++ /dev/null @@ -1,164 +0,0 @@ -################# mysql-test\t\innodb_max_dirty_pages_pct_func.test ########## -# # -# Variable Name: innodb_max_dirty_pages_pct # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 90 # -# Range: 0-100 # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -#Description: Test Cases of Dynamic System Variable innodb_max_dirty_pages_pct# -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---echo '#--------------------FN_DYNVARS_044_02-------------------------#' -########################################################################### -# Check if setting innodb_max_dirty_pages_pct is changed in new connection# -########################################################################### - -SET @@global.innodb_max_dirty_pages_pct = 80; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.innodb_max_dirty_pages_pct; -SET @@global.innodb_max_dirty_pages_pct = 70; ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); ---echo 'connection con2' -connection con2; -SELECT @@global.innodb_max_dirty_pages_pct; -disconnect con2; -disconnect con1; - ---echo '#--------------------FN_DYNVARS_044_02-------------------------#' -################################################################### -# Begin the functionality Testing of innodb_max_dirty_pages_pct # -################################################################### - ---echo 'connection default' -connection default; - ---disable_query_log - ---disable_warnings -DROP PROCEDURE IF EXISTS add_records; -DROP PROCEDURE IF EXISTS add_until; -DROP PROCEDURE IF EXISTS check_pct; -DROP FUNCTION IF EXISTS dirty_pct; -DROP TABLE IF EXISTS t1; ---enable_warnings - -DELIMITER //; -CREATE PROCEDURE add_records(IN NUM INT) -BEGIN - START TRANSACTION; - WHILE (NUM>0) DO - INSERT INTO t1(b) VALUES('MYSQL'); - SET NUM = NUM - 1; - END WHILE; - COMMIT; -END// - -CREATE FUNCTION dirty_pct() RETURNS DECIMAL(20,17) -BEGIN - DECLARE res DECIMAL(20,17); - DECLARE a1,b1 VARCHAR(256); - DECLARE a2,b2 VARCHAR(256); - DECLARE dirty CURSOR FOR SELECT * FROM information_schema.global_status - WHERE variable_name LIKE 'Innodb_buffer_pool_pages_dirty' - UNION SELECT * FROM information_schema.session_status - WHERE variable_name LIKE 'Innodb_buffer_pool_pages_dirty'; - DECLARE total CURSOR FOR SELECT * FROM information_schema.global_status - WHERE variable_name LIKE 'Innodb_buffer_pool_pages_total' - UNION SELECT * FROM information_schema.session_status - WHERE variable_name LIKE 'Innodb_buffer_pool_pages_total'; - - OPEN dirty; - OPEN total; - - FETCH dirty INTO a1, b1; - FETCH total INTO a2, b2; - - SET res = ( CONVERT(b1,DECIMAL)*100)/CONVERT(b2,DECIMAL); - - CLOSE dirty; - CLOSE total; - RETURN res; -END// - -CREATE PROCEDURE add_until(IN NUM DECIMAL) -BEGIN - DECLARE pct,last DECIMAL(20,17); - - SET pct = dirty_pct(); - SET last = 0; - WHILE (pct<NUM and pct<100) DO - CALL add_records(500); - SET pct = dirty_pct(); - IF (pct<last) THEN - SET pct = NUM+1; - ELSE - SET last = pct; - END IF; - END WHILE; -END// - -CREATE PROCEDURE check_pct(IN NUM DECIMAL) -BEGIN - IF (dirty_pct() < NUM) THEN - SELECT 'BELOW_MAX' AS PCT_VALUE; - ELSE - SELECT 'ABOVE_MAX' AS PCT_VALUE; - END IF; -END// - -DELIMITER ;// - -CREATE TABLE t1( -a INT AUTO_INCREMENT PRIMARY KEY, -b CHAR(200) -)ENGINE=INNODB; - ---enable_query_log - -#========================================================== ---echo '---Check when innodb_max_dirty_pages_pct is 10---' -#========================================================== - -SET @@global.innodb_max_dirty_pages_pct = 10; - -FLUSH STATUS; - -# add rows until dirty pages pct is less than this value -CALL add_until(10); - -# give server some time to flush dirty pages -FLUSH TABLES; -CALL add_records(500); ---echo '--sleep 5' ---sleep 5 - ---echo 'We expect dirty pages pct to be BELOW_MAX' -CALL check_pct(10); - -#SHOW STATUS LIKE 'innodb%'; - -DROP PROCEDURE add_records; -DROP PROCEDURE add_until; -DROP PROCEDURE check_pct; -DROP FUNCTION dirty_pct; - -################################################################## -# End of functionality Testing for innodb_max_dirty_pages_pct # -################################################################## - diff --git a/mysql-test/t/innodb_mirrored_log_groups_basic.test b/mysql-test/t/innodb_mirrored_log_groups_basic.test deleted file mode 100644 index 6edb07ac39f..00000000000 --- a/mysql-test/t/innodb_mirrored_log_groups_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_mirrored_log_groups_basic.test ######### -# # -# Variable Name: innodb_mirrored_log_groups # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_mirrored_log_groups# -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_037_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_037_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_mirrored_log_groups=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_037_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_mirrored_log_groups = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_mirrored_log_groups'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_mirrored_log_groups'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_037_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_mirrored_log_groups = @@GLOBAL.innodb_mirrored_log_groups; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_037_05----------------------#' -################################################################################ -# Check if innodb_mirrored_log_groups can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_mirrored_log_groups); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_mirrored_log_groups); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_mirrored_log_groups); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_mirrored_log_groups = @@SESSION.innodb_mirrored_log_groups; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index d47406697f8..21ee440f10b 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -53,3 +53,135 @@ CREATE TABLE t1 (a char(50)) ENGINE=InnoDB; CREATE INDEX i1 on t1 (a(3)); SELECT * FROM t1 WHERE a = 'abcde'; DROP TABLE t1; + +# +# Bug #37742: HA_EXTRA_KEYREAD flag is set when key contains only prefix of +# requested column +# + +CREATE TABLE foo (a int, b int, c char(10), + PRIMARY KEY (c(3)), + KEY b (b) +) engine=innodb; + +CREATE TABLE foo2 (a int, b int, c char(10), + PRIMARY KEY (c), + KEY b (b) +) engine=innodb; + +CREATE TABLE bar (a int, b int, c char(10), + PRIMARY KEY (c(3)), + KEY b (b) +) engine=myisam; + +INSERT INTO foo VALUES + (1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'), + (4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe'); + +INSERT INTO bar SELECT * FROM foo; +INSERT INTO foo2 SELECT * FROM foo; + +--query_vertical EXPLAIN SELECT c FROM bar WHERE b>2; +--query_vertical EXPLAIN SELECT c FROM foo WHERE b>2; +--query_vertical EXPLAIN SELECT c FROM foo2 WHERE b>2; + +--query_vertical EXPLAIN SELECT c FROM bar WHERE c>2; +--query_vertical EXPLAIN SELECT c FROM foo WHERE c>2; +--query_vertical EXPLAIN SELECT c FROM foo2 WHERE c>2; + +DROP TABLE foo, bar, foo2; + +# +# Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites locking type of temp table +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t3,t2; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +DELIMITER |; +CREATE FUNCTION f1() RETURNS VARCHAR(250) + BEGIN + return 'hhhhhhh' ; + END| +DELIMITER ;| + +CREATE TABLE t1 (a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) ENGINE=INNODB; + +BEGIN WORK; + +CREATE TEMPORARY TABLE t2 (a VARCHAR(20), b VARCHAR(20), c varchar(20)) ENGINE=INNODB; +CREATE TEMPORARY TABLE t3 LIKE t2; + +INSERT INTO t1 VALUES ('a','b',NULL),('c','d',NULL),('e','f',NULL); + +SET @stmt := CONCAT('INSERT INTO t2 SELECT tbl.a, tbl.b, f1()',' FROM t1 tbl'); +PREPARE stmt1 FROM @stmt; + +SET @stmt := CONCAT('INSERT INTO t3', ' SELECT * FROM t2'); +PREPARE stmt3 FROM @stmt; + +EXECUTE stmt1; + +COMMIT; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt3; + +DROP TABLE t1,t3,t2; +DROP FUNCTION f1; + +# +# Bug#37016: TRUNCATE TABLE removes some rows but not all +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, + t1_id INT, INDEX par_ind (t1_id), + FOREIGN KEY (t1_id) REFERENCES t1(id)) ENGINE=INNODB; +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (3,2); + +SET AUTOCOMMIT = 0; + +START TRANSACTION; +--error ER_ROW_IS_REFERENCED_2 +TRUNCATE TABLE t1; +SELECT * FROM t1; +COMMIT; +SELECT * FROM t1; + +START TRANSACTION; +--error ER_ROW_IS_REFERENCED_2 +TRUNCATE TABLE t1; +SELECT * FROM t1; +ROLLBACK; +SELECT * FROM t1; + +SET AUTOCOMMIT = 1; + +START TRANSACTION; +SELECT * FROM t1; +COMMIT; + +--error ER_ROW_IS_REFERENCED_2 +TRUNCATE TABLE t1; +SELECT * FROM t1; +DELETE FROM t2 WHERE id = 3; + +START TRANSACTION; +SELECT * FROM t1; +TRUNCATE TABLE t1; +ROLLBACK; +SELECT * FROM t1; +TRUNCATE TABLE t2; + +DROP TABLE t2; +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/innodb_mysql_rbk-master.opt b/mysql-test/t/innodb_mysql_rbk-master.opt new file mode 100644 index 00000000000..0e400f9c36b --- /dev/null +++ b/mysql-test/t/innodb_mysql_rbk-master.opt @@ -0,0 +1 @@ +--innodb_lock_wait_timeout=1 --innodb_rollback_on_timeout=1 diff --git a/mysql-test/t/innodb_mysql_rbk.test b/mysql-test/t/innodb_mysql_rbk.test new file mode 100644 index 00000000000..d2368c81f95 --- /dev/null +++ b/mysql-test/t/innodb_mysql_rbk.test @@ -0,0 +1,35 @@ +-- source include/have_innodb.inc + +# +# Bug #41453: Assertion `m_status == DA_ERROR' failed in +# Diagnostics_area::sql_errno +# + +CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb +DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7); +CONNECT (con1,localhost,root,,); +CONNECT (con2,localhost,root,,); + +CONNECTION con1; +START TRANSACTION; +SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE; +CONNECTION con2; +START TRANSACTION; +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a; +ROLLBACK; + +CONNECTION con1; +START TRANSACTION; +SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE; +CONNECTION con2; +START TRANSACTION; +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a; +SELECT * FROM t1 WHERE b = 10; + +CONNECTION default; +DISCONNECT con1; +DISCONNECT con2; +DROP TABLE t1; diff --git a/mysql-test/t/innodb_notembedded.test b/mysql-test/t/innodb_notembedded.test index 2731f8e33ed..564b947c75e 100644 --- a/mysql-test/t/innodb_notembedded.test +++ b/mysql-test/t/innodb_notembedded.test @@ -5,6 +5,8 @@ drop table if exists t1; --enable_warnings +SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; + connect (a,localhost,root,,); connect (b,localhost,root,,); @@ -39,4 +41,4 @@ drop table t1; drop function f1; disconnect a; disconnect b; -SET GLOBAL log_bin_trust_function_creators = 0; +SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; diff --git a/mysql-test/t/innodb_open_files_basic.test b/mysql-test/t/innodb_open_files_basic.test deleted file mode 100644 index c55b7e55937..00000000000 --- a/mysql-test/t/innodb_open_files_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_open_files_basic.test ################## -# # -# Variable Name: innodb_open_files # -# Scope: Global # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_open_files # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_038_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_open_files); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_038_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_open_files=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_open_files); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_038_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_open_files = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_open_files'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_open_files); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_open_files'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_038_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_open_files = @@GLOBAL.innodb_open_files; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_038_05----------------------#' -################################################################################ -# Check if innodb_open_files can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_open_files); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_open_files); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_open_files); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_open_files); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_open_files = @@SESSION.innodb_open_files; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_rollback_on_timeout_basic.test b/mysql-test/t/innodb_rollback_on_timeout_basic.test deleted file mode 100644 index c33e0fa1b75..00000000000 --- a/mysql-test/t/innodb_rollback_on_timeout_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\innodb_rollback_on_timeout_basic.test ######### -# # -# Variable Name: innodb_rollback_on_timeout # -# Scope: Global # -# Access Type: Static # -# Data Type: boolean # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable innodb_rollback_on_timeout# -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---echo '#---------------------BS_STVARS_039_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_039_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_rollback_on_timeout=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_039_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.innodb_rollback_on_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_rollback_on_timeout'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_rollback_on_timeout'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_039_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@innodb_rollback_on_timeout = @@GLOBAL.innodb_rollback_on_timeout; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_039_05----------------------#' -################################################################################ -# Check if innodb_rollback_on_timeout can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@innodb_rollback_on_timeout); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.innodb_rollback_on_timeout); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.innodb_rollback_on_timeout); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT innodb_rollback_on_timeout = @@SESSION.innodb_rollback_on_timeout; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/innodb_support_xa_basic.test b/mysql-test/t/innodb_support_xa_basic.test deleted file mode 100644 index 6da3e68ebdf..00000000000 --- a/mysql-test/t/innodb_support_xa_basic.test +++ /dev/null @@ -1,235 +0,0 @@ -################# mysql-test\t\innodb_support_xa_basic.test ################### -# # -# Variable Name: innodb_support_xa # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-02-20 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable innodb_support_xa # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_support_xa TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of innodb_support_xa in a temporary variable # -################################################################################ - - -SET @session_start_value = @@session.innodb_support_xa; -SELECT @session_start_value; - - -SET @global_start_value = @@global.innodb_support_xa; -SELECT @global_start_value; - - - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_support_xa # -######################################################################## - -SET @@session.innodb_support_xa = 0; -SET @@session.innodb_support_xa = DEFAULT; -SELECT @@session.innodb_support_xa; - -SET @@global.innodb_support_xa = 0; -SET @@global.innodb_support_xa = DEFAULT; -SELECT @@global.innodb_support_xa; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -########################################################################## -# Check if innodb_support_xa can be accessed with and without @@ sign # -########################################################################## - -SET innodb_support_xa = 1; -SELECT @@innodb_support_xa; - ---Error ER_UNKNOWN_TABLE -SELECT session.innodb_support_xa; - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_support_xa; - ---Error ER_UNKNOWN_TABLE -SELECT global.innodb_support_xa; -#using another syntax for accessing system variables -SET session innodb_support_xa = 0; -SELECT @@session.innodb_support_xa; - -SET global innodb_support_xa = 0; -SELECT @@global.innodb_support_xa; - - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_support_xa to a valid value # -########################################################################## -# for session -SET @@session.innodb_support_xa = 0; -SELECT @@session.innodb_support_xa; -SET @@session.innodb_support_xa = 1; -SELECT @@session.innodb_support_xa; - -# for global -SET @@global.innodb_support_xa = 0; -SELECT @@global.innodb_support_xa; -SET @@global.innodb_support_xa = 1; -SELECT @@global.innodb_support_xa; - - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_support_xa to invalid value # -########################################################################### - -# for session ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_support_xa = -0.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_support_xa = 1.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_support_xa = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_support_xa = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_support_xa = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_support_xa = ÕN; - -SET @@session.innodb_support_xa = OF; -SELECT @@session.innodb_support_xa; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_support_xa = ÓFF; - -# for global - - -SET @@global.innodb_support_xa = -1; -SELECT @@global.innodb_support_xa; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_support_xa = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_support_xa = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_support_xa = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_support_xa = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_support_xa = ÕN; - -SET @@global.innodb_support_xa = OF; -SELECT @@global.innodb_support_xa; - ---echo 'Bug# 34828 : OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_support_xa = ÓFF; - - ---echo '#-------------------FN_DYNVARS_046_05----------------------------#' -########################################################################### -# Test if changing global variable effects session and vice versa # -########################################################################### - -SET @@global.innodb_support_xa = 0; -SET @@session.innodb_support_xa = 1; -SELECT @@global.innodb_support_xa AS res_is_0; - -SET @@global.innodb_support_xa = 0; -SELECT @@session.innodb_support_xa AS res_is_1; - ---echo '#----------------------FN_DYNVARS_046_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_support_xa = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_support_xa'; -SELECT @@global.innodb_support_xa; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_support_xa'; - - ---echo '#----------------------FN_DYNVARS_046_07------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@session.innodb_support_xa = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='innodb_support_xa'; -SELECT @@session.innodb_support_xa; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='innodb_support_xa'; - - ---echo '#---------------------FN_DYNVARS_046_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.innodb_support_xa = OFF; -SELECT @@session.innodb_support_xa; -SET @@session.innodb_support_xa = ON; -SELECT @@session.innodb_support_xa; - -SET @@global.innodb_support_xa = OFF; -SELECT @@global.innodb_support_xa; -SET @@global.innodb_support_xa = ON; -SELECT @@global.innodb_support_xa; - ---echo '#---------------------FN_DYNVARS_046_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.innodb_support_xa = TRUE; -SELECT @@session.innodb_support_xa; -SET @@session.innodb_support_xa = FALSE; -SELECT @@session.innodb_support_xa; - -SET @@global.innodb_support_xa = TRUE; -SELECT @@global.innodb_support_xa; -SET @@global.innodb_support_xa = FALSE; -SELECT @@global.innodb_support_xa; - -############################## -# Restore initial value # -############################## - -SET @@session.innodb_support_xa = @session_start_value; -SELECT @@session.innodb_support_xa; - -SET @@global.innodb_support_xa = @global_start_value; -SELECT @@global.innodb_support_xa; - -############################################################### -# END OF innodb_support_xa TESTS # -############################################################### diff --git a/mysql-test/t/innodb_support_xa_func.test b/mysql-test/t/innodb_support_xa_func.test deleted file mode 100644 index f1b6fe84fe1..00000000000 --- a/mysql-test/t/innodb_support_xa_func.test +++ /dev/null @@ -1,138 +0,0 @@ -################# mysql-test\t\innodb_support_xa_func.test ################### -# # -# Variable Name: innodb_support_xa # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable innodb_support_xa # -# that checks the behavior of this variable in the following ways# -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---echo '#--------------------FN_DYNVARS_046_01-------------------------#' -#################################################################### -# Check if setting innodb_support_xa is changed in new connection # -#################################################################### - -SET @@global.innodb_support_xa = OFF; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.innodb_support_xa; -SELECT @@session.innodb_support_xa; -disconnect con1; - - ---echo '#--------------------FN_DYNVARS_046_01-------------------------#' -########################################################### -# Begin the functionality Testing of innodb_support_xa # -########################################################### - ---echo 'connection default' -connection default; -SET @@global.innodb_support_xa = 1; - ---disable_warnings -drop table if exists t1, t2; ---enable_warnings - -create table t1 (a int) engine=innodb; - -#==================================================== ---echo '---check when innodb_support_xa is 1---' -#==================================================== - - -SET @@innodb_support_xa = 1; - -xa start 'test1'; -INSERT t1 values (10); -xa end 'test1'; -xa prepare 'test1'; -xa rollback 'test1'; -SELECT * from t1; - -#==================================================== ---echo '---check when innodb_support_xa is 0---' -#==================================================== - -SET @@innodb_support_xa = 0; -# -xa start 'test1'; -INSERT t1 values (10); -xa end 'test1'; -xa prepare 'test1'; -xa rollback 'test1'; -SELECT * from t1; - -#==================================================== ---echo '------general xa testing--------' -#==================================================== - -SET @@global.innodb_support_xa = 1; -SET @@innodb_support_xa = 1; - -xa start 'testa','testb'; -INSERT t1 values (30); ---Error ER_XAER_RMFAIL -COMMIT; -xa end 'testa','testb'; ---Error ER_XAER_RMFAIL -BEGIN; ---Error ER_XAER_RMFAIL -CREATE table t2 (a int); ---echo 'connect (con1,localhost,root,,,,)' -CONNECT (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; - ---Error ER_XAER_DUPID -xa start 'testa','testb'; ---Error ER_XAER_DUPID -xa start 'testa','testb', 123; - -# gtrid [ , bqual [ , formatID ] ] -xa start 0x7465737462, 0x2030405060, 0xb; -INSERT t1 values (40); -xa end 'testb',' 0@P`',11; -xa prepare 'testb',0x2030405060,11; - ---Error ER_XAER_RMFAIL -START TRANSACTION; -xa recover; - -# uncomment the line below when binlog will be able to prepare -#disconnect con1; - ---echo 'connection default' -CONNECTION default; -xa prepare 'testa','testb'; -xa recover; ---Error ER_XAER_NOTA -xa commit 'testb',0x2030405060,11; -xa commit 'testa','testb'; - ---echo 'connection con1' -CONNECTION con1; -xa rollback 'testb',0x2030405060,11; - -SELECT * from t1; - -DROP table t1; - -######################################################## -# End of functionality Testing for innodb_support_xa # -######################################################## - diff --git a/mysql-test/t/innodb_table_locks_basic.test b/mysql-test/t/innodb_table_locks_basic.test deleted file mode 100644 index 35961c43a7f..00000000000 --- a/mysql-test/t/innodb_table_locks_basic.test +++ /dev/null @@ -1,232 +0,0 @@ -################# mysql-test\t\innodb_table_locks_basic.test ################## -# # -# Variable Name: innodb_table_locks # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-02-20 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable innodb_table_locks # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_table_locks TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of innodb_table_locks in a temporary variable # -################################################################################ - - -SET @session_start_value = @@session.innodb_table_locks; -SELECT @session_start_value; - - -SET @global_start_value = @@global.innodb_table_locks; -SELECT @global_start_value; - - - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_table_locks # -######################################################################## - -SET @@session.innodb_table_locks = 0; -SET @@session.innodb_table_locks = DEFAULT; -SELECT @@session.innodb_table_locks; - -SET @@global.innodb_table_locks = 0; -SET @@global.innodb_table_locks = DEFAULT; -SELECT @@global.innodb_table_locks; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -############################################################################### -# Check if innodb_table_locks can be accessed with and without @@ sign # -############################################################################### - -SET innodb_table_locks = 1; -SELECT @@innodb_table_locks; - ---Error ER_UNKNOWN_TABLE -SELECT session.innodb_table_locks; - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_table_locks; - ---Error ER_UNKNOWN_TABLE -SELECT global.innodb_table_locks; -#using another syntax for accessing system variables -SET session innodb_table_locks = 0; -SELECT @@session.innodb_table_locks; - -SET global innodb_table_locks = 0; -SELECT @@global.innodb_table_locks; - - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_table_locks to a valid value # -########################################################################## -# for session -SET @@session.innodb_table_locks = 0; -SELECT @@session.innodb_table_locks; -SET @@session.innodb_table_locks = 1; -SELECT @@session.innodb_table_locks; - -# for global -SET @@global.innodb_table_locks = 0; -SELECT @@global.innodb_table_locks; -SET @@global.innodb_table_locks = 1; -SELECT @@global.innodb_table_locks; - - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_table_locks to invalid value # -########################################################################### - -# for session - -SET @@session.innodb_table_locks = -6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_table_locks = 1.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_table_locks = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_table_locks = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_table_locks = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_table_locks = ÕN; - -SET @@session.innodb_table_locks = OF; -SELECT @@session.innodb_table_locks; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.innodb_table_locks = ÓFF; - -# for global - - -SET @@global.innodb_table_locks = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_table_locks = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_table_locks = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_table_locks = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_table_locks = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.innodb_table_locks = QN; - -SET @@global.innodb_table_locks = OF; -SELECT @@global.innodb_table_locks; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_TYPE_FOR_VAR -#SET @@global.innodb_table_locks = ÓFF; - - ---echo '#-------------------FN_DYNVARS_046_05----------------------------#' -########################################################################### -# Test if changing global variable effects session and vice versa # -########################################################################### - -SET @@global.innodb_table_locks = 0; -SET @@session.innodb_table_locks = 1; -SELECT @@global.innodb_table_locks AS res_is_0; - -SET @@global.innodb_table_locks = 0; -SELECT @@session.innodb_table_locks AS res_is_1; - ---echo '#----------------------FN_DYNVARS_046_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_table_locks = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_table_locks'; -SELECT @@global.innodb_table_locks; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_table_locks'; - ---echo '#----------------------FN_DYNVARS_046_07------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@session.innodb_table_locks = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='innodb_table_locks'; -SELECT @@session.innodb_table_locks; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='innodb_table_locks'; - - ---echo '#---------------------FN_DYNVARS_046_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.innodb_table_locks = OFF; -SELECT @@session.innodb_table_locks; -SET @@session.innodb_table_locks = ON; -SELECT @@session.innodb_table_locks; - -SET @@global.innodb_table_locks = OFF; -SELECT @@global.innodb_table_locks; -SET @@global.innodb_table_locks = ON; -SELECT @@global.innodb_table_locks; - ---echo '#---------------------FN_DYNVARS_046_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.innodb_table_locks = TRUE; -SELECT @@session.innodb_table_locks; -SET @@session.innodb_table_locks = FALSE; -SELECT @@session.innodb_table_locks; - -SET @@global.innodb_table_locks = TRUE; -SELECT @@global.innodb_table_locks; -SET @@global.innodb_table_locks = FALSE; -SELECT @@global.innodb_table_locks; - -############################## -# Restore initial value # -############################## - -SET @@session.innodb_table_locks = @session_start_value; -SELECT @@session.innodb_table_locks; - -SET @@global.innodb_table_locks = @global_start_value; -SELECT @@global.innodb_table_locks; - -############################################################### -# END OF innodb_table_locks TESTS # -############################################################### diff --git a/mysql-test/t/innodb_table_locks_func.test b/mysql-test/t/innodb_table_locks_func.test deleted file mode 100644 index d233a2a5240..00000000000 --- a/mysql-test/t/innodb_table_locks_func.test +++ /dev/null @@ -1,88 +0,0 @@ -################# mysql-test\t\innodb_table_locks_func.test ################## -# # -# Variable Name: innodb_table_locks # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable innodb_table_locks # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/not_embedded.inc ---source include/have_innodb.inc - ---echo '#--------------------FN_DYNVARS_048_01-------------------------#' -#################################################################### -# Check if setting innodb_table_locks is changed in new connection # -#################################################################### - -SET @@global.innodb_table_locks = OFF; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.innodb_table_locks; -SELECT @@session.innodb_table_locks; -disconnect con1; - - ---echo '#--------------------FN_DYNVARS_048_02-------------------------#' -########################################################### -# Begin the functionality Testing of innodb_table_locks # -########################################################### - -#============================================================================== ---echo '----check when innodb_table_locks = ON and autocommit = OFF---' -#============================================================================== ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -CREATE TABLE t1 (a INT) ENGINE=INNODB; - -SET @@autocommit = OFF; -SET @@innodb_table_locks = ON; - -BEGIN; -INSERT INTO t1 VALUES(1); -SELECT * FROM t1 FOR UPDATE; - ---echo 'CONNECTION con2' -CONNECTION con2; -SET @@innodb_table_locks = ON; -SET @@autocommit = OFF; -send LOCK TABLES t1 WRITE; - ---echo 'CONNECTION default' -CONNECTION default; -COMMIT; - ---echo 'CONNECTION con2' -CONNECTION con2; -UNLOCK tables; - -DROP TABLE t1; -disconnect con2; - - -########################################################## -# End of functionality Testing for innodb_table_locks # -########################################################## - - diff --git a/mysql-test/t/innodb_thread_concurrency_basic.test b/mysql-test/t/innodb_thread_concurrency_basic.test deleted file mode 100644 index d30ec214f4a..00000000000 --- a/mysql-test/t/innodb_thread_concurrency_basic.test +++ /dev/null @@ -1,151 +0,0 @@ -################# mysql-test\t\innodb_thread_concurrency_basic.test ########### -# # -# Variable Name: innodb_thread_concurrency # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 0 # -# Range: 0-1000 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description:Test Cases of Dynamic System Variable innodb_thread_concurrency # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_thread_concurrency TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of innodb_thread_concurrency in a temporary variable # -################################################################################ - - -SET @global_start_value = @@global.innodb_thread_concurrency; -SELECT @global_start_value; - - - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_thread_concurrency # -######################################################################## - - - -SET @@global.innodb_thread_concurrency = 0; -SET @@global.innodb_thread_concurrency = DEFAULT; -SELECT @@global.innodb_thread_concurrency; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -############################################################################### -# Check if innodb_thread_concurrency can be accessed with and without @@ sign # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET innodb_thread_concurrency = 1; -SELECT @@innodb_thread_concurrency; - - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_thread_concurrency; - - -SET global innodb_thread_concurrency = 0; -SELECT @@global.innodb_thread_concurrency; - - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_thread_concurrency to a valid value # -########################################################################## - - -SET @@global.innodb_thread_concurrency = 0; -SELECT @@global.innodb_thread_concurrency; - -SET @@global.innodb_thread_concurrency = 1; -SELECT @@global.innodb_thread_concurrency; -SET @@global.innodb_thread_concurrency = 1000; -SELECT @@global.innodb_thread_concurrency; - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_thread_concurrency to invalid value # -########################################################################### - -SET @@global.innodb_thread_concurrency = -1; -SELECT @@global.innodb_thread_concurrency; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_thread_concurrency = "T"; -SELECT @@global.innodb_thread_concurrency; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_thread_concurrency = "Y"; -SELECT @@global.innodb_thread_concurrency; - - -SET @@global.innodb_thread_concurrency = 1001; -SELECT @@global.innodb_thread_concurrency; - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_thread_concurrency = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_thread_concurrency'; -SELECT @@global.innodb_thread_concurrency; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_thread_concurrency'; - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_thread_concurrency = OFF; -SELECT @@global.innodb_thread_concurrency; - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_thread_concurrency = ON; -SELECT @@global.innodb_thread_concurrency; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.innodb_thread_concurrency = TRUE; -SELECT @@global.innodb_thread_concurrency; -SET @@global.innodb_thread_concurrency = FALSE; -SELECT @@global.innodb_thread_concurrency; - -############################## -# Restore initial value # -############################## - -SET @@global.innodb_thread_concurrency = @global_start_value; -SELECT @@global.innodb_thread_concurrency; - -############################################################### -# END OF innodb_thread_concurrency TESTS # -############################################################### diff --git a/mysql-test/t/insert_id_basic.test b/mysql-test/t/insert_id_basic.test deleted file mode 100644 index cfae87095bc..00000000000 --- a/mysql-test/t/insert_id_basic.test +++ /dev/null @@ -1,192 +0,0 @@ -############## mysql-test\t\insert_id_basic.test ############### -# # -# Variable Name: insert_id # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:- # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable insert_id # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -################################################################ -# START OF insert_id TESTS # -################################################################ - - -################################################################ -# Saving initial value of insert_id in a temporary variable # -################################################################ - -SET @start_value = @@session.insert_id; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_051_01------------------------#' -################################################################# -# Display the DEFAULT value of insert_id # -################################################################# - -SET @@session.insert_id = 99; -# SET @@session.insert_id = DEFAULT; ---echo 'Variable is giving error on assigning Default value'; -SELECT @@session.insert_id; - - ---echo '#---------------------FN_DYNVARS_051_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@session.insert_id = @start_value; -SELECT @@session.insert_id = 0; - - ---echo '#--------------------FN_DYNVARS_051_03------------------------#' -################################################################# -# Change the value of insert_id to a valid value # -################################################################# - -SET @@session.insert_id = 0; -SELECT @@session.insert_id; -SET @@session.insert_id = 1099; -SELECT @@session.insert_id; -SET @@session.insert_id = 1800; -SELECT @@session.insert_id; -SET @@session.insert_id = 65535; -SELECT @@session.insert_id; - - ---echo '#--------------------FN_DYNVARS_051_04-------------------------#' -#################################################################### -# Change the value of insert_id to invalid value # -#################################################################### - -SET @@session.insert_id = -1; -SELECT @@session.insert_id; -SET @@session.insert_id = 100000000000; -SELECT @@session.insert_id; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.insert_id = 10000.01; -SELECT @@session.insert_id; -SET @@session.insert_id = -1024; -SELECT @@session.insert_id; -SET @@session.insert_id = 42949672950; -SELECT @@session.insert_id; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.insert_id = ON; -SELECT @@session.insert_id; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.insert_id = 'test'; -SELECT @@session.insert_id; - - ---echo '#-------------------FN_DYNVARS_051_05----------------------------#' -################################################################### -# Test if accessing global insert_id gives error # -################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.insert_id = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.insert_id; - - ---echo '#----------------------FN_DYNVARS_051_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.insert_id = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='insert_id'; - -SELECT @@session.insert_id = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='insert_id'; - - ---echo '#-------------------FN_DYNVARS_051_07----------------------------#' -###################################################################### -# Test if accessing GLOBAL identity gives error # -###################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.insert_id = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.insert_id; - - ---echo '#---------------------FN_DYNVARS_051_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.insert_id = TRUE; -SELECT @@session.insert_id; -SET @@session.insert_id = FALSE; -SELECT @@session.insert_id; - - ---echo '#---------------------FN_DYNVARS_051_09----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@session.insert_id = 1; -SELECT @@insert_id = @@session.insert_id; -SELECT @@session.insert_id = @@local.insert_id; - - ---echo '#---------------------FN_DYNVARS_051_10----------------------#' -################################################################### -# Check if insert_id can be accessed with and without @@ sign # -################################################################### - - -SET insert_id = 1; -SELECT @@insert_id; ---Error ER_PARSE_ERROR -SET local.insert_id = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.insert_id; ---Error ER_PARSE_ERROR -SET session.insert_id = 1; ---Error ER_UNKNOWN_TABLE -SELECT session.insert_id; ---Error ER_BAD_FIELD_ERROR -SELECT insert_id = @@session.insert_id; - - -############################## -# Restore initial value # -############################## - -SET @@session.insert_id = @start_value; -SELECT @@session.insert_id; - - -################################################################# -# END OF insert_id TESTS # -################################################################# - diff --git a/mysql-test/t/insert_id_func.test b/mysql-test/t/insert_id_func.test deleted file mode 100644 index d7103f806bd..00000000000 --- a/mysql-test/t/insert_id_func.test +++ /dev/null @@ -1,113 +0,0 @@ -################### mysql-test\t\insert_id_func.test ########################## -# # -# Variable Name: insert_id # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:- # -# Range: - # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable insert_id # -# that checks the functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table t1 ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - ---echo '#--------------------FN_DYNVARS_051_01-------------------------#' -####################################################################### -# Setting initial value of insert_id and verifying its behavior # -####################################################################### - ---echo ## Setting value of variable to 100 ## -SET @@session.insert_id = 100; -SELECT @@session.insert_id; - ---echo ## Inserting some rows in table ## -INSERT into t1(name) values('Record_1'); -INSERT into t1(name) values('Record_2'); - ---echo ## Verifying rows in table ## -SELECT * from t1; -SELECT @@session.insert_id; - -INSERT into t1(name) values('Record_3'); - - - ---echo '#--------------------FN_DYNVARS_051_02-------------------------#' -########################################################## -# Verifying value of insert_id with new connection # -########################################################## - ---echo ## Creating & Connecting new connection test_con1 ## -connect (test_con1, localhost, root,,); -connection test_con1; - ---echo ## Setting value of insert_id to 50 ## -SET @@session.insert_id = 50; -SELECT @@session.insert_id; - ---echo ## Inserting rows in table t1 ## -INSERT into t1(name) values('Record_4'); -INSERT into t1(name) values('Record_5'); -INSERT into t1(name) values('Record_6'); - -SELECT * from t1; - ---echo 'Bug#35376 Value of insert_id automatically resets to 0 after inserting ---echo ' 1st row' - ---echo '#--------------------FN_DYNVARS_051_03-------------------------#' -############################################################################# -# Now verifying some new value of insert_id with second new connection # -############################################################################# - ---echo ## Creating and switching to new connection test_con2 ## -connect (test_con2, localhost, root,,); -connection test_con2; - ---echo ## Setting session value of variable to 25 ## -SET @@session.insert_id = 25; - ---echo ## Inserting some rows in table ## -INSERT into t1(name) values('Record_7'); -INSERT into t1(name) values('Record_8'); - ---echo ## Verifying data in table t1 ## -SELECT * from t1; - - ---echo ## Dropping table t1 ## -drop table t1; - ---echo ## Disconnecting connections ## -disconnect test_con1; -disconnect test_con2; - - - - - diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 67f21731afe..de38ae0b0d3 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -76,7 +76,7 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100; SELECT * FROM t1; INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; SELECT * FROM t1; ---error 1052 +--error ER_NON_UNIQ_ERROR INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a); SELECT *, VALUES(a) FROM t1; @@ -95,9 +95,9 @@ insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ; select * from t1; insert into t1 select 1 on duplicate key update a=2; select * from t1; ---error 1052 +--error ER_NON_UNIQ_ERROR insert into t1 select a from t1 on duplicate key update a=a+1 ; ---error 1052 +--error ER_NON_UNIQ_ERROR insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ; drop table t1; @@ -171,13 +171,13 @@ SET SQL_MODE = 'TRADITIONAL'; CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); ---error 1364 +--error ER_NO_DEFAULT_FOR_FIELD INSERT INTO t1 (a) VALUES (1); ---error 1364 +--error ER_NO_DEFAULT_FOR_FIELD INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b; ---error 1364 +--error ER_NO_DEFAULT_FOR_FIELD INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b; SELECT * FROM t1; @@ -278,7 +278,7 @@ INSERT INTO t1 (id,c1) VALUES (1,10); SELECT * FROM t1; CREATE TABLE t2 (id INT, c1 INT); INSERT INTO t2 VALUES (1,NULL), (2,2); ---error 1048 +--error ER_BAD_NULL_ERROR INSERT INTO t1 (id,c1) SELECT 1,NULL ON DUPLICATE KEY UPDATE c1=NULL; SELECT * FROM t1; @@ -290,6 +290,7 @@ INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2 SELECT * FROM t1; DROP TABLE t1; +DROP TABLE t2; # # Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it diff --git a/mysql-test/t/interactive_timeout_basic.test b/mysql-test/t/interactive_timeout_basic.test deleted file mode 100644 index 0c1a6716348..00000000000 --- a/mysql-test/t/interactive_timeout_basic.test +++ /dev/null @@ -1,207 +0,0 @@ -############## mysql-test\t\interactive_timeout_basic.test ############### -# # -# Variable Name: interactive_timeout # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:28800 # -# Minvalue: 1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable interactive_timeout # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -################################################################### -# START OF interactive_timeout TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.interactive_timeout; -SELECT @start_global_value; -SET @start_session_value = @@session.interactive_timeout; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_052_01-------------------------#' -################################################################### -# Display the DEFAULT value of interactive_timeout # -################################################################### - -SET @@global.interactive_timeout = 100; -SET @@global.interactive_timeout = DEFAULT; -SELECT @@global.interactive_timeout; - -SET @@session.interactive_timeout = 200; -SET @@session.interactive_timeout = DEFAULT; -SELECT @@session.interactive_timeout; - - ---echo '#--------------------FN_DYNVARS_052_02-------------------------#' -################################################################### -# Check the DEFAULT value of interactive_timeout # -################################################################### - -SET @@global.interactive_timeout = DEFAULT; -SELECT @@global.interactive_timeout = 28800; - -SET @@session.interactive_timeout = DEFAULT; -SELECT @@session.interactive_timeout = 28800; - - ---echo '#--------------------FN_DYNVARS_052_03-------------------------#' -############################################################################# -# Change the value of interactive_timeout to a valid value for GLOBAL Scope # -############################################################################# - -SET @@global.interactive_timeout = 1; -SELECT @@global.interactive_timeout; -SET @@global.interactive_timeout = 60020; -SELECT @@global.interactive_timeout; -SET @@global.interactive_timeout = 65535; -SELECT @@global.interactive_timeout; - - ---echo '#--------------------FN_DYNVARS_052_04-------------------------#' -############################################################################## -# Change the value of interactive_timeout to a valid value for SESSION Scope # -############################################################################## - -SET @@session.interactive_timeout = 1; -SELECT @@session.interactive_timeout; -SET @@session.interactive_timeout = 50050; -SELECT @@session.interactive_timeout; -SET @@session.interactive_timeout = 65535; -SELECT @@session.interactive_timeout; - - ---echo '#------------------FN_DYNVARS_052_05-----------------------#' -############################################################### -# Change the value of interactive_timeout to an invalid value # -############################################################### - -SET @@global.interactive_timeout = 0; -SELECT @@global.interactive_timeout; -SET @@global.interactive_timeout = -1024; -SELECT @@global.interactive_timeout; -SET @@global.interactive_timeout = 1000000000; -SELECT @@global.interactive_timeout; ---Error ER_PARSE_ERROR -SET @@global.interactive_timeout = 65530.34.; -SELECT @@global.interactive_timeout; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.interactive_timeout = test; -SELECT @@global.interactive_timeout; - -SET @@session.interactive_timeout = 0; -SELECT @@session.interactive_timeout; -SET @@session.interactive_timeout = -2; -SELECT @@session.interactive_timeout; ---Error ER_PARSE_ERROR -SET @@session.interactive_timeout = 65530.34.; -SET @@session.interactive_timeout = 100000000; -SELECT @@session.interactive_timeout; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.interactive_timeout = test; -SELECT @@session.interactive_timeout; - - ---echo '#------------------FN_DYNVARS_052_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.interactive_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='interactive_timeout'; - ---echo '#------------------FN_DYNVARS_052_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.interactive_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='interactive_timeout'; - - ---echo '#------------------FN_DYNVARS_052_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.interactive_timeout = TRUE; -SELECT @@global.interactive_timeout; -SET @@global.interactive_timeout = FALSE; -SELECT @@global.interactive_timeout; - - ---echo '#---------------------FN_DYNVARS_052_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.interactive_timeout = 10; -SELECT @@interactive_timeout = @@global.interactive_timeout; - - ---echo '#---------------------FN_DYNVARS_052_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@interactive_timeout = 100; -SELECT @@interactive_timeout = @@local.interactive_timeout; -SELECT @@local.interactive_timeout = @@session.interactive_timeout; - - ---echo '#---------------------FN_DYNVARS_052_11----------------------#' -############################################################################## -# Check if interactive_timeout can be accessed with and without @@ sign # -############################################################################## - -SET interactive_timeout = 1; -SELECT @@interactive_timeout; ---Error ER_UNKNOWN_TABLE -SELECT local.interactive_timeout; ---Error ER_UNKNOWN_TABLE -SELECT session.interactive_timeout; ---Error ER_BAD_FIELD_ERROR -SELECT interactive_timeout = @@session.interactive_timeout; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.interactive_timeout = @start_global_value; -SELECT @@global.interactive_timeout; -SET @@session.interactive_timeout = @start_session_value; -SELECT @@session.interactive_timeout; - - -######################################################## -# END OF interactive_timeout TESTS # -######################################################## - diff --git a/mysql-test/t/interactive_timeout_func.test b/mysql-test/t/interactive_timeout_func.test deleted file mode 100644 index e3a210bf508..00000000000 --- a/mysql-test/t/interactive_timeout_func.test +++ /dev/null @@ -1,70 +0,0 @@ -############## mysql-test\t\interactive_timeout_func.test ##################### -# # -# Variable Name: interactive_timeout # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:28800 # -# Minvalue: 1 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable interactive_timeout # -# that checks the functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - - ---disable_warnings -drop table if exists t1; ---enable_warnings - -############################## -# Creating two new tables # -############################## - ---echo ## Creating new table t1 ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - - ---echo '#--------------------FN_DYNVARS_052_01-------------------------#' -####################################################################### -# Setting initial value of interactive_timeout to 1 and verifying its -# behavior -####################################################################### - ---echo ## Setting initial value of variable to 1 ## -SET @@global.interactive_timeout = 1; - ---echo ## Creating new interactive connection test_con1 ## -connect (test_con1, localhost, root,); -connection test_con1; - ---echo ## Inserting record in table ## -INSERT into t1(name) values('Record_1'); - ---echo ## Setting session value of interactive_timeout ## -SET @@session.interactive_timeout = 1; - ---echo ## Verifying values of variable ## -SELECT @@session.interactive_timeout; -SELECT @@global.interactive_timeout; - ---echo ## Using sleep to check timeout ## -sleep 5; -SELECT * from t1; - ---echo 'Bug#35377: Error should appear here because interactive_timeout value'; ---echo 'is 1 and connection remains idle for 5 secs'; - -INSERT into t1(name) values('Record_2'); diff --git a/mysql-test/t/keep_files_on_create_basic.test b/mysql-test/t/keep_files_on_create_basic.test deleted file mode 100644 index a855f56c863..00000000000 --- a/mysql-test/t/keep_files_on_create_basic.test +++ /dev/null @@ -1,222 +0,0 @@ -############## mysql-test\t\keep_files_on_create_basic.test ################### -# # -# Variable Name: keep_files_on_create # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: OFF # -# Range: # -# # -# # -# Creation Date: 2008-02-11 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable keep_files_on_create # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_keep_files_on_create # -# # -############################################################################### - ---source include/load_sysvars.inc - -#################################################################### -# START OF keep_files_on_create TESTS # -#################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.keep_files_on_create; -SELECT @start_global_value; -SET @start_session_value = @@session.keep_files_on_create; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_054_01-------------------------#' -######################################################################## -# Display the DEFAULT value of keep_files_on_create # -######################################################################## - -SET @@global.keep_files_on_create = ON; -SET @@global.keep_files_on_create = DEFAULT; -SELECT @@global.keep_files_on_create; - -SET @@session.keep_files_on_create = ON; -SET @@session.keep_files_on_create = DEFAULT; -SELECT @@session.keep_files_on_create; - - ---echo '#--------------------FN_DYNVARS_054_02-------------------------#' -######################################################################## -# Check the DEFAULT value of keep_files_on_create # -######################################################################## - -SET @@global.keep_files_on_create = DEFAULT; -SELECT @@global.keep_files_on_create = 'OFF'; - -SET @@session.keep_files_on_create = DEFAULT; -SELECT @@session.keep_files_on_create = 'OFF'; - - ---echo '#--------------------FN_DYNVARS_054_03-------------------------#' -############################################################################## -# Change the value of keep_files_on_create to a valid value for GLOBAL Scope # -############################################################################## - -SET @@global.keep_files_on_create = ON; -SELECT @@global.keep_files_on_create; -SET @@global.keep_files_on_create = OFF; -SELECT @@global.keep_files_on_create; -SET @@global.keep_files_on_create = 0; -SELECT @@global.keep_files_on_create; -SET @@global.keep_files_on_create = 1; -SELECT @@global.keep_files_on_create; -SET @@global.keep_files_on_create = TRUE; -SELECT @@global.keep_files_on_create; -SET @@global.keep_files_on_create = FALSE; -SELECT @@global.keep_files_on_create; - - - ---echo '#--------------------FN_DYNVARS_054_04-------------------------#' -############################################################################### -# Change the value of keep_files_on_create to a valid value for SESSION Scope # -############################################################################### - -SET @@session.keep_files_on_create = ON; -SELECT @@session.keep_files_on_create; -SET @@session.keep_files_on_create = OFF; -SELECT @@session.keep_files_on_create; -SET @@session.keep_files_on_create = 0; -SELECT @@session.keep_files_on_create; -SET @@session.keep_files_on_create = 1; -SELECT @@session.keep_files_on_create; -SET @@session.keep_files_on_create = TRUE; -SELECT @@session.keep_files_on_create; -SET @@session.keep_files_on_create = FALSE; -SELECT @@session.keep_files_on_create; - - ---echo '#------------------FN_DYNVARS_054_05-----------------------#' -################################################################ -# Change the value of keep_files_on_create to an invalid value # -################################################################ - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = 'ONN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = "OFFF"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = TTRUE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = FELSE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = -1024; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = 65536; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = 65530.34; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.keep_files_on_create = test; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.keep_files_on_create = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.keep_files_on_create = ONF; - -SET @@session.keep_files_on_create = OF; -SELECT @@session.keep_files_on_create; ---echo 'Bug# 34828: FN_DYNVARS_054_05 - OF is also working as OFF and no error is coming'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.keep_files_on_create = 'OFN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.keep_files_on_create = -2; ---Error ER_PARSE_ERROR -SET @@session.keep_files_on_create = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.keep_files_on_create = 65550; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.keep_files_on_create = test; -SELECT @@session.keep_files_on_create; - - ---echo '#------------------FN_DYNVARS_054_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.keep_files_on_create = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='keep_files_on_create'; - ---echo '#------------------FN_DYNVARS_054_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.keep_files_on_create = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='keep_files_on_create'; - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -############################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -############################################################################### - -SET @@keep_files_on_create = OFF; -SET @@global.keep_files_on_create = ON; -SELECT @@keep_files_on_create = @@global.keep_files_on_create; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@keep_files_on_create = ON; -SELECT @@keep_files_on_create = @@local.keep_files_on_create; -SELECT @@local.keep_files_on_create = @@session.keep_files_on_create; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################### -# Check if keep_files_on_create can be accessed with and without @@ sign # -############################################################################### - -SET keep_files_on_create = 1; -SELECT @@keep_files_on_create; ---Error ER_UNKNOWN_TABLE -SELECT local.keep_files_on_create; ---Error ER_UNKNOWN_TABLE -SELECT session.keep_files_on_create; ---Error ER_BAD_FIELD_ERROR -SELECT keep_files_on_create = @@session.keep_files_on_create; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.keep_files_on_create = @start_global_value; -SELECT @@global.keep_files_on_create; -SET @@session.keep_files_on_create = @start_session_value; -SELECT @@session.keep_files_on_create; - - -######################################################### -# END OF keep_files_on_create TESTS # -######################################################### - diff --git a/mysql-test/t/key_buffer_size_func.test b/mysql-test/t/key_buffer_size_func.test deleted file mode 100644 index 05c591678dc..00000000000 --- a/mysql-test/t/key_buffer_size_func.test +++ /dev/null @@ -1,100 +0,0 @@ -################### mysql-test\t\key_buffer_size_func.test #################### -# # -# Variable Name: key_buffer_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 131072 # -# Range:8-4294967295 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable key_buffer_size # -# that checks the functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table t1 ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -rollno int NOT NULL, -name VARCHAR(30) -); - -FLUSH STATUS; - ---echo '#--------------------FN_DYNVARS_055_01-------------------------#' -######################################################################## -# Setting initial value of key_buffer_size, inserting some rows -# & creating 2 new connections -######################################################################## - ---echo ## Setting initial value of variable to 131072 ## -SET @@global.key_buffer_size = 131072; - - ---echo ## Creating two new connections ## -CONNECT (test_con1,localhost,root,,); -CONNECT (test_con2,localhost,root,,); - - ---echo '#--------------------FN_DYNVARS_055_02-------------------------#' -############################################################################### -# Verifying initial behavior of variable by concatinating values greater than 4 -############################################################################### - ---echo ## Connecting with connection test_con1 ## -CONNECTION test_con1; -SELECT @@global.key_buffer_size; - - ---echo ## Inserting some rows in table ## -INSERT into t1(rollno, name) values(1, 'Record_1'); -INSERT into t1(rollno, name) values(2, 'Record_2'); -INSERT into t1(rollno, name) values(1, 'Record_3'); -INSERT into t1(rollno, name) values(3, 'Record_4'); -INSERT into t1(rollno, name) values(1, 'Record_5'); -INSERT into t1(rollno, name) values(3, 'Record_6'); -INSERT into t1(rollno, name) values(4, 'Record_7'); -INSERT into t1(rollno, name) values(4, 'Record_8'); -INSERT into t1(rollno, name) values(4, 'Record_9'); -INSERT into t1(rollno, name) values(4, 'Record_10'); - ---echo ## Verifying status of reading & writing variables ## -# Disabled due to differences in results -#show status like 'Key%'; - ---echo ## Switching to connection test_con2 ## -connection test_con2; - ---echo ## Verifying status of reading & writing variables ## -# Disabled due to differences in results -#show status like 'Key%'; - -############################################################ -# Disconnecting all connection & dropping table # -############################################################ - ---echo ## Dropping table ## -DROP table if exists t1; - ---echo ## Disconnecting both the connections ## -DISCONNECT test_con2; -DISCONNECT test_con1; - - diff --git a/mysql-test/t/last_insert_id_func-master.opt b/mysql-test/t/last_insert_id_func-master.opt deleted file mode 100644 index 66f581b56d0..00000000000 --- a/mysql-test/t/last_insert_id_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---innodb - diff --git a/mysql-test/t/last_insert_id_func.test b/mysql-test/t/last_insert_id_func.test deleted file mode 100644 index 2309c539bd9..00000000000 --- a/mysql-test/t/last_insert_id_func.test +++ /dev/null @@ -1,147 +0,0 @@ -################# mysql-test\t\last_insert_id_func.test ####################### -# # -# Variable Name: last_insert_id # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: - # -# Range: - # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable key_buffer_size # -# that checks the functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -) ENGINE = INNODB; - ---echo '#--------------------FN_DYNVARS_059_01-------------------------#' -####################################################################### -# Setting initial value of last_insert_id and verifying its behavior # -####################################################################### - ---echo ## Verifying initial value of ## -SELECT @@session.last_insert_id; - ---echo ## Inserting records in table t1 ## -INSERT into t1(name) values('Record_1'); -INSERT into t1(name) values('Record_2'); -SELECT * from t1; - ---echo ## Verifying value of variable after inserting some rows ## -SELECT @@session.last_insert_id = 2; - - ---echo '#--------------------FN_DYNVARS_059_02-------------------------#' -################################################################################# -# Verifying value of last_insert_id with new connection without committing rows # -################################################################################# - ---echo ## Creating & connecting to new connection test_con1 ## -connect (test_con1, localhost, root,,); -connection test_con1; - -SET @@autocommit = 0; - ---echo ## Verifying initial value of variable in new connection ## -SELECT @@session.last_insert_id; - ---echo ## Inserting rows in table t1 ## -START TRANSACTION; -INSERT into t1(name) values('Record_3'); -INSERT into t1(name) values('Record_4'); -INSERT into t1(name) values('Record_5'); - ---echo ## Verifying value of variable without committing rows ## -SELECT @@session.last_insert_id; - ---echo '#--------------------FN_DYNVARS_059_03-------------------------#' -######################################################################### -# Now verifying value of last_insert_id with second new connection # -######################################################################### - ---echo ## Creating & connecting to new connection test_con2 ## -connect (test_con2, localhost, root,,); -connection test_con2; - ---echo ## Inserting values through new connection ## -INSERT into t1(name) values('Record_6'); -INSERT into t1(name) values('Record_7'); - -SELECT * from t1; - ---echo ## Verifying value of variable in second connection ## -SELECT @@last_insert_id; - - - ---echo '#--------------------FN_DYNVARS_059_04-------------------------#' -############################################################################ -# Now verifying value of last_insert_id after committing rows in -# connection # 1 -############################################################################ - ---echo ## Switching to test_con1 ## -connection test_con1; - ---echo ## Verifying all records in table & value of variable ## -SELECT * from t1; -SELECT @@session.last_insert_id; - ---echo ## Commiting records in table ## -COMMIT; -SELECT @@session.last_insert_id; - - ---echo ## Switching to test_con2 & verifying value of variable in it ## -connection test_con2; -SELECT @@session.last_insert_id; - - - ---echo '#--------------------FN_DYNVARS_059_05-------------------------#' -##################################################################### -# Verify value after explicitly setting value of variable # -##################################################################### - ---echo ## Setting value of variable ## -SET @@session.last_insert_id = 100; -SELECT @@session.last_insert_id; - ---echo ## Inserting new record and verifying variable's effect on it ## -INSERT into t1(name) values('Record_8'); -SELECT @@session.last_insert_id; - ---echo ## Dropping table t1 ## -drop table t1; - ---echo ## Disconnecting both the connections ## -disconnect test_con1; -disconnect test_con2; - - - - - diff --git a/mysql-test/t/lc_time_names_basic.test b/mysql-test/t/lc_time_names_basic.test deleted file mode 100644 index d0aa0c56937..00000000000 --- a/mysql-test/t/lc_time_names_basic.test +++ /dev/null @@ -1,714 +0,0 @@ -###################### mysql-test\t\lc_time_names_basic.test ################## -# # -# Variable Name: lc_time_names # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: en_ZA # -# Range: NA # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable lc_time_names # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -################################################### -## START OF lc_time_names TESTS ## -################################################### - -############################################################# -# Save initial value # -############################################################# - -SET @global_start_value = @@global.lc_time_names; -SELECT @global_start_value; -# Save initial session value -SET @session_start_value = @@lc_time_names; -SELECT @session_start_value; -# now save using local access -SET @session_start_value = @@local.lc_time_names; -SELECT @session_start_value; -# save using default access (session) -SET @session_start_value = @@session.lc_time_names; -SELECT @session_start_value; - - ---echo '#--------------------FN_DYNVARS_060_01------------------#' -############################################################################### -# Test Variable access and assignment with and withoud @@ # -############################################################################### - -# select without @@ ---error ER_BAD_FIELD_ERROR -SELECT lc_time_names; -# assign value without @@ -SET lc_time_names=ar_AE; -SELECT @@session.lc_time_names; -# assign global variable without @@ ---Error ER_PARSE_ERROR -SET global.lc_time_names=ar_AE; -# using another syntax for accessing session variable -SET session lc_time_names=ar_AE; -# accessing variable with scope the wrong way ---Error ER_BAD_FIELD_ERROR -SELECT session lc_time_names; -# using another syntax for accessing dynamic variable -SET global lc_time_names=ar_AE; ---Error ER_BAD_FIELD_ERROR -SELECT global lc_time_names; - - ---echo '#--------------------FN_DYNVARS_060_02-------------------------#' -############################################################################### -# Check the DEFAULT value of lc_time_names for session and global # -############################################################################### - -SET @@lc_time_names = en_ZA; -SET @@lc_time_names = DEFAULT; -SELECT @@lc_time_names AS DEFAULT_VALUE; - -SET @@global.lc_time_names = en_ZA; -SET @@global.lc_time_names = DEFAULT; -SELECT @@global.lc_time_names; - ---echo '#--------------------FN_DYNVARS_060_03-------------------------#' -########################################################################## -# see if setting global value changes session value and vice versa # -########################################################################## - -SET @@session.lc_time_names = en_IN; -SELECT @@session.lc_time_names; -SET @@global.lc_time_names = en_NZ; -SELECT @@global.lc_time_names; -SELECT @@session.lc_time_names AS res_is_en_IN; - -SET @@session.lc_time_names = en_AU; -SELECT @@session.lc_time_names; -SELECT @@global.lc_time_names AS res_is_en_NZ; -# composite check -SELECT @@global.lc_time_names=@@session.lc_time_names AS res_is_false; - - ---echo '#--------------------FN_DYNVARS_060_04-------------------------#' -########################################################################### -# Check if accessing variable with and without session point to session -# variable -########################################################################### - -SELECT @@lc_time_names = @@session.lc_time_names AS res; -SELECT @@lc_time_names = @@local.lc_time_names AS res; - ---echo '#--------------------FN_DYNVARS_060_05-------------------------#' -########################################################################### -# Check if combining character set works # -########################################################################### ---Error ER_BAD_FIELD_ERROR -SET @@lc_time_names = en_US | en_GB ; - ---echo '#--------------------FN_DYNVARS_060_06-------------------------#' -########################################################################### -# Change the value of lc_time_names to a valid value for session # -########################################################################### -SET @@session.lc_time_names=ar_AE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_BH; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_DZ; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_EG; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_IN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_IQ; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_JO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_KW; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_LB; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_LY; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_MA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_OM; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_QA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_SA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_SD; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_SY; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_TN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ar_YE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=be_BY; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=bg_BG; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ca_ES; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=cs_CZ; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=da_DK; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=de_AT; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=de_BE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=de_CH; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=de_DE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=de_LU; -SELECT @@session.lc_time_names; - ---Error ER_UNKNOWN_ERROR -SET @@session.lc_time_names=EE; ---echo 'Bug: The locale for Estonian - Estonia is not supported. It is present'; ---echo 'in manual'; ---echo 'See http://dev.mysql.com/doc/refman/5.1/en/locale-support.html' - -SET @@session.lc_time_names=en_AU; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_CA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_GB; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_IN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_NZ; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_PH; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_US; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_ZA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=en_ZW; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_AR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_BO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_CL; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_CO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_CR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_DO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_EC; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_ES; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_GT; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_HN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_MX; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_NI; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_PA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_PE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_PR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_PY; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_SV; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_US; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_UY; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=es_VE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=eu_ES; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=fi_FI; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=fo_FO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=fr_BE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=fr_CA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=fr_CH; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=fr_FR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=fr_LU; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=gl_ES; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=gu_IN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=he_IL; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=hi_IN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=hr_HR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=hu_HU; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=id_ID; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=is_IS; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=it_CH; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=it_IT; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ja_JP; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ko_KR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=lt_LT; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=lv_LV; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=mk_MK; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=mn_MN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ms_MY; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=nb_NO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=nl_BE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=nl_NL; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=no_NO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=pl_PL; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=pt_BR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=pt_PT; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ro_RO; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ru_RU; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ru_UA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=sk_SK; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=sl_SI; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=sq_AL; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=sr_YU; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=sv_FI; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=sv_SE; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ta_IN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=te_IN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=th_TH; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=tr_TR; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=uk_UA; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=ur_PK; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=vi_VN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=zh_CN; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=zh_HK; -SELECT @@session.lc_time_names; -SET @@session.lc_time_names=zh_TW; -SELECT @@session.lc_time_names; - - ---echo '#--------------------FN_DYNVARS_060_07-------------------------#' -########################################################################## -# Change the value of lc_time_names to a valid value for global # -########################################################################## -SET @@global.lc_time_names=ar_AE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_BH; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_DZ; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_EG; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_IN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_IQ; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_JO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_KW; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_LB; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_LY; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_MA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_OM; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_QA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_SA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_SD; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_SY; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_TN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ar_YE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=be_BY; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=bg_BG; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ca_ES; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=cs_CZ; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=da_DK; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=de_AT; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=de_BE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=de_CH; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=de_DE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=de_LU; -SELECT @@global.lc_time_names; - ---Error ER_UNKNOWN_ERROR -SET @@global.lc_time_names=EE; ---echo 'Bug: The locale for Estonian - Estonia is not supported. It is'; ---echo 'present in manual'; ---echo 'See http://dev.mysql.com/doc/refman/5.1/en/locale-support.html'; - - -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_AU; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_CA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_GB; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_IN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_NZ; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_PH; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_US; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_ZA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=en_ZW; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_AR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_BO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_CL; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_CO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_CR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_DO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_EC; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_ES; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_GT; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_HN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_MX; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_NI; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_PA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_PE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_PR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_PY; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_SV; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_US; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_UY; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=es_VE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=eu_ES; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=fi_FI; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=fo_FO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=fr_BE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=fr_CA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=fr_CH; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=fr_FR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=fr_LU; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=gl_ES; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=gu_IN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=he_IL; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=hi_IN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=hr_HR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=hu_HU; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=id_ID; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=is_IS; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=it_CH; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=it_IT; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ja_JP; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ko_KR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=lt_LT; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=lv_LV; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=mk_MK; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=mn_MN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ms_MY; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=nb_NO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=nl_BE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=nl_NL; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=no_NO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=pl_PL; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=pt_BR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=pt_PT; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ro_RO; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ru_RU; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ru_UA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=sk_SK; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=sl_SI; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=sq_AL; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=sr_YU; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=sv_FI; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=sv_SE; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ta_IN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=te_IN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=th_TH; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=tr_TR; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=uk_UA; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=ur_PK; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=vi_VN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=zh_CN; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=zh_HK; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names=zh_TW; -SELECT @@global.lc_time_names; - - ---echo '#--------------------FN_DYNVARS_060_08-------------------------#' -########################################################################## -# Change the value of lc_time_names to a valid value with uppercase, -# lowercase and mixedcase -########################################################################## - -SET @@lc_time_names = ur_pk; -SELECT @@lc_time_names; -SET @@lc_time_names = UR_PK; -SELECT @@lc_time_names; -SET @@lc_time_names = uR_pK; -SELECT @@lc_time_names; - - ---echo '#--------------------FN_DYNVARS_060_09-------------------------#' -############################################################## -# Check if 0,1,2,3, ... values can be used on variable # -############################################################## - -SET @@lc_time_names = 0; -SELECT @@lc_time_names; -SET @@lc_time_names = 1; -SELECT @@lc_time_names; -SET @@lc_time_names = 2; -SELECT @@lc_time_names; -SET @@lc_time_names = 3; -SELECT @@lc_time_names; -SET @@lc_time_names = 10; -SELECT @@lc_time_names; -SET @@lc_time_names = 50; -SELECT @@lc_time_names; -SET @@lc_time_names = 100; -SELECT @@lc_time_names; -SET @@lc_time_names = 101; -SELECT @@lc_time_names; -SET @@lc_time_names = 107; -SELECT @@lc_time_names; -SET @@lc_time_names = 108; -SELECT @@lc_time_names; - ---Error ER_UNKNOWN_ERROR -SET @@lc_time_names = 109; - - ---echo '#--------------------FN_DYNVARS_060_10-------------------------#' -############################################################################# -# Change the value of lc_time_names to an invalid value for session # -############################################################################# - ---Error ER_UNKNOWN_ERROR -SET @@lc_time_names = en_EN; ---Error ER_UNKNOWN_ERROR -SET @@lc_time_names = US_en; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@lc_time_names = 1.1; ---Error ER_UNKNOWN_ERROR -SET @@lc_time_names = -1; ---Error ER_UNKNOWN_ERROR -SET @@lc_time_names = 'en US'; ---Error ER_UNKNOWN_ERROR -SET @@lc_time_names = 'enUS'; - -SET @@lc_time_names = true; -SELECT @@lc_time_names AS res_with_true; -SET @@lc_time_names = false; -SELECT @@lc_time_names AS res_with_false; - ---Error ER_UNKNOWN_ERROR -SET @@lc_time_names = ON; - - ---echo '#--------------------FN_DYNVARS_060_11-------------------------#' -############################################################################ -# Change the value of lc_time_names to an invalid value for global # -############################################################################ - ---Error ER_UNKNOWN_ERROR -SET @@global.lc_time_names = en_EN; ---Error ER_UNKNOWN_ERROR -SET @@global.lc_time_names = US_en; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.lc_time_names = 1.1; ---Error ER_UNKNOWN_ERROR -SET @@global.lc_time_names = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.lc_time_names = NULL; ---Error ER_UNKNOWN_ERROR -SET @@global.lc_time_names = 'enUS'; - -SET @@global.lc_time_names = true; -SELECT @@global.lc_time_names; -SET @@global.lc_time_names = false; -SELECT @@global.lc_time_names; - ---Error ER_UNKNOWN_ERROR -SET @@global.lc_time_names = ON; - ---echo '#--------------------FN_DYNVARS_060_12-------------------------#' -############################################################################## -# Check if the value in GLOBAL Table matches value in variable # -############################################################################## -SELECT @@global.lc_time_names = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='lc_time_names') AS res; -SET @@global.lc_time_names = 1; -SELECT @@global.lc_time_names; -SELECT @@global.lc_time_names = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='lc_time_names') AS res; - ---echo '#--------------------FN_DYNVARS_060_13-------------------------#' -############################################################################## -# Check if the value in SESSION Table matches value in variable # -############################################################################## -SELECT @@lc_time_names = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='lc_time_names') AS res; -SELECT @@local.lc_time_names = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='lc_time_names') AS res; -SELECT @@session.lc_time_names = (SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='lc_time_names') AS res; - -#################################### -# Restore initial value # -#################################### -SET @@global.lc_time_names = @global_start_value; -SELECT @@global.lc_time_names; -SET @@session.lc_time_names = @session_start_value; -SELECT @@session.lc_time_names; - -############################################################# -# END OF lc_time_names TESTS # -############################################################# diff --git a/mysql-test/t/lc_time_names_func.test b/mysql-test/t/lc_time_names_func.test deleted file mode 100644 index 2c86a597773..00000000000 --- a/mysql-test/t/lc_time_names_func.test +++ /dev/null @@ -1,87 +0,0 @@ -###################### mysql-test\t\lc_time_names_func.test ################## -# # -# Variable Name: lc_time_names # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: en_US # -# Range: NA # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable lc_time_names # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_060_01-------------------------#' -###################################################################### -# Check if setting global lc_time_names is changed in new connection # -###################################################################### - -SET @@global.lc_time_names = "en_CA"; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.lc_time_names; -SELECT @@session.lc_time_names; -SET @@global.lc_time_names = "en_IN"; ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); ---echo 'connection con2' -connection con2; -SELECT @@global.lc_time_names; -SELECT @@session.lc_time_names; -disconnect con2; -disconnect con1; - - ---echo '#--------------------FN_DYNVARS_060_02-------------------------#' -################################################################# -# Begin the functionality Testing of lc_time_names # -################################################################# - ---echo 'connection default' -connection default; - -SET NAMES 'utf8'; - -SET @@session.lc_time_names = 'en_US'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - - -SET @@session.lc_time_names = 'ar_AE'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - -SET @@session.lc_time_names = 'es_ES'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - -SET @@session.lc_time_names = 'fi_FI'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - -SET @@session.lc_time_names = 'gu_IN'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - -SET @@session.lc_time_names = 'it_IT'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - -SET @@session.lc_time_names = 'pt_BR'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - -SET @@session.lc_time_names = 'ur_PK'; -SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12'); - - -# restore default -SET @@global.lc_time_names = "en_US"; - -########################################################## -# End of functionality Testing for lc_time_names # -########################################################## - diff --git a/mysql-test/t/license_basic.test b/mysql-test/t/license_basic.test deleted file mode 100644 index e0c761dc5a5..00000000000 --- a/mysql-test/t/license_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\license_basic.test ############################ -# # -# Variable Name: license # -# Scope: Global # -# Access Type: Static # -# Data Type: string # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable license # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_040_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.license); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_040_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.license=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.license); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_040_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.license = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='license'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.license); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='license'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_040_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@license = @@GLOBAL.license; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_040_05----------------------#' -################################################################################ -# Check if license can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@license); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.license); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.license); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.license); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT license = @@SESSION.license; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 46de411677c..7bfe2491c7c 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -7,25 +7,25 @@ drop table if exists t1, t2; --enable_warnings create table t1 (a date, b date, c date not null, d date); -load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ','; -load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; SELECT * from t1; truncate table t1; -load data infile '../std_data_ln/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); SELECT * from t1; drop table t1; create table t1 (a text, b text); -load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; select concat('|',a,'|'), concat('|',b,'|') from t1; drop table t1; create table t1 (a int, b char(10)); -load data infile '../std_data_ln/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; select * from t1; truncate table t1; -load data infile '../std_data_ln/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; # The empty line last comes from the end line field in the file select * from t1; @@ -63,7 +63,7 @@ drop table t1; # ENCLOSED # create table t1 (a varchar(20), b varchar(20)); -load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); +load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b); select * from t1; drop table t1; @@ -108,44 +108,44 @@ DROP TABLE t1,t2; # create table t1 (a int default 100, b int, c varchar(60)); # we can do something like this -load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b); +load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b); select * from t1; truncate table t1; # we can use filled fields in expressions # we also assigning NULL value to field with non-NULL default here -load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a); +load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set c= if(a is null,"oops",a); select * from t1; truncate table t1; # we even can use variables in set clause, and missed columns will be set # with default values set @c:=123; -load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b); +load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, b) set c= if(@a is null,@c,b); select * from t1; # let us test side-effect of such load -load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b); +load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, @b); select * from t1; select @a, @b; truncate table t1; # Reading of all columns with set -load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 set c=b; +load data infile '../../std_data/rpl_loaddata.dat' into table t1 set c=b; select * from t1; truncate table t1; # now going to test fixed field-row file format -load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow"; +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow"; select * from t1; truncate table t1; # this also should work -load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c)); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c=concat(a,"+",b,"+",@c,"+",b,"+",if(c is null,"NIL",c)); select * from t1; # and this should bark --error 1409 -load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, @b); # Now let us test LOAD DATA with subselect create table t2 (num int primary key, str varchar(10)); insert into t2 values (10,'Ten'), (15,'Fifteen'); truncate table t1; -load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n); +load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n); select * from t1; # @@ -163,7 +163,7 @@ set @@secure_file_priv= 0; # Test "load data" truncate table t1; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---error 1290 +--error ER_OPTION_PREVENTS_STATEMENT, ER_TEXTFILE_NOT_READABLE eval load data infile '$MYSQL_TEST_DIR/t/loaddata.test' into table t1; select * from t1; @@ -264,7 +264,7 @@ CREATE VIEW v2 AS SELECT 1 + 2 AS c0, c1, c2 FROM t1; CREATE VIEW v3 AS SELECT 1 AS d1, 2 AS d2; --echo -LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v1 +LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v1 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' @@ -280,7 +280,7 @@ SELECT * FROM v1; DELETE FROM t1; --echo -LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2 +LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' @@ -297,7 +297,7 @@ DELETE FROM t1; --echo --error ER_LOAD_DATA_INVALID_COLUMN -LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2 +LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' @@ -305,7 +305,7 @@ LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v2 --echo --error ER_NON_UPDATABLE_TABLE -LOAD DATA INFILE '../std_data_ln/bug35469.dat' INTO TABLE v3 +LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v3 FIELDS ESCAPED BY '\\' TERMINATED BY ',' ENCLOSED BY '"' @@ -526,7 +526,8 @@ select @@character_set_filesystem; LOAD DATA INFILE 't@002d1' INTO TABLE t1; SELECT * FROM t1; DROP TABLE t1; -remove_file $MYSQLTEST_VARDIR/master-data/test/t@002d1; +let $MYSQLD_DATADIR= `select @@datadir`; +remove_file $MYSQLD_DATADIR/test/t@002d1; SET character_set_filesystem=default; select @@character_set_filesystem; diff --git a/mysql-test/t/local_infile_basic.test b/mysql-test/t/local_infile_basic.test deleted file mode 100644 index 63f6b0fdb91..00000000000 --- a/mysql-test/t/local_infile_basic.test +++ /dev/null @@ -1,173 +0,0 @@ -############## mysql-test\t\local_infile_basic.test ############################ -# # -# Variable Name: local_infile # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: 1 # -# Valid Values: # -# # -# # -# Creation Date: 2008-02-19 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable "local_infile" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_local_infile # -# # -################################################################################ - ---source include/load_sysvars.inc - -############################################################ -# START OF local_infile TESTS # -############################################################ - - -#################################################################### -# Saving initial value of local_infile in a temporary variable # -#################################################################### - -SET @start_value = @@global.local_infile; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_018_01------------------------#' -#################################################################### -# Display the DEFAULT value of local_infile # -#################################################################### - -SET @@global.local_infile = 0; -SET @@global.local_infile = DEFAULT; -SELECT @@global.local_infile; - ---echo '#---------------------FN_DYNVARS_018_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.local_infile = DEFAULT; -SELECT @@global.local_infile = 1; - - ---echo '#--------------------FN_DYNVARS_018_03------------------------#' -#################################################################### -# Change the value of local_infile to a valid value # -#################################################################### - -SET @@global.local_infile = 0; -SELECT @@global.local_infile; -SET @@global.local_infile = 1; -SELECT @@global.local_infile; - ---echo '#--------------------FN_DYNVARS_018_04-------------------------#' -###################################################################### -# Change the value of local_infile to invalid value # -###################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = 100; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.local_infile = " "; - - ---echo '#-------------------FN_DYNVARS_018_05----------------------------#' -################################################################ -# Test if accessing session local_infile gives error # -################################################################ - ---Error ER_GLOBAL_VARIABLE -SET @@session.local_infile = 1; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.local_infile = 1; - - ---echo '#----------------------FN_DYNVARS_018_06------------------------#' -#################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -#################################################################### - -SELECT @@global.local_infile = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='local_infile'; - - ---echo '#---------------------FN_DYNVARS_018_07----------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@global.local_infile = OFF; -SELECT @@global.local_infile; -SET @@global.local_infile = ON; -SELECT @@global.local_infile; - ---echo '#---------------------FN_DYNVARS_018_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.local_infile = TRUE; -SELECT @@global.local_infile; -SET @@global.local_infile = FALSE; -SELECT @@global.local_infile; - ---echo '#---------------------FN_DYNVARS_018_09----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same global variable # -############################################################################### - -SET @@global.local_infile = 1; -SELECT @@local_infile = @@global.local_infile; - - ---echo '#---------------------FN_DYNVARS_018_10----------------------#' -########################################################################## -# Check if local_infile can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET local_infile = 1; -SELECT @@local_infile; ---Error ER_PARSE_ERROR -SET global.local_infile = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.local_infile; ---Error ER_BAD_FIELD_ERROR -SELECT local_infile = @@session.local_infile; - -############################## -# Restore initial value # -############################## - -SET @@global.local_infile = @start_value; -SELECT @@global.local_infile; - -################################################## -# END OF local_infile TESTS # -################################################## diff --git a/mysql-test/t/local_infile_func.test b/mysql-test/t/local_infile_func.test deleted file mode 100644 index 166149ad9aa..00000000000 --- a/mysql-test/t/local_infile_func.test +++ /dev/null @@ -1,94 +0,0 @@ -############## mysql-test\t\local_infile_func.test ############################ -# # -# Variable Name: local_infile # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: 1 # -# Valid Values: # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable "local_infile" # -# that checks behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_local_infile # -# # -################################################################################ - ---source include/not_embedded.inc - ---echo '#--------------------FN_DYNVARS_037_01-------------------------#' -#################################################################### -# Check if setting local_infile is changed in every new connection # -#################################################################### - -SET @@global.local_infile = 0; - -# con1 will be default connection from now on ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.local_infile; -SET @@global.local_infile = 1; - ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); ---echo 'connection con2' -connection con2; -SELECT @@global.local_infile; -disconnect con2; - - ---echo '#--------------------FN_DYNVARS_037_02-------------------------#' -###################################################### -# Begin the functionality Testing of local_infile # -###################################################### - ---echo 'connection con1' -connection con1; - -#============================================================= ---echo '-----Checking LOAD DATA when local_infile is 1-------' -#============================================================= -SET @@global.local_infile = 1; ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -create table t1(a int); - ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval LOAD DATA LOCAL INFILE -'$MYSQLTEST_VARDIR/std_data_ln/numbers.txt' INTO TABLE test.t1; - -SELECT count(*) from t1; - -#============================================================= ---echo '-----Checking LOAD DATA when local_infile is 0-------' -#============================================================= -SET @@global.local_infile = 0; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -create table t1(a int); - ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---Error ER_NOT_ALLOWED_COMMAND -eval LOAD DATA LOCAL INFILE -'$MYSQLTEST_VARDIR/std_data_ln/numbers.txt' INTO TABLE test.t1; - -SELECT count(*) from t1; - -# clean up and restore -DROP TABLE t1; -SET @@global.local_infile = 1; -###################################################### -# Endo of functionality Testing for local_infile # -###################################################### - diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test index d31b4b7dfb5..754c8f3c378 100644 --- a/mysql-test/t/lock_tables_lost_commit.test +++ b/mysql-test/t/lock_tables_lost_commit.test @@ -1,24 +1,33 @@ -# This is a test for bug 578 +# Test for Bug#578 mysqlimport -l silently fails when binlog-ignore-db is set --- source include/have_innodb.inc +--source include/have_innodb.inc + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con1; --disable_warnings -drop table if exists t1; -create table t1(a int) engine=innodb; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a INT) ENGINE=innodb; --enable_warnings -lock tables t1 write; -insert into t1 values(10); +LOCK TABLES t1 WRITE; +INSERT INTO t1 VALUES(10); disconnect con1; connection con2; # The bug was that, because of the LOCK TABLES, the handler "forgot" to commit, # and the other commit when we write to the binlog was not done because of -# binlog-ignore-db -select * from t1; -drop table t1; +# binlog-ignore-db +SELECT * FROM t1; +DROP TABLE t1; + +connection default; +disconnect con2; # End of 4.1 tests + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/log_basic.test b/mysql-test/t/log_basic.test deleted file mode 100644 index b9a64f8981b..00000000000 --- a/mysql-test/t/log_basic.test +++ /dev/null @@ -1,60 +0,0 @@ -###################### mysql-test\t\log_basic.test ############################ -# # -# Variable Name: log_basic # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable log # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -##################################### -## START OF log TESTS ## -##################################### - ---echo '#--------------------FN_DYNVARS_062_01------------------#' -############################################################# -# Accessing variable # -############################################################# - -SELECT @@global.log AS INIT_VALUE; - -SELECT @@log AS INIT_VALUE; - -SET @@global.general_log = ON; - -SET global general_log = 0; - ---echo 'Bug# 34832: log is a system but it is not accessible using SET @@global.log;' ---echo 'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.' - - ---echo '#--------------------FN_DYNVARS_062_02-------------------------#' -################################################################################### -# Check if the value in GLOBAL Table matches value in variable # -################################################################################### -# We can only access log value from information schema global_variables table -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log'; - -############################################ -# END OF log TESTS # -############################################ diff --git a/mysql-test/t/log_bin_trust_function_creators_basic.test b/mysql-test/t/log_bin_trust_function_creators_basic.test deleted file mode 100644 index 3b8b43e1354..00000000000 --- a/mysql-test/t/log_bin_trust_function_creators_basic.test +++ /dev/null @@ -1,170 +0,0 @@ -############## mysql-test\t\log_bin_trust_function_creators_basic.test ######## -# # -# Variable Name: log_bin_trust_function_creators # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: False # -# Range: # -# # -# # -# Creation Date: 2008-02-11 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable # -# log_bin_trust_function_creators that checks the behavior of # -# this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system # -# -variables.html#option_mysqld_log-bin-trust-function-ceators # -# # -############################################################################### - ---source include/load_sysvars.inc - -#################################################################### -# START OF log_bin_trust_function_creators TESTS # -#################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.log_bin_trust_function_creators; -SELECT @start_global_value; ---echo 'Bug# 34876: TRUE value is coming as Default' ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @start_session_value = @@session.log_bin_trust_function_creators; ---echo 'Bug# 34881: According to documentation the scope of this variable is GLOBAL as well as SESSION too'; - ---echo '#--------------------FN_DYNVARS_063_01-------------------------#' -######################################################################## -# Display the DEFAULT value of log_bin_trust_function_creators # -######################################################################## - -SET @@global.log_bin_trust_function_creators = TRUE; -SET @@global.log_bin_trust_function_creators = DEFAULT; -SELECT @@global.log_bin_trust_function_creators; - - ---echo '#--------------------FN_DYNVARS_063_02-------------------------#' -############################################################################### -# Check the DEFAULT value of log_bin_trust_function_creators # -############################################################################### - -SET @@global.log_bin_trust_function_creators = DEFAULT; -SELECT @@global.log_bin_trust_function_creators = 'FALSE'; - - ---echo '#--------------------FN_DYNVARS_063_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.log_bin_trust_function_creators = ON; -SELECT @@global.log_bin_trust_function_creators; -SET @@global.log_bin_trust_function_creators = OFF; -SELECT @@global.log_bin_trust_function_creators; -SET @@global.log_bin_trust_function_creators = 0; -SELECT @@global.log_bin_trust_function_creators; -SET @@global.log_bin_trust_function_creators = 1; -SELECT @@global.log_bin_trust_function_creators; -SET @@global.log_bin_trust_function_creators = TRUE; -SELECT @@global.log_bin_trust_function_creators; -SET @@global.log_bin_trust_function_creators = FALSE; -SELECT @@global.log_bin_trust_function_creators; - - ---echo '#-------------------FN_DYNVARS_063_04----------------------------#' -############################################################################### -# Test if accessing session log_bin_trust_function_creators gives error # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.log_bin_trust_function_creators = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.log_bin_trust_function_creators; - ---echo '#------------------FN_DYNVARS_063_05-----------------------#' -########################################################################### -# Change the value of log_bin_trust_function_creators to an invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = 'ONN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = "OFFF"; -SET @@global.log_bin_trust_function_creators = OF; - ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = TTRUE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = FELSE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = -1024; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = 65536; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = 65530.34; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_function_creators = test; - ---echo '#------------------FN_DYNVARS_063_06-----------------------#' -############################################################################### -# Check if the value in GLOBAL & SESSION Tables matches value in variable # -############################################################################### - - -SELECT @@global.log_bin_trust_function_creators = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log_bin_trust_function_creators'; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.log_bin_trust_function_creators = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='log_bin_trust_function_creators'; - ---echo '#---------------------FN_DYNVARS_063_07----------------------#' -############################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -############################################################################### - - -SET @@global.log_bin_trust_function_creators = TRUE; -SELECT @@log_bin_trust_function_creators = @@global.log_bin_trust_function_creators; - - ---echo '#---------------------FN_DYNVARS_063_08----------------------#' -################################################################### -# Check if variable can be accessed with and without @@ sign # -################################################################### - -SET @@global.log_bin_trust_function_creators = TRUE; -SELECT @@log_bin_trust_function_creators; ---Error ER_UNKNOWN_TABLE -SELECT local.log_bin_trust_function_creators; ---Error ER_UNKNOWN_TABLE -SELECT session.log_bin_trust_function_creators; ---Error ER_BAD_FIELD_ERROR -SELECT log_bin_trust_function_creators = @@session.log_bin_trust_function_creators; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.log_bin_trust_function_creators = @start_global_value; -SELECT @@global.log_bin_trust_function_creators; - - -######################################################### -# END OF log_bin_trust_function_creators TESTS # -######################################################### - diff --git a/mysql-test/t/log_bin_trust_function_creators_func-master.opt b/mysql-test/t/log_bin_trust_function_creators_func-master.opt deleted file mode 100644 index 2dd562ea1aa..00000000000 --- a/mysql-test/t/log_bin_trust_function_creators_func-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-bin=test.log diff --git a/mysql-test/t/log_bin_trust_function_creators_func.test b/mysql-test/t/log_bin_trust_function_creators_func.test deleted file mode 100644 index db91128b225..00000000000 --- a/mysql-test/t/log_bin_trust_function_creators_func.test +++ /dev/null @@ -1,121 +0,0 @@ -############## mysql-test\t\log_bin_trust_function_creators_func.test ######### -# # -# Variable Name: log_bin_trust_function_creators # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: False # -# Range: # -# # -# # -# Creation Date: 2008-03-11 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable # -# log_bin_trust_function_creators that checks the functionality # -# of this variable in the following ways # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system # -# -variables.html#option_mysqld_log-bin-trust-function-ceators # -# # -############################################################################### - ---disable_warnings -drop table if exists t1; ---enable_warnings - - ---echo '#--------------------FN_DYNVARS_063_01-------------------------#' -######################################################################## -# Setting initial value of variable to 0 and verifying whether user -# is allowed to create function or not. -######################################################################## - ---echo ## Creating new user tt ## -CREATE user tt@localhost; - ---echo ## Setting value of variable to 0 ## -SET @@global.log_bin_trust_function_creators = 0; - ---echo ## Creating new table t2 ## -create table t2 (a INT); - ---echo ## Creating & connecting with new connection test_con1 ## -connect (test_con1,localhost,tt,,); -connection test_con1; - -SELECT @@log_bin_trust_function_creators; -SELECT @@sql_log_bin; - ---echo ## Creating new function f1 ## -delimiter |; -CREATE FUNCTION f1(a INT) RETURNS INT -BEGIN - IF (a < 3) THEN - INSERT INTO t2 VALUES (a); - END IF; - RETURN 1; -END| -delimiter ;| - ---echo 'Bug: Create Function should give error here because non-super user'; ---echo 'is creating function here'; - ---echo ## Creating new table t1 ## -CREATE TABLE t1 (a INT); - ---echo ## Inserting some records in t1 ## -INSERT INTO t1 VALUES (1),(2),(3); -SELECT f1(a) FROM t1; - ---echo ## Dropping function f1 & table t1 ## -drop function f1; -drop table t1; - ---echo '#--------------------FN_DYNVARS_063_02-------------------------#' -######################################################################## -# Setting initial value of variable to 1 and verifying whether user -# is allowed to create function or not. -######################################################################## - ---echo ## Switching to default connection ## -connection default; - ---echo ## Setting value of variable to 1 ## -SET @@global.log_bin_trust_function_creators = 1; - ---echo ## Creating and connecting to new connection test_con2 ## -connect (test_con2,localhost,tt,,); -connection test_con2; - ---echo ## Verifying value of variable ## -SELECT @@log_bin_trust_function_creators; -SELECT @@sql_log_bin; - ---echo ## Creating new function f1 ## -delimiter |; -CREATE FUNCTION f1(a INT) RETURNS INT -BEGIN - IF (a < 3) THEN - INSERT INTO t2 VALUES (a); - END IF; - RETURN 1; -END| -delimiter ;| - ---echo ## Creating new table t1 ## -CREATE TABLE t1 (a INT); - ---echo ## Inserting values in table t1 ## -INSERT INTO t1 VALUES (1),(2),(3); -SELECT f1(a) FROM t1; - ---echo ## Dropping function f1 ## -drop function f1; - ---echo ## Dropping table t1 & t2 ## -drop table t1,t2; - ---echo ## Disconnecting both the connections ## -disconnect test_con2; - diff --git a/mysql-test/t/log_bin_trust_routine_creators_basic.test b/mysql-test/t/log_bin_trust_routine_creators_basic.test deleted file mode 100644 index 1d44c77b1a7..00000000000 --- a/mysql-test/t/log_bin_trust_routine_creators_basic.test +++ /dev/null @@ -1,164 +0,0 @@ -############## mysql-test\t\log_bin_trust_routine_creators_basic.test ######### -# # -# Variable Name: log_bin_trust_routine_creators # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: False # -# Range: # -# # -# # -# Creation Date: 2008-02-12 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable # -# log_bin_trust_routine_creators that checks the # -# behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: (Not given on website) # -# # -############################################################################### - ---source include/load_sysvars.inc -#################################################################### -# START OF log_bin_trust_routine_creators TESTS # -#################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.log_bin_trust_routine_creators; -SELECT @start_global_value; - - ---echo '#--------------------FN_DYNVARS_064_01-------------------------#' -######################################################################## -# Display the DEFAULT value of log_bin_trust_routine_creators # -######################################################################## - -SET @@global.log_bin_trust_routine_creators = TRUE; -SET @@global.log_bin_trust_routine_creators = DEFAULT; -SELECT @@global.log_bin_trust_routine_creators; - - ---echo '#--------------------FN_DYNVARS_064_02-------------------------#' -############################################################################## -# Check the DEFAULT value of log_bin_trust_routine_creators # -############################################################################## - -SET @@global.log_bin_trust_routine_creators = DEFAULT; -SELECT @@global.log_bin_trust_routine_creators = 'FALSE'; - - ---echo '#--------------------FN_DYNVARS_064_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.log_bin_trust_routine_creators = ON; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = OFF; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = 0; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = 1; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = TRUE; -SELECT @@global.log_bin_trust_routine_creators; -SET @@global.log_bin_trust_routine_creators = FALSE; -SELECT @@global.log_bin_trust_routine_creators; - - ---echo '#-------------------FN_DYNVARS_064_04----------------------------#' -########################################################################### -# Test if accessing session log_bin_trust_routine_creators gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.log_bin_trust_routine_creators = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.log_bin_trust_routine_creators; - - ---echo '#------------------FN_DYNVARS_064_05-----------------------#' -########################################################################## -# Change the value of log_bin_trust_routine_creators to an invalid value # -########################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = 'ONN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = "OFFF"; -SET @@global.log_bin_trust_routine_creators = OF; -SELECT @@global.log_bin_trust_routine_creators; ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = TTRUE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = FELSE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = -1024; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = 65536; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = 65530.34; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_bin_trust_routine_creators = test; - - ---echo '#------------------FN_DYNVARS_064_06-----------------------#' -############################################################################### -# Check if the value in GLOBAL & SESSION Tables matches value in variable # -############################################################################### - - -SELECT @@global.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators'; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.log_bin_trust_routine_creators = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='log_bin_trust_routine_creators'; - - ---echo '#---------------------FN_DYNVARS_064_07----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - - -SET @@global.log_bin_trust_routine_creators = TRUE; -SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators; - - ---echo '#---------------------FN_DYNVARS_064_08----------------------#' -################################################################### -# Check if variable can be accessed with and without @@ sign # -################################################################### - -SET @@global.log_bin_trust_routine_creators = TRUE; -SELECT @@log_bin_trust_routine_creators; ---Error ER_UNKNOWN_TABLE -SELECT local.log_bin_trust_routine_creators; ---Error ER_UNKNOWN_TABLE -SELECT session.log_bin_trust_routine_creators; ---Error ER_BAD_FIELD_ERROR -SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.log_bin_trust_routine_creators = @start_global_value; -SELECT @@global.log_bin_trust_routine_creators; - - -################################################################### -# END OF log_bin_trust_routine_creators TESTS # -################################################################### - diff --git a/mysql-test/t/log_output_basic.test b/mysql-test/t/log_output_basic.test deleted file mode 100644 index 45998e85480..00000000000 --- a/mysql-test/t/log_output_basic.test +++ /dev/null @@ -1,234 +0,0 @@ -################# mysql-test\t\log_output_basic.test ########################## -# # -# Variable Name: log_output # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: TABLE # -# Range: TABLE, FILE, NONE # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable log_output # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF log_output TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of log_output in a temporary variable # -######################################################################## - -SET @start_value = @@global.log_output; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_065_01------------------------#' -######################################################################## -# Display the DEFAULT value of log_output # -######################################################################## - -SET @@global.log_output = FILE; -SET @@global.log_output = DEFAULT; -SELECT @@global.log_output; ---echo 'Bug# 34876: Documentation specifies a DEFAULT value of TABLE whereas'; ---echo 'DEFAULT value is FILE. Also note that initial value is different'; ---echo 'from DEFAULT'; - - ---echo '#---------------------FN_DYNVARS_065_02-------------------------#' -################################################## -# Check if NULL or empty value is accepeted # -################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = NULL; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = ""; -SELECT @@global.log_output; ---echo 'Bug# 34838: Empty value is allowed where as it is not specified in'; ---echo 'documentation'; - ---echo '#--------------------FN_DYNVARS_065_03------------------------#' -######################################################################## -# Change the value of log_output to a valid value # -######################################################################## - -SET @@global.log_output = 'TABLE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'FILE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'NONE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'FILE,TABLE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'TABLE,FILE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'NONE,TABLE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'NONE,FILE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'FILE,TABLE,NONE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'TABLE,NONE'; -SELECT @@global.log_output; - -SET @@global.log_output = 'TABLE,TABLE'; -SELECT @@global.log_output; - -SET @@global.log_output = ',TABLE'; -SELECT @@global.log_output; - -SET @@global.log_output = ','; -SELECT @@global.log_output; - -SET @@global.log_output = 'TABLE,,FILE,,,'; -SELECT @@global.log_output; - - ---echo '#--------------------FN_DYNVARS_065_04-------------------------#' -########################################################################### -# Change the value of log_output to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = TAB; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = NIL; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = 'FIL'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = 'T'; - -# use of space in value ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = 'TABLE, FILE'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = ' TABLE,FILE'; - -SET @@global.log_output = ', '; -SELECT @@global.log_output; -SET @@global.log_output = ' '; -SELECT @@global.log_output; -SET @@global.log_output = ' '; -SELECT @@global.log_output; - ---echo 'Bug: The behavior of space in value is not consistent.'; ---echo 'Some times it is trimmed and some times not.'; ---echo 'The space before and after value is not accepted where as space'; ---echo 'between comma is accepted.'; - - ---echo '#-------------------FN_DYNVARS_065_05----------------------------#' -###################################################################### -# Test if accessing session log_output gives error # -###################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@log_output = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.log_output; - - ---echo '#----------------------FN_DYNVARS_065_06------------------------#' -######################################################################## -# Check if the value in GLOBAL Table matches value in variable # -######################################################################## - -SELECT @@log_output = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log_output'; - - ---echo '#---------------------FN_DYNVARS_065_07-------------------------#' -################################################################### -# Check if numbers can be used on variable # -################################################################### - -# test if variable accepts 0,1,2 ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = 0; -SELECT @@global.log_output; - -SET @@global.log_output = 1; -SELECT @@global.log_output; - -SET @@global.log_output = 2; -SELECT @@global.log_output; - -SET @@global.log_output = 3; -SELECT @@global.log_output; - -SET @@global.log_output = 4; -SELECT @@global.log_output; - -SET @@global.log_output = 5; -SELECT @@global.log_output; - -SET @@global.log_output = 6; -SELECT @@global.log_output; - -SET @@global.log_output = 7; -SELECT @@global.log_output; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = 8; - - ---echo '#---------------------FN_DYNVARS_065_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.log_output = TRUE; -SELECT @@global.log_output; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.log_output = FALSE; -SELECT @@global.log_output; - ---echo '#---------------------FN_DYNVARS_065_09----------------------#' -################################################################ -# Check if log_output can be accessed with and without @@ sign # -################################################################ ---Error ER_GLOBAL_VARIABLE -SET log_output = ON; - -SET global log_output = 'TABLE'; -SELECT @@global.log_output; - -############################## -# Restore initial value # -############################## - -SET @@global.log_output = @start_value; -SELECT @@global.log_output; - -################################################################### -# END OF log_output TESTS # -################################################################### diff --git a/mysql-test/t/log_output_func.test b/mysql-test/t/log_output_func.test deleted file mode 100644 index 007c4f38659..00000000000 --- a/mysql-test/t/log_output_func.test +++ /dev/null @@ -1,125 +0,0 @@ -################# mysql-test\t\log_output_func.test ########################## -# # -# Variable Name: log_output # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: TABLE # -# Range: TABLE, FILE, NONE # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# Modified: HHunger 2008-08-29 -# # -# Description: Test Cases of Dynamic System Variable log_output # -# that checks the behavior of this variable # -# # -# Reference: # -# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # -# # -############################################################################### - -# The access to mysql.general_log delivers different result depending on -# ps-protocol. So, it is switched off. ---disable_ps_protocol - -SET @start_value= @@global.log_output; -SET @start_general_log= @@global.general_log; -SET @start_general_log_file= @@global.general_log_file; - ---echo '#--------------------FN_DYNVARS_065_01-------------------------#' -################################################################## -# Check if setting log_output is changed in every new connection # -################################################################## - -SET @@global.log_output = 'NONE'; -# con1 will be default connection from now on ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); -SET @@global.log_output = 'TABLE,FILE'; - -# Test that the effect is global ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); -SELECT @@global.log_output; - ---echo '#--------------------FN_DYNVARS_065_02-------------------------#' -#################################################### -# Begin the functionality Testing of log_output # -#################################################### - ---echo 'connection con1' -connection con1; - -#=============================================================== ---echo '---Checking general_log when log_output is NONE---' -#=============================================================== - -SET @@global.log_output = 'NONE'; -TRUNCATE TABLE mysql.general_log; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -CREATE TABLE t1(a INT); -INSERT INTO t1 VALUE(1); -SELECT 'abc'; -SELECT count(*) FROM mysql.general_log; - -#=============================================================== ---echo '---Checking general_log when log_output is TABLE---' -#=============================================================== - -SET @@global.log_output = 'TABLE'; -TRUNCATE TABLE mysql.general_log; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -CREATE TABLE t1(a int); -INSERT INTO t1 VALUE(1); -SELECT 'abc'; -# At least the last 4 statement should be logged. -SELECT count(*)>4 FROM mysql.general_log; - -#=============================================================== -# Checking general_log when log_output is FILE -#=============================================================== - -SET @@global.general_log = 'OFF'; -FLUSH LOGS; ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval SET @@global.general_log_file = '$MYSQLTEST_VARDIR/run/mytest.log'; -SET @@global.general_log = 'ON'; -SET @@global.log_output = 'FILE'; -TRUNCATE TABLE mysql.general_log; ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings -CREATE TABLE t1(a INT); -INSERT INTO t1 VALUE(1); -SELECT 'abc'; -SELECT count(*) FROM mysql.general_log; - -DROP TABLE t1; - -file_exists $MYSQLTEST_VARDIR/run/mytest.log ; - -#============================================================== -# Clean up -#============================================================== - ---echo connection default; -connection default; -SET @@global.general_log= 'OFF'; -SET @@global.general_log_file= @start_general_log_file; -SET @@global.log_output= @start_value; -SET @@global.general_log= @start_general_log; -SET @@global.general_log= 'ON'; - ---enable_ps_protocol -#################################################### -# End of functionality Testing for log_output # -#################################################### - diff --git a/mysql-test/t/log_queries_not_using_indexes_basic.test b/mysql-test/t/log_queries_not_using_indexes_basic.test deleted file mode 100644 index d6de4d4ca02..00000000000 --- a/mysql-test/t/log_queries_not_using_indexes_basic.test +++ /dev/null @@ -1,103 +0,0 @@ - - -################## mysql-test\t\log_queries_not_using_indexes_basic.test ###### -# # -# Variable Name: log_queries_not_using_indexes # -# Scope: Global # -# Access Type: Static # -# Data Type: # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable log_queries_not_using_indexes# -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_041_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_041_02----------------------#' -# -# Test case for Bug #35433 -# -#################################################################### -# Check if Value can set # -#################################################################### - -#--error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.log_queries_not_using_indexes=1; ---echo Expected error 'Read only variable' ---ECHO "BUG:It should give error on setting this variable as it is readonly variable" -SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_041_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.log_queries_not_using_indexes = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log_queries_not_using_indexes'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log_queries_not_using_indexes'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_041_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@log_queries_not_using_indexes = @@GLOBAL.log_queries_not_using_indexes; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_041_05----------------------#' -################################################################################ -# Check if log_queries_not_using_indexes can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@log_queries_not_using_indexes); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.log_queries_not_using_indexes); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.log_queries_not_using_indexes); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.log_queries_not_using_indexes); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT log_queries_not_using_indexes = @@SESSION.log_queries_not_using_indexes; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test index 977b74aa1e3..e40dd1e3491 100644 --- a/mysql-test/t/log_state.test +++ b/mysql-test/t/log_state.test @@ -1,7 +1,30 @@ --- source include/not_embedded.inc +### t/log_state.test ### +# +# This test suffers from server +# Bug#38124 "general_log_file" variable silently unset when using expression +# In short: +# SET GLOBAL general_log_file = @<whatever> +# SET GLOBAL slow_query_log = @<whatever> +# cause that the value of these server system variables is set to default +# instead of the assigned values. There comes no error message or warning. +# If this bug is fixed please +# 1. try this test with "let $fixed_bug38124 = 0;" +# 2. remove all workarounds if 1. was successful. +let $fixed_bug38124 = 0; + +--source include/not_embedded.inc --source include/have_csv.inc +# Several subtests modify global variables. Save the initial values only here, +# but reset to the initial values per subtest. +SET @old_general_log= @@global.general_log; +SET @old_general_log_file= @@global.general_log_file; +SET @old_slow_query_log= @@global.slow_query_log; +SET @old_slow_query_log_file= @@global.slow_query_log_file; + + --disable_ps_protocol + set global general_log= OFF; truncate table mysql.general_log; truncate table mysql.slow_log; @@ -23,20 +46,32 @@ show global variables where Variable_name = 'log' or Variable_name = 'log_slow_queries' or Variable_name = 'general_log' or Variable_name = 'slow_query_log'; +--echo # Establish connection con1 (user=root) connect (con1,localhost,root,,); +--echo # Switch to connection con1 connection con1; -set session long_query_time=1; -select sleep(2); +# Please increase @long_query_time if the corresponding selects show an +# additional unexpected entry like +# start_time ... sql_text +# TIMESTAMP ... set session long_query_time=... +# (Bug#40377 sporadic pushbuild failure in log_state: result mismatch) +--replace_result 2 <long_query_time> +set @long_query_time = 2; +set session long_query_time = @long_query_time; +select sleep(@long_query_time + 1); --replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%'; +--echo # Switch to connection default connection default; set global slow_query_log= ON; +--echo # Switch to connection con1 connection con1; -set session long_query_time=1; -select sleep(2); +set session long_query_time = @long_query_time; +select sleep(@long_query_time + 1); --replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%'; +--echo # Switch to connection default connection default; show global variables where Variable_name = 'log' or Variable_name = 'log_slow_queries' or @@ -71,16 +106,16 @@ show variables like 'slow_query_log_file'; show variables like 'log_output'; # Can't set general_log_file to a non existing file ---error 1231 -set global general_log_file='/not exiting path/log.master'; +--error ER_WRONG_VALUE_FOR_VAR +set global general_log_file='/not existing path/log.master'; # Can't set general_log_file to a directory --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR eval set global general_log_file='$MYSQLTEST_VARDIR'; # Can't set general_log_file to empty string ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set global general_log_file=''; --replace_column 2 # @@ -126,17 +161,30 @@ drop table t1; --replace_column 1 TIMESTAMP 2 USER_HOST 3 # select * from mysql.general_log; -# -# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes -# a deadlock) +# Reset to initial values +SET @@global.general_log = @old_general_log; +SET @@global.general_log_file = @old_general_log_file; +SET @@global.slow_query_log = @old_slow_query_log; +SET @@global.slow_query_log_file = @old_slow_query_log_file; +if(!$fixed_bug38124) +{ + --disable_query_log + let $my_var = `SELECT @old_general_log_file`; + eval SET @@global.general_log_file = '$my_var'; + let $my_var = `SELECT @old_slow_query_log_file`; + eval SET @@global.slow_query_log_file = '$my_var'; + --enable_query_log +} -# save state -SET @old_general_log_state = @@global.general_log; -SET @old_slow_log_state = @@global.slow_query_log; +########################################################################### -# Test ON->OFF transition under a GLOBAL READ LOCK +# +# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes +# a deadlock) +# +# Test ON->OFF transition under a GLOBAL READ LOCK SET GLOBAL general_log = ON; SET GLOBAL slow_query_log = ON; @@ -148,7 +196,6 @@ SET GLOBAL slow_query_log = OFF; UNLOCK TABLES; # Test OFF->ON transition under a GLOBAL READ LOCK - FLUSH TABLES WITH READ LOCK; SET GLOBAL general_log = ON; @@ -157,7 +204,6 @@ SET GLOBAL slow_query_log = ON; UNLOCK TABLES; # Test ON->OFF transition under a GLOBAL READ_ONLY - SET GLOBAL READ_ONLY = ON; SET GLOBAL general_log = OFF; @@ -166,7 +212,6 @@ SET GLOBAL slow_query_log = OFF; SET GLOBAL READ_ONLY = OFF; # Test OFF->ON transition under a GLOBAL READ_ONLY - SET GLOBAL READ_ONLY = ON; SET GLOBAL general_log = ON; @@ -174,17 +219,18 @@ SET GLOBAL slow_query_log = ON; SET GLOBAL READ_ONLY = OFF; -# Restore state +# Reset to initial values +SET GLOBAL general_log = @old_general_log; +SET GLOBAL slow_query_log = @old_slow_query_log; -SET GLOBAL general_log = @old_general_log_state; -SET GLOBAL slow_query_log = @old_slow_log_state; + +########################################################################### # -# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it +# Bug#29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it # -SET @old_general_log_state = @@global.general_log; -SET @old_slow_log_state = @@global.slow_query_log; +SET GLOBAL general_log = ON; SHOW VARIABLES LIKE 'general_log'; SHOW VARIABLES LIKE 'log'; @@ -210,67 +256,84 @@ SHOW VARIABLES LIKE 'slow_query_log'; SHOW VARIABLES LIKE 'log_slow_queries'; SELECT @@slow_query_log, @@log_slow_queries; -SET GLOBAL general_log = @old_general_log_state; -SET GLOBAL slow_query_log = @old_slow_log_state; +SET GLOBAL general_log = @old_general_log; +SET GLOBAL slow_query_log = @old_slow_query_log; + + +########################################################################### # -# Bug #31604: server crash when setting slow_query_log_file/general_log_file +# Bug#31604: server crash when setting slow_query_log_file/general_log_file # -set @old_general_log_file= @@global.general_log_file; -set @old_slow_query_log_file= @@global.slow_query_log_file; - ---error 1231 -set global general_log_file= concat('/not exiting path/log.maste', 'r'); ---error 1231 -set global general_log_file= NULL; ---error 1231 -set global slow_query_log_file= concat('/not exiting path/log.maste', 'r'); ---error 1231 -set global slow_query_log_file= NULL; -set global general_log_file= @old_general_log_file; -set global slow_query_log_file= @old_slow_query_log_file; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL general_log_file= CONCAT('/not existing path/log.maste', 'r'); +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL general_log_file= NULL; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL slow_query_log_file= CONCAT('/not existing path/log.maste', 'r'); +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL slow_query_log_file= NULL; + +# Reset to initial values in case a setting above was successful. +SET GLOBAL general_log_file= @old_general_log_file; +SET GLOBAL slow_query_log_file= @old_slow_query_log_file; +if(!$fixed_bug38124) +{ + --disable_query_log + let $my_var = `SELECT @old_general_log_file`; + eval SET @@global.general_log_file = '$my_var'; + let $my_var = `SELECT @old_slow_query_log_file`; + eval SET @@global.slow_query_log_file = '$my_var'; + --enable_query_log +} ########################################################################### --echo --echo # -- --echo # -- Bug#32748: Inconsistent handling of assignments to ---echo # -- general_log_file/slow_query_log_file. +--echo # -- general_log_file/slow_query_log_file. --echo # -- --echo -SET @general_log_file_saved = @@global.general_log_file; -SET @slow_query_log_file_saved = @@global.slow_query_log_file; - ---echo SET GLOBAL general_log_file = 'bug32748.query.log'; SET GLOBAL slow_query_log_file = 'bug32748.slow.log'; --echo SHOW VARIABLES LIKE '%log_file'; +# Reset to initial values --echo -SET GLOBAL general_log_file = @general_log_file_saved; -SET GLOBAL slow_query_log_file = @slow_query_log_file_saved; +SET GLOBAL general_log_file = @old_general_log_file; +SET GLOBAL slow_query_log_file = @old_slow_query_log_file; +if(!$fixed_bug38124) +{ + --disable_query_log + let $my_var = `SELECT @old_general_log_file`; + eval SET @@global.general_log_file = '$my_var'; + let $my_var = `SELECT @old_slow_query_log_file`; + eval SET @@global.slow_query_log_file = '$my_var'; + --enable_query_log +} --echo --echo # -- End of Bug#32748. -########################################################################### - +########################################################################### -## WL#4403 - deprecate @log and @slow_log_queries variables +# WL#4403 - deprecate @log and @slow_log_queries variables -## these are all deprecated -- show for command-line as well! +# These server system variables are all deprecated +# -- show for command-line as well! --echo deprecated: SET GLOBAL log = 0; SET GLOBAL log_slow_queries = 0; SET GLOBAL log = DEFAULT; SET GLOBAL log_slow_queries = DEFAULT; -## these are NOT deprecated +# These server system variables are NOT deprecated. --echo not deprecated: SELECT @@global.general_log_file INTO @my_glf; SELECT @@global.slow_query_log_file INTO @my_sqlf; @@ -283,6 +346,20 @@ SET GLOBAL slow_query_log_file = @my_sqlf; SET GLOBAL general_log = DEFAULT; SET GLOBAL slow_query_log = DEFAULT; +## Reset to initial values +SET @@global.general_log = @old_general_log; +SET @@global.general_log_file = @old_general_log_file; +SET @@global.slow_query_log = @old_slow_query_log; +SET @@global.slow_query_log_file = @old_slow_query_log_file; +if(!$fixed_bug38124) +{ + --disable_query_log + let $my_var = `SELECT @old_general_log_file`; + eval SET @@global.general_log_file = '$my_var'; + let $my_var = `SELECT @old_slow_query_log_file`; + eval SET @@global.slow_query_log_file = '$my_var'; + --enable_query_log +} --echo End of 5.1 tests @@ -290,10 +367,30 @@ SET GLOBAL slow_query_log = DEFAULT; --enable_ps_protocol # -# Cleanup (must be done last to avoid delayed 'Quit' message in general log) +# Cleanup # +# Disconnect must be done last to avoid delayed 'Quit' message in general log +--echo # Close connection con1 disconnect con1; +# set back the saved default values +connection default; + +# Reset global system variables to initial values if forgotten somewhere above. +SET global general_log = @old_general_log; +SET global general_log_file = @old_general_log_file; +SET global slow_query_log = @old_slow_query_log; +SET global slow_query_log_file = @old_slow_query_log_file; +if(!$fixed_bug38124) +{ + --disable_query_log + let $my_var = `SELECT @old_general_log_file`; + eval SET @@global.general_log_file = '$my_var'; + let $my_var = `SELECT @old_slow_query_log_file`; + eval SET @@global.slow_query_log_file = '$my_var'; + --enable_query_log +} # Remove the log files that was created in the "default location" # i.e var/run ---remove_file $MYSQLTEST_VARDIR/run/master.log +--remove_file $MYSQLTEST_VARDIR/run/mysqld.log +--remove_file $MYSQLTEST_VARDIR/tmp/log.master diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index bdd22538c14..326914f09d9 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -7,6 +7,12 @@ # check that CSV engine was compiled in --source include/have_csv.inc +SET @old_general_log_state = @@global.general_log; +SET @old_log_output= @@global.log_output; +SET @old_slow_query_log= @@global.slow_query_log; +SET @old_general_log= @@global.general_log; +SET @old_long_query_time= @@session.long_query_time; + --disable_ps_protocol use mysql; @@ -525,7 +531,8 @@ FLUSH LOGS; ALTER TABLE mysql.slow_log DROP COLUMN seq; ALTER TABLE mysql.slow_log ENGINE = CSV; -SET GLOBAL slow_query_log = @saved_slow_query_log; +SET GLOBAL general_log = @old_general_log; +SET GLOBAL slow_query_log = @old_slow_query_log; # # Bug#25422 (Hang with log tables) @@ -829,8 +836,8 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveSlowLog`; DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`; DROP DATABASE IF EXISTS `db_17876`; -SET GLOBAL general_log = @saved_general_log; -SET GLOBAL slow_query_log = @saved_slow_query_log; +SET GLOBAL general_log = @old_general_log; +SET GLOBAL slow_query_log = @old_slow_query_log; # # Bug#21557 entries in the general query log truncated at 1000 characters. @@ -948,7 +955,7 @@ execute long_query using @lparam; set global general_log = off; select command_type, argument from mysql.general_log where thread_id = @thread_id; deallocate prepare long_query; -set global general_log = @saved_general_log; +set global general_log = @old_general_log; # # Bug#34306: Can't make copy of log tables when server binary log is enabled @@ -1020,10 +1027,8 @@ DROP TABLE t1; TRUNCATE TABLE mysql.slow_log; -# RESET altered system variables before exiting the test -SET GLOBAL slow_query_log = @saved_slow_query_log; -SET GLOBAL general_log=@saved_general_log; -SET SESSION long_query_time =@saved_long_query_time; -SET GLOBAL LOG_OUTPUT = @saved_log_output; - +SET @@session.long_query_time= @old_long_query_time; +SET @@global.log_output= @old_log_output; +SET @@global.slow_query_log= @old_slow_query_log; +SET @@global.general_log= @old_general_log; diff --git a/mysql-test/t/long_query_time_basic.test b/mysql-test/t/long_query_time_basic.test deleted file mode 100644 index c21e0a751c1..00000000000 --- a/mysql-test/t/long_query_time_basic.test +++ /dev/null @@ -1,210 +0,0 @@ -####################### mysql-test\t\long_query_time_basic.test ############### -# # -# Variable Name: long_query_time # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:10 # -# Min Value: 1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable long_query_time # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -############################################################ -# START OF long_query_time TESTS # -############################################################ - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.long_query_time; -SELECT @start_global_value; -SET @start_session_value = @@session.long_query_time; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_068_01-------------------------#' -############################################################### -# Display the DEFAULT value of long_query_time # -############################################################### - -SET @@global.long_query_time = 100; -SET @@global.long_query_time = DEFAULT; -SELECT @@global.long_query_time; - -SET @@session.long_query_time = 200; -SET @@session.long_query_time = DEFAULT; -SELECT @@session.long_query_time; - - ---echo '#--------------------FN_DYNVARS_068_02-------------------------#' -############################################################### -# Check the DEFAULT value of long_query_time # -############################################################### - -SET @@global.long_query_time = DEFAULT; -SELECT @@global.long_query_time = 10; - -SET @@session.long_query_time = DEFAULT; -SELECT @@session.long_query_time = 10; - - ---echo '#--------------------FN_DYNVARS_068_03-------------------------#' -######################################################################### -# Change the value of long_query_time to a valid value for GLOBAL Scope # -######################################################################### - -SET @@global.long_query_time = 0; -SELECT @@global.long_query_time; -SET @@global.long_query_time = 1; -SELECT @@global.long_query_time; -SET @@global.long_query_time = 60020; -SELECT @@global.long_query_time; -SET @@global.long_query_time = 31536000; -SELECT @@global.long_query_time; -SET @@global.long_query_time = 65536; -SELECT @@global.long_query_time; - - ---echo '#--------------------FN_DYNVARS_068_04-------------------------#' -########################################################################## -# Change the value of long_query_time to a valid value for SESSION Scope # -########################################################################## - -SET @@session.long_query_time = 0; -SELECT @@session.long_query_time; -SET @@session.long_query_time = 1; -SELECT @@session.long_query_time; -SET @@session.long_query_time = 50050; -SELECT @@session.long_query_time; -SET @@session.long_query_time = 31536000; -SELECT @@session.long_query_time; -SET @@session.long_query_time = 65550; -SELECT @@session.long_query_time; - - ---echo '#------------------FN_DYNVARS_068_05-----------------------#' -######################################################## -# Change the value of long_query_time to an invalid value # -######################################################## - -SET @@global.long_query_time = 100000000000; -SELECT @@global.long_query_time; -SET @@global.long_query_time = -1; -SELECT @@global.long_query_time; ---Error ER_PARSE_ERROR -SET @@global.long_query_time = 65530.34.; -SELECT @@global.long_query_time; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.long_query_time = test; -SELECT @@global.long_query_time; - -SET @@session.long_query_time = 100000000000; -SELECT @@session.long_query_time; -SET @@session.long_query_time = -2; -SELECT @@session.long_query_time; ---Error ER_PARSE_ERROR -SET @@session.long_query_time = 65530.34.; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.long_query_time = test; -SELECT @@session.long_query_time; - - ---echo '#------------------FN_DYNVARS_068_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.long_query_time = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='long_query_time'; - ---echo '#------------------FN_DYNVARS_068_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.long_query_time = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='long_query_time'; - - ---echo '#------------------FN_DYNVARS_068_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.long_query_time = TRUE; -SELECT @@global.long_query_time; -SET @@global.long_query_time = FALSE; -SELECT @@global.long_query_time; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.long_query_time = 10; -SELECT @@long_query_time = @@global.long_query_time; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@long_query_time = 100; -SELECT @@long_query_time = @@local.long_query_time; -SELECT @@local.long_query_time = @@session.long_query_time; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -########################################################################## -# Check if long_query_time can be accessed with and without @@ sign # -########################################################################## - -SET long_query_time = 1; -SELECT @@long_query_time; ---Error ER_UNKNOWN_TABLE -SELECT local.long_query_time; ---Error ER_UNKNOWN_TABLE -SELECT session.long_query_time; ---Error ER_BAD_FIELD_ERROR -SELECT long_query_time = @@session.long_query_time; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.long_query_time = @start_global_value; -SELECT @@global.long_query_time; -SET @@session.long_query_time = @start_session_value; -SELECT @@session.long_query_time; - - -#################################################### -# END OF long_query_time TESTS # -#################################################### - diff --git a/mysql-test/t/low_priority_updates_basic.test b/mysql-test/t/low_priority_updates_basic.test deleted file mode 100644 index 0ce4ee8f921..00000000000 --- a/mysql-test/t/low_priority_updates_basic.test +++ /dev/null @@ -1,222 +0,0 @@ -############## mysql-test\t\low_priority_updates_basic.test ################### -# # -# Variable Name: low_priority_updates # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Range: # -# # -# # -# Creation Date: 2008-02-11 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable low_priority_updates # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_low-priority-updates # -# # -############################################################################### - ---source include/load_sysvars.inc - -#################################################################### -# START OF low_priority_updates TESTS # -#################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.low_priority_updates; -SELECT @start_global_value; -SET @start_session_value = @@session.low_priority_updates; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_069_01-------------------------#' -#################################################################### -# Display the DEFAULT value of low_priority_updates # -#################################################################### - -SET @@global.low_priority_updates = ON; -SET @@global.low_priority_updates = DEFAULT; -SELECT @@global.low_priority_updates; - -SET @@session.low_priority_updates = ON; -SET @@session.low_priority_updates = DEFAULT; -SELECT @@session.low_priority_updates; - - ---echo '#--------------------FN_DYNVARS_069_02-------------------------#' -######################################################################## -# Check the DEFAULT value of low_priority_updates # -######################################################################## - -SET @@global.low_priority_updates = DEFAULT; -SELECT @@global.low_priority_updates = 'FALSE'; - -SET @@session.low_priority_updates = DEFAULT; -SELECT @@session.low_priority_updates = 'FALSE'; - - ---echo '#--------------------FN_DYNVARS_069_03-------------------------#' -############################################################################## -# Change the value of low_priority_updates to a valid value for GLOBAL Scope # -############################################################################## - -SET @@global.low_priority_updates = ON; -SELECT @@global.low_priority_updates; -SET @@global.low_priority_updates = OFF; -SELECT @@global.low_priority_updates; -SET @@global.low_priority_updates = 0; -SELECT @@global.low_priority_updates; -SET @@global.low_priority_updates = 1; -SELECT @@global.low_priority_updates; -SET @@global.low_priority_updates = TRUE; -SELECT @@global.low_priority_updates; -SET @@global.low_priority_updates = FALSE; -SELECT @@global.low_priority_updates; - - - ---echo '#--------------------FN_DYNVARS_069_04-------------------------#' -############################################################################### -# Change the value of low_priority_updates to a valid value for SESSION Scope # -############################################################################### - -SET @@session.low_priority_updates = ON; -SELECT @@session.low_priority_updates; -SET @@session.low_priority_updates = OFF; -SELECT @@session.low_priority_updates; -SET @@session.low_priority_updates = 0; -SELECT @@session.low_priority_updates; -SET @@session.low_priority_updates = 1; -SELECT @@session.low_priority_updates; -SET @@session.low_priority_updates = TRUE; -SELECT @@session.low_priority_updates; -SET @@session.low_priority_updates = FALSE; -SELECT @@session.low_priority_updates; - - ---echo '#------------------FN_DYNVARS_069_05-----------------------#' -################################################################ -# Change the value of low_priority_updates to an invalid value # -################################################################ - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = 'ONN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = "OFFF"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = TTRUE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = FELSE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = -1024; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = 65536; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = 65530.34; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.low_priority_updates = test; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.low_priority_updates = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.low_priority_updates = ONF; - -SET @@session.low_priority_updates = OF; -SELECT @@session.low_priority_updates; ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.low_priority_updates = 'OFN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.low_priority_updates = -2; ---Error ER_PARSE_ERROR -SET @@session.low_priority_updates = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.low_priority_updates = 65550; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.low_priority_updates = test; - - ---echo '#------------------FN_DYNVARS_069_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.low_priority_updates = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='low_priority_updates'; - ---echo '#------------------FN_DYNVARS_069_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.low_priority_updates = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='low_priority_updates'; - - ---echo '#---------------------FN_DYNVARS_069_08----------------------#' -############################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -############################################################################### - -SET @@low_priority_updates = FALSE; -SET @@global.low_priority_updates = TRUE; -SELECT @@low_priority_updates = @@global.low_priority_updates; - - ---echo '#---------------------FN_DYNVARS_069_09----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## - -SET @@low_priority_updates = ON; -SELECT @@low_priority_updates = @@local.low_priority_updates; -SELECT @@local.low_priority_updates = @@session.low_priority_updates; - - ---echo '#---------------------FN_DYNVARS_069_10----------------------#' -############################################################################### -# Check if low_priority_updates can be accessed with and without @@ sign # -############################################################################### - -SET low_priority_updates = 1; -SELECT @@low_priority_updates; ---Error ER_UNKNOWN_TABLE -SELECT local.low_priority_updates; ---Error ER_UNKNOWN_TABLE -SELECT session.low_priority_updates; ---Error ER_BAD_FIELD_ERROR -SELECT low_priority_updates = @@session.low_priority_updates; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.low_priority_updates = @start_global_value; -SELECT @@global.low_priority_updates; -SET @@session.low_priority_updates = @start_session_value; -SELECT @@session.low_priority_updates; - - -######################################################### -# END OF low_priority_updates TESTS # -######################################################### - diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index d3c9ec5145e..e71d9029606 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -9,6 +9,8 @@ --source include/have_case_insensitive_file_system.inc --source include/not_windows.inc +call mtr.add_suppression("Cannot find or open table test/BUG29839 from"); + --disable_warnings DROP TABLE IF EXISTS t1,T1; --enable_warnings diff --git a/mysql-test/t/max_allowed_packet_basic.test b/mysql-test/t/max_allowed_packet_basic.test deleted file mode 100644 index 8be0e5f670e..00000000000 --- a/mysql-test/t/max_allowed_packet_basic.test +++ /dev/null @@ -1,231 +0,0 @@ -############## mysql-test\t\max_allowed_packet_basic.test ############### -# # -# Variable Name: max_allowed_packet # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:1048576 # -# Range:1024-1073741824 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_allowed_packet # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################## -# START OF max_allowed_packet TESTS # -################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_allowed_packet; -SELECT @start_global_value; - -# give a known value to @@session.max_allowed_packet by assigning to -# @@global and setting up a new connection (for deterministic result -# file diffing) -SET @@global.max_allowed_packet = DEFAULT; -connect (conn1, localhost, root,,); - - - ---echo '#--------------------FN_DYNVARS_070_01-------------------------#' -################################################################## -# Display the DEFAULT value of max_allowed_packet # -################################################################## - -SET @@global.max_allowed_packet = 1000; -SET @@global.max_allowed_packet = DEFAULT; -SELECT @@global.max_allowed_packet; - ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 20000; ---Error ER_NO_DEFAULT -SET @@session.max_allowed_packet = DEFAULT; -SELECT @@session.max_allowed_packet; - - ---echo '#--------------------FN_DYNVARS_070_02-------------------------#' -################################################################## -# Check the DEFAULT value of max_allowed_packet # -################################################################## - -SET @@global.max_allowed_packet = DEFAULT; -SELECT @@global.max_allowed_packet = 1048576; - - ---echo '#--------------------FN_DYNVARS_070_03-------------------------#' -############################################################################ -# Change the value of max_allowed_packet to a valid value for GLOBAL Scope # -############################################################################ - -SET @@global.max_allowed_packet = 1024; -SELECT @@global.max_allowed_packet; -SET @@global.max_allowed_packet = 1025; -SELECT @@global.max_allowed_packet; ---echo : 'Bug# 34841: "Invalid values are coming in variable on assigning valid value'; -SET @@global.max_allowed_packet = 1073741824; -SELECT @@global.max_allowed_packet; -SET @@global.max_allowed_packet = 1073741823; -SELECT @@global.max_allowed_packet; - ---echo '#--------------------FN_DYNVARS_070_04-------------------------#' -############################################################################# -# Change the value of max_allowed_packet to a valid value for SESSION Scope # -############################################################################# - ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 1024; -SELECT @@session.max_allowed_packet; ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 1025; -SELECT @@session.max_allowed_packet; ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 65535; -SELECT @@session.max_allowed_packet; ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 1073741824; -SELECT @@session.max_allowed_packet; ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 1073741823; -SELECT @@session.max_allowed_packet; - - ---echo '#------------------FN_DYNVARS_070_05-----------------------#' -############################################################## -# Change the value of max_allowed_packet to an invalid value # -############################################################## - -SET @@global.max_allowed_packet = 0; -SELECT @@global.max_allowed_packet; -SET @@global.max_allowed_packet = -1024; -SELECT @@global.max_allowed_packet; -SET @@global.max_allowed_packet = 1023; -SELECT @@global.max_allowed_packet; -SET @@global.max_allowed_packet = 10737418241; -SELECT @@global.max_allowed_packet; ---Error ER_PARSE_ERROR -SET @@global.max_allowed_packet = 65530.34.; -SELECT @@global.max_allowed_packet; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_allowed_packet = test; -SELECT @@global.max_allowed_packet; - ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 0; -SELECT @@session.max_allowed_packet; ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 1023; -SELECT @@session.max_allowed_packet; ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = -2; -SELECT @@session.max_allowed_packet; ---Error ER_PARSE_ERROR -SET @@session.max_allowed_packet = 65530.34.; ---Error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 10737418241; -SELECT @@session.max_allowed_packet; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_allowed_packet = test; -SELECT @@session.max_allowed_packet; - - ---echo '#------------------FN_DYNVARS_070_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_allowed_packet = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_allowed_packet'; - ---echo '#------------------FN_DYNVARS_070_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_allowed_packet = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_allowed_packet'; - - ---echo '#------------------FN_DYNVARS_070_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_allowed_packet = TRUE; -SELECT @@global.max_allowed_packet; -SET @@global.max_allowed_packet = FALSE; -SELECT @@global.max_allowed_packet; - - ---echo '#---------------------FN_DYNVARS_070_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_allowed_packet = 2048; -SELECT @@max_allowed_packet = @@global.max_allowed_packet; - - ---echo '#---------------------FN_DYNVARS_070_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - ---Error ER_VARIABLE_IS_READONLY -SET @@max_allowed_packet = 100000; -SELECT @@max_allowed_packet = @@local.max_allowed_packet; -SELECT @@local.max_allowed_packet = @@session.max_allowed_packet; - - ---echo '#---------------------FN_DYNVARS_070_11----------------------#' -############################################################################# -# Check if max_allowed_packet can be accessed with and without @@ sign # -############################################################################# - ---Error ER_VARIABLE_IS_READONLY -SET max_allowed_packet = 1024; -SELECT @@max_allowed_packet; ---Error ER_UNKNOWN_TABLE -SELECT local.max_allowed_packet; ---Error ER_UNKNOWN_TABLE -SELECT session.max_allowed_packet; ---Error ER_BAD_FIELD_ERROR -SELECT max_allowed_packet = @@session.max_allowed_packet; - - -#################################### -# Restore initial value # -#################################### - -connection default; -SET @@global.max_allowed_packet = @start_global_value; -SELECT @@global.max_allowed_packet; -SELECT @@session.max_allowed_packet; - - -####################################################### -# END OF max_allowed_packet TESTS # -####################################################### - diff --git a/mysql-test/t/max_allowed_packet_func.test b/mysql-test/t/max_allowed_packet_func.test deleted file mode 100644 index 8437d480a37..00000000000 --- a/mysql-test/t/max_allowed_packet_func.test +++ /dev/null @@ -1,88 +0,0 @@ -################## mysql-test\t\max_allowed_packet_func.test ################## -# # -# Variable Name: max_allowed_packet # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:1048576 # -# Range:1024-1073741824 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable max_allowed_packet # -# that checks the functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - -#due to lost connection on win64 ---source include/not_windows.inc - -let $start_global_value = `SELECT @@global.max_allowed_packet`; ---echo $start_global_value - ---disable_warnings -drop table if exists t1; ---enable_warnings - -######################### -# Creating new table # -######################### - ---echo ## Creating new table t1 ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name BLOB -); - ---echo '#--------------------FN_DYNVARS_070_01-------------------------#' -############################################################################### -# Setting initial value of max_allowed_packet to 1024 at session level -# should result in an error (session variable is readonly) -############################################################################### - ---echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ## ---error ER_VARIABLE_IS_READONLY -SET @@session.max_allowed_packet = 1024; -SELECT @@session.max_allowed_packet; - ---error ER_VARIABLE_IS_READONLY -SET @@session.net_buffer_length = 1024; -SELECT @@session.net_buffer_length; - - ---echo '#--------------------FN_DYNVARS_070_02-------------------------#' -############################################################################### -# Setting value of max_allowed_packet to 1024 at global level and -# verifying its behavior after inserting data greater than 1024 bytes -############################################################################### - ---echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ## -SET @@global.max_allowed_packet = 1024; -SET @@global.net_buffer_length = 1024; -SELECT @@global.max_allowed_packet; -SELECT @@global.net_buffer_length; - ---echo ## Creating new connection test_con1 ## -connect (test_con1,localhost,root,,); -connection test_con1; - ---echo ## Inserting and fetching data of length greater than 1024 ## ---Error 0,ER_NET_PACKET_TOO_LARGE -INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"); - -disconnect test_con1; -connection default; -drop table t1; -eval SET @@global.max_allowed_packet = $start_global_value; - ---echo ## Server disconnects after this case and error occurs that Server ## ---echo ## has gone away ## - - diff --git a/mysql-test/t/max_binlog_cache_size_func-master.opt b/mysql-test/t/max_binlog_cache_size_func-master.opt deleted file mode 100644 index 6e00d7157d6..00000000000 --- a/mysql-test/t/max_binlog_cache_size_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---log-bin ---innodb diff --git a/mysql-test/t/max_binlog_size_basic.test b/mysql-test/t/max_binlog_size_basic.test deleted file mode 100644 index 11d01b5c10f..00000000000 --- a/mysql-test/t/max_binlog_size_basic.test +++ /dev/null @@ -1,183 +0,0 @@ -############## mysql-test\t\max_binlog_size_basic.test ############### -# # -# Variable Name: max_binlog_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:1073741824 # -# Min Value:4096 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_binlog_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -################################################################## -# START OF max_binlog_size TESTS # -################################################################## - - -################################################################## -# Saving initial value of max_binlog_size in a temporary variable# -################################################################## - -SET @start_value = @@global.max_binlog_size; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_072_01------------------------#' -################################################################## -# Display the DEFAULT value of max_binlog_size # -################################################################## - -SET @@global.max_binlog_size = 5000; -SET @@global.max_binlog_size = DEFAULT; -SELECT @@global.max_binlog_size; ---echo 'Bug# 34878: This variable has invalid default value as compared to documentation'; - ---echo '#---------------------FN_DYNVARS_072_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.max_binlog_size = @start_value; -SELECT @@global.max_binlog_size = 1073741824; - ---echo '#--------------------FN_DYNVARS_072_03------------------------#' -################################################################## -# Change the value of max_binlog_size to a valid value # -################################################################## - -SET @@global.max_binlog_size = 4096; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 1073741824; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 1073741823; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 4097; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 65535; -SELECT @@global.max_binlog_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_072_04-------------------------#' -##################################################################### -# Change the value of max_binlog_size to invalid value # -##################################################################### - -SET @@global.max_binlog_size = -1; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 100000000000; -SELECT @@global.max_binlog_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_binlog_size = 10000.01; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = -1024; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 1024; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 4294967296; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = 4095; -SELECT @@global.max_binlog_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_binlog_size = ON; -SELECT @@global.max_binlog_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_binlog_size = 'test'; -SELECT @@global.max_binlog_size; - - ---echo '#-------------------FN_DYNVARS_072_05----------------------------#' -##################################################################### -# Test if accessing session max_binlog_size gives error # -##################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.max_binlog_size = 4096; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.max_binlog_size; - - ---echo '#----------------------FN_DYNVARS_072_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.max_binlog_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_binlog_size'; - -SELECT @@max_binlog_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_binlog_size'; - - ---echo '#---------------------FN_DYNVARS_072_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.max_binlog_size = TRUE; -SELECT @@global.max_binlog_size; -SET @@global.max_binlog_size = FALSE; -SELECT @@global.max_binlog_size; - - ---echo '#---------------------FN_DYNVARS_072_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.max_binlog_size = 5000; -SELECT @@max_binlog_size = @@global.max_binlog_size; - - ---echo '#---------------------FN_DYNVARS_072_09----------------------#' -########################################################################## -# Check if max_binlog_size can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET max_binlog_size = 6000; -SELECT @@max_binlog_size; ---Error ER_PARSE_ERROR -SET local.max_binlog_size = 7000; ---Error ER_UNKNOWN_TABLE -SELECT local.max_binlog_size; ---Error ER_PARSE_ERROR -SET global.max_binlog_size = 8000; ---Error ER_UNKNOWN_TABLE -SELECT global.max_binlog_size; ---Error ER_BAD_FIELD_ERROR -SELECT max_binlog_size = @@session.max_binlog_size; - - -############################## -# Restore initial value # -############################## - -SET @@global.max_binlog_size = @start_value; -SELECT @@global.max_binlog_size; - - -################################################################## -# END OF max_binlog_size TESTS # -################################################################## - diff --git a/mysql-test/t/max_connections_basic.test b/mysql-test/t/max_connections_basic.test deleted file mode 100644 index ffc964db28f..00000000000 --- a/mysql-test/t/max_connections_basic.test +++ /dev/null @@ -1,184 +0,0 @@ -############## mysql-test\t\max_connections_basic.test ############### -# # -# Variable Name: max_connections # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:151 # -# Range: 1-100000 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_connections # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -############################################################### -# START OF max_connections TESTS # -############################################################### - - -################################################################### -# Saving initial value of max_connections in a temporary variable # -################################################################### - -SET @start_value = @@global.max_connections; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_074_01------------------------#' -################################################################## -# Display the DEFAULT value of max_connections # -################################################################## - -SET @@global.max_connections = 5000; -SET @@global.max_connections = DEFAULT; -SELECT @@global.max_connections; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - - ---echo '#---------------------FN_DYNVARS_074_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.max_connections = @start_value; -SELECT @@global.max_connections = 151; - - ---echo '#--------------------FN_DYNVARS_074_03------------------------#' -################################################################## -# Change the value of max_connections to a valid value # -################################################################## - -SET @@global.max_connections = 100000; -SELECT @@global.max_connections; -SET @@global.max_connections = 99999; -SELECT @@global.max_connections; -SET @@global.max_connections = 65536; -SELECT @@global.max_connections; -SET @@global.max_connections = 1; -SELECT @@global.max_connections; -SET @@global.max_connections = 2; -SELECT @@global.max_connections; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_074_04-------------------------#' -##################################################################### -# Change the value of max_connections to invalid value # -##################################################################### - -SET @@global.max_connections = -1; -SELECT @@global.max_connections; -SET @@global.max_connections = 100000000000; -SELECT @@global.max_connections; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_connections = 10000.01; -SELECT @@global.max_connections; -SET @@global.max_connections = -1024; -SELECT @@global.max_connections; -SET @@global.max_connections = 0; -SELECT @@global.max_connections; -SET @@global.max_connections = 100001; -SELECT @@global.max_connections; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_connections = ON; -SELECT @@global.max_connections; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_connections = 'test'; -SELECT @@global.max_connections; - - ---echo '#-------------------FN_DYNVARS_074_05----------------------------#' -##################################################################### -# Test if accessing session max_connections gives error # -##################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.max_connections = 4096; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.max_connections; - - ---echo '#----------------------FN_DYNVARS_074_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.max_connections = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_connections'; - -SELECT @@max_connections = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_connections'; - - ---echo '#---------------------FN_DYNVARS_074_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.max_connections = TRUE; -SELECT @@global.max_connections; -SET @@global.max_connections = FALSE; -SELECT @@global.max_connections; - - ---echo '#---------------------FN_DYNVARS_074_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.max_connections = 5000; -SELECT @@max_connections = @@global.max_connections; - - ---echo '#---------------------FN_DYNVARS_074_09----------------------#' -########################################################################## -# Check if max_connections can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET max_connections = 6000; -SELECT @@max_connections; ---Error ER_PARSE_ERROR -SET local.max_connections = 7000; ---Error ER_UNKNOWN_TABLE -SELECT local.max_connections; ---Error ER_PARSE_ERROR -SET global.max_connections = 8000; ---Error ER_UNKNOWN_TABLE -SELECT global.max_connections; ---Error ER_BAD_FIELD_ERROR -SELECT max_connections = @@session.max_connections; - - -############################## -# Restore initial value # -############################## - -SET @@global.max_connections = @start_value; -SELECT @@global.max_connections; - - -################################################################## -# END OF max_connections TESTS # -################################################################## - diff --git a/mysql-test/t/max_delayed_threads_basic.test b/mysql-test/t/max_delayed_threads_basic.test deleted file mode 100644 index dc908c8396b..00000000000 --- a/mysql-test/t/max_delayed_threads_basic.test +++ /dev/null @@ -1,229 +0,0 @@ -############## mysql-test\t\max_delayed_threads_basic.test ############### -# # -# Variable Name: max_delayed_threads # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 20 # -# Range: 0-16384 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_delayed_threads # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################## -# START OF max_delayed_threads TESTS # -################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_delayed_threads; -SELECT @start_global_value; -SET @start_session_value = @@session.max_delayed_threads; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_075_01-------------------------#' -################################################################## -# Display the DEFAULT value of max_delayed_threads # -################################################################## - -SET @@global.max_delayed_threads = 1000; -SET @@global.max_delayed_threads = DEFAULT; -SELECT @@global.max_delayed_threads; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = 1000; ---echo 'Bug# 34882: Valid values are not allowed to assign in this variable'; -SET @@session.max_delayed_threads = DEFAULT; -SELECT @@session.max_delayed_threads; - - ---echo '#--------------------FN_DYNVARS_075_02-------------------------#' -################################################################## -# Check the DEFAULT value of max_delayed_threads # -################################################################## - -SET @@global.max_delayed_threads = DEFAULT; -SELECT @@global.max_delayed_threads = 20; - -SET @@session.max_delayed_threads = DEFAULT; -SELECT @@session.max_delayed_threads = 20; - - ---echo '#--------------------FN_DYNVARS_075_03-------------------------#' -############################################################################ -# Change the value of max_delayed_threads to a valid value for GLOBAL Scope # -############################################################################ - -SET @@global.max_delayed_threads = 1; -SELECT @@global.max_delayed_threads; -SET @@global.max_delayed_threads = 1025; -SELECT @@global.max_delayed_threads; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - -SET @@global.max_delayed_threads = 0; -SELECT @@global.max_delayed_threads; -SET @@global.max_delayed_threads = 16384; -SELECT @@global.max_delayed_threads; -SET @@global.max_delayed_threads = 16383; -SELECT @@global.max_delayed_threads; - ---echo '#--------------------FN_DYNVARS_075_04-------------------------#' -############################################################################# -# Change the value of max_delayed_threads to a valid value for SESSION Scope # -############################################################################# - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = 1; -SELECT @@session.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = 1025; -SELECT @@session.max_delayed_threads; - -SET @@session.max_delayed_threads = 0; -SELECT @@session.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = 16384; -SELECT @@session.max_delayed_threads; - -SET @@session.max_delayed_threads = 16383; -SELECT @@session.max_delayed_threads; - - ---echo '#------------------FN_DYNVARS_075_05-----------------------#' -############################################################## -# Change the value of max_delayed_threads to an invalid value # -############################################################## - -SET @@global.max_delayed_threads = -1024; -SELECT @@global.max_delayed_threads; -SET @@global.max_delayed_threads = -1; -SELECT @@global.max_delayed_threads; -SET @@global.max_delayed_threads = 16385; -SELECT @@global.max_delayed_threads; ---Error ER_PARSE_ERROR -SET @@global.max_delayed_threads = 65530.34.; -SELECT @@global.max_delayed_threads; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_delayed_threads = test; -SELECT @@global.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = 16385; -SELECT @@session.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = -1; -SELECT @@session.max_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = -2; -SELECT @@session.max_delayed_threads; ---Error ER_PARSE_ERROR -SET @@session.max_delayed_threads = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_delayed_threads = 10737418241; -SELECT @@session.max_delayed_threads; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_delayed_threads = test; -SELECT @@session.max_delayed_threads; - - ---echo '#------------------FN_DYNVARS_075_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_delayed_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_delayed_threads'; - ---echo '#------------------FN_DYNVARS_075_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_delayed_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_delayed_threads'; - - ---echo '#------------------FN_DYNVARS_075_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_delayed_threads = TRUE; -SELECT @@global.max_delayed_threads; -SET @@global.max_delayed_threads = FALSE; -SELECT @@global.max_delayed_threads; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_delayed_threads = 2048; -SELECT @@max_delayed_threads = @@global.max_delayed_threads; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@max_delayed_threads = 100000; -SELECT @@max_delayed_threads = @@local.max_delayed_threads; -SELECT @@local.max_delayed_threads = @@session.max_delayed_threads; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################# -# Check if max_delayed_threads can be accessed with and without @@ sign # -############################################################################# - ---Error ER_WRONG_VALUE_FOR_VAR -SET max_delayed_threads = 1024; -SELECT @@max_delayed_threads; ---Error ER_UNKNOWN_TABLE -SELECT local.max_delayed_threads; ---Error ER_UNKNOWN_TABLE -SELECT session.max_delayed_threads; ---Error ER_BAD_FIELD_ERROR -SELECT max_delayed_threads = @@session.max_delayed_threads; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_delayed_threads = @start_global_value; -SELECT @@global.max_delayed_threads; -SET @@session.max_delayed_threads = @start_session_value; -SELECT @@session.max_delayed_threads; - - -####################################################### -# END OF max_delayed_threads TESTS # -####################################################### - diff --git a/mysql-test/t/max_error_count_basic.test b/mysql-test/t/max_error_count_basic.test deleted file mode 100644 index 2b1e12843cf..00000000000 --- a/mysql-test/t/max_error_count_basic.test +++ /dev/null @@ -1,215 +0,0 @@ -############## mysql-test\t\max_error_count_basic.test ############### -# # -# Variable Name: max_error_count # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 64 # -# Range: 0-65535 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_error_count # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -############################################################### -# START OF max_error_count TESTS # -############################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_error_count; -SELECT @start_global_value; -SET @start_session_value = @@session.max_error_count; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_076_01-------------------------#' -############################################################### -# Display the DEFAULT value of max_error_count # -############################################################### - -SET @@global.max_error_count = 1000; -SET @@global.max_error_count = DEFAULT; -SELECT @@global.max_error_count; - -SET @@session.max_error_count = 20000; -SET @@session.max_error_count = DEFAULT; -SELECT @@session.max_error_count; - - ---echo '#--------------------FN_DYNVARS_076_02-------------------------#' -################################################################## -# Check the DEFAULT value of max_error_count # -################################################################## - -SET @@global.max_error_count = DEFAULT; -SELECT @@global.max_error_count = 64; - -SET @@session.max_error_count = DEFAULT; -SELECT @@session.max_error_count = 64; - - ---echo '#--------------------FN_DYNVARS_076_03-------------------------#' -############################################################################ -# Change the value of max_error_count to a valid value for GLOBAL Scope # -############################################################################ - -SET @@global.max_error_count = 1; -SELECT @@global.max_error_count; -SET @@global.max_error_count = 0; -SELECT @@global.max_error_count; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - -SET @@global.max_error_count = 65535; -SELECT @@global.max_error_count; -SET @@global.max_error_count = 65534; -SELECT @@global.max_error_count; - ---echo '#--------------------FN_DYNVARS_076_04-------------------------#' -############################################################################# -# Change the value of max_error_count to a valid value for SESSION Scope # -############################################################################# - -SET @@session.max_error_count = 0; -SELECT @@session.max_error_count; -SET @@session.max_error_count = 1; -SELECT @@session.max_error_count; -SET @@session.max_error_count = 65535; -SELECT @@session.max_error_count; -SET @@session.max_error_count = 65534; -SELECT @@session.max_error_count; - - ---echo '#------------------FN_DYNVARS_076_05-----------------------#' -############################################################## -# Change the value of max_error_count to an invalid value # -############################################################## - -SET @@global.max_error_count = -1; -SELECT @@global.max_error_count; -SET @@global.max_error_count = -1024; -SELECT @@global.max_error_count; -SET @@global.max_error_count = 65536; -SELECT @@global.max_error_count; -SET @@global.max_error_count = 10737418241; -SELECT @@global.max_error_count; ---Error ER_PARSE_ERROR -SET @@global.max_error_count = 65530.34.; -SELECT @@global.max_error_count; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_error_count = test; -SELECT @@global.max_error_count; - -SET @@session.max_error_count = -1; -SELECT @@session.max_error_count; -SET @@session.max_error_count = 65536; -SELECT @@session.max_error_count; -SET @@session.max_error_count = -2; -SELECT @@session.max_error_count; ---Error ER_PARSE_ERROR -SET @@session.max_error_count = 65530.34.; -SET @@session.max_error_count = 10737418241; -SELECT @@session.max_error_count; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_error_count = test; -SELECT @@session.max_error_count; - - ---echo '#------------------FN_DYNVARS_076_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_error_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_error_count'; - ---echo '#------------------FN_DYNVARS_076_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_error_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_error_count'; - - ---echo '#------------------FN_DYNVARS_076_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_error_count = TRUE; -SELECT @@global.max_error_count; -SET @@global.max_error_count = FALSE; -SELECT @@global.max_error_count; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_error_count = 2048; -SELECT @@max_error_count = @@global.max_error_count; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_error_count = 60000; -SELECT @@max_error_count = @@local.max_error_count; -SELECT @@local.max_error_count = @@session.max_error_count; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################# -# Check if max_error_count can be accessed with and without @@ sign # -############################################################################# - -SET max_error_count = 1024; -SELECT @@max_error_count; ---Error ER_UNKNOWN_TABLE -SELECT local.max_error_count; ---Error ER_UNKNOWN_TABLE -SELECT session.max_error_count; ---Error ER_BAD_FIELD_ERROR -SELECT max_error_count = @@session.max_error_count; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_error_count = @start_global_value; -SELECT @@global.max_error_count; -SET @@session.max_error_count = @start_session_value; -SELECT @@session.max_error_count; - - -####################################################### -# END OF max_error_count TESTS # -####################################################### - diff --git a/mysql-test/t/max_insert_delayed_threads_basic.test b/mysql-test/t/max_insert_delayed_threads_basic.test deleted file mode 100644 index d165ddc11fe..00000000000 --- a/mysql-test/t/max_insert_delayed_threads_basic.test +++ /dev/null @@ -1,231 +0,0 @@ -############## mysql-test\t\max_insert_delayed_threads_basic.test ############### -# # -# Variable Name: max_insert_delayed_threads # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: - # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_insert_delayed_threads # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################## -# START OF max_insert_delayed_threads TESTS # -################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_insert_delayed_threads; -SELECT @start_global_value; -SET @start_session_value = @@session.max_insert_delayed_threads; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_078_01-------------------------#' -################################################################## -# Display the DEFAULT value of max_insert_delayed_threads # -################################################################## - -SET @@global.max_insert_delayed_threads = 1000; ---Error ER_NO_DEFAULT -SET @@global.max_insert_delayed_threads = DEFAULT; -SELECT @@global.max_insert_delayed_threads; - - -SET @@session.max_insert_delayed_threads = 1000; -SET @@session.max_insert_delayed_threads = DEFAULT; -SELECT @@session.max_insert_delayed_threads; - - ---echo '#--------------------FN_DYNVARS_078_02-------------------------#' -################################################################## -# Check the DEFAULT value of max_insert_delayed_threads # -################################################################## - ---Error ER_NO_DEFAULT -SET @@global.max_insert_delayed_threads = DEFAULT; -SELECT @@global.max_insert_delayed_threads = 20; - -SET @@session.max_insert_delayed_threads = DEFAULT; -SELECT @@session.max_insert_delayed_threads = 20; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - - ---echo '#--------------------FN_DYNVARS_078_03-------------------------#' -###############################################################$$$$$$$$############# -# Change the value of max_insert_delayed_threads to a valid value for GLOBAL Scope # -###############################################################$$$$$$$$############# - -SET @@global.max_insert_delayed_threads = 1; -SELECT @@global.max_insert_delayed_threads; -SET @@global.max_insert_delayed_threads = 1025; -SELECT @@global.max_insert_delayed_threads; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - -SET @@global.max_insert_delayed_threads = 0; -SELECT @@global.max_insert_delayed_threads; -SET @@global.max_insert_delayed_threads = 16384; -SELECT @@global.max_insert_delayed_threads; -SET @@global.max_insert_delayed_threads = 16383; -SELECT @@global.max_insert_delayed_threads; - ---echo '#--------------------FN_DYNVARS_078_04-------------------------#' -##################################################################################### -# Change the value of max_insert_delayed_threads to a valid value for SESSION Scope # -##################################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_insert_delayed_threads = 1; -SELECT @@session.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_insert_delayed_threads = 1025; -SELECT @@session.max_insert_delayed_threads; - -SET @@session.max_insert_delayed_threads = 0; -SELECT @@session.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_insert_delayed_threads = 16384; -SELECT @@session.max_insert_delayed_threads; - -SET @@session.max_insert_delayed_threads = 16383; -SELECT @@session.max_insert_delayed_threads; - - ---echo '#------------------FN_DYNVARS_078_05-----------------------#' -###################################################################### -# Change the value of max_insert_delayed_threads to an invalid value # -###################################################################### - -SET @@global.max_insert_delayed_threads = -1024; -SELECT @@global.max_insert_delayed_threads; -SET @@global.max_insert_delayed_threads = -1; -SELECT @@global.max_insert_delayed_threads; -SET @@global.max_insert_delayed_threads = 16385; -SELECT @@global.max_insert_delayed_threads; ---Error ER_PARSE_ERROR -SET @@global.max_insert_delayed_threads = 65530.34.; -SELECT @@global.max_insert_delayed_threads; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_insert_delayed_threads = test; -SELECT @@global.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_insert_delayed_threads = 16385; -SELECT @@session.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_insert_delayed_threads = -1; -SELECT @@session.max_insert_delayed_threads; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_insert_delayed_threads = -2; -SELECT @@session.max_insert_delayed_threads; ---Error ER_PARSE_ERROR -SET @@session.max_insert_delayed_threads = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.max_insert_delayed_threads = 10737418241; -SELECT @@session.max_insert_delayed_threads; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_insert_delayed_threads = test; -SELECT @@session.max_insert_delayed_threads; - - ---echo '#------------------FN_DYNVARS_078_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_insert_delayed_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_insert_delayed_threads'; - ---echo '#------------------FN_DYNVARS_078_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_insert_delayed_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_insert_delayed_threads'; - - ---echo '#------------------FN_DYNVARS_078_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_insert_delayed_threads = TRUE; -SELECT @@global.max_insert_delayed_threads; -SET @@global.max_insert_delayed_threads = FALSE; -SELECT @@global.max_insert_delayed_threads; - - ---echo '#---------------------FN_DYNVARS_078_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_insert_delayed_threads = 2048; -SELECT @@max_insert_delayed_threads = @@global.max_insert_delayed_threads; - - ---echo '#---------------------FN_DYNVARS_078_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@max_insert_delayed_threads = 100000; -SELECT @@max_insert_delayed_threads = @@local.max_insert_delayed_threads; -SELECT @@local.max_insert_delayed_threads = @@session.max_insert_delayed_threads; - - ---echo '#---------------------FN_DYNVARS_078_11----------------------#' -##################################################################################### -# Check if max_insert_delayed_threads can be accessed with and without @@ sign # -##################################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET max_insert_delayed_threads = 1024; -SELECT @@max_insert_delayed_threads; ---Error ER_UNKNOWN_TABLE -SELECT local.max_insert_delayed_threads; ---Error ER_UNKNOWN_TABLE -SELECT session.max_insert_delayed_threads; ---Error ER_BAD_FIELD_ERROR -SELECT max_insert_delayed_threads = @@session.max_insert_delayed_threads; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_insert_delayed_threads = @start_global_value; -SELECT @@global.max_insert_delayed_threads; -SET @@session.max_insert_delayed_threads = @start_session_value; -SELECT @@session.max_insert_delayed_threads; - - -############################################################### -# END OF max_insert_delayed_threads TESTS # -############################################################### - diff --git a/mysql-test/t/max_join_size_func.test b/mysql-test/t/max_join_size_func.test deleted file mode 100644 index 0ea0d77bcd6..00000000000 --- a/mysql-test/t/max_join_size_func.test +++ /dev/null @@ -1,124 +0,0 @@ -################# mysql-test\t\max_join_size_func.test ######################## -# # -# Variable Name: max_join_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 4294967295 # -# Range: 1-4294967295 # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable max_join_size # -# that checks the functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - - ---disable_warnings -drop table if exists t1; ---enable_warnings - -############################## -# Creating two new tables # -############################## - ---echo ## Creating new table t1 ## -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - ---echo ## Creating another table t2 ## -CREATE TABLE t2 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name VARCHAR(30) -); - -######################################### -# Inserting some data in both tables # -######################################### - ---echo ## Inserting records in both the tables ## -INSERT INTO t1(name) VALUES('Record_1'); -INSERT INTO t1(name) VALUES('Record_2'); -INSERT INTO t1(name) VALUES('Record_3'); -INSERT INTO t1(name) VALUES('Record_4'); -INSERT INTO t1(name) VALUES('Record_5'); - -INSERT INTO t2(name) VALUES('Record_1_1'); -INSERT INTO t2(name) VALUES('Record_2_1'); -INSERT INTO t2(name) VALUES('Record_3_1'); -INSERT INTO t2(name) VALUES('Record_4_1'); -INSERT INTO t2(name) VALUES('Record_5_1'); - - ---echo '#--------------------FN_DYNVARS_079_01-------------------------#' -####################################################################### -# Verifying case where max_join_size is greater than the join size # -####################################################################### - - ---echo ## Setting max_join size value to 10 ## -SET @@session.max_join_size=10; - ---echo ## This should work ## -SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id; - - ---echo '#--------------------FN_DYNVARS_079_02-------------------------#' -#################################################################### -# Verifying case where max_join_size is less than the join size # -#################################################################### - ---echo ## Creating new connection test_con1 ## -connect (test_con1, localhost, root,,); -connection test_con1; - ---echo ## Setting value of max_join_size ## -SET @@session.max_join_size=8; - ---echo ## Since total joins are more than max_join_size value so error will occur ## ---Error ER_TOO_BIG_SELECT -SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id; - - ---echo '#--------------------FN_DYNVARS_079_03-------------------------#' -########################################################## -# Verifying behavior of max_join_size on global scope # -########################################################## - ---echo ## Setting global value of variable ## -SET @@global.max_join_size=8; - ---echo ## Creating and switching to new connection test_con2 ## -connect (test_con2, localhost, root,,); -connection test_con2; - ---echo ## Verifying value of max_join_size ## -SELECT @@global.max_join_size; - ---echo ## Since total joins are more than max_join_size value so error will occur ## ---Error ER_TOO_BIG_SELECT -SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id; - ---echo ## Dropping both the tables ## -Drop table t1, t2; - ---echo ## Restoring values ## -SET @@global.max_join_size = DEFAULT; -SET @@session.max_join_size = DEFAULT; - ---echo ## Dropping connections ## -disconnect test_con1; -disconnect test_con2; - diff --git a/mysql-test/t/max_length_for_sort_data_basic.test b/mysql-test/t/max_length_for_sort_data_basic.test deleted file mode 100644 index 682e14146d7..00000000000 --- a/mysql-test/t/max_length_for_sort_data_basic.test +++ /dev/null @@ -1,224 +0,0 @@ -############## mysql-test\t\max_length_for_sort_data_basic.test ############### -# # -# Variable Name: max_length_for_sort_data # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1024 # -# Range: 4-8388608 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_length_for_sort_data # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -##################################################### -# START OF max_length_for_sort_data TESTS # -##################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_length_for_sort_data; -SELECT @start_global_value; -SET @start_session_value = @@session.max_length_for_sort_data; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_080_01-------------------------#' -################################################################ -# Display the DEFAULT value of max_length_for_sort_data # -################################################################ - -SET @@global.max_length_for_sort_data = 1000; -SET @@global.max_length_for_sort_data = DEFAULT; -SELECT @@global.max_length_for_sort_data; - - -SET @@session.max_length_for_sort_data = 1000; -SET @@session.max_length_for_sort_data = DEFAULT; -SELECT @@session.max_length_for_sort_data; - - ---echo '#--------------------FN_DYNVARS_080_02-------------------------#' -################################################################ -# Check the DEFAULT value of max_length_for_sort_data # -################################################################ - -SET @@global.max_length_for_sort_data = DEFAULT; -SELECT @@global.max_length_for_sort_data = 1024; - -SET @@session.max_length_for_sort_data = DEFAULT; -SELECT @@session.max_length_for_sort_data = 1024; - - - ---echo '#--------------------FN_DYNVARS_080_03-------------------------#' -################################################################################## -# Change the value of max_length_for_sort_data to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.max_length_for_sort_data = 4; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = 5; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = 8388608; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = 8388607; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = 65536; -SELECT @@global.max_length_for_sort_data; - ---echo '#--------------------FN_DYNVARS_080_04-------------------------#' -################################################################################### -# Change the value of max_length_for_sort_data to a valid value for SESSION Scope # -################################################################################### - -SET @@session.max_length_for_sort_data = 4; -SELECT @@session.max_length_for_sort_data; - -SET @@session.max_length_for_sort_data = 5; -SELECT @@session.max_length_for_sort_data; - -SET @@session.max_length_for_sort_data = 8388608; -SELECT @@session.max_length_for_sort_data; - -SET @@session.max_length_for_sort_data = 8388607; -SELECT @@session.max_length_for_sort_data; - -SET @@session.max_length_for_sort_data = 65536; -SELECT @@session.max_length_for_sort_data; - - ---echo '#------------------FN_DYNVARS_080_05-----------------------#' -#################################################################### -# Change the value of max_length_for_sort_data to an invalid value # -#################################################################### - -SET @@global.max_length_for_sort_data = -1024; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = 3; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = 8388609; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = 0; -SELECT @@global.max_length_for_sort_data; ---Error ER_PARSE_ERROR -SET @@global.max_length_for_sort_data = 65530.34.; -SELECT @@global.max_length_for_sort_data; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_length_for_sort_data = test; -SELECT @@global.max_length_for_sort_data; - -SET @@session.max_length_for_sort_data = 8388610; -SELECT @@session.max_length_for_sort_data; -SET @@session.max_length_for_sort_data = -1; -SELECT @@session.max_length_for_sort_data; -SET @@session.max_length_for_sort_data = 3; -SELECT @@session.max_length_for_sort_data; -SET @@session.max_length_for_sort_data = 0; -SELECT @@session.max_length_for_sort_data; ---Error ER_PARSE_ERROR -SET @@session.max_length_for_sort_data = 65530.34.; -SET @@session.max_length_for_sort_data = 10737418241; -SELECT @@session.max_length_for_sort_data; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_length_for_sort_data = test; -SELECT @@session.max_length_for_sort_data; - - ---echo '#------------------FN_DYNVARS_080_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_length_for_sort_data = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_length_for_sort_data'; - ---echo '#------------------FN_DYNVARS_080_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_length_for_sort_data = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_length_for_sort_data'; - - ---echo '#------------------FN_DYNVARS_080_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_length_for_sort_data = TRUE; -SELECT @@global.max_length_for_sort_data; -SET @@global.max_length_for_sort_data = FALSE; -SELECT @@global.max_length_for_sort_data; - - ---echo '#---------------------FN_DYNVARS_080_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_length_for_sort_data = 2048; -SELECT @@max_length_for_sort_data = @@global.max_length_for_sort_data; - - ---echo '#---------------------FN_DYNVARS_080_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_length_for_sort_data = 100000; -SELECT @@max_length_for_sort_data = @@local.max_length_for_sort_data; -SELECT @@local.max_length_for_sort_data = @@session.max_length_for_sort_data; - - ---echo '#---------------------FN_DYNVARS_080_11----------------------#' -################################################################################### -# Check if max_length_for_sort_data can be accessed with and without @@ sign # -################################################################################### - - -SET max_length_for_sort_data = 1024; -SELECT @@max_length_for_sort_data; ---Error ER_UNKNOWN_TABLE -SELECT local.max_length_for_sort_data; ---Error ER_UNKNOWN_TABLE -SELECT session.max_length_for_sort_data; ---Error ER_BAD_FIELD_ERROR -SELECT max_length_for_sort_data = @@session.max_length_for_sort_data; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_length_for_sort_data = @start_global_value; -SELECT @@global.max_length_for_sort_data; -SET @@session.max_length_for_sort_data = @start_session_value; -SELECT @@session.max_length_for_sort_data; - - -############################################################# -# END OF max_length_for_sort_data TESTS # -############################################################# - diff --git a/mysql-test/t/max_prepared_stmt_count_basic.test b/mysql-test/t/max_prepared_stmt_count_basic.test deleted file mode 100644 index 2206a388abb..00000000000 --- a/mysql-test/t/max_prepared_stmt_count_basic.test +++ /dev/null @@ -1,185 +0,0 @@ -############## mysql-test\t\max_prepared_stmt_count_basic.test ############### -# # -# Variable Name: max_prepared_stmt_count # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 16382 # -# Range: 0-1048576 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_prepared_stmt_count # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - -#Due to differences in the results, ps-protocol is switched off. ---disable_ps_protocol - ---source include/load_sysvars.inc - - -######################################################################## -# START OF max_prepared_stmt_count TESTS # -######################################################################## - - -########################################################################### -# Saving initial value of max_prepared_stmt_count in a temporary variable # -########################################################################### - -SET @start_value = @@global.max_prepared_stmt_count; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_081_01------------------------#' -########################################################################## -# Display the DEFAULT value of max_prepared_stmt_count # -########################################################################## - -SET @@global.max_prepared_stmt_count = 5000; -SET @@global.max_prepared_stmt_count = DEFAULT; -SELECT @@global.max_prepared_stmt_count; - - ---echo '#---------------------FN_DYNVARS_081_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.max_prepared_stmt_count = @start_value; -SELECT @@global.max_prepared_stmt_count = 16382; - - ---echo '#--------------------FN_DYNVARS_081_03------------------------#' -########################################################################## -# Change the value of max_prepared_stmt_count to a valid value # -########################################################################## - -SET @@global.max_prepared_stmt_count = 0; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 1; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 1048576; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 1048575; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 65535; -SELECT @@global.max_prepared_stmt_count; - - ---echo '#--------------------FN_DYNVARS_081_04-------------------------#' -############################################################################# -# Change the value of max_prepared_stmt_count to invalid value # -############################################################################# - -SET @@global.max_prepared_stmt_count = -1; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 100000000000; -SELECT @@global.max_prepared_stmt_count; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_prepared_stmt_count = 10000.01; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = -1024; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 1048577; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = 104857612; -SELECT @@global.max_prepared_stmt_count; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_prepared_stmt_count = ON; -SELECT @@global.max_prepared_stmt_count; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_prepared_stmt_count = 'test'; -SELECT @@global.max_prepared_stmt_count; - - ---echo '#-------------------FN_DYNVARS_081_05----------------------------#' -############################################################################# -# Test if accessing session max_prepared_stmt_count gives error # -############################################################################# - ---Error ER_GLOBAL_VARIABLE -SET @@session.max_prepared_stmt_count = 4096; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.max_prepared_stmt_count; - - ---echo '#----------------------FN_DYNVARS_081_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.max_prepared_stmt_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_prepared_stmt_count'; - -SELECT @@max_prepared_stmt_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_prepared_stmt_count'; - - ---echo '#---------------------FN_DYNVARS_081_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.max_prepared_stmt_count = TRUE; -SELECT @@global.max_prepared_stmt_count; -SET @@global.max_prepared_stmt_count = FALSE; -SELECT @@global.max_prepared_stmt_count; - - ---echo '#---------------------FN_DYNVARS_081_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.max_prepared_stmt_count = 5000; -SELECT @@max_prepared_stmt_count = @@global.max_prepared_stmt_count; - - ---echo '#---------------------FN_DYNVARS_081_09----------------------#' -################################################################################ -# Check if max_prepared_stmt_count can be accessed with and without @@ sign # -################################################################################ - ---Error ER_GLOBAL_VARIABLE -SET max_prepared_stmt_count = 6000; -SELECT @@max_prepared_stmt_count; ---Error ER_PARSE_ERROR -SET local.max_prepared_stmt_count = 7000; ---Error ER_UNKNOWN_TABLE -SELECT local.max_prepared_stmt_count; ---Error ER_PARSE_ERROR -SET global.max_prepared_stmt_count = 8000; ---Error ER_UNKNOWN_TABLE -SELECT global.max_prepared_stmt_count; ---Error ER_BAD_FIELD_ERROR -SELECT max_prepared_stmt_count = @@session.max_prepared_stmt_count; - - -############################## -# Restore initial value # -############################## - -SET @@global.max_prepared_stmt_count = @start_value; -SELECT @@global.max_prepared_stmt_count; - ---enable_ps_protocol -######################################################################## -# END OF max_prepared_stmt_count TESTS # -######################################################################## diff --git a/mysql-test/t/max_prepared_stmt_count_func.test b/mysql-test/t/max_prepared_stmt_count_func.test deleted file mode 100644 index 6617c4ad2ea..00000000000 --- a/mysql-test/t/max_prepared_stmt_count_func.test +++ /dev/null @@ -1,152 +0,0 @@ -############# mysql-test\t\max_prepared_stmt_count_fn.test ##################### -# # -# Variable Name: max_prepared_stmt_count # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: NUMERIC # -# Default Value: 16382 # -# Values: 0-1048576 # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "max_prepared_stmt_count" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html# -# option_mysqld_max_prepared_stmt_count # -# # -################################################################################ - - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @global_max_prepared_stmt_count = @@global.max_prepared_stmt_count; - - ---echo '#---------------------FN_DYNVARS_031_01----------------------#' -################################################################################# -# Check if prepared stmt Can be created more then max_prepared_stmt_count value# -################################################################################# - -SET GLOBAL max_prepared_stmt_count=2; ---echo ** Prepare statements ** -#preparing stmts -PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; -PREPARE stmt1 from "SELECT * FROM information_schema.CHARACTER_SETS C"; ---Error ER_MAX_PREPARED_STMT_COUNT_REACHED -PREPARE stmt2 from "SELECT * FROM information_schema.CHARACTER_SETS C"; ---echo Expected error "Max prepared statements count reached" - -SHOW STATUS like 'Prepared_stmt_count'; ---echo 2 Expected - - ---echo '#---------------------FN_DYNVARS_031_02----------------------#' -################################################################################ -# Check if prepared stmt Can be created more then max_prepared_stmt_count value -################################################################################ - -SET GLOBAL max_prepared_stmt_count=0; - ---Error ER_MAX_PREPARED_STMT_COUNT_REACHED -PREPARE stmt3 from "SELECT * FROM information_schema.CHARACTER_SETS C"; ---echo Expected error "Max prepared statements count reached" - -SHOW STATUS like 'Prepared_stmt_count'; ---echo 2 Expected - ---Error ER_MAX_PREPARED_STMT_COUNT_REACHED -PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; ---echo Expected error "Max prepared statements count reached" - -SHOW STATUS like 'Prepared_stmt_count'; ---echo 2 Expected ---echo 'Bug#35389 A pre existing valid prepared statement DROPS if a PREPARE' ---echo 'STATEMENT command is issued with the same name that' ---echo 'causes ER_MAX_PREPARED_STMT_COUNT_REACHED error' - - ---echo '#---------------------FN_DYNVARS_031_03----------------------#' -############################################################################## -# check the status of prepared_max stmt after setting max_prepared_stmt_count -############################################################################## - - -SHOW STATUS like 'Prepared_stmt_count'; -SET GLOBAL max_prepared_stmt_count=4; -PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; -PREPARE stmt1 from "SELECT * FROM information_schema.CHARACTER_SETS C"; -PREPARE stmt2 from "SELECT * FROM information_schema.CHARACTER_SETS C"; -PREPARE stmt3 from "SELECT * FROM information_schema.CHARACTER_SETS C"; ---echo ** Value of prepared stmt' -SHOW STATUS LIKE 'Prepared_stmt_count'; ---echo 4 Expected - - ---echo '#---------------------FN_DYNVARS_031_04----------------------#' -###################################################################### -# Setting value lower then number of prepared stmt # -###################################################################### - ---echo ** preparing stmts ** -#preparing stmts - -PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; -PREPARE stmt1 from "SELECT * FROM information_schema.CHARACTER_SETS C"; -PREPARE stmt2 from "SELECT * FROM information_schema.CHARACTER_SETS C"; - ---echo ** setting value ** -SET GLOBAL max_prepared_stmt_count=3; ---echo ** Check wether any more statements can be prepared ** - ---Error ER_MAX_PREPARED_STMT_COUNT_REACHED -PREPARE stmt5 from "SELECT * FROM information_schema.CHARACTER_SETS C"; ---echo Expected error "Max prepared statements count reached" - -SHOW STATUS LIKE 'Prepared_stmt_count'; ---echo 4 Expected - - ---echo '#---------------------FN_DYNVARS_031_05----------------------#' -########################################################################### -# Checking in stored procedure# -########################################################################### - -SET GLOBAL max_prepared_stmt_count=3; - ---echo ** Creating procedure ** -# create procedure to add rows -DROP PROCEDURE IF EXISTS sp_checkstmts; - -DELIMITER //; - -CREATE PROCEDURE sp_checkstmts () -BEGIN -PREPARE newstmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; -END // - -DELIMITER ;// - --- Error ER_MAX_PREPARED_STMT_COUNT_REACHED -CALL sp_checkstmts(); ---echo Expected error "Max prepared statements count reached" - -# -# Cleanup -# - -DROP PREPARE stmt; -DROP PREPARE stmt1; -DROP PREPARE stmt2; -DROP PREPARE stmt3; - -DROP PROCEDURE sp_checkstmts; - -SET @@global.max_prepared_stmt_count = @global_max_prepared_stmt_count; diff --git a/mysql-test/t/max_relay_log_size_basic.test b/mysql-test/t/max_relay_log_size_basic.test deleted file mode 100644 index b780aa2b444..00000000000 --- a/mysql-test/t/max_relay_log_size_basic.test +++ /dev/null @@ -1,184 +0,0 @@ -############## mysql-test\t\max_relay_log_size_basic.test ############### -# # -# Variable Name: max_relay_log_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1024 # -# Range: 0-1073741824 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_relay_log_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -################################################################### -# START OF max_relay_log_size TESTS # -################################################################### - - -###################################################################### -# Saving initial value of max_relay_log_size in a temporary variable # -###################################################################### - -SET @start_value = @@global.max_relay_log_size; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_082_01------------------------#' -##################################################################### -# Display the DEFAULT value of max_relay_log_size # -##################################################################### - -SET @@global.max_relay_log_size = 5000; -SET @@global.max_relay_log_size = DEFAULT; -SELECT @@global.max_relay_log_size; - - ---echo '#---------------------FN_DYNVARS_082_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.max_relay_log_size = @start_value; -SELECT @@global.max_relay_log_size = 1024; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - - ---echo '#--------------------FN_DYNVARS_082_03------------------------#' -##################################################################### -# Change the value of max_relay_log_size to a valid value # -##################################################################### - -SET @@global.max_relay_log_size = 0; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = 1; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = 1073741824; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = 1073741823; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = 65535; -SELECT @@global.max_relay_log_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - ---echo '#--------------------FN_DYNVARS_082_04-------------------------#' -######################################################################## -# Change the value of max_relay_log_size to invalid value # -######################################################################## - -SET @@global.max_relay_log_size = -1; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = 100000000000; -SELECT @@global.max_relay_log_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_relay_log_size = 10000.01; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = -1024; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = 1073741825; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = 10737418241; -SELECT @@global.max_relay_log_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_relay_log_size = ON; -SELECT @@global.max_relay_log_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_relay_log_size = 'test'; -SELECT @@global.max_relay_log_size; - - ---echo '#-------------------FN_DYNVARS_082_05----------------------------#' -######################################################################## -# Test if accessing session max_relay_log_size gives error # -######################################################################## - ---Error ER_GLOBAL_VARIABLE -SET @@session.max_relay_log_size = 4096; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.max_relay_log_size; - - ---echo '#----------------------FN_DYNVARS_082_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.max_relay_log_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_relay_log_size'; - -SELECT @@max_relay_log_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_relay_log_size'; - - ---echo '#---------------------FN_DYNVARS_082_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.max_relay_log_size = TRUE; -SELECT @@global.max_relay_log_size; -SET @@global.max_relay_log_size = FALSE; -SELECT @@global.max_relay_log_size; - - ---echo '#---------------------FN_DYNVARS_082_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.max_relay_log_size = 5000; -SELECT @@max_relay_log_size = @@global.max_relay_log_size; - - ---echo '#---------------------FN_DYNVARS_082_09----------------------#' -############################################################################# -# Check if max_relay_log_size can be accessed with and without @@ sign # -############################################################################# - ---Error ER_GLOBAL_VARIABLE -SET max_relay_log_size = 6000; -SELECT @@max_relay_log_size; ---Error ER_PARSE_ERROR -SET local.max_relay_log_size = 7000; ---Error ER_UNKNOWN_TABLE -SELECT local.max_relay_log_size; ---Error ER_PARSE_ERROR -SET global.max_relay_log_size = 8000; ---Error ER_UNKNOWN_TABLE -SELECT global.max_relay_log_size; ---Error ER_BAD_FIELD_ERROR -SELECT max_relay_log_size = @@session.max_relay_log_size; - - -############################## -# Restore initial value # -############################## - -SET @@global.max_relay_log_size = @start_value; -SELECT @@global.max_relay_log_size; - - -##################################################################### -# END OF max_relay_log_size TESTS # -##################################################################### - diff --git a/mysql-test/t/max_seeks_for_key_func.test b/mysql-test/t/max_seeks_for_key_func.test deleted file mode 100644 index cdabd43328f..00000000000 --- a/mysql-test/t/max_seeks_for_key_func.test +++ /dev/null @@ -1,104 +0,0 @@ - - - -#Test for max_seeks_for_key# - - ---disable_warnings -drop table if exists t1; ---enable_warnings - - -######################### -# Creating new table # -######################### - -CREATE TABLE t1 -(a int auto_increment primary key, -b char(20) -); - - - ---echo '#--------------------FN_DYNVARS_084_01-------------------------#' -########################################################## -# Test behavior of variable on new connection # 01 # -########################################################## - -CONNECT (test_con1,localhost,root,,); -CONNECTION test_con1; - -# Value of session & global vairable here should be 10 -SELECT @@global.max_seeks_for_key = 10; -SELECT @@session.max_seeks_for_key = 10; - -# Setting global value of variable and inserting data in table -SET @@global.max_seeks_for_key = 20; -SELECT @@global.max_seeks_for_key; -INSERT into t1(b) values("AREc"); -explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; - -# Setting session value of variable and inserting data in table -SET @@session.max_seeks_for_key = 2; -SELECT @@session.max_seeks_for_key; -INSERT into t1(b) values("BREc"); -INSERT into t1(b) values("CRec"); -explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; - - ---echo '#--------------------FN_DYNVARS_084_02-------------------------#' -########################################################## -# Test behavior of variable on new connection # 02 # -########################################################## - - -CONNECT (test_con2,localhost,root,,); -connection test_con2; - - -# Value of session & global vairable here should be 10 -SELECT @@global.max_seeks_for_key = 10; -SELECT @@session.max_seeks_for_key = 10; - -# Setting global value of variable and inserting data in table -SET @@global.max_seeks_for_key = 20; -SELECT @@global.max_seeks_for_key; -INSERT into t1(b) values("AREc"); -explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; - -# Setting session value of variable and inserting data in table -SET @@session.max_seeks_for_key = 2; -SELECT @@session.max_seeks_for_key; -INSERT into t1(b) values("BREc"); -INSERT into t1(b) values("CRec"); -explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; - - - - - - -##################################################### -# Inserting values in table t and analyzing table # -##################################################### - -INSERT INTO t1 values(null,"test"); -INSERT INTO t1 VALUES (null,"a"),(null,"a"),(null,"a"), - (null,"a"),(null,"a"),(null,"a"),(null,"a"), - (null,"a"),(null,"a"),(null,"a"); -explain SELECT STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; -analyze table t1; - -################################################################### -# Setting new value for max_seeks_for_key and anaylyzing table # -################################################################### - -SET MAX_SEEKS_FOR_KEY=1; - - -explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; -SET MAX_SEEKS_FOR_KEY=DEFAULT; - -drop table t1; - - diff --git a/mysql-test/t/max_sort_length_basic.test b/mysql-test/t/max_sort_length_basic.test deleted file mode 100644 index 1198d7b1851..00000000000 --- a/mysql-test/t/max_sort_length_basic.test +++ /dev/null @@ -1,225 +0,0 @@ -############## mysql-test\t\max_sort_length_basic.test ############### -# # -# Variable Name: max_sort_length # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1024 # -# Range: 4-8388608 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_sort_length # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -############################################ -# START OF max_sort_length TESTS # -############################################ - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_sort_length; -SELECT @start_global_value; -SET @start_session_value = @@session.max_sort_length; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_084_01-------------------------#' -####################################################### -# Display the DEFAULT value of max_sort_length # -####################################################### - -SET @@global.max_sort_length = 1000; -SET @@global.max_sort_length = DEFAULT; -SELECT @@global.max_sort_length; - - -SET @@session.max_sort_length = 1000; -SET @@session.max_sort_length = DEFAULT; -SELECT @@session.max_sort_length; - - ---echo '#--------------------FN_DYNVARS_084_02-------------------------#' -####################################################### -# Check the DEFAULT value of max_sort_length # -####################################################### - -SET @@global.max_sort_length = DEFAULT; -SELECT @@global.max_sort_length = 1024; - -SET @@session.max_sort_length = DEFAULT; -SELECT @@session.max_sort_length = 1024; - - - ---echo '#--------------------FN_DYNVARS_084_03-------------------------#' -######################################################################### -# Change the value of max_sort_length to a valid value for GLOBAL Scope # -######################################################################### - -SET @@global.max_sort_length = 4; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 5; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 8388608; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 8388607; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 65536; -SELECT @@global.max_sort_length; - ---echo '#--------------------FN_DYNVARS_084_04-------------------------#' -########################################################################## -# Change the value of max_sort_length to a valid value for SESSION Scope # -########################################################################## - -SET @@session.max_sort_length = 4; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 5; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 8388608; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 8388607; -SELECT @@session.max_sort_length; - -SET @@session.max_sort_length = 65536; -SELECT @@session.max_sort_length; - - ---echo '#------------------FN_DYNVARS_084_05-----------------------#' -########################################################### -# Change the value of max_sort_length to an invalid value # -########################################################### - -SET @@global.max_sort_length = -1024; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 3; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 8388609; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = 0; -SELECT @@global.max_sort_length; ---Error ER_PARSE_ERROR -SET @@global.max_sort_length = 65530.34.; -SELECT @@global.max_sort_length; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_sort_length = test; -SELECT @@global.max_sort_length; - -SET @@session.max_sort_length = 8388610; -SELECT @@session.max_sort_length; -SET @@session.max_sort_length = -1; -SELECT @@session.max_sort_length; -SET @@session.max_sort_length = 3; -SELECT @@session.max_sort_length; -SET @@session.max_sort_length = 0; -SELECT @@session.max_sort_length; ---Error ER_PARSE_ERROR -SET @@session.max_sort_length = 65530.34.; -SET @@session.max_sort_length = 10737418241; -SELECT @@session.max_sort_length; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_sort_length = test; -SELECT @@session.max_sort_length; - - ---echo '#------------------FN_DYNVARS_084_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_sort_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_sort_length'; - ---echo '#------------------FN_DYNVARS_084_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_sort_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_sort_length'; - - ---echo '#------------------FN_DYNVARS_084_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_sort_length = TRUE; -SELECT @@global.max_sort_length; -SET @@global.max_sort_length = FALSE; -SELECT @@global.max_sort_length; - - ---echo '#---------------------FN_DYNVARS_084_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_sort_length = 2048; -SELECT @@max_sort_length = @@global.max_sort_length; - - ---echo '#---------------------FN_DYNVARS_084_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_sort_length = 100000; -SELECT @@max_sort_length = @@local.max_sort_length; -SELECT @@local.max_sort_length = @@session.max_sort_length; - - ---echo '#---------------------FN_DYNVARS_084_11----------------------#' -########################################################################## -# Check if max_sort_length can be accessed with and without @@ sign # -########################################################################## - - -SET max_sort_length = 1024; -SELECT @@max_sort_length; ---Error ER_UNKNOWN_TABLE -SELECT local.max_sort_length; ---Error ER_UNKNOWN_TABLE -SELECT session.max_sort_length; ---Error ER_BAD_FIELD_ERROR -SELECT max_sort_length = @@session.max_sort_length; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_sort_length = @start_global_value; -SELECT @@global.max_sort_length; -SET @@session.max_sort_length = @start_session_value; -SELECT @@session.max_sort_length; - - -#################################################### -# END OF max_sort_length TESTS # -#################################################### - diff --git a/mysql-test/t/max_sort_length_func.test b/mysql-test/t/max_sort_length_func.test deleted file mode 100644 index e3197653f0d..00000000000 --- a/mysql-test/t/max_sort_length_func.test +++ /dev/null @@ -1,253 +0,0 @@ -############# mysql-test\t\max_sort_length_func.test ########################### -# # -# Variable Name: sql_warnings # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: NUMERIC # -# Default Value: 1024 # -# Values: 4-8388608 # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable max_prepared_stmt_count_fn# -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html# -# option_mysqld_max_sort_length # -# # -################################################################################ - -# -# Setup -# - -SET @session_max_sort_length = @@Session.max_sort_length; - - ---disable_warnings -DROP TABLE IF EXISTS t; ---enable_warnings - -######################### -# Creating new table # -######################### - - ---echo ** creating tables ** -CREATE TABLE t -( -id INT AUTO_INCREMENT PRIMARY KEY, -c TEXT(30) -); - -CREATE TABLE t1 -( -id INT AUTO_INCREMENT PRIMARY KEY, -c BLOB(30) -); - -CREATE TABLE t2 -( -id INT AUTO_INCREMENT PRIMARY KEY, -c TEXT(30) -); - - - ---echo '#--------------------FN_DYNVARS_098_01-------------------------#' -########################################################## -# Test behavior of variable on new connection # 01 # -########################################################## - - ---echo ** Connecting test_con1 using username 'root' ** -connect (test_con1,localhost,root,,); ---echo ** Connection test_con1 ** -connection test_con1; - -# Value of session & global vairable here should be 10 -SELECT @@global.max_sort_length = 10; -SELECT @@session.max_sort_length = 10; - -# Setting global value of variable and inserting data in table ---echo ** Setting value to 30 and inserting data ** -SET @@global.max_sort_length = 30; -SELECT @@global.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); -SELECT c from t ORDER BY c, id; ---echo ** Results should be sorted ** - -# Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 29; -SELECT @@session.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); -SELECT c from t ORDER BY c, id; ---echo ** Results should be sorted ** - ---echo '#--------------------FN_DYNVARS_098_02-------------------------#' -########################################################## -# Test behavior of variable on new connection # 02 # -########################################################## - ---echo ** Connecting test_con2 using username 'root' ** -connect (test_con2,localhost,root,,); ---echo ** Connection test_con2 ** -connection test_con2; - - -## Setting global value of variable and inserting data in table -SET @@global.max_sort_length = 30; -SELECT @@global.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); -SELECT c from t ORDER BY c, id; - ---echo ** Results should be sorted ** - -# Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 20; -SELECT @@session.max_sort_length; -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); -SELECT c from t ORDER BY c, id; - ---echo ** Results should not be sorted ** - ---echo '#--------------------FN_DYNVARS_098_03-------------------------#' -######################################################### -#Check if sorting is applied with the max_sort_length=20# -######################################################### - -########################################### -# Setting new value for max_sort_length # -########################################### - -SET max_sort_length=20; - -################################### -# Inserting values in table t # -################################### - -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); - -SELECT c from t ORDER BY c, id; ---echo ** Results should not be sorted ** - -RESET QUERY CACHE; - - ---echo '#--------------------FN_DYNVARS_098_04-------------------------#' -######################################################### -#Check if sorting is applied with the max_sort_length=29# -######################################################### - -SET max_sort_length=29; -SELECT c from t ORDER BY c, id; ---echo ** Results should be sorted ** - ---echo '#--------------------FN_DYNVARS_098_05-------------------------#' -######################################################### -#Check if sorting is applied with the max_sort_length=30# -######################################################### - -SET max_sort_length=30; -SELECT c from t ORDER BY c, id; ---echo ** Results should be sorted ** - ---echo '#--------------------FN_DYNVARS_098_06-------------------------#' -############################################################## -#Check if sorting is applied with the max_sort_length=Default# -############################################################## - - -SET max_sort_length=default; -SELECT c from t ORDER BY c, id; ---echo ** Results should be sorted ** - - ---echo '#--------------------FN_DYNVARS_098_07-------------------------#' -########################################### -#Check if sorting is applied on BLOB type # -########################################### ---echo Testing type BLOB -## Setting global value of variable and inserting data in table -SET @@global.max_sort_length = 30; -SELECT @@global.max_sort_length; -INSERT INTO t1 set c = repeat('x',29); -INSERT INTO t1 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t1 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t1 set c = concat(repeat('x',28),'g','w'); -SELECT c from t1 ORDER BY c, id; ---echo ** Results should be sorted ** - -# Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 20; -SELECT @@session.max_sort_length; -INSERT INTO t1 set c = repeat('x',29); -INSERT INTO t1 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t1 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t1 set c = concat(repeat('x',28),'g','w'); -SELECT c from t1 ORDER BY c, id; ---echo ** Results should not be sorted ** - ---echo '#--------------------FN_DYNVARS_098_08-------------------------#' -########################################### -#Check if sorting is applied on CHAR type # -########################################### ---echo Testing type CHAR -## Setting global value of variable and inserting data in table -SET @@global.max_sort_length = 30; -SELECT @@global.max_sort_length; -INSERT INTO t2 set c = repeat('x',29); -INSERT INTO t2 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t2 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t2 set c = concat(repeat('x',28),'g','w'); -SELECT c from t2 ORDER BY c, id; ---echo ** Results should not be sorted ** - -# Setting session value of variable and inserting data in table -SET @@session.max_sort_length = 20; -SELECT @@session.max_sort_length; -INSERT INTO t2 set c = repeat('x',29); -INSERT INTO t2 set c = concat(repeat('x',28),'r','x'); -INSERT INTO t2 set c = concat(repeat('x',28),'s','y'); -INSERT INTO t2 set c = concat(repeat('x',28),'g','w'); -SELECT c from t2 ORDER BY c, id; ---echo ** Results should not be sorted ** - - -# -# Cleanup -# - ---echo ** Connection default ** -connection default; - ---echo ** Disconnecting test_con1, test_con2 ** -disconnect test_con1; -disconnect test_con2; - -SET @@SESSION.max_sort_length = @session_max_sort_length; - ---disable_warnings -DROP TABLE IF EXISTS t; -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; ---enable_warnings - diff --git a/mysql-test/t/max_sp_recursion_depth_basic.test b/mysql-test/t/max_sp_recursion_depth_basic.test deleted file mode 100644 index 8089951c8a2..00000000000 --- a/mysql-test/t/max_sp_recursion_depth_basic.test +++ /dev/null @@ -1,225 +0,0 @@ -############## mysql-test\t\max_sp_recursion_depth_basic.test ############### -# # -# Variable Name: max_sp_recursion_depth # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:0 # -# Max value:255 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_sp_recursion_depth # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -############################################ -# START OF max_sp_recursion_depth TESTS # -############################################ - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_sp_recursion_depth; -SELECT @start_global_value; -SET @start_session_value = @@session.max_sp_recursion_depth; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_085_01-------------------------#' -############################################################## -# Display the DEFAULT value of max_sp_recursion_depth # -############################################################## - -SET @@global.max_sp_recursion_depth = 1000; -SET @@global.max_sp_recursion_depth = DEFAULT; -SELECT @@global.max_sp_recursion_depth; - - -SET @@session.max_sp_recursion_depth = 1000; -SET @@session.max_sp_recursion_depth = DEFAULT; -SELECT @@session.max_sp_recursion_depth; - - ---echo '#--------------------FN_DYNVARS_085_02-------------------------#' -############################################################## -# Check the DEFAULT value of max_sp_recursion_depth # -############################################################## - -SET @@global.max_sp_recursion_depth = DEFAULT; -SELECT @@global.max_sp_recursion_depth = 0; - -SET @@session.max_sp_recursion_depth = DEFAULT; -SELECT @@session.max_sp_recursion_depth = 0; - - - ---echo '#--------------------FN_DYNVARS_085_03-------------------------#' -######################################################################### -# Change the value of max_sp_recursion_depth to a valid value for GLOBAL Scope # -######################################################################### - -SET @@global.max_sp_recursion_depth = 0; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = 1; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = 254; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = 255; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = 150; -SELECT @@global.max_sp_recursion_depth; - ---echo '#--------------------FN_DYNVARS_085_04-------------------------#' -################################################################################# -# Change the value of max_sp_recursion_depth to a valid value for SESSION Scope # -################################################################################# - -SET @@session.max_sp_recursion_depth = 0; -SELECT @@session.max_sp_recursion_depth; - -SET @@session.max_sp_recursion_depth = 1; -SELECT @@session.max_sp_recursion_depth; - -SET @@session.max_sp_recursion_depth = 254; -SELECT @@session.max_sp_recursion_depth; - -SET @@session.max_sp_recursion_depth = 255; -SELECT @@session.max_sp_recursion_depth; - -SET @@session.max_sp_recursion_depth = 150; -SELECT @@session.max_sp_recursion_depth; - - ---echo '#------------------FN_DYNVARS_085_05-----------------------#' -################################################################## -# Change the value of max_sp_recursion_depth to an invalid value # -################################################################## - -SET @@global.max_sp_recursion_depth = -1024; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = 256; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = -1; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = 3000; -SELECT @@global.max_sp_recursion_depth; ---Error ER_PARSE_ERROR -SET @@global.max_sp_recursion_depth = 65530.34.; -SELECT @@global.max_sp_recursion_depth; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_sp_recursion_depth = test; -SELECT @@global.max_sp_recursion_depth; - -SET @@session.max_sp_recursion_depth = 256; -SELECT @@session.max_sp_recursion_depth; -SET @@session.max_sp_recursion_depth = -1; -SELECT @@session.max_sp_recursion_depth; -SET @@session.max_sp_recursion_depth = 500000; -SELECT @@session.max_sp_recursion_depth; -SET @@session.max_sp_recursion_depth = -001; -SELECT @@session.max_sp_recursion_depth; ---Error ER_PARSE_ERROR -SET @@session.max_sp_recursion_depth = 65530.34.; -SET @@session.max_sp_recursion_depth = 10737418241; -SELECT @@session.max_sp_recursion_depth; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_sp_recursion_depth = test; -SELECT @@session.max_sp_recursion_depth; - - ---echo '#------------------FN_DYNVARS_085_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_sp_recursion_depth = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_sp_recursion_depth'; - ---echo '#------------------FN_DYNVARS_085_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_sp_recursion_depth = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_sp_recursion_depth'; - - ---echo '#------------------FN_DYNVARS_085_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_sp_recursion_depth = TRUE; -SELECT @@global.max_sp_recursion_depth; -SET @@global.max_sp_recursion_depth = FALSE; -SELECT @@global.max_sp_recursion_depth; - - ---echo '#---------------------FN_DYNVARS_085_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_sp_recursion_depth = 20; -SELECT @@max_sp_recursion_depth = @@global.max_sp_recursion_depth; - - ---echo '#---------------------FN_DYNVARS_085_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_sp_recursion_depth = 255; -SELECT @@max_sp_recursion_depth = @@local.max_sp_recursion_depth; -SELECT @@local.max_sp_recursion_depth = @@session.max_sp_recursion_depth; - - ---echo '#---------------------FN_DYNVARS_085_11----------------------#' -########################################################################## -# Check if max_sp_recursion_depth can be accessed with and without @@ sign # -########################################################################## - - -SET max_sp_recursion_depth = 102; -SELECT @@max_sp_recursion_depth; ---Error ER_UNKNOWN_TABLE -SELECT local.max_sp_recursion_depth; ---Error ER_UNKNOWN_TABLE -SELECT session.max_sp_recursion_depth; ---Error ER_BAD_FIELD_ERROR -SELECT max_sp_recursion_depth = @@session.max_sp_recursion_depth; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_sp_recursion_depth = @start_global_value; -SELECT @@global.max_sp_recursion_depth; -SET @@session.max_sp_recursion_depth = @start_session_value; -SELECT @@session.max_sp_recursion_depth; - - -#################################################### -# END OF max_sp_recursion_depth TESTS # -#################################################### - diff --git a/mysql-test/t/max_sp_recursion_depth_func.test b/mysql-test/t/max_sp_recursion_depth_func.test deleted file mode 100644 index ab43536457b..00000000000 --- a/mysql-test/t/max_sp_recursion_depth_func.test +++ /dev/null @@ -1,182 +0,0 @@ -############# mysql-test\t\max_sp_recursion_depth_func.test ################### -# # -# Variable Name: max_sp_recursion_depth # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: NUMERIC # -# Default Value: 0 # -# Max Value: 25 # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "max_sp_recursion_depth # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -#Reference:http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html# -# option_mysqld_max_sp_recursion_depth # -# # -############################################################################### - - -# -# Setup -# - -SET @session_max_recursion_depth = @@SESSION.max_sp_recursion_depth; - - ---echo '#--------------------FN_DYNVARS_099_01-------------------------#' -########################################################## -# Test behavior of variable on new connection # 01 # -########################################################## ---echo ** Connecting test_con1 using username 'root' ** -CONNECT (test_con1,localhost,root,,); ---echo ** Connection test_con1 ** -CONNECTION test_con1; - - -# Setting session value of variable -SET @@session.max_sp_recursion_depth = 10; -SELECT @@session.max_sp_recursion_depth; -# create procedure to add rows - ---disable_warnings -DROP PROCEDURE IF EXISTS sp_addRecords; ---enable_warnings - -DELIMITER //; - -CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT) -BEGIN -SELECT var1,var2; -IF var1 < var2 THEN - CALL sp_addRecords(var1+1,var2); - SELECT var1,var2; -END IF; -END // - -DELIMITER ;// - - -CALL sp_addRecords(0,8); - ---echo '#--------------------FN_DYNVARS_099_02-------------------------#' -########################################################## -# Test behavior of variable on new connection # 02 # -########################################################## - ---echo ** Connecting test_con2 using username 'root' ** -CONNECT (test_con2,localhost,root,,); ---echo ** Connection test_con2 ** -connection test_con2; - - -# Setting session value of variable and inserting data in table -SET @@session.max_sp_recursion_depth = 4; -SELECT @@session.max_sp_recursion_depth; -# create procedure to add rows - ---disable_warnings -DROP PROCEDURE IF EXISTS sp_addRecords1; ---enable_warnings - -DELIMITER //; - -CREATE PROCEDURE sp_addRecords1 (IN var1 INT,IN var2 INT) -BEGIN -SELECT var1,var2; -IF var1 < var2 THEN - CALL sp_addRecords1(var1+1,var2); - SELECT var1,var2; -END IF; -END // - -DELIMITER ;// - - -CALL sp_addRecords1(0,4); - - - - ---echo '#---------------------FN_DYNVARS_99_03----------------------#' -#################################################################### -# Check if max_sp_recursion_depth value is set to 10 # -#################################################################### -SET @@max_sp_recursion_depth = 10; -# create procedure to add rows - ---disable_warnings -DROP PROCEDURE IF EXISTS sp_addRecords2; ---enable_warnings - -DELIMITER //; - -CREATE PROCEDURE sp_addRecords2(IN var1 INT,IN var2 INT) -BEGIN -SELECT var1,var2; -IF var1 < var2 THEN - CALL sp_addRecords2(var1+1,var2); - SELECT var1,var2; -END IF; -END // - -DELIMITER ;// - - -CALL sp_addRecords2(0,8); - - ---echo '#---------------------FN_DYNVARS_99_04----------------------#' -############################################################################### -#Check if max_sp_recursion_depth value is set lower then called recursion value -############################################################################### - - -SET @@max_sp_recursion_depth = 4; -# create procedure to add rows -#DROP PROCEDURE IF EXISTS sp_addRecords1; - ---disable_warnings -DROP PROCEDURE IF EXISTS sp_addRecords3; ---enable_warnings - -DELIMITER //; - -CREATE PROCEDURE sp_addRecords3 (IN var1 INT,IN var2 INT) -BEGIN -SELECT var1,var2; -IF var1 < var2 THEN - CALL sp_addRecords3(var1+1,var2); - SELECT var1,var2; -END IF; -END // - -DELIMITER ;// - ---echo Expected error 'SP Recursion limit' ---ERROR ER_SP_RECURSION_LIMIT -CALL sp_addRecords3(0,8); - -# -# Cleanup -# - ---echo ** Connection default ** -connection default; - ---echo ** Disconnecting test_con1, test_con2 ** -disconnect test_con1; -disconnect test_con2; - ---disable_warnings -DROP PROCEDURE IF EXISTS sp_addRecords; -DROP PROCEDURE IF EXISTS sp_addRecords1; -DROP PROCEDURE IF EXISTS sp_addRecords2; -DROP PROCEDURE IF EXISTS sp_addRecords3; ---enable_warnings - -SET @@SESSION.max_sp_recursion_depth = @session_max_recursion_depth; diff --git a/mysql-test/t/max_user_connections_basic.test b/mysql-test/t/max_user_connections_basic.test deleted file mode 100644 index eb231bd8076..00000000000 --- a/mysql-test/t/max_user_connections_basic.test +++ /dev/null @@ -1,172 +0,0 @@ -############## mysql-test\t\max_user_connections_basic.test ############### -# # -# Variable Name: max_user_connections # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: - # -# Range: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_user_connections # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -#################################### -# START OF max_user_connections TESTS # -#################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_user_connections; -SELECT @start_global_value; -SET @start_session_value = @@session.max_user_connections; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_087_01-------------------------#' -###################################################### -# Display the DEFAULT value of max_user_connections # -###################################################### - -SET @@global.max_user_connections = 1000; -SET @@global.max_user_connections = DEFAULT; -SELECT @@global.max_user_connections; - ---Error ER_GLOBAL_VARIABLE -SET @@session.max_user_connections = 1000; ---Error ER_NO_DEFAULT -SET @@session.max_user_connections = DEFAULT; -SELECT @@session.max_user_connections; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---echo '#--------------------FN_DYNVARS_087_02-------------------------#' -###################################################### -# Check the DEFAULT value of max_user_connections # -###################################################### - -SET @@global.max_user_connections = DEFAULT; -SELECT @@global.max_user_connections = 0; - ---Error ER_NO_DEFAULT -SET @@session.max_user_connections = DEFAULT; -SELECT @@session.max_user_connections = 0; - - - ---echo '#--------------------FN_DYNVARS_087_03-------------------------#' -######################################################################## -# Change the value of max_user_connections to a valid value for GLOBAL Scope # -######################################################################## - -SET @@global.max_user_connections = 1; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = 2; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = 65536; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = 4294967295; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = 4294967294; -SELECT @@global.max_user_connections; - - - ---echo '#------------------FN_DYNVARS_087_05-----------------------#' -########################################################## -# Change the value of max_user_connections to an invalid value # -########################################################## - -SET @@global.max_user_connections = -1024; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = 4294967296; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = -1; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = 429496729500; -SELECT @@global.max_user_connections; ---Error ER_PARSE_ERROR -SET @@global.max_user_connections = 65530.34.; -SELECT @@global.max_user_connections; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_user_connections = test; -SELECT @@global.max_user_connections; - - - ---echo '#------------------FN_DYNVARS_087_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_user_connections = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_user_connections'; - - ---echo '#------------------FN_DYNVARS_087_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_user_connections = TRUE; -SELECT @@global.max_user_connections; -SET @@global.max_user_connections = FALSE; -SELECT @@global.max_user_connections; - - ---echo '#---------------------FN_DYNVARS_087_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_user_connections = 20; -SELECT @@max_user_connections = @@global.max_user_connections; - - ---echo '#---------------------FN_DYNVARS_087_11----------------------#' -######################################################################### -# Check if max_user_connections can be accessed with and without @@ sign # -######################################################################### - - -SET @@global.max_user_connections = 102; -SELECT @@max_user_connections; ---Error ER_UNKNOWN_TABLE -SELECT local.max_user_connections; ---Error ER_UNKNOWN_TABLE -SELECT session.max_user_connections; ---Error ER_BAD_FIELD_ERROR -SELECT max_user_connections = @@session.max_user_connections; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_user_connections = @start_global_value; -SELECT @@global.max_user_connections; - - -################################################### -# END OF max_user_connections TESTS # -################################################### - diff --git a/mysql-test/t/max_user_connections_func.test b/mysql-test/t/max_user_connections_func.test deleted file mode 100644 index 841a630c5ce..00000000000 --- a/mysql-test/t/max_user_connections_func.test +++ /dev/null @@ -1,92 +0,0 @@ -############# mysql-test\t\max_user_connections_func.test #################### -# # -# Variable Name: max_user_connections # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: NUMERIC # -# Default Value: - # -# Values: 1-4294967295 # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "max_user_connections # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: # -# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # -# option_mysqld_max_user_connections # -# # -# Modified: 2008-07-10 HHUNGER: Inserted wait condition # -# # -############################################################################## - ---echo ** Setup ** ---echo -# -# Setup -# - ---source include/not_embedded.inc - -SET @default_max_user_connections = @@global.max_user_connections; - -################################### -#Setting value max_user_connection# -################################### - -Set Global max_user_connections=2; - ---echo '#--------------------FN_DYNVARS_114_01-------------------------#' -######################################## -#Should not make more then 2 connection# -######################################## - ---echo ** Connecting conn1 using username 'root' ** -CONNECT (conn1,localhost,root,,); - ---echo ** Connecting conn2 using username 'root' ** -CONNECT (conn2,localhost,root,,); - ---echo ** Connecting conn3 using username 'root' ** ---disable_query_log ---Error ER_TOO_MANY_USER_CONNECTIONS -CONNECT (conn3,localhost,root,,); ---enable_query_log ---echo Expected error "too many connections" - ---echo ** Disconnecting conn1 ** -DISCONNECT conn1; - ---echo ** Poll till disconnected conn1 disappears from processlist -let $wait_condition= SELECT count(id) <= 2 - FROM information_schema.processlist WHERE user = 'root'; ---source include/wait_condition.inc - ---echo '#--------------------FN_DYNVARS_114_02-------------------------#' -##################################################### -#Set value to 3 and see if 3 connections can be made# -##################################################### - -Set Global max_user_connections=3; ---echo ** Connecting conn5 using username 'root' ** -CONNECT (conn5,localhost,root,,); ---echo ** Connecting conn6 using username 'root' ** -CONNECT (conn6,localhost,root,,); - -# -# Cleanup -# - ---echo ** Connection default ** -CONNECTION default; - ---echo ** Disconnecting conn5, conn6 ** -DISCONNECT conn2; -DISCONNECT conn5; -DISCONNECT conn6; - -SET @@global.max_user_connections = @default_max_user_connections; - diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index dd3e4e28aeb..118f8771f91 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -613,6 +613,19 @@ ALTER TABLE m1 UNION=(); SHOW CREATE TABLE m1; DROP TABLE t1, m1; +# +# BUG#32047 - 'Spurious' errors while opening MERGE tables +# +CREATE TABLE t1(a INT); +CREATE TABLE t2(a VARCHAR(10)); +CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2); +CREATE TABLE m2(a INT) ENGINE=MERGE UNION=(t1); +SELECT * FROM t1; +--error ER_WRONG_MRG_TABLE +SELECT * FROM m1; +SELECT * FROM m2; +DROP TABLE t1, t2, m1, m2; + --echo End of 5.0 tests # diff --git a/mysql-test/t/myisam-system.test b/mysql-test/t/myisam-system.test index c4a7651ac7d..dc5bb58b6a2 100644 --- a/mysql-test/t/myisam-system.test +++ b/mysql-test/t/myisam-system.test @@ -7,14 +7,15 @@ drop table if exists t1,t2; --enable_warnings create table t1 (a int) engine=myisam; ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/t1.MYI drop table if exists t1; create table t1 (a int) engine=myisam; ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI +--remove_file $MYSQLD_DATADIR/test/t1.MYI --error 1051,6 drop table t1; create table t1 (a int) engine=myisam; ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD +--remove_file $MYSQLD_DATADIR/test/t1.MYD --error 1105,6,29 drop table t1; --error 1051 diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index f8d9f15fab1..6d7e03b1c28 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1473,8 +1473,9 @@ CREATE TABLE t1 ( KEY (c1), KEY (c2) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0; ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYISAMCHK -d $MYSQLTEST_VARDIR/master-data/test/t1 +let $MYSQLD_DATADIR= `select @@datadir`; +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +--exec $MYISAMCHK -d $MYSQLD_DATADIR/test/t1 DROP TABLE t1; --echo End of 5.1 tests diff --git a/mysql-test/t/myisam_data_pointer_size_basic.test b/mysql-test/t/myisam_data_pointer_size_basic.test deleted file mode 100644 index d151c6000b8..00000000000 --- a/mysql-test/t/myisam_data_pointer_size_basic.test +++ /dev/null @@ -1,182 +0,0 @@ - -############## mysql-test\t\myisam_data_pointer_size_basic.test ################ -# # -# Variable Name: myisam_data_pointer_size # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable myisam_data_pointer_size # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ - ---source include/load_sysvars.inc -################################################################### -# START OF myisam_data_pointer_size TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.myisam_data_pointer_size; -SELECT @start_global_value; - ---echo '#--------------------FN_DYNVARS_093_01-------------------------#' -################################################################### -# Display the DEFAULT value of myisam_data_pointer_size # -################################################################### - -SET @@global.myisam_data_pointer_size = 5; -SET @@global.myisam_data_pointer_size = DEFAULT; -SELECT @@global.myisam_data_pointer_size; - ---echo '#--------------------FN_DYNVARS_093_02-------------------------#' -################################################################### -# Check the DEFAULT value of myisam_data_pointer_size # -################################################################### - -SET @@global.myisam_data_pointer_size = DEFAULT; -SELECT @@global.myisam_data_pointer_size = 6; - ---echo '#--------------------FN_DYNVARS_093_03-------------------------#' -################################################################################## -# Change the value of myisam_data_pointer_size to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.myisam_data_pointer_size = 2; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 3; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 4; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 5; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 6; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 7; -SELECT @@global.myisam_data_pointer_size; - ---echo '#--------------------FN_DYNVARS_093_04-------------------------#' -################################################################################# -# Check if variable can be access with session scope # -################################################################################# - ---Error ER_GLOBAL_VARIABLE -SET @@myisam_data_pointer_size = 2; - ---Error ER_GLOBAL_VARIABLE -SET @@session.myisam_data_pointer_size = 3; - ---Error ER_GLOBAL_VARIABLE -SET @@local.myisam_data_pointer_size = 4; - - - ---echo '#------------------FN_DYNVARS_093_05-----------------------#' -#################################################################### -# Change the value of myisam_data_pointer_size to an invalid value # -#################################################################### - -SET @@global.myisam_data_pointer_size = -1; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 8; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 1; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 4294967296; -SELECT @@global.myisam_data_pointer_size; ---Error ER_PARSE_ERROR -SET @@global.myisam_data_pointer_size = 65530.34.; -SELECT @@global.myisam_data_pointer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_data_pointer_size = two; -SELECT @@global.myisam_data_pointer_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---echo '#------------------FN_DYNVARS_093_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SET @@global.myisam_data_pointer_size = 3; -SELECT @@global.myisam_data_pointer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_data_pointer_size'; - - ---echo '#------------------FN_DYNVARS_093_07-----------------------#' -########################################################################### -# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # -########################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_data_pointer_size'; - - ---echo '#------------------FN_DYNVARS_093_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.myisam_data_pointer_size = TRUE; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = FALSE; -SELECT @@global.myisam_data_pointer_size; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - - -SET @@global.myisam_data_pointer_size = 5; -SELECT @@myisam_data_pointer_size = @@global.myisam_data_pointer_size; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################################## -# Check if myisam_data_pointer_size can be accessed without @@ sign and scope # -################################################################################## - ---Error ER_GLOBAL_VARIABLE -SET myisam_data_pointer_size = 7; ---Error ER_BAD_FIELD_ERROR -SELECT myisam_data_pointer_size; - -SELECT @@myisam_data_pointer_size; - -#verifying another syntax for setting value# - -SET global myisam_data_pointer_size = 2; - -#################################### -# Restore initial value # -#################################### - -SET @@global.myisam_data_pointer_size = @start_global_value; -SELECT @@global.myisam_data_pointer_size; - -######################################################## -# END OF myisam_data_pointer_size TESTS # -######################################################## - diff --git a/mysql-test/t/myisam_data_pointer_size_func.test b/mysql-test/t/myisam_data_pointer_size_func.test deleted file mode 100644 index 36ad31acf6c..00000000000 --- a/mysql-test/t/myisam_data_pointer_size_func.test +++ /dev/null @@ -1,111 +0,0 @@ -############## mysql-test\t\myisam_data_pointer_size_func.test ################ -# # -# Variable Name: myisam_data_pointer_size # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable myisam_data_pointer_size # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ - ---echo '#--------------------FN_DYNVARS_093_01-------------------------#' -############################################################################### -# Check if setting myisam_data_pointer_size is changed in every new connection# -############################################################################### - -SET @@global.myisam_data_pointer_size = 2; -# con1 will be default connection from now on ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.myisam_data_pointer_size; -SET @@global.myisam_data_pointer_size = 3; ---echo 'connect (con2,localhost,root,,,,)' -connect (con2,localhost,root,,,,); ---echo 'connection con2' -connection con2; -SELECT @@global.myisam_data_pointer_size; -disconnect con2; - - ---echo '#--------------------FN_DYNVARS_093_02-------------------------#' -################################################################# -# Begin the functionality Testing of myisam_data_pointer_size # -################################################################# - ---echo 'connection con1' -connection con1; - - -#=========================================================== -# Checking myisam_data_pointer_size is 2 -#=========================================================== - -# create sp to add 'count' records ---disable_warnings -DROP PROCEDURE IF EXISTS sp_addRec; -DROP TABLE IF EXISTS t1; ---enable_warnings - - - -DELIMITER //; - -CREATE PROCEDURE sp_addRec(IN count INT) -BEGIN - WHILE (count>0) DO - INSERT INTO t1 value(1); - SET count = count -1; - END WHILE; -END // - -DELIMITER ;// - -# setting 2 will allow data pointer to access files with size < 65536 -SET @@global.myisam_data_pointer_size = 2; - -CREATE TABLE t1(a INT); - -CALL sp_addRec(65535); - ---Error ER_RECORD_FILE_FULL -CALL sp_addRec(1); - -SELECT count(*) from t1; - -#======================================================================= ---echo '--Checking myisam_data_pointer_size with MAX_ROWS table option--' -#======================================================================= - -# specifying MAX_ROWS table option renders pointer size useless -SET @@global.myisam_data_pointer_size = 2; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1(a INT)MAX_ROWS=70000; - -CALL sp_addRec(65536); - -SELECT count(*) from t1; - -DROP PROCEDURE sp_addRec; -DROP TABLE t1; - -################################################################ -# End of functionality Testing for myisam_data_pointer_size # -################################################################ - diff --git a/mysql-test/t/myisam_stats_method_basic.test b/mysql-test/t/myisam_stats_method_basic.test deleted file mode 100644 index 0045842269b..00000000000 --- a/mysql-test/t/myisam_stats_method_basic.test +++ /dev/null @@ -1,226 +0,0 @@ -############## mysql-test\t\myisam_stats_method_basic.test #################### -# # -# Variable Name: myisam_stats_method # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: nulls_equal # -# Valid Values: nulls_equal, nulls_unequal # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable myisam_stats_method # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF myisam_stats_method TESTS # -######################################################################## - - -########################################################################### -# Saving initial value of myisam_stats_method in a temporary variable # -########################################################################### - -SET @global_start_value = @@global.myisam_stats_method; -SELECT @global_start_value; - -SET @session_start_value = @@session.myisam_stats_method; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_097_01------------------------#' -######################################################################## -# Display the DEFAULT value of myisam_stats_method # -######################################################################## - -SET @@global.myisam_stats_method = nulls_equal; -SET @@global.myisam_stats_method = DEFAULT; -SELECT @@global.myisam_stats_method; - -SET @@session.myisam_stats_method = nulls_equal; -SET @@session.myisam_stats_method = DEFAULT; -SELECT @@session.myisam_stats_method; - - ---echo '#---------------------FN_DYNVARS_097_02-------------------------#' -######################################################### -# Check if NULL or empty value is accepeted # -######################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = NULL; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = ''; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.myisam_stats_method = NULL; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.myisam_stats_method = ''; - ---echo '#--------------------FN_DYNVARS_097_03------------------------#' -######################################################################## -# Change the value of myisam_stats_method to a valid value # -######################################################################## - -SET @@global.myisam_stats_method = 'nulls_equal'; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 'nulls_unequal'; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 'nulls_ignored'; -SELECT @@global.myisam_stats_method; - ---echo 'Bug: Value of nulls_ignored is not documented. Its ordinal value is 2' - -SET @@session.myisam_stats_method = 'nulls_equal'; -SELECT @@session.myisam_stats_method; - -SET @@session.myisam_stats_method = 'nulls_unequal'; -SELECT @@session.myisam_stats_method; - -SET @@session.myisam_stats_method = 'nulls_ignored'; -SELECT @@session.myisam_stats_method; - - ---echo '#--------------------FN_DYNVARS_097_04-------------------------#' -########################################################################### -# Change the value of myisam_stats_method to invalid value # -########################################################################### - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = unequal; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = ENABLED; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = 'equal'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = 'null_equal'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = ' '; - - ---echo '#-------------------FN_DYNVARS_097_05----------------------------#' -######################################################################### -# Check if the value in session Table matches value in variable # -######################################################################### - -SELECT @@session.myisam_stats_method = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_stats_method'; - ---echo '#----------------------FN_DYNVARS_097_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.myisam_stats_method = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_stats_method'; - - ---echo '#---------------------FN_DYNVARS_097_07-------------------------#' -################################################################### -# Check if numbers can be used on variable # -################################################################### - -# test if variable accepts 0,1,2 -SET @@global.myisam_stats_method = 0; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 1; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 2; -SELECT @@global.myisam_stats_method; - -# use of decimal values - -SET @@global.myisam_stats_method = 0.4; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 1.0; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 1.1; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 1.5; -SELECT @@global.myisam_stats_method; - -SET @@global.myisam_stats_method = 2.49; -SELECT @@global.myisam_stats_method; - -SET @@session.myisam_stats_method = 0.5; -SELECT @@session.myisam_stats_method; - -SET @@session.myisam_stats_method = 1.6; -SELECT @@session.myisam_stats_method; - - ---echo 'Bug# 34877: Decimal values can be used within the range [0.0-2.5). Values'; ---echo 'are rounded to 0,1,2 as evident from outcome.'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.myisam_stats_method = 3; - - ---echo '#---------------------FN_DYNVARS_097_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.myisam_stats_method = TRUE; -SELECT @@global.myisam_stats_method; -SET @@global.myisam_stats_method = FALSE; -SELECT @@global.myisam_stats_method; - ---echo '#---------------------FN_DYNVARS_097_09----------------------#' -######################################################################### -# Check if myisam_stats_method can be accessed with and without @@ sign # -######################################################################### - -SET myisam_stats_method = 'nulls_equal'; - ---Error ER_PARSE_ERROR -SET session.myisam_stats_method = 'nulls_equal'; ---Error ER_PARSE_ERROR -SET global.myisam_stats_method = 'nulls_equal'; - -SET session myisam_stats_method = 'nulls_equal'; -SELECT @@myisam_stats_method; - -SET global myisam_stats_method = 'nulls_equal'; -SELECT @@global.myisam_stats_method; - -############################## -# Restore initial value # -############################## - -SET @@global.myisam_stats_method = @global_start_value; -SELECT @@global.myisam_stats_method; - -SET @@session.myisam_stats_method = @session_start_value; -SELECT @@session.myisam_stats_method; - -######################################################################## -# END OF myisam_stats_method TESTS # -######################################################################## diff --git a/mysql-test/t/myisam_stats_method_func.test b/mysql-test/t/myisam_stats_method_func.test deleted file mode 100644 index 8b47015ba87..00000000000 --- a/mysql-test/t/myisam_stats_method_func.test +++ /dev/null @@ -1,106 +0,0 @@ -############## mysql-test\t\myisam_stats_method_func.test #################### -# # -# Variable Name: myisam_stats_method # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: nulls_equal # -# Valid Values: nulls_equal, nulls_unequal # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable myisam_stats_method # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#--------------------FN_DYNVARS_097_01-------------------------#' -##################################################################### -# Check if Setting myisam_stats_method is changed in new connection # -##################################################################### - -SET @@global.myisam_stats_method = nulls_equal; ---echo 'connect (con1,localhost,root,,,,)' -connect (con1,localhost,root,,,,); ---echo 'connection con1' -connection con1; -SELECT @@global.myisam_stats_method; -SELECT @@session.myisam_stats_method; -disconnect con1; - ---echo '#--------------------FN_DYNVARS_097_02-------------------------#' -########################################################### -# Begin the functionality Testing of myisam_stats_method # -########################################################### - ---echo 'connection default' -connection default; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1 (a int, key (a)); -INSERT INTO t1 VALUES (0),(1),(2),(3),(4); -INSERT INTO t1 SELECT NULL FROM t1; - -#======================================= ---echo 'default: NULLs considered unequal' -#======================================= -SET myisam_stats_method=nulls_unequal; - -ANALYZE TABLE t1; -SHOW INDEX FROM t1; -INSERT INTO t1 VALUES (11); -DELETE FROM t1 WHERE a=11; -CHECK TABLE t1; -SHOW INDEX FROM t1; - - -#===================================== ---echo 'Set nulls to be equal' -#===================================== -SET myisam_stats_method=nulls_equal; - -INSERT INTO t1 VALUES (11); -DELETE FROM t1 WHERE a=11; -ANALYZE TABLE t1; -SHOW INDEX FROM t1; -INSERT INTO t1 VALUES (11); -DELETE FROM t1 WHERE a=11; -CHECK TABLE t1; -SHOW INDEX FROM t1; - -#===================================== ---echo 'Set nulls to be ignored' -#===================================== - -SET myisam_stats_method=nulls_ignored; -SHOW variables LIKE 'myisam_stats_method'; -drop TABLE t1; - -CREATE TABLE t1 ( - a char(3), b char(4), c char(5), d char(6), - key(a,b,c,d) -); -INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz'); -INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz'); -INSERT INTO t1 VALUES ('bce','def1', 'yuu', NULL); -INSERT INTO t1 VALUES ('bce','def2', NULL, 'quux'); -ANALYZE TABLE t1; -SHOW INDEX FROM t1; -DELETE FROM t1; -ANALYZE TABLE t1; -SHOW INDEX FROM t1; - -SET myisam_stats_method=DEFAULT; -DROP TABLE t1; - -######################################################## -# End of functionality Testing for myisam_stats_method # -######################################################## diff --git a/mysql-test/t/myisam_use_mmap_basic.test b/mysql-test/t/myisam_use_mmap_basic.test deleted file mode 100644 index d2cc39cfea7..00000000000 --- a/mysql-test/t/myisam_use_mmap_basic.test +++ /dev/null @@ -1,104 +0,0 @@ - - -################## mysql-test\t\myisam_use_mmap_basic.test #################### -# # -# Variable Name: myisam_use_mmap # -# Scope: Global # -# Access Type: Static # -# Data Type: # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable myisam_use_mmap # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_042_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.myisam_use_mmap); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_042_02----------------------#' -# -# Test case for Bug #35433 -# -#################################################################### -# Check if Value can set # -#################################################################### - -#--error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@GLOBAL.myisam_use_mmap=1; ---ECHO "BUG:It should give error on setting this variable as it is readonly variable" ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.myisam_use_mmap); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_042_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.myisam_use_mmap = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_use_mmap'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.myisam_use_mmap); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_use_mmap'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_042_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@myisam_use_mmap = @@GLOBAL.myisam_use_mmap; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_042_05----------------------#' -################################################################################ -# Check if myisam_use_mmap can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@myisam_use_mmap); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.myisam_use_mmap); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.myisam_use_mmap); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.myisam_use_mmap); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT myisam_use_mmap = @@SESSION.myisam_use_mmap; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test index 6598af6318a..f554e7d0184 100644 --- a/mysql-test/t/myisampack.test +++ b/mysql-test/t/myisampack.test @@ -26,8 +26,38 @@ INSERT INTO t1 VALUES (2.22402118719591e-05,2.37546284320705e-05,2.58463051055541e-05,1.83391609130854e-05,1.6300720519646e-05,1.74559091886791e-05,1.63733785575587e-05,2.26616253279828e-05,1.79541237435621e-05,45), (3.01092775359837e-05,3.23865212934412e-05,4.09444584045994e-05,0,2.15470966302776e-05,2.39082636344032e-05,2.28296706429177e-05,2.9007671511595e-05,2.44201138973326e-05,46); FLUSH TABLES; ---exec $MYISAMPACK -s $MYSQLTEST_VARDIR/master-data/test/t1 ---exec $MYISAMCHK -srq $MYSQLTEST_VARDIR/master-data/test/t1 ---exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1 +let $MYSQLD_DATADIR= `select @@datadir`; +--exec $MYISAMPACK -s $MYSQLD_DATADIR/test/t1 +--exec $MYISAMCHK -srq $MYSQLD_DATADIR/test/t1 +--exec $MYISAMCHK -s --unpack $MYSQLD_DATADIR/test/t1 CHECK TABLE t1 EXTENDED; DROP TABLE t1; + +# +# Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table. +# expanded with testcase for +# BUG#41574 - REPAIR TABLE: crashes for compressed tables +# +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1(f1 int, f2 char(255)); +insert into t1 values(1, 'foo'), (2, 'bar'); +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +flush tables; +let $MYSQLD_DATADIR= `select @@datadir`; +--exec $MYISAMPACK $MYSQLD_DATADIR/test/t1 +optimize table t1; +repair table t1; +drop table t1; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 528337da77b..a182da5fbea 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -291,6 +291,30 @@ EOF --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql; +# +# Bug #33812: mysql client incorrectly parsing DELIMITER +# +# The space and ; after delimiter are important +--exec $MYSQL -e "select 1 delimiter ;" + +# +# Bug #38158: mysql client regression, can't read dump files +# +--write_file $MYSQLTEST_VARDIR/tmp/bug38158.sql +-- Testing +-- +delimiter || +select 2 || +EOF +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug38158.sql 2>&1 +--exec $MYSQL -c < $MYSQLTEST_VARDIR/tmp/bug38158.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/bug38158.sql; + +# +# Bug #41437: Value stored in 'case' lacks charset, causees segfault +# +--exec $MYSQL -e "select @z:='1',@z=database()" + --echo End of 5.0 tests # diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 7667522feaf..15c0cd4ac84 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -1,6 +1,8 @@ # This test should work in embedded server after we fix mysqltest -- source include/not_embedded.inc +SET @old_general_log= @@global.general_log; + # We run with different binaries for normal and --embedded-server # # If this test fails with "command "$MYSQL_CLIENT_TEST" failed", @@ -14,3 +16,4 @@ # End of 4.1 tests echo ok; +SET @@global.general_log= @old_general_log; diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test index 233e8c7c256..6b2ce0cd2d6 100644 --- a/mysql-test/t/mysql_upgrade.test +++ b/mysql-test/t/mysql_upgrade.test @@ -15,7 +15,8 @@ select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade; --exec $MYSQL_UPGRADE --skip-verbose 2>&1 # It should have created a file in the MySQL Servers datadir -file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info; +let $MYSQLD_DATADIR= `select @@datadir`; +file_exists $MYSQLD_DATADIR/mysql_upgrade_info; --echo Run it again - should say already completed --replace_result $MYSQL_SERVER_VERSION VERSION @@ -23,13 +24,13 @@ file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info; --exec $MYSQL_UPGRADE --skip-verbose 2>&1 # It should have created a file in the MySQL Servers datadir -file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info; +file_exists $MYSQLD_DATADIR/mysql_upgrade_info; --echo Force should run it regardless of wether it's been run before --exec $MYSQL_UPGRADE --skip-verbose --force 2>&1 # It should have created a file in the MySQL Servers datadir -file_exists $MYSQLTEST_VARDIR/master-data/mysql_upgrade_info; +file_exists $MYSQLD_DATADIR/mysql_upgrade_info; # diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test index 4ca0eedaece..a7055bfc8ca 100644 --- a/mysql-test/t/mysqlbinlog-cp932.test +++ b/mysql-test/t/mysqlbinlog-cp932.test @@ -13,7 +13,8 @@ create table t4 (f text character set cp932); --exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'ƒ\');" flush logs; rename table t3 to t03, t4 to t04; ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000002 | $MYSQL --default-character-set=utf8 +let $MYSQLD_DATADIR= `select @@datadir`; +--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000002 | $MYSQL --default-character-set=utf8 # original and recovered data must be equal select HEX(f) from t03; select HEX(f) from t3; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index eb364c60e71..e0595674cf9 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -4,6 +4,9 @@ -- source include/have_log_bin.inc +# Deletes all the binary logs +reset master; + # we need this for getting fixed timestamps inside of this test set timestamp=1000000000; @@ -23,11 +26,11 @@ insert into t2 values (); # test for load data and load data distributed among the several # files (we need to fill up first binlog) -load data infile '../std_data_ln/words.dat' into table t1; -load data infile '../std_data_ln/words.dat' into table t1; -load data infile '../std_data_ln/words.dat' into table t1; -load data infile '../std_data_ln/words.dat' into table t1; -load data infile '../std_data_ln/words.dat' into table t1; +load data infile '../../std_data/words.dat' into table t1; +load data infile '../../std_data/words.dat' into table t1; +load data infile '../../std_data/words.dat' into table t1; +load data infile '../../std_data/words.dat' into table t1; +load data infile '../../std_data/words.dat' into table t1; # simple query to show more in second binlog insert into t1 values ("Alas"); flush logs; @@ -41,10 +44,10 @@ select "--- Local --" as ""; # We should use --short-form everywhere because in other case output will # be time dependend. Better than nothing. # - +let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001 # this should not fail but shouldn't produce any working statements --disable_query_log @@ -52,7 +55,7 @@ select "--- Broken LOAD DATA --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000002 2> /dev/null +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000002 2> /dev/null # this should show almost nothing --disable_query_log @@ -60,7 +63,7 @@ select "--- --database --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLTEST_VARDIR/log/master-bin.000001 2> /dev/null +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLD_DATADIR/master-bin.000001 2> /dev/null # this test for position option --disable_query_log @@ -68,7 +71,7 @@ select "--- --position --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=239 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=239 $MYSQLD_DATADIR/master-bin.000002 # These are tests for remote binlog. # They should return the same as previous test. @@ -137,7 +140,7 @@ EOF # must be digestable for both client and server. In 4.1 the client # should use default-character-set same as the server. flush logs; ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000004 | $MYSQL +--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL select * from t5 /* must be (1),(1) */; drop table t5; @@ -156,7 +159,7 @@ insert into t5 values (3, date_format('2001-01-01','%W')); select * from t5 order by c1; flush logs; drop table t5; ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL +--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000006 | $MYSQL select * from t5 order by c1; drop table t5; @@ -180,8 +183,8 @@ drop procedure p1; --error 1305 call p1(); --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL +--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 +--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 | $MYSQL call p1(); drop procedure p1; @@ -200,23 +203,23 @@ drop procedure p1; flush logs; create table t1 (a varchar(64) character set utf8); -load data infile '../std_data_ln/loaddata6.dat' into table t1; +load data infile '../../std_data/loaddata6.dat' into table t1; set character_set_database=koi8r; -load data infile '../std_data_ln/loaddata6.dat' into table t1; +load data infile '../../std_data/loaddata6.dat' into table t1; set character_set_database=latin1; -load data infile '../std_data_ln/loaddata6.dat' into table t1; -load data infile '../std_data_ln/loaddata6.dat' into table t1; +load data infile '../../std_data/loaddata6.dat' into table t1; +load data infile '../../std_data/loaddata6.dat' into table t1; set character_set_database=koi8r; -load data infile '../std_data_ln/loaddata6.dat' into table t1; +load data infile '../../std_data/loaddata6.dat' into table t1; set character_set_database=latin1; -load data infile '../std_data_ln/loaddata6.dat' into table t1; -load data infile '../std_data_ln/loaddata6.dat' into table t1 character set koi8r; +load data infile '../../std_data/loaddata6.dat' into table t1; +load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r; select hex(a) from t1; drop table t1; flush logs; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000010 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000010 # # Bug#28293 missed '#' sign in the hex dump when the dump length @@ -229,7 +232,7 @@ flush logs; INSERT INTO t1 VALUES ('0123456789'); flush logs; DROP TABLE t1; ---exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g' +--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000012 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g' # # Bug #29928: incorrect connection_id() restoring from mysqlbinlog out @@ -239,7 +242,7 @@ create table t1(a int); insert into t1 values(connection_id()); let $a= `select a from t1`; flush logs; ---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $MYSQLTEST_VARDIR/tmp/bug29928.sql drop table t1; connect (con1, localhost, root, , test); connection con1; @@ -263,8 +266,8 @@ exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTES # flush logs; --error 1 ---exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null ---exec $MYSQL_BINLOG --force-if-open $MYSQLTEST_VARDIR/log/master-bin.000016 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null --echo BUG#31611: Security risk with BINLOG statement @@ -280,7 +283,7 @@ flush logs; INSERT INTO t1 VALUES (1,USER()); flush logs; echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql; -exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql; +exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql; connect (unsecure,localhost,untrusted,,mysqltest1); echo mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql; error 1; @@ -313,7 +316,7 @@ query_vertical SELECT * FROM t1; DROP TABLE t1; echo >> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql; -exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000019 > $MYSQLTEST_VARDIR/tmp/bug32580.sql; +exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000019 > $MYSQLTEST_VARDIR/tmp/bug32580.sql; echo >> mysql test < var/tmp/bug32580.sql; exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug32580.sql; remove_file $MYSQLTEST_VARDIR/tmp/bug32580.sql; diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 59017b09c54..d6be029ea56 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -40,33 +40,33 @@ select "--- Local --" as ""; # We should use --short-form everywhere because in other case output will # be time dependent (the Start events). Better than nothing. # - ---exec $MYSQL_BINLOG --short-form --base64-output=never $MYSQLTEST_VARDIR/log/master-bin.000001 +let $MYSQLD_DATADIR= `select @@datadir`; +--exec $MYSQL_BINLOG --short-form --base64-output=never $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- Local with 2 binlogs on command line --" as ""; @@ -75,28 +75,28 @@ select "--- Local with 2 binlogs on command line --" as ""; # This is to verify that some options apply only to first, or last binlog flush logs; ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- offset --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- stop-datetime --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002 +--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- Remote --" as ""; diff --git a/mysql-test/t/mysqlbinlog_base64.test b/mysql-test/t/mysqlbinlog_base64.test index 1b5dc67c150..fb21e28fdcb 100644 --- a/mysql-test/t/mysqlbinlog_base64.test +++ b/mysql-test/t/mysqlbinlog_base64.test @@ -1,5 +1,10 @@ -- source include/have_binlog_format_row.inc # +# Reset master to cleanup binlog +# +reset master; + +# # Write different events to binlog # create table t1 (a int); @@ -10,13 +15,14 @@ update t1 set a=a+2 where a=2; update t1 set a=a+2 where a=3; create table t2 (word varchar(20)); -load data infile '../std_data_ln/words.dat' into table t2; +load data infile '../../std_data/words.dat' into table t2; # # Save binlog # +let $MYSQLD_DATADIR=`select @@datadir`; flush logs; ---exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql +--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql # # Clear database and restore from binlog @@ -38,7 +44,7 @@ select * from t2; flush logs; drop table t2; create table t2 (word varchar(20)); -load data infile '../std_data_ln/words.dat' into table t2; +load data infile '../../std_data/words.dat' into table t2; insert into t2 select * from t2; insert into t2 select * from t2; insert into t2 select * from t2; @@ -51,7 +57,7 @@ insert into t2 select * from t2; select count(*) from t2; flush logs; ---exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql +--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql # @@ -62,6 +68,6 @@ select count(*) from t2; # # Test cleanup # ---exec rm $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql +--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql drop table t1; drop table t2; diff --git a/mysql-test/t/mysqlbinlog_row.test b/mysql-test/t/mysqlbinlog_row.test index 9d94e1f55e7..9b41c63d195 100644 --- a/mysql-test/t/mysqlbinlog_row.test +++ b/mysql-test/t/mysqlbinlog_row.test @@ -443,4 +443,4 @@ flush logs; let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ ---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001 diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test index 62c8c7df327..14e818e7214 100644 --- a/mysql-test/t/mysqlbinlog_row_big.test +++ b/mysql-test/t/mysqlbinlog_row_big.test @@ -38,7 +38,7 @@ SET timestamp=1000000000; --echo # --echo # We need big packets. --echo # -SET @@session.max_allowed_packet= 1024*1024*1024; +SET @@global.max_allowed_packet= 1024*1024*1024; --echo # --echo # Delete all existing binary logs. @@ -115,7 +115,7 @@ FLUSH LOGS; let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ ---exec $MYSQL_BINLOG -v -v $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output +--exec $MYSQL_BINLOG -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output --echo # --echo # Cleanup. diff --git a/mysql-test/t/mysqlbinlog_row_trans.test b/mysql-test/t/mysqlbinlog_row_trans.test index d84b1743783..24abc441c4c 100644 --- a/mysql-test/t/mysqlbinlog_row_trans.test +++ b/mysql-test/t/mysqlbinlog_row_trans.test @@ -151,7 +151,7 @@ FLUSH LOGS; let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ ---exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001 --echo # --echo # Cleanup. diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index 0e675731fd5..e834c60dcb5 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -14,6 +14,9 @@ DROP TABLE IF EXISTS t1, `t``1`, `t 1`; drop view if exists v1; drop database if exists client_test_db; +# Repair any tables in mysql, sometimes the slow_log is marked as crashed +# after server has been killed +--exec $MYSQL_CHECK --repair --databases mysql > /dev/null 2>&1 --enable_warnings # @@ -55,9 +58,10 @@ create table t_bug25347 (a int); create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; +let $MYSQLD_DATADIR= `select @@datadir`; --echo removing and creating ---remove_file $MYSQLTEST_VARDIR/master-data/d_bug25347/t_bug25347.MYI ---write_file $MYSQLTEST_VARDIR/master-data/d_bug25347/t_bug25347.MYI +--remove_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI +--write_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI EOF --exec $MYSQL_CHECK --repair --databases d_bug25347 --error 130 @@ -78,7 +82,6 @@ create view v1 as select * from information_schema.routines; check table v1, information_schema.routines; drop view v1; - # # Bug#37527: mysqlcheck fails to report entire database # when frm file corruption @@ -86,29 +89,109 @@ drop view v1; CREATE TABLE t1(a INT); CREATE TABLE t2(a INT); # backup then null t1.frm ---copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ---write_file $MYSQLTEST_VARDIR/master-data/test/t1.frm +--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t1.frm.bak +--remove_file $MYSQLD_DATADIR/test/t1.frm +--write_file $MYSQLD_DATADIR/test/t1.frm EOF --exec $MYSQL_CHECK test # restore t1.frm ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm ---copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak $MYSQLTEST_VARDIR/master-data/test/t1.frm ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm.bak +--remove_file $MYSQLD_DATADIR/test/t1.frm +--copy_file $MYSQLD_DATADIR/test/t1.frm.bak $MYSQLD_DATADIR/test/t1.frm +--remove_file $MYSQLD_DATADIR/test/t1.frm.bak DROP TABLE t1, t2; --echo End of 5.0 tests + # # Bug #30679: 5.1 name encoding not performed for views during upgrade # create table t1(a int); create view v1 as select * from t1; show tables; ---copy_file $MYSQLTEST_VARDIR/master-data/test/v1.frm $MYSQLTEST_VARDIR/master-data/test/v-1.frm +let $MYSQLD_DATADIR= `select @@datadir`; +--copy_file $MYSQLD_DATADIR/test/v1.frm $MYSQLD_DATADIR/test/v-1.frm show tables; --exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test show tables; drop view v1, `v-1`; drop table t1; + + +# +# Bug #33094: Error in upgrading from 5.0 to 5.1 when table contains triggers +# Bug #41385: Crash when attempting to repair a #mysql50# upgraded table with +# triggers +# +SET NAMES utf8; +CREATE TABLE `#mysql50#@` (a INT); +SHOW TABLES; +SET NAMES DEFAULT; +--echo mysqlcheck --fix-table-names --databases test +--exec $MYSQL_CHECK --fix-table-names --databases test +SET NAMES utf8; +SHOW TABLES; +DROP TABLE `@`; + +CREATE TABLE `Ñ` (a INT); +SET NAMES DEFAULT; +--echo mysqlcheck --default-character-set="latin1" --databases test +# Error returned depends on platform, replace it with "Table doesn't exist" +--replace_result "Can't find file: './test/@003f.frm' (errno: 22)" "Table doesn't exist" "Table 'test.?' doesn't exist" "Table doesn't exist" +--exec $MYSQL_CHECK --default-character-set="latin1" --databases test +--echo mysqlcheck --default-character-set="utf8" --databases test +--exec $MYSQL_CHECK --default-character-set="utf8" --databases test +SET NAMES utf8; +DROP TABLE `Ñ`; +SET NAMES DEFAULT; + +CREATE DATABASE `#mysql50#a@b`; +USE `#mysql50#a@b`; +CREATE TABLE `#mysql50#c@d` (a INT); +CREATE TABLE t1 (a INT); + +# Create 5.0 like triggers +let $MYSQLTEST_VARDIR= `select @@datadir`; +--write_file $MYSQLTEST_VARDIR/a@b/c@d.TRG +TYPE=TRIGGERS +triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON `c@d` FOR EACH ROW SET NEW.a = 10 * NEW.a' +sql_modes=0 +definers='root@localhost' +EOF +--write_file $MYSQLTEST_VARDIR/a@b/tr1.TRN +TYPE=TRIGGERNAME +trigger_table=c@d +EOF +--write_file $MYSQLTEST_VARDIR/a@b/t1.TRG +TYPE=TRIGGERS +triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 BEFORE INSERT ON `a@b`.t1 FOR EACH ROW SET NEW.a = 100 * NEW.a' +sql_modes=0 +definers='root@localhost' +EOF +--write_file $MYSQLTEST_VARDIR/a@b/tr2.TRN +TYPE=TRIGGERNAME +trigger_table=t1 +EOF + +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS + WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name; + +--echo mysqlcheck --fix-db-names --fix-table-names --all-databases +--exec $MYSQL_CHECK --fix-db-names --fix-table-names --all-databases + +USE `a@b`; +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS + WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name; + +INSERT INTO `c@d` VALUES (2), (1); +SELECT * FROM `c@d`; +INSERT INTO t1 VALUES (3), (5); +SELECT * FROM t1; + +DROP DATABASE `a@b`; + +USE test; + + +--echo End of 5.1 tests diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 8084457b92b..e93c9cbd274 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -5,10 +5,13 @@ # Binlog is required --source include/have_log_bin.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc ---echo Bug#37938 - Test "mysqldump" lacks various insert statements ---echo Turn off concurrent inserts to avoid random errors ---echo NOTE: We reset the variable back to saved value at the end of test + +--echo # Bug#37938 Test "mysqldump" lacks various insert statements +--echo # Turn off concurrent inserts to avoid random errors +--echo # NOTE: We reset the variable back to saved value at the end of test SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT; SET @@GLOBAL.CONCURRENT_INSERT = 0; @@ -23,13 +26,13 @@ drop view if exists v1, v2, v3; # XML output -CREATE TABLE t1(a int, key (a)) key_block_size=1024; +CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024; INSERT INTO t1 VALUES (1), (2); --exec $MYSQL_DUMP --skip-create --skip-comments -X test t1 DROP TABLE t1; --echo # ---echo # Bug #2005 +--echo # Bug#2005 Long decimal comparison bug. --echo # CREATE TABLE t1 (a decimal(64, 20)); @@ -39,7 +42,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), DROP TABLE t1; --echo # ---echo # Bug #2055 +--echo # Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL" --echo # CREATE TABLE t1 (a double); @@ -51,7 +54,7 @@ INSERT INTO t1 VALUES ('-9e999999'); DROP TABLE t1; --echo # ---echo # Bug #3361 mysqldump quotes DECIMAL values inconsistently +--echo # Bug#3361 mysqldump quotes DECIMAL values inconsistently --echo # CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT); @@ -65,7 +68,7 @@ INSERT INTO t1 VALUES ("1.2345", 2.3456); SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES'; INSERT INTO t1 VALUES (1.2345, 2.3456); INSERT INTO t1 VALUES ('1.2345', 2.3456); ---error 1054 +--error ER_BAD_FIELD_ERROR INSERT INTO t1 VALUES ("1.2345", 2.3456); SET SQL_MODE=@OLD_SQL_MODE; @@ -82,7 +85,7 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); DROP TABLE t1; --echo # ---echo # Bug #1707 +--echo # Bug#1707 mysqldump -X does't quote field and table names --echo # CREATE TABLE t1 (`a"b"` char(2)); @@ -91,8 +94,8 @@ INSERT INTO t1 VALUES ("1\""), ("\"2"); DROP TABLE t1; --echo # ---echo # Bug #1994 ---echo # Bug #4261 +--echo # Bug#1994 mysqldump does not correctly dump UCS2 data +--echo # Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts --echo # CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r; @@ -101,7 +104,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); DROP TABLE t1; --echo # ---echo # Bug #2634 +--echo # Bug#2634 mysqldump in --compatible=mysql4 --echo # CREATE TABLE t1 (a int) ENGINE=MYISAM; @@ -111,7 +114,7 @@ INSERT INTO t1 VALUES (1), (2); DROP TABLE t1; --echo # ---echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly' +--echo # Bug#2592 mysqldump doesn't quote "tricky" names correctly --echo # create table ```a` (i int); @@ -119,7 +122,7 @@ create table ```a` (i int); drop table ```a`; --echo # ---echo # Bug #2591 "mysqldump quotes names inconsistently" +--echo # Bug#2591 mysqldump quotes names inconsistently --echo # create table t1(a int); @@ -132,7 +135,7 @@ set global sql_mode=''; drop table t1; --echo # ---echo # Bug #2705 'mysqldump --tab extra output' +--echo # Bug#2705 mysqldump --tab extra output --echo # create table t1(a int); @@ -148,7 +151,7 @@ insert into t1 values (1),(2),(3); drop table t1; --echo # ---echo # Bug #6101: create database problem +--echo # Bug#6101 create database problem --echo # --exec $MYSQL_DUMP --skip-comments --databases test @@ -158,7 +161,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; drop database mysqldump_test_db; --echo # ---echo # Bug #7020 +--echo # Bug#7020 mysqldump --compatible=mysql40 should set --skip-set-charset --default-char... --echo # Check that we don't dump in UTF8 in compatible mode by default, --echo # but use the default compiled values, or the values given in --echo # --default-character-set=xxx. However, we should dump in UTF8 @@ -169,8 +172,8 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 --echo # ---echo # Bug#8063: make test mysqldump [ fail ] ---echo # We cannot tes this command because its output depends +--echo # Bug#8063 make test mysqldump [ fail ] +--echo # We cannot test this command because its output depends --echo # on --default-character-set incompiled into "mysqldump" program. --echo # If the future we can move this command into a separate test with --echo # checking that "mysqldump" is compiled with "latin1" @@ -183,7 +186,7 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); DROP TABLE t1; --echo # ---echo # WL #2319: Exclude Tables from dump +--echo # WL#2319 Exclude Tables from dump --echo # CREATE TABLE t1 (a int); @@ -195,7 +198,7 @@ DROP TABLE t1; DROP TABLE t2; --echo # ---echo # Bug #8830 +--echo # Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values --echo # CREATE TABLE t1 (`b` blob); @@ -207,7 +210,7 @@ DROP TABLE t1; --echo # Test for --insert-ignore --echo # -CREATE TABLE t1 (a int); +CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t1 VALUES (4),(5),(6); --exec $MYSQL_DUMP --skip-comments --insert-ignore test t1 @@ -215,9 +218,9 @@ INSERT INTO t1 VALUES (4),(5),(6); DROP TABLE t1; --echo # ---echo # Bug #10286: mysqldump -c crashes on table that has many fields with long ---echo # names ---echo # +--echo # Bug#10286 mysqldump -c crashes on table that has many fields with long +--echo # names +--echo # create table t1 ( F_c4ca4238a0b923820dcc509a6f75849b int, F_c81e728d9d4c2f636f067f89cc14862c int, @@ -563,7 +566,7 @@ INSERT INTO t1 VALUES (1),(2),(3); DROP TABLE t1; --echo # ---echo # Bug #9558 mysqldump --no-data db t1 t2 format still dumps data +--echo # Bug#9558 mysqldump --no-data db t1 t2 format still dumps data --echo # CREATE DATABASE mysqldump_test_db; @@ -582,7 +585,7 @@ DROP DATABASE mysqldump_test_db; --echo # --echo # Testing with tables and databases that don't exists --echo # or contains illegal characters ---echo # (Bug #9358 mysqldump crashes if tablename starts with \) +--echo # (Bug#9358 mysqldump crashes if tablename starts with \) --echo # create database mysqldump_test_db; use mysqldump_test_db; @@ -601,7 +604,7 @@ select '------ Testing with illegal table names ------' as test_sequence ; --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1 - + --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1 @@ -644,7 +647,7 @@ use test; --echo # ---echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly +--echo # Bug#9657 mysqldump xml ( -x ) does not format NULL fields correctly --echo # create table t1 (a int(10)); @@ -655,8 +658,9 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir --exec $MYSQL_DUMP --skip-comments --xml --no-create-info test drop table t1, t2; + --echo # ---echo # BUG #12123 +--echo # Bug#12123 mysqldump --tab results in text file which can't be imported --echo # create table t1 (a text character set utf8, b text character set latin1); @@ -669,14 +673,15 @@ select * from t1; drop table t1; + --echo # ---echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence +--echo # Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence --echo # --exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump --echo # ---echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]" +--echo # Bug#19025 mysqldump doesn't correctly dump "auto_increment = [int]" --echo # create table `t1` ( @@ -704,9 +709,11 @@ select * from t1; show create table `t1`; drop table `t1`; +--remove_file $MYSQLTEST_VARDIR/tmp/bug19025.sql + --echo # ---echo # Bug #18536: wrong table order +--echo # Bug#18536 wrong table order --echo # create table t1(a int); @@ -716,8 +723,9 @@ create table t3(a int); --exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2 drop table t1, t2, t3; + --echo # ---echo # Bug #21288: mysqldump segmentation fault when using --where +--echo # Bug#21288 mysqldump segmentation fault when using --where --echo # create table t1 (a int); @@ -725,8 +733,9 @@ create table t1 (a int); --exec $MYSQL_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1 drop table t1; + --echo # ---echo # BUG#13926: --order-by-primary fails if PKEY contains quote character +--echo # Bug#13926 --order-by-primary fails if PKEY contains quote character --echo # --disable_warnings @@ -746,8 +755,9 @@ DROP TABLE `t1`; --echo End of 4.1 tests + --echo # ---echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X) +--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X) --echo # create database db1; @@ -770,8 +780,9 @@ drop view v2; drop database db1; use test; + --echo # ---echo # Bug 10713 mysqldump includes database in create view and referenced tables +--echo # Bug#10713 mysqldump includes database in create view and referenced tables --echo # # create table and views in db2 @@ -805,10 +816,11 @@ select * from t2 order by a; drop table t1, t2; drop database db1; use test; +--remove_file $MYSQLTEST_VARDIR/tmp/bug10713.sql ---echo # ---echo # dump of view ---echo # +# +# dump of view +# create table t1(a int); create view v1 as select * from t1; @@ -816,8 +828,9 @@ create view v1 as select * from t1; drop view v1; drop table t1; + --echo # ---echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X) +--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X) --echo # create database mysqldump_test_db; @@ -841,7 +854,7 @@ drop database mysqldump_test_db; use test; --echo # ---echo # Bug #9756 +--echo # Bug#9756 mysql client failing on dumps containing certain \ sequences --echo # CREATE TABLE t1 (a char(10)); @@ -850,7 +863,7 @@ INSERT INTO t1 VALUES ('\''); DROP TABLE t1; --echo # ---echo # Bug #10927 mysqldump: Can't reload dump with view that consist of other view +--echo # Bug#10927 mysqldump: Can't reload dump with view that consist of other view --echo # create table t1(a int, b int, c varchar(30)); @@ -922,7 +935,9 @@ show triggers; DROP TABLE t1, t2; --echo # ---echo # Bugs #9136, #12917: problems with --defaults-extra-file option +--echo # Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a +--echo # Bug#12917 The --defaults-extra-file option is ignored by the 5.0 client binaries +--echo # (Problems with --defaults-extra-file option) --echo # --write_file $MYSQLTEST_VARDIR/tmp/tmp.cnf @@ -934,7 +949,7 @@ EOF --remove_file $MYSQLTEST_VARDIR/tmp/tmp.cnf --echo # ---echo # Test of fix to BUG 12597 +--echo # Test of fix to Bug#12597 mysqldump dumps triggers wrongly --echo # DROP TABLE IF EXISTS `test1`; @@ -970,9 +985,11 @@ SELECT * FROM `test2`; DROP TRIGGER testref; DROP TABLE test1; DROP TABLE test2; +--remove_file $MYSQLTEST_VARDIR/tmp/mysqldump.sql + --echo # ---echo # BUG#9056 - mysqldump does not dump routines +--echo # Bug#9056 mysqldump does not dump routines --echo # --disable_warnings @@ -998,9 +1015,9 @@ begin return f1; end // -CREATE PROCEDURE bug9056_proc2(OUT a INT) -BEGIN - select sum(id) from t1 into a; +CREATE PROCEDURE bug9056_proc2(OUT a INT) +BEGIN + select sum(id) from t1 into a; END // DELIMITER ;// @@ -1009,7 +1026,7 @@ set sql_mode='ansi'; create procedure `a'b` () select 1; # to fix syntax highlighting :') set sql_mode=''; -# Dump the DB and ROUTINES +# Dump the DB and ROUTINES --exec $MYSQL_DUMP --skip-comments --routines --databases test # ok, now blow it all away @@ -1020,8 +1037,9 @@ DROP PROCEDURE bug9056_proc2; DROP PROCEDURE `a'b`; drop table t1; + --echo # ---echo # BUG# 13052 - mysqldump timestamp reloads broken +--echo # Bug#13052 mysqldump timestamp reloads broken --echo # --disable_warnings @@ -1044,7 +1062,7 @@ set global time_zone=default; set time_zone=default; --echo # ---echo # Test of fix to BUG 13146 - ansi quotes break loading of triggers +--echo # Test of fix to Bug#13146 ansi quotes break loading of triggers --echo # --disable_warnings @@ -1069,7 +1087,7 @@ INSERT INTO `t1 test` VALUES (1); INSERT INTO `t1 test` VALUES (2); INSERT INTO `t1 test` VALUES (3); SELECT * FROM `t2 test`; -# dump with compatible=ansi. Everything except triggers should be double +# dump with compatible=ansi. Everything except triggers should be double # quoted --exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test @@ -1078,7 +1096,7 @@ DROP TABLE `t1 test`; DROP TABLE `t2 test`; --echo # ---echo # BUG# 12838 mysqldump -x with views exits with error +--echo # Bug#12838 mysqldump -x with views exits with error --echo # --disable_warnings @@ -1095,13 +1113,14 @@ create view v2 as select * from v0; select * from v2; --exec $MYSQL_DUMP -x --skip-comments --databases test + drop view v2; drop view v0; drop view v1; drop table t1; --echo # ---echo # BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN" +--echo # Bug#14554 mysqldump does not separate words "ROW" and "BEGIN" --echo # for tables with trigger created in the IGNORE_SPACE sql mode. --echo # @@ -1125,8 +1144,8 @@ DROP TRIGGER tr1; DROP TABLE t1; --echo # ---echo # Bug #13318: Bad result with empty field and --hex-blob ---echo # +--echo # Bug#13318 Bad result with empty field and --hex-blob +--echo # create table t1 (a binary(1), b blob); insert into t1 values ('',''); @@ -1135,7 +1154,7 @@ insert into t1 values ('',''); drop table t1; --echo # ---echo # Bug 14871 Invalid view dump output +--echo # Bug#14871 Invalid view dump output --echo # create table t1 (a int); @@ -1162,9 +1181,11 @@ select * from v3 order by a; drop table t1; drop view v1, v2, v3, v4, v5; +--remove_file $MYSQLTEST_VARDIR/tmp/bug14871.sql + --echo # ---echo # Bug #16878 dump of trigger +--echo # Bug#16878 dump of trigger --echo # create table t1 (a int, created datetime); @@ -1192,6 +1213,8 @@ show triggers; drop trigger tr1; drop trigger tr2; drop table t1, t2; +--remove_file $MYSQLTEST_VARDIR/tmp/bug16878.sql + --echo # --echo # Bug#18462 mysqldump does not dump view structures correctly @@ -1211,11 +1234,15 @@ create view v2 as select qty from v1; drop view v1; drop view v2; drop table t; +--remove_file $MYSQLTEST_VARDIR/tmp/v1.sql +--remove_file $MYSQLTEST_VARDIR/tmp/v2.sql +--remove_file $MYSQLTEST_VARDIR/tmp/t.sql +--remove_file $MYSQLTEST_VARDIR/tmp/t.txt --echo # --echo # Bug#14857 Reading dump files with single statement stored routines fails. ---echo # fixed by patch for bug#16878 +--echo # fixed by patch for Bug#16878 --echo # DELIMITER |; @@ -1230,7 +1257,7 @@ drop function f; drop procedure p; --echo # ---echo # Bug #17371 Unable to dump a schema with invalid views +--echo # Bug#17371 Unable to dump a schema with invalid views --echo # create table t1 ( id serial ); @@ -1243,7 +1270,8 @@ drop table t1; --echo } mysqldump drop view v1; ---echo # BUG#17201 Spurious 'DROP DATABASE' in output, + +--echo # Bug#17201 Spurious 'DROP DATABASE' in output, --echo # also confusion between tables and views. --echo # Example code from Markus Popp @@ -1260,8 +1288,9 @@ drop view v1; drop table t1; drop database mysqldump_test_db; + --echo # ---echo # Bug21014 Segmentation fault of mysqldump on view +--echo # Bug#21014 Segmentation fault of mysqldump on view --echo # create database mysqldump_tables; @@ -1280,7 +1309,7 @@ drop table mysqldump_tables.basetable; drop database mysqldump_tables; --echo # ---echo # Bug20221 Dumping of multiple databases containing view(s) yields maleformed dumps +--echo # Bug#20221 Dumping of multiple databases containing view(s) yields maleformed dumps --echo # create database mysqldump_dba; @@ -1318,6 +1347,7 @@ use mysqldump_dbb; drop view v1; drop table t1; drop database mysqldump_dbb; +--remove_file $MYSQLTEST_VARDIR/tmp/bug20221_backup use test; --echo # @@ -1364,11 +1394,12 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost; drop table t1; drop user mysqltest_1@localhost; + --echo # ---echo # Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the ---echo # information_schema database. +--echo # Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the +--echo # information_schema database. --echo # ---echo # Bug #21424 mysqldump failing to export/import views +--echo # Bug#21424 mysqldump failing to export/import views --echo # # Do as root @@ -1389,7 +1420,7 @@ create table u1 (f1 int); insert into u1 values (4); create view v1 (c1) as select * from t1; -# Backup should not fail for Bug #21527. Flush priviliges test begins. +# Backup should not fail for Bug#21527. Flush priviliges test begins. --exec $MYSQL_DUMP --skip-comments --add-drop-table --flush-privileges --ignore-table=mysql.general_log --ignore-table=mysql.slow_log --databases mysqldump_myDB mysql > $MYSQLTEST_VARDIR/tmp/bug21527.sql # Clean up @@ -1403,8 +1434,9 @@ drop user myDB_User@localhost; drop database mysqldump_myDB; flush privileges; ---echo # Bug #21424 continues from here. ---echo # Restore. Flush Privileges test ends. + +--echo # Bug#21424 continues from here. +--echo # Restore. Flush Privileges test ends. --echo # --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21527.sql @@ -1417,8 +1449,9 @@ use mysqldump_myDB; select * from mysqldump_myDB.v1; select * from mysqldump_myDB.u1; -#Final cleanup. +# Final cleanup. connection root; +disconnect user1; use mysqldump_myDB; drop view v1; drop table t1; @@ -1426,10 +1459,14 @@ drop table u1; revoke all privileges on mysqldump_myDB.* from myDB_User@localhost; drop user myDB_User@localhost; drop database mysqldump_myDB; +connection default; +disconnect root; +--remove_file $MYSQLTEST_VARDIR/tmp/bug21527.sql use test; + --echo # ---echo # Bug #19745: mysqldump --xml produces invalid xml +--echo # Bug#19745 mysqldump --xml produces invalid xml --echo # --disable_warnings @@ -1444,9 +1481,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0); DROP TABLE t1; - --echo # ---echo # Bug#26346: stack + buffer overrun in mysqldump +--echo # Bug#26346 stack + buffer overrun in mysqldump --echo # CREATE TABLE t1(a int); @@ -1467,18 +1503,20 @@ INSERT INTO t1 VALUES (1), (2); DROP TABLE t1; + # -# Bug #25993: crashe with a merge table and -c +# Bug#25993 crashes with a merge table and -c # -CREATE TABLE t2 (a int); -CREATE TABLE t3 (a int); -CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3); +CREATE TABLE t2 (a INT); +CREATE TABLE t3 (a INT); +CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3); --exec $MYSQL_DUMP --skip-comments -c test DROP TABLE t1, t2, t3; + --echo # ---echo # Bug #23491: MySQLDump prefix function call in a view by database name +--echo # Bug#23491 MySQLDump prefix function call in a view by database name --echo # # Setup @@ -1508,13 +1546,16 @@ show create view bug23491_restore.v3; drop database bug23491_original; drop database bug23491_restore; use test; +--remove_file $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql + + ---echo # ---echo # Bug 27293: mysqldump crashes when dumping routines ---echo # defined by a different user --echo # ---echo # Bug #22761: mysqldump reports no errors when using ---echo # --routines without mysql.proc privileges +--echo # Bug#27293 mysqldump crashes when dumping routines +--echo # defined by a different user +--echo # +--echo # Bug#22761 mysqldump reports no errors when using +--echo # --routines without mysql.proc privileges --echo # create database mysqldump_test_db; @@ -1535,13 +1576,14 @@ create procedure mysqldump_test_db.sp1() select 'hello'; drop procedure sp1; connection default; +disconnect user27293; drop user user1; drop user user2; drop database mysqldump_test_db; --echo # ---echo # Bug #28522: buffer overrun by '\0' byte using --hex-blob. +--echo # Bug#28522 buffer overrun by '\0' byte using --hex-blob. --echo # CREATE TABLE t1 (c1 INT, c2 LONGBLOB); @@ -1550,8 +1592,8 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',509); DROP TABLE t1; --echo # ---echo # Bug #28524: mysqldump --skip-add-drop-table is not ---echo # compatible with views +--echo # Bug#28524 mysqldump --skip-add-drop-table is not +--echo # compatible with views --echo # CREATE VIEW v1 AS SELECT 1; @@ -1561,10 +1603,12 @@ DROP VIEW v1; --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql SELECT * FROM v1; DROP VIEW v1; +--remove_file $MYSQLTEST_VARDIR/tmp/bug28524.sql + --echo # ---echo # Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of ---echo # the SQL_MODE variable after the dumping of triggers. +--echo # Bug#29788 mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of +--echo # the SQL_MODE variable after the dumping of triggers. --echo # CREATE TABLE t1 (c1 INT); @@ -1583,10 +1627,12 @@ SELECT * FROM t2; SELECT * FROM t2; DROP TABLE t1,t2; +--remove_file $MYSQLTEST_VARDIR/tmp/bug29788.sql + --echo # ---echo # Bug#29815: new option for suppressing last line of mysqldump: ---echo # "Dump completed on" +--echo # Bug#29815 new option for suppressing last line of mysqldump: +--echo # "Dump completed on" --echo # --echo # --skip-dump-date: @@ -1623,7 +1669,7 @@ DROP TABLE t1; # Added for use-thread option # -# THIS PART OF THE TEST IS DISABLED UNTIL BUG#32991 IS FIXED +# THIS PART OF THE TEST IS DISABLED UNTIL Bug#32991 IS FIXED if ($bug32991_fixed) { create table t1 (a text , b text); @@ -1646,7 +1692,7 @@ select * from t2; # Now we test with multiple threads, but less threads than files. create table words(a varchar(255)); create table words2(b varchar(255)); ---exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat +--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat select * from t1; select * from t2; select * from words; @@ -1656,7 +1702,7 @@ select * from words2; drop table words; --replace_regex /.*mysqlimport(\.exe)*/mysql-import/ --error 1 ---exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat 2>&1 +--exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat 2>&1 drop table t1; drop table t2; @@ -1666,7 +1712,7 @@ drop table words2; } --echo # ---echo # BUG# 16853: mysqldump doesn't show events +--echo # Bug#16853 mysqldump doesn't show events --echo # create database first; @@ -1685,6 +1731,7 @@ use second; --exec $MYSQL second < $MYSQLTEST_VARDIR/tmp/bug16853-1.sql show events; show create event ee1; +--remove_file $MYSQLTEST_VARDIR/tmp/bug16853-1.sql ## prove three works (with spaces and tabs on the end) # start with one from the previous restore @@ -1699,13 +1746,14 @@ use third; --exec $MYSQL third < $MYSQLTEST_VARDIR/tmp/bug16853-2.sql show events; drop database third; +--remove_file $MYSQLTEST_VARDIR/tmp/bug16853-2.sql # revert back to normal settings set time_zone = 'SYSTEM'; use test; --echo # ---echo # BUG#17201 Spurious 'DROP DATABASE' in output, +--echo # Bug#17201 Spurious 'DROP DATABASE' in output, --echo # also confusion between tables and views. --echo # Example code from Markus Popp --echo # @@ -1724,7 +1772,7 @@ drop table t1; drop database mysqldump_test_db; # -# BUG#26121 mysqldump includes LOCK TABLES general_log WRITE +# Bug#26121 mysqldump includes LOCK TABLES general_log WRITE # --exec $MYSQL_DUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug26121.sql --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug26121.sql @@ -1733,8 +1781,8 @@ drop database mysqldump_test_db; ########################################################################### --echo # ---echo # Bug #30027: mysqldump does not dump views properly. ---echo # +--echo # Bug#30027 mysqldump does not dump views properly. +--echo # --echo --echo # Cleanup. @@ -1784,12 +1832,13 @@ set names latin1; --echo # Cleanup. DROP DATABASE mysqldump_test_db; +--remove_file $MYSQLTEST_VARDIR/tmp/bug30027.sql ########################################################################### --echo # ---echo # BUG#29938: wrong behavior of mysqldump --skip-events ---echo # with --all-databases +--echo # Bug#29938 wrong behavior of mysqldump --skip-events +--echo # with --all-databases --echo # TRUNCATE mysql.event; @@ -1802,6 +1851,7 @@ SHOW EVENTS; TRUNCATE mysql.event; --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29938.sql SHOW EVENTS; +--remove_file $MYSQLTEST_VARDIR/tmp/bug29938.sql --echo # @@ -1818,7 +1868,7 @@ use test; --echo --echo # ----------------------------------------------------------------- ---echo # -- Bug#30217: Views: changes in metadata behaviour between 5.0 and 5.1. +--echo # -- Bug#30217 Views: changes in metadata behaviour between 5.0 and 5.1. --echo # ----------------------------------------------------------------- --echo @@ -1863,6 +1913,7 @@ WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1'; --echo DROP DATABASE mysqldump_test_db; +--remove_file $MYSQLTEST_VARDIR/tmp/bug30217.sql --echo --echo # -- End of test case for Bug#32538. @@ -1877,3 +1928,6 @@ SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT; --echo # --echo # End of 5.1 tests --echo # + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index b4b4cf2f308..6c5efba8b5b 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1229,7 +1229,7 @@ select "a" as col1, "c" as col2; --exec echo "replace_result a;" | $MYSQL_TEST 2>&1 --error 1 --exec echo "replace_result a ;" | $MYSQL_TEST 2>&1 ---exec echo "replace_result a b; echo OK;" | $MYSQL_TEST 2>&1 +--exec echo "replace_result a b; echo OK; exit;" | $MYSQL_TEST 2>&1 --error 1 --exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1 --error 1 @@ -1293,7 +1293,7 @@ while ($i) dec $i; } EOF ---exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1 +--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK; exit;" | $MYSQL_TEST 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # Repeat connect/disconnect @@ -1500,6 +1500,7 @@ echo Multi statement using expected error; --exec echo "select 'select-me';" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql --exec echo "insertz "error query"||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql --exec echo "delimiter ;||||" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql +--exec echo "exit;" >> $MYSQLTEST_VARDIR/tmp/bug11731.sql # These two should work since the error is expected --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1 @@ -1692,6 +1693,7 @@ EOF --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp --error 1 --diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp +exit; EOF # Execute the above diffs, and send their output to /dev/null - only @@ -2147,5 +2149,71 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir; --replace_result c:\\a.txt z SELECT 'c:\\a.txt' AS col; +# +# Bug #32307 mysqltest - does not detect illegal if syntax +# + +let $test= 1; +if ($test){ + echo hej; +} + +--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql +if ($mysql_errno != 1436) +{ + echo ^ Should not be allowed! +} +EOF +--error 1 +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; + + +# ---------------------------------------------------------------------------- +# Test that -- is not allowed as comment, only as mysqltest builtin command +# ---------------------------------------------------------------------------- + +# valid +select 1; +--query select 1 +--query -- a comment for the server + +# Not valid, "select" is not a mysqltest command +--error 1 +--exec echo "--select 1;" | $MYSQL_TEST 2>&1 + + +# ---------------------------------------------------------------------------- +# BUG#35701: please allow test language variables in connection and sync_slave_with_master +# Test that "connection $variable" works and that $CURRENT_CONNECTION has the right value. +# ---------------------------------------------------------------------------- + +connect (con1,localhost,root,,); +--echo $CURRENT_CONNECTION + +connection default; +--echo $CURRENT_CONNECTION + +connection con1; +--echo $CURRENT_CONNECTION + +let $x= default; +let $y= con1; + +connection $x; +--echo $CURRENT_CONNECTION + +connection $y; +--echo $CURRENT_CONNECTION + +# Disconnect the not selected connection +disconnect $x; +--echo $CURRENT_CONNECTION + +# Disconnect the selected connection +disconnect $y; +--echo $CURRENT_CONNECTION + + --echo End of tests diff --git a/mysql-test/t/ndb_log_update_as_write_basic.test b/mysql-test/t/ndb_log_update_as_write_basic.test deleted file mode 100644 index 0b9d3ada158..00000000000 --- a/mysql-test/t/ndb_log_update_as_write_basic.test +++ /dev/null @@ -1,216 +0,0 @@ -############## mysql-test\t\ndb_log_update_as_write_basic.test ############### -# # -# Variable Name: ndb_log_update_as_write # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_update_as_write # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### -############## mysql-test\t\ndb_log_update_as_write_basic.test ################ -# # -# Variable Name: ndb_log_update_as_write # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_update_as_write # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ -################# mysql-test\t\ndb_log_update_as_write_basic.test ###### -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable # -# ndb_log_update_as_write 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. # -# Scope: Global # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system # -# -variables.html # -# # -######################################################################## - ---source include/load_sysvars.inc - -######################################################################## -# START OF ndb_log_update_as_write TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of ndb_log_update_as_write in a temporary variable # -################################################################################ - - ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SET @global_start_value = @@global.ndb_log_update_as_write; ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SELECT @@global.ndb_log_update_as_write; - ---echo 'Bug: The value is not a system variable or atleast not supported in version 5.1.22' - - ---echo '#--------------------FN_DYNVARS_102_01------------------------#' -######################################################################## -# Display the DEFAULT value of ndb_log_update_as_write # -######################################################################## - -#SET @@ndb_log_update_as_write = 0; -#SET @@ndb_log_update_as_write = DEFAULT; -#SELECT @@ndb_log_update_as_write; -# -#SET @@ndb_log_update_as_write = 1; -#SET @@ndb_log_update_as_write = DEFAULT; -#SELECT @@ndb_log_update_as_write; - - ---echo '#---------------------FN_DYNVARS_102_02-------------------------#' -############################################################################# -# Check if ndb_log_update_as_write can be accessed with and without @@ sign # -############################################################################# - -#SET ndb_log_update_as_write = 1; -#SELECT @@ndb_log_update_as_write; -#--Error ER_UNKNOWN_TABLE -#SELECT global.ndb_log_update_as_write; -# -#SET global ndb_log_update_as_write = 1; -#SELECT @@global.ndb_log_update_as_write; - - ---echo '#--------------------FN_DYNVARS_102_03------------------------#' -######################################################################## -# Change the value of ndb_log_update_as_write to a valid value # -######################################################################## - -#SET @@global.ndb_log_update_as_write = 0; -#SELECT @@global.ndb_log_update_as_write; -#SET @@global.ndb_log_update_as_write = 1; -#SELECT @@global.ndb_log_update_as_write; -## a value of 2 is used to just flush logs and then shutdown cold. Not supported on Netware -#SET @@global.ndb_log_update_as_write = 2; -#SELECT @@global.ndb_log_update_as_write; - ---echo '#--------------------FN_DYNVARS_102_04-------------------------#' -########################################################################### -# Change the value of ndb_log_update_as_write to invalid value # -########################################################################### - -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = -1; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = TRU; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = TRUE_F; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = FALS; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = OON; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = ONN; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = OOFF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = 0FF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = ' 1'; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = "0 "; - - - ---echo '#-------------------FN_DYNVARS_102_05----------------------------#' -########################################################################### -# Test if accessing session ndb_log_update_as_write gives error # -########################################################################### - -#--Error ER_LOCAL_VARIABLE -#SET @@session.ndb_log_update_as_write = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@ndb_log_update_as_write = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@local.ndb_log_update_as_write = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@session.ndb_log_update_as_write; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@local.ndb_log_update_as_write; - ---echo '#----------------------FN_DYNVARS_102_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -#SELECT count(VARIABLE_VALUE) AS res_is_0 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='ndb_log_update_as_write'; - - ---echo '#----------------------FN_DYNVARS_102_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -#SELECT @@global.ndb_log_update_as_write = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='ndb_log_update_as_write'; - - ---echo '#---------------------FN_DYNVARS_102_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -#SET @@ndb_log_update_as_write = OFF; -#SELECT @@ndb_log_update_as_write; -#SET @@ndb_log_update_as_write = ON; -#SELECT @@ndb_log_update_as_write; - ---echo '#---------------------FN_DYNVARS_102_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -#SET @@ndb_log_update_as_write = TRUE; -#SELECT @@ndb_log_update_as_write; -#SET @@ndb_log_update_as_write = 'FALSE'; -#SELECT @@ndb_log_update_as_write; - -############################## -# Restore initial value # -############################## - -#SET @@ndb_log_update_as_write = @global_start_value; -#SELECT @@ndb_log_update_as_write; - -######################################################################## -# END OF ndb_log_update_as_write TESTS # -######################################################################## diff --git a/mysql-test/t/ndb_log_updated_only_basic.test b/mysql-test/t/ndb_log_updated_only_basic.test deleted file mode 100644 index 85b76cc88a4..00000000000 --- a/mysql-test/t/ndb_log_updated_only_basic.test +++ /dev/null @@ -1,216 +0,0 @@ -############## mysql-test\t\ndb_log_updated_only_basic.test ############### -# # -# Variable Name: ndb_log_updated_only # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_updated_only # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### -############## mysql-test\t\ndb_log_updated_only_basic.test ################ -# # -# Variable Name: ndb_log_updated_only # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_updated_only # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ -################# mysql-test\t\ndb_log_updated_only_basic.test ######### -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable # -# ndb_log_updated_only 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. # -# Scope: Global # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system # -# -variables.html # -# # -######################################################################## - ---source include/load_sysvars.inc - -######################################################################## -# START OF ndb_log_updated_only TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of ndb_log_updated_only in a temporary variable # -################################################################################ - - ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SET @global_start_value = @@global.ndb_log_updated_only; ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SELECT @@global.ndb_log_updated_only; - ---echo 'Bug: The value is not a system variable or atleast not supported in version 5.1.22' - - ---echo '#--------------------FN_DYNVARS_103_01------------------------#' -######################################################################## -# Display the DEFAULT value of ndb_log_updated_only # -######################################################################## - -#SET @@ndb_log_updated_only = 0; -#SET @@ndb_log_updated_only = DEFAULT; -#SELECT @@ndb_log_updated_only; -# -#SET @@ndb_log_updated_only = 1; -#SET @@ndb_log_updated_only = DEFAULT; -#SELECT @@ndb_log_updated_only; - - ---echo '#---------------------FN_DYNVARS_103_02-------------------------#' -############################################################################# -# Check if ndb_log_updated_only can be accessed with and without @@ sign # -############################################################################# - -#SET ndb_log_updated_only = 1; -#SELECT @@ndb_log_updated_only; -#--Error ER_UNKNOWN_TABLE -#SELECT global.ndb_log_updated_only; -# -#SET global ndb_log_updated_only = 1; -#SELECT @@global.ndb_log_updated_only; - - ---echo '#--------------------FN_DYNVARS_103_03------------------------#' -######################################################################## -# Change the value of ndb_log_updated_only to a valid value # -######################################################################## - -#SET @@global.ndb_log_updated_only = 0; -#SELECT @@global.ndb_log_updated_only; -#SET @@global.ndb_log_updated_only = 1; -#SELECT @@global.ndb_log_updated_only; -## a value of 2 is used to just flush logs and then shutdown cold. Not supported on Netware -#SET @@global.ndb_log_updated_only = 2; -#SELECT @@global.ndb_log_updated_only; - ---echo '#--------------------FN_DYNVARS_103_04-------------------------#' -########################################################################### -# Change the value of ndb_log_updated_only to invalid value # -########################################################################### - -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = -1; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = TRU; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = TRUE_F; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = FALS; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = OON; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = ONN; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = OOFF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = 0FF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = ' 1'; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = "0 "; - - - ---echo '#-------------------FN_DYNVARS_103_05----------------------------#' -########################################################################### -# Test if accessing session ndb_log_updated_only gives error # -########################################################################### - -#--Error ER_LOCAL_VARIABLE -#SET @@session.ndb_log_updated_only = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@ndb_log_updated_only = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@local.ndb_log_updated_only = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@session.ndb_log_updated_only; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@local.ndb_log_updated_only; - ---echo '#----------------------FN_DYNVARS_103_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -#SELECT count(VARIABLE_VALUE) AS res_is_0 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='ndb_log_updated_only'; - - ---echo '#----------------------FN_DYNVARS_103_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -#SELECT @@global.ndb_log_updated_only = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='ndb_log_updated_only'; - - ---echo '#---------------------FN_DYNVARS_103_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -#SET @@ndb_log_updated_only = OFF; -#SELECT @@ndb_log_updated_only; -#SET @@ndb_log_updated_only = ON; -#SELECT @@ndb_log_updated_only; - ---echo '#---------------------FN_DYNVARS_103_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -#SET @@ndb_log_updated_only = TRUE; -#SELECT @@ndb_log_updated_only; -#SET @@ndb_log_updated_only = 'FALSE'; -#SELECT @@ndb_log_updated_only; - -############################## -# Restore initial value # -############################## - -#SET @@ndb_log_updated_only = @global_start_value; -#SELECT @@ndb_log_updated_only; - -######################################################################## -# END OF ndb_log_updated_only TESTS # -######################################################################## diff --git a/mysql-test/t/net_buffer_length_basic.test b/mysql-test/t/net_buffer_length_basic.test deleted file mode 100644 index 6e1e0559c61..00000000000 --- a/mysql-test/t/net_buffer_length_basic.test +++ /dev/null @@ -1,207 +0,0 @@ -################# mysql-test\t\net_buffer_length_basic.test ################### -# # -# Variable Name: net_buffer_length # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 16384 # -# Range: 1024-1048576 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable net_buffer_length # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -################################################################# -# START OF net_buffer_length TESTS # -################################################################# - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.net_buffer_length; -# Due to differences in results of linux and windows -#SELECT @start_global_value; - -# give a known value to @@session.net_buffer_length by assigning to -# @@global and setting up a new connection (for deterministic result -# file diffing) -SET @@global.net_buffer_length = DEFAULT; -connect(con1,localhost,root,,); -connection con1; - ---echo '#--------------------FN_DYNVARS_109_01-------------------------#' -################################################################# -# Display the DEFAULT value of net_buffer_length # -################################################################# - -SET @@global.net_buffer_length = 10000; -SET @@global.net_buffer_length = DEFAULT; -SELECT @@global.net_buffer_length; - ---Error ER_VARIABLE_IS_READONLY -SET @@session.net_buffer_length = 20000; ---Error ER_NO_DEFAULT -SET @@session.net_buffer_length = DEFAULT; -SELECT @@session.net_buffer_length; - - ---echo '#--------------------FN_DYNVARS_109_02-------------------------#' -######################################################################## -# Check the DEFAULT value of net_buffer_length # -######################################################################## - -SET @@global.net_buffer_length = DEFAULT; -SELECT @@global.net_buffer_length = 16384; - - ---echo '#--------------------FN_DYNVARS_109_03-------------------------#' -########################################################################### -# Change the value of net_buffer_length to a valid value for GLOBAL Scope # -########################################################################### - -SET @@global.net_buffer_length = 1024; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = 1025; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = 1048576; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = 1048575; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = 65535; -SELECT @@global.net_buffer_length; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_109_04-------------------------#' -############################################################################ -# Change the value of net_buffer_length to a valid value for SESSION Scope # -############################################################################ - -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped - - ---echo '#------------------FN_DYNVARS_109_05-----------------------#' -############################################################# -# Change the value of net_buffer_length to an invalid value # -############################################################# - -SET @@global.net_buffer_length = 0; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = -1024; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = 1023; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = 1048577; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = 104857633; -SELECT @@global.net_buffer_length; ---Error ER_PARSE_ERROR -SET @@global.net_buffer_length = 65530.34.; -SELECT @@global.net_buffer_length; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.net_buffer_length = test; -SELECT @@global.net_buffer_length; - -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.net_buffer_length = test; -SELECT @@session.net_buffer_length; - - ---echo '#------------------FN_DYNVARS_109_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.net_buffer_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='net_buffer_length'; - ---echo '#------------------FN_DYNVARS_109_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.net_buffer_length = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='net_buffer_length'; - - ---echo '#------------------FN_DYNVARS_109_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.net_buffer_length = TRUE; -SELECT @@global.net_buffer_length; -SET @@global.net_buffer_length = FALSE; -SELECT @@global.net_buffer_length; - - ---echo '#---------------------FN_DYNVARS_109_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.net_buffer_length = 2048; -SELECT @@net_buffer_length = @@global.net_buffer_length; - - ---echo '#---------------------FN_DYNVARS_109_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped - - ---echo '#---------------------FN_DYNVARS_109_11----------------------#' -############################################################################ -# Check if net_buffer_length can be accessed with and without @@ sign # -############################################################################ - -# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped -SELECT @@net_buffer_length; ---Error ER_UNKNOWN_TABLE -SELECT local.net_buffer_length; ---Error ER_UNKNOWN_TABLE -SELECT session.net_buffer_length; ---Error ER_BAD_FIELD_ERROR -SELECT net_buffer_length = @@session.net_buffer_length; - - -#################################### -# Restore initial value # -#################################### - -connection default; - -SET @@global.net_buffer_length = @start_global_value; -# Due to differences in results of linux and windows -#SELECT @@global.net_buffer_length; - - -###################################################### -# END OF net_buffer_length TESTS # -###################################################### diff --git a/mysql-test/t/net_read_timeout_basic.test b/mysql-test/t/net_read_timeout_basic.test deleted file mode 100644 index f0d32302e4f..00000000000 --- a/mysql-test/t/net_read_timeout_basic.test +++ /dev/null @@ -1,207 +0,0 @@ -############## mysql-test\t\net_read_timeout_basic.test ############### -# # -# Variable Name: net_read_timeout # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 30 # -# Min Vlue: 1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable net_read_timeout # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -##################################################################### -# START OF net_read_timeout TESTS # -##################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.net_read_timeout; -SELECT @start_global_value; -SET @start_session_value = @@session.net_read_timeout; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_110_01-------------------------#' -##################################################################### -# Display the DEFAULT value of net_read_timeout # -##################################################################### - -SET @@global.net_read_timeout = 100; -SET @@global.net_read_timeout = DEFAULT; -SELECT @@global.net_read_timeout; - -SET @@session.net_read_timeout = 200; -SET @@session.net_read_timeout = DEFAULT; -SELECT @@session.net_read_timeout; - - ---echo '#--------------------FN_DYNVARS_110_02-------------------------#' -######################################################################## -# Check the DEFAULT value of net_read_timeout # -######################################################################## - -SET @@global.net_read_timeout = DEFAULT; -SELECT @@global.net_read_timeout = 30; - -SET @@session.net_read_timeout = DEFAULT; -SELECT @@session.net_read_timeout = 30; - - ---echo '#--------------------FN_DYNVARS_110_03-------------------------#' -################################################################################## -# Change the value of net_read_timeout to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.net_read_timeout = 1; -SELECT @@global.net_read_timeout; -SET @@global.net_read_timeout = 60020; -SELECT @@global.net_read_timeout; -SET @@global.net_read_timeout = 65535; -SELECT @@global.net_read_timeout; - - ---echo '#--------------------FN_DYNVARS_110_04-------------------------#' -################################################################################### -# Change the value of net_read_timeout to a valid value for SESSION Scope # -################################################################################### - -SET @@session.net_read_timeout = 1; -SELECT @@session.net_read_timeout; -SET @@session.net_read_timeout = 50050; -SELECT @@session.net_read_timeout; -SET @@session.net_read_timeout = 65535; -SELECT @@session.net_read_timeout; - - ---echo '#------------------FN_DYNVARS_110_05-----------------------#' -#################################################################### -# Change the value of net_read_timeout to an invalid value # -#################################################################### - -SET @@global.net_read_timeout = 0; -SELECT @@global.net_read_timeout; -SET @@global.net_read_timeout = -1024; -SELECT @@global.net_read_timeout; -SET @@global.net_read_timeout = 655360354; -SELECT @@global.net_read_timeout; ---Error ER_PARSE_ERROR -SET @@global.net_read_timeout = 65530.34.; -SELECT @@global.net_read_timeout; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.net_read_timeout = test; -SELECT @@global.net_read_timeout; - -SET @@session.net_read_timeout = 0; -SELECT @@session.net_read_timeout; -SET @@session.net_read_timeout = -2; -SELECT @@session.net_read_timeout; ---Error ER_PARSE_ERROR -SET @@session.net_read_timeout = 65530.34.; -SET @@session.net_read_timeout = 6555015425; -SELECT @@session.net_read_timeout; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.net_read_timeout = test; -SELECT @@session.net_read_timeout; - - ---echo '#------------------FN_DYNVARS_110_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.net_read_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='net_read_timeout'; - ---echo '#------------------FN_DYNVARS_110_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.net_read_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='net_read_timeout'; - - ---echo '#------------------FN_DYNVARS_110_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.net_read_timeout = TRUE; -SELECT @@global.net_read_timeout; -SET @@global.net_read_timeout = FALSE; -SELECT @@global.net_read_timeout; - - ---echo '#---------------------FN_DYNVARS_110_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.net_read_timeout = 10; -SELECT @@net_read_timeout = @@global.net_read_timeout; - - ---echo '#---------------------FN_DYNVARS_110_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@net_read_timeout = 100; -SELECT @@net_read_timeout = @@local.net_read_timeout; -SELECT @@local.net_read_timeout = @@session.net_read_timeout; - - ---echo '#---------------------FN_DYNVARS_110_11----------------------#' -################################################################################### -# Check if net_read_timeout can be accessed with and without @@ sign # -################################################################################### - -SET net_read_timeout = 1; -SELECT @@net_read_timeout; ---Error ER_UNKNOWN_TABLE -SELECT local.net_read_timeout; ---Error ER_UNKNOWN_TABLE -SELECT session.net_read_timeout; ---Error ER_BAD_FIELD_ERROR -SELECT net_read_timeout = @@session.net_read_timeout; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.net_read_timeout = @start_global_value; -SELECT @@global.net_read_timeout; -SET @@session.net_read_timeout = @start_session_value; -SELECT @@session.net_read_timeout; - - -############################################################# -# END OF net_read_timeout TESTS # -############################################################# - diff --git a/mysql-test/t/net_write_timeout_basic.test b/mysql-test/t/net_write_timeout_basic.test deleted file mode 100644 index 84c682561e3..00000000000 --- a/mysql-test/t/net_write_timeout_basic.test +++ /dev/null @@ -1,203 +0,0 @@ -############## mysql-test\t\net_write_timeout_basic.test ############### -# # -# Variable Name: net_write_timeout # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 60 # -# Min Value: 1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable net_write_timeout # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -################################################################# -# START OF net_write_timeout TESTS # -################################################################# - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.net_write_timeout; -SELECT @start_global_value; -SET @start_session_value = @@session.net_write_timeout; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_112_01-------------------------#' -################################################################# -# Display the DEFAULT value of net_write_timeout # -################################################################# - -SET @@global.net_write_timeout = 100; -SET @@global.net_write_timeout = DEFAULT; -SELECT @@global.net_write_timeout; - -SET @@session.net_write_timeout = 200; -SET @@session.net_write_timeout = DEFAULT; -SELECT @@session.net_write_timeout; - - ---echo '#--------------------FN_DYNVARS_112_02-------------------------#' -################################################################# -# Check the DEFAULT value of net_write_timeout # -################################################################# - -SET @@global.net_write_timeout = DEFAULT; -SELECT @@global.net_write_timeout = 60; - -SET @@session.net_write_timeout = DEFAULT; -SELECT @@session.net_write_timeout = 60; - - ---echo '#--------------------FN_DYNVARS_112_03-------------------------#' -########################################################################### -# Change the value of net_write_timeout to a valid value for GLOBAL Scope # -########################################################################### - -SET @@global.net_write_timeout = 1; -SELECT @@global.net_write_timeout; -SET @@global.net_write_timeout = 60020; -SELECT @@global.net_write_timeout; -SET @@global.net_write_timeout = 65535; -SELECT @@global.net_write_timeout; - - ---echo '#--------------------FN_DYNVARS_112_04-------------------------#' -############################################################################ -# Change the value of net_write_timeout to a valid value for SESSION Scope # -############################################################################ - -SET @@session.net_write_timeout = 1; -SELECT @@session.net_write_timeout; -SET @@session.net_write_timeout = 50050; -SELECT @@session.net_write_timeout; -SET @@session.net_write_timeout = 65535; -SELECT @@session.net_write_timeout; - - ---echo '#------------------FN_DYNVARS_112_05-----------------------#' -############################################################# -# Change the value of net_write_timeout to an invalid value # -############################################################# - -SET @@global.net_write_timeout = 0; -SELECT @@global.net_write_timeout; -SET @@global.net_write_timeout = -1024; -SELECT @@global.net_write_timeout; -SET @@global.net_write_timeout = 655360354; -SELECT @@global.net_write_timeout; ---Error ER_PARSE_ERROR -SET @@global.net_write_timeout = 65530.34.; -SELECT @@global.net_write_timeout; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.net_write_timeout = test; -SELECT @@global.net_write_timeout; - -SET @@session.net_write_timeout = 0; -SELECT @@session.net_write_timeout; -SET @@session.net_write_timeout = -2; -SELECT @@session.net_write_timeout; ---Error ER_PARSE_ERROR -SET @@session.net_write_timeout = 65530.34.; -SET @@session.net_write_timeout = 6555015425; -SELECT @@session.net_write_timeout; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.net_write_timeout = test; -SELECT @@session.net_write_timeout; - - ---echo '#------------------FN_DYNVARS_112_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.net_write_timeout = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='net_write_timeout'; - ---echo '#------------------FN_DYNVARS_112_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.net_write_timeout = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='net_write_timeout'; - - ---echo '#------------------FN_DYNVARS_112_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.net_write_timeout = TRUE; -SELECT @@global.net_write_timeout; -SET @@global.net_write_timeout = FALSE; -SELECT @@global.net_write_timeout; - - ---echo '#---------------------FN_DYNVARS_112_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.net_write_timeout = 10; -SELECT @@net_write_timeout = @@global.net_write_timeout; - - ---echo '#---------------------FN_DYNVARS_112_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@net_write_timeout = 100; -SELECT @@net_write_timeout = @@local.net_write_timeout; -SELECT @@local.net_write_timeout = @@session.net_write_timeout; - - ---echo '#---------------------FN_DYNVARS_112_11----------------------#' -############################################################################ -# Check if net_write_timeout can be accessed with and without @@ sign # -############################################################################ - -SET net_write_timeout = 1; -SELECT @@net_write_timeout; ---Error ER_UNKNOWN_TABLE -SELECT local.net_write_timeout; ---Error ER_UNKNOWN_TABLE -SELECT session.net_write_timeout; ---Error ER_BAD_FIELD_ERROR -SELECT net_write_timeout = @@session.net_write_timeout; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.net_write_timeout = @start_global_value; -SELECT @@global.net_write_timeout; -SET @@session.net_write_timeout = @start_session_value; -SELECT @@session.net_write_timeout; - - -###################################################### -# END OF net_write_timeout TESTS # -###################################################### - diff --git a/mysql-test/t/new_basic.test b/mysql-test/t/new_basic.test deleted file mode 100644 index b1d12c9a4de..00000000000 --- a/mysql-test/t/new_basic.test +++ /dev/null @@ -1,220 +0,0 @@ -############## mysql-test\t\new_basic.test #################################### -# # -# Variable Name: new # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable "new" # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_new # -# # -############################################################################### - ---source include/load_sysvars.inc -################################################### -# START OF new TESTS # -################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.new; -SELECT @start_global_value; -SET @start_session_value = @@session.new; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_113_01-------------------------#' -################################################### -# Display the DEFAULT value of new # -################################################### - -SET @@global.new = ON; -SET @@global.new = DEFAULT; -SELECT @@global.new; - -SET @@session.new = ON; -SET @@session.new = DEFAULT; -SELECT @@session.new; - - ---echo '#--------------------FN_DYNVARS_113_02-------------------------#' -################################################### -# Check the DEFAULT value of new # -################################################### - -SET @@global.new = DEFAULT; -SELECT @@global.new = 'OFF'; - -SET @@session.new = DEFAULT; -SELECT @@session.new = 'OFF'; - - ---echo '#--------------------FN_DYNVARS_113_03-------------------------#' -############################################################# -# Change the value of new to a valid value for GLOBAL Scope # -############################################################# - -SET @@global.new = ON; -SELECT @@global.new; -SET @@global.new = OFF; -SELECT @@global.new; -SET @@global.new = 0; -SELECT @@global.new; -SET @@global.new = 1; -SELECT @@global.new; -SET @@global.new = TRUE; -SELECT @@global.new; -SET @@global.new = FALSE; -SELECT @@global.new; - - - ---echo '#--------------------FN_DYNVARS_113_04-------------------------#' -############################################################## -# Change the value of new to a valid value for SESSION Scope # -############################################################## - -SET @@session.new = ON; -SELECT @@session.new; -SET @@session.new = OFF; -SELECT @@session.new; -SET @@session.new = 0; -SELECT @@session.new; -SET @@session.new = 1; -SELECT @@session.new; -SET @@session.new = TRUE; -SELECT @@session.new; -SET @@session.new = FALSE; -SELECT @@session.new; - - ---echo '#------------------FN_DYNVARS_113_05-----------------------#' -############################################### -# Change the value of new to an invalid value # -############################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = 'ONN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = "OFFF"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = TTRUE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = FELSE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = -1024; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = 65536; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = 65530.34; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.new = test; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.new = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.new = ONF; - -SET @@session.new = OF; -SELECT @@session.new; ---echo 'Bug# 34828: FN_DYNVARS_113_05 - OF is also working as OFF and no error is coming'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.new = 'OFN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.new = -2; ---Error ER_PARSE_ERROR -SET @@session.new = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.new = 65550; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.new = test; - - ---echo '#------------------FN_DYNVARS_113_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.new = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='new'; - ---echo '#------------------FN_DYNVARS_113_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.new = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='new'; - - - ---echo '#---------------------FN_DYNVARS_113_08----------------------#' -############################################################################### -# Check if global and session variable are independent of each other # -############################################################################### - -SET @@new = OFF; -SET @@global.new = ON; -SELECT @@new = @@global.new; - ---echo '#---------------------FN_DYNVARS_113_09----------------------#' -############################################################################### -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################### - -SET @@new = ON; -SELECT @@new = @@local.new; -SELECT @@local.new = @@session.new; - - ---echo '#---------------------FN_DYNVARS_113_10----------------------#' -############################################################## -# Check if new can be accessed with and without @@ sign # -############################################################## - -SET new = 1; -SELECT @@new; ---Error ER_UNKNOWN_TABLE -SELECT local.new; ---Error ER_UNKNOWN_TABLE -SELECT session.new; ---Error ER_BAD_FIELD_ERROR -SELECT new = @@session.new; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.new = @start_global_value; -SELECT @@global.new; -SET @@session.new = @start_session_value; -SELECT @@session.new; - - -######################################## -# END OF new TESTS # -######################################## - diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test index ffc13cf80f7..233ac3edfbb 100644 --- a/mysql-test/t/not_embedded_server.test +++ b/mysql-test/t/not_embedded_server.test @@ -5,53 +5,35 @@ -- source include/not_embedded.inc # -# Show full process list with prepare -# To not show other connections, this must be the first test and we must -# have a server restart before this one -# -# We don't have any 4.1 tests as we use I_S to query the PROCESSLIST to -# exclude system threads that may/may not be active in the server -# (namely the ndb injector thread) -# -# End of 4.1 tests - -prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' '; ---replace_column 1 number 6 time 3 localhost -execute stmt1; -deallocate prepare stmt1; - - -# -# Bug#31222: com_% global status counters behave randomly with -# mysql_change_user. -# -# Moved from change_user.test due to Bug#34517: SHOW GLOBAL STATUS does not -# work properly in embedded server. -# -# TODO: move it back when Bug#34517 is fixed. -# - -FLUSH STATUS; - ---disable_result_log ---disable_query_log - -let $i = 100; - -while ($i) -{ - dec $i; - - SELECT 1; -} - ---enable_query_log ---enable_result_log - -SHOW GLOBAL STATUS LIKE 'com_select'; - ---change_user - -SHOW GLOBAL STATUS LIKE 'com_select'; +# Produce output +# + +select 1; + +# The following fails sporadically because 'check-testcase' runs +# queries before this test and there is no way to guarantee that any +# previous process finishes. The purpose of the test is not clearly +# stated, there is no reference to any bug report, and "select from +# I_S from prepared statement" doesn't look like something that's +# really imporant to test. I'm commenting out this for now. If +# anyone wants to keep this, please fix the race and motivate why we +# need to test this. If you see this comment and it is after mid-2009 +# or so, feel free to remove this test from the file. /Sven +# +# +## Show full process list with prepare +## To not show other connections, this must be the first test and we must +## have a server restart before this one +## +## We don't have any 4.1 tests as we use I_S to query the PROCESSLIST to +## exclude system threads that may/may not be active in the server +## (namely the ndb injector thread) +## +## End of 4.1 tests +# +#prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' '; +#--replace_column 1 number 6 time 3 localhost +#execute stmt1; +#deallocate prepare stmt1; # End of 5.1 tests diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index ddf6b8870fa..2878b54c357 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -61,9 +61,7 @@ drop table t1; # CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0); INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55"; ---error 1048 UPDATE t1 SET d=1/NULL; ---error 1048 UPDATE t1 SET d=NULL; --error 1048 INSERT INTO t1 (a) values (null); diff --git a/mysql-test/t/old_passwords_basic.test b/mysql-test/t/old_passwords_basic.test deleted file mode 100644 index b78ac9ca9b8..00000000000 --- a/mysql-test/t/old_passwords_basic.test +++ /dev/null @@ -1,220 +0,0 @@ -############## mysql-test\t\old_passwords_basic.test ########################## -# # -# Variable Name: old_passwords # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable old_passwords # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_old-passwords # -# # -############################################################################### - ---source include/load_sysvars.inc -################################################### -# START OF old_passwords TESTS # -################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.old_passwords; -SELECT @start_global_value; -SET @start_session_value = @@session.old_passwords; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_114_01-------------------------#' -################################################### -# Display the DEFAULT value of old_passwords # -################################################### - -SET @@global.old_passwords = ON; -SET @@global.old_passwords = DEFAULT; -SELECT @@global.old_passwords; - -SET @@session.old_passwords = ON; -SET @@session.old_passwords = DEFAULT; -SELECT @@session.old_passwords; - - ---echo '#--------------------FN_DYNVARS_114_02-------------------------#' -################################################### -# Check the DEFAULT value of old_passwords # -################################################### - -SET @@global.old_passwords = DEFAULT; -SELECT @@global.old_passwords = FALSE; - -SET @@session.old_passwords = DEFAULT; -SELECT @@session.old_passwords = FALSE; - - ---echo '#--------------------FN_DYNVARS_114_03-------------------------#' -####################################################################### -# Change the value of old_passwords to a valid value for GLOBAL Scope # -####################################################################### - -SET @@global.old_passwords = ON; -SELECT @@global.old_passwords; -SET @@global.old_passwords = OFF; -SELECT @@global.old_passwords; -SET @@global.old_passwords = 0; -SELECT @@global.old_passwords; -SET @@global.old_passwords = 1; -SELECT @@global.old_passwords; -SET @@global.old_passwords = TRUE; -SELECT @@global.old_passwords; -SET @@global.old_passwords = FALSE; -SELECT @@global.old_passwords; - - - ---echo '#--------------------FN_DYNVARS_114_04-------------------------#' -######################################################################## -# Change the value of old_passwords to a valid value for SESSION Scope # -######################################################################## - -SET @@session.old_passwords = ON; -SELECT @@session.old_passwords; -SET @@session.old_passwords = OFF; -SELECT @@session.old_passwords; -SET @@session.old_passwords = 0; -SELECT @@session.old_passwords; -SET @@session.old_passwords = 1; -SELECT @@session.old_passwords; -SET @@session.old_passwords = TRUE; -SELECT @@session.old_passwords; -SET @@session.old_passwords = FALSE; -SELECT @@session.old_passwords; - - ---echo '#------------------FN_DYNVARS_114_05-----------------------#' -######################################################### -# Change the value of old_passwords to an invalid value # -######################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = 'ONN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = "OFFF"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = TTRUE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = FELSE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = -1024; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = 65536; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = 65530.34; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.old_passwords = test; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.old_passwords = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.old_passwords = ONF; - -SET @@session.old_passwords = OF; -SELECT @@session.old_passwords; ---echo 'Bug# 34828: OF is also working as OFF and no error is coming'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.old_passwords = 'OFN'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.old_passwords = -2; ---Error ER_PARSE_ERROR -SET @@session.old_passwords = 65530.34.; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.old_passwords = 65550; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.old_passwords = test; - - ---echo '#------------------FN_DYNVARS_114_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.old_passwords = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='old_passwords'; - ---echo '#------------------FN_DYNVARS_114_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.old_passwords = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='old_passwords'; - - ---echo '#---------------------FN_DYNVARS_114_08----------------------#' -############################################################################### -# Check if global and session variable are independent of each other # -############################################################################### - -SET @@old_passwords = OFF; -SET @@global.old_passwords = ON; -SELECT @@old_passwords = @@global.old_passwords; - - ---echo '#---------------------FN_DYNVARS_114_09----------------------#' -############################################################################### -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################### - -SET @@old_passwords = ON; -SELECT @@old_passwords = @@local.old_passwords; -SELECT @@local.old_passwords = @@session.old_passwords; - - ---echo '#---------------------FN_DYNVARS_114_10----------------------#' -######################################################################## -# Check if old_passwords can be accessed with and without @@ sign # -######################################################################## - -SET old_passwords = 1; -SELECT @@old_passwords; ---Error ER_UNKNOWN_TABLE -SELECT local.old_passwords; ---Error ER_UNKNOWN_TABLE -SELECT session.old_passwords; ---Error ER_BAD_FIELD_ERROR -SELECT old_passwords = @@session.old_passwords; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.old_passwords = @start_global_value; -SELECT @@global.old_passwords; -SET @@session.old_passwords = @start_session_value; -SELECT @@session.old_passwords; - - -################################################## -# END OF old_passwords TESTS # -################################################## - diff --git a/mysql-test/t/old_passwords_func.test b/mysql-test/t/old_passwords_func.test deleted file mode 100644 index 2707fc3ab6d..00000000000 --- a/mysql-test/t/old_passwords_func.test +++ /dev/null @@ -1,120 +0,0 @@ -############# mysql-test\t\old_passwords_func.test ############################ -# # -# Variable Name: old_passwords # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: FALSE # -# Values: TRUE, FALSE # -# # -# # -# Creation Date: 2008-03-12 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "old_passwords" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.0/en # -# /server-options.html#option_mysqld_old-passwords # -# # -############################################################################### - -# -# Setup -# - ---source include/not_embedded.inc - -SET @global_old_passwords = @@GLOBAL.old_passwords; -SET @session_old_passwords = @@SESSION.old_passwords; -SET @global_secure_auth = @@GLOBAL.secure_auth; - - ---echo '#------------------------FN_DYNVARS_115_01---------------------------#' - ---echo ** Connection default ** -connection default; - -# -# 2 Users with FALSE value -# - -CREATE USER 'userNewPass1'@'localhost' IDENTIFIED BY 'pass1'; -CREATE USER 'userNewPass2'@'localhost' IDENTIFIED BY 'pass2'; - -SET GLOBAL old_passwords = TRUE; -SET SESSION old_passwords = TRUE; - -# -# 1 User with TRUE value -# - -CREATE USER 'userOldPass'@'localhost' IDENTIFIED BY 'pass3'; - -SET GLOBAL secure_auth = FALSE; - ---echo ** Connecting con1 using username 'userNewPass1' ** -connect (con1,localhost,userNewPass1,pass1,); -SELECT CURRENT_USER(); ---echo userNewPass1@localhost Expected - ---echo ** Connecting con2 using username 'userNewPass2' ** -connect (con2,localhost,userNewPass2,pass2,); -SELECT CURRENT_USER(); ---echo userNewPass2@localhost Expected - ---echo ** Connecting con3 using username 'userOldPass' ** -connect (con3,localhost,userOldPass,pass3,); -SELECT CURRENT_USER(); ---echo userOldPass@localhost Expected - ---echo ** Connection default ** -connection default; - ---echo ** Disconnecting con1, con2, con3 ** -disconnect con1; -disconnect con2; -disconnect con3; - ---echo '#------------------------FN_DYNVARS_115_02---------------------------#' - -SET GLOBAL secure_auth = TRUE; - ---echo ** Connecting con1 using username 'userNewPass1' ** -connect (con1,localhost,userNewPass1,pass1,); -SELECT CURRENT_USER(); ---echo userNewPass1@localhost Expected - ---echo ** Connecting con2 using username 'userNewPass2' ** -connect (con2,localhost,userNewPass2,pass2,); -SELECT CURRENT_USER(); ---echo userNewPass2@localhost Expected - ---echo ** Connecting con3 using username 'userOldPass' ** ---disable_query_log ---error ER_SERVER_IS_IN_SECURE_AUTH_MODE -connect (con3,localhost,userOldPass,pass3,); ---enable_query_log ---echo Expected Error 'Server is running in secure auth mode' -SELECT CURRENT_USER(); ---echo userNewPass2@localhost Expected - ---echo ** Connection default ** -connection default; - ---echo ** Disconnecting con1, con2 ** -disconnect con1; -disconnect con2; - -# -# Cleanup -# - -DROP USER 'userNewPass1'@'localhost'; -DROP USER 'userNewPass2'@'localhost'; -DROP USER 'userOldPass'@'localhost'; - -SET @@GLOBAL.old_passwords = @global_old_passwords; -SET @@SESSION.old_passwords = @session_old_passwords; -SET @@GLOBAL.secure_auth = @global_secure_auth; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 1f5ada76366..240a977fdca 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -1,7 +1,11 @@ # Tests for SSL connections, only run if mysqld is compiled # with support for SSL. --- source include/have_ssl.inc +--source include/have_ssl.inc + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + --disable_warnings drop table if exists t1; @@ -11,8 +15,8 @@ insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; @@ -21,38 +25,42 @@ connect (con2,localhost,ssl_user2,,,,,SSL); connect (con3,localhost,ssl_user3,,,,,SSL); connect (con4,localhost,ssl_user4,,,,,SSL); --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT ---error 1045 +--error ER_ACCESS_DENIED_ERROR connect (con5,localhost,ssl_user5,,,,,SSL); connection con1; # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR delete from t1; connection con2; # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR delete from t1; connection con3; # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR delete from t1; connection con4; # Check ssl turned on SHOW STATUS LIKE 'Ssl_cipher'; select * from t1; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR delete from t1; connection default; +disconnect con1; +disconnect con2; +disconnect con3; +disconnect con4; drop user ssl_user1@localhost, ssl_user2@localhost, ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost; @@ -97,11 +105,11 @@ drop table t1; --exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 # -# BUG#21611 Slave can't connect when master-ssl-cipher specified +# Bug#21611 Slave can't connect when master-ssl-cipher specified # - Apparently selecting a cipher doesn't work at all # - Usa a cipher that both yaSSL and OpenSSL supports # ---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit;" > $MYSQLTEST_VARDIR/tmp/test.sql --exec $MYSQL_TEST --ssl-cipher=DHE-RSA-AES256-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 # @@ -115,7 +123,7 @@ drop table t1; --echo End of 5.0 tests # -# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in +# Bug#26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in # Event (see also information_schema.test for the other part of test for # this bug). # @@ -155,23 +163,23 @@ SET GLOBAL event_scheduler=0; # # Test to connect using a list of ciphers # ---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit;" > $MYSQLTEST_VARDIR/tmp/test.sql --exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER:AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 # Test to connect using a specifi cipher # ---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit;" > $MYSQLTEST_VARDIR/tmp/test.sql --exec $MYSQL_TEST --ssl-cipher=AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 # Test to connect using an unknown cipher # ---exec echo "SHOW STATUS LIKE 'Ssl_cipher';" > $MYSQLTEST_VARDIR/tmp/test.sql +--exec echo "SHOW STATUS LIKE 'Ssl_cipher'; exit" > $MYSQLTEST_VARDIR/tmp/test.sql --error 1 --exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1 # -# Bug #27669 mysqldump: SSL connection error when trying to connect +# Bug#27669 mysqldump: SSL connection error when trying to connect # CREATE TABLE t1(a int); @@ -190,10 +198,11 @@ INSERT INTO t1 VALUES (1), (2); --exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1 DROP TABLE t1; +--remove_file $MYSQLTEST_VARDIR/tmp/test.sql # -# Bug#39172: Asking for DH+non-RSA key with server set to use other key caused -# YaSSL to crash the server. +# Bug#39172 Asking for DH+non-RSA key with server set to use other key caused +# YaSSL to crash the server. # # Common ciphers to openssl and yassl @@ -201,7 +210,8 @@ DROP TABLE t1; --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=RC4-SHA ---disable_output +--disable_query_log +--disable_result_log # Below here caused crashes. ################ --error 1,0 @@ -224,8 +234,12 @@ DROP TABLE t1; # End of crashers. ########################## # If this gives a result, then the bug is fixed. ---enable_output +--enable_result_log +--enable_query_log select 'is still running; no cipher request crashed the server' as result from dual; ## --echo End of 5.1 tests + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/optimizer_prune_level_basic.test b/mysql-test/t/optimizer_prune_level_basic.test deleted file mode 100644 index 58c074d7d5e..00000000000 --- a/mysql-test/t/optimizer_prune_level_basic.test +++ /dev/null @@ -1,228 +0,0 @@ -############## mysql-test\t\optimizer_prune_level_basic.test ################## -# # -# Variable Name: optimizer_prune_level # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable optimizer_prune_level # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_optimizer_prune_level # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################### -# START OF optimizer_prune_level TESTS # -################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.optimizer_prune_level; -SELECT @start_global_value; -SET @start_session_value = @@session.optimizer_prune_level; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_115_01-------------------------#' -########################################################### -# Display the DEFAULT value of optimizer_prune_level # -########################################################### - -SET @@global.optimizer_prune_level = 0; -SET @@global.optimizer_prune_level = DEFAULT; -SELECT @@global.optimizer_prune_level; - -SET @@session.optimizer_prune_level = 0; -SET @@session.optimizer_prune_level = DEFAULT; -SELECT @@session.optimizer_prune_level; - - ---echo '#--------------------FN_DYNVARS_115_02-------------------------#' -########################################################### -# Check the DEFAULT value of optimizer_prune_level # -########################################################### - -SET @@global.optimizer_prune_level = DEFAULT; -SELECT @@global.optimizer_prune_level = 1; - -SET @@session.optimizer_prune_level = DEFAULT; -SELECT @@session.optimizer_prune_level = 1; - - ---echo '#--------------------FN_DYNVARS_115_03-------------------------#' -############################################################################### -# Change the value of optimizer_prune_level to a valid value for GLOBAL Scope # -############################################################################### - - -SELECT @@global.optimizer_prune_level; -SET @@global.optimizer_prune_level = 0; -SELECT @@global.optimizer_prune_level; -SET @@global.optimizer_prune_level = 1; -SELECT @@global.optimizer_prune_level; -SET @@global.optimizer_prune_level = TRUE; -SELECT @@global.optimizer_prune_level; -SET @@global.optimizer_prune_level = FALSE; -SELECT @@global.optimizer_prune_level; - - - ---echo '#--------------------FN_DYNVARS_115_04-------------------------#' -############################################################################### -# Change the value of optimizer_prune_level to a valid value for SESSION Scope# -############################################################################### - -SELECT @@session.optimizer_prune_level; -SET @@session.optimizer_prune_level = 0; -SELECT @@session.optimizer_prune_level; -SET @@session.optimizer_prune_level = 1; -SELECT @@session.optimizer_prune_level; -SET @@session.optimizer_prune_level = TRUE; -SELECT @@session.optimizer_prune_level; -SET @@session.optimizer_prune_level = FALSE; -SELECT @@session.optimizer_prune_level; - - ---echo '#------------------FN_DYNVARS_115_05-----------------------#' -################################################################# -# Change the value of optimizer_prune_level to an invalid value # -################################################################# - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = ON; ---echo 'Bug# 34840: Since it is a boolean variable, it should not give errors on 'ON' & 'OFF' values'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = OFF; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = 'ONN'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = "OFFF"; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = TTRUE; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = FELSE; - -SET @@global.optimizer_prune_level = -1024; -SELECT @@global.optimizer_prune_level; - ---echo 'Bug# 34840: Since it is a boolean variable, it should give errors on numeric values'; - -SET @@global.optimizer_prune_level = 65536; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = 65530.34; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_prune_level = test; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = ON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = OFF; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = ONN; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = ONF; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = ON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = OF; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = 'OFN'; -SET @@session.optimizer_prune_level = -2; -SELECT @@session.optimizer_prune_level; ---Error ER_PARSE_ERROR -SET @@session.optimizer_prune_level = 65530.34.; - -SET @@session.optimizer_prune_level = 65550; -SELECT @@session.optimizer_prune_level; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_prune_level = test; - ---echo '#------------------FN_DYNVARS_115_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.optimizer_prune_level = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='optimizer_prune_level'; - ---echo '#------------------FN_DYNVARS_115_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.optimizer_prune_level = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='optimizer_prune_level'; - - - ---echo '#---------------------FN_DYNVARS_115_08----------------------#' -############################################################################### -# Check if global and session variable are independent of each other # -############################################################################### - -SET @@optimizer_prune_level = 0; -SET @@global.optimizer_prune_level = 1; -SELECT @@optimizer_prune_level = @@global.optimizer_prune_level; - - ---echo '#---------------------FN_DYNVARS_115_09----------------------#' -############################################################################### -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################### - -SET @@optimizer_prune_level = 1; -SELECT @@optimizer_prune_level = @@local.optimizer_prune_level; -SELECT @@local.optimizer_prune_level = @@session.optimizer_prune_level; - - ---echo '#---------------------FN_DYNVARS_115_10----------------------#' -############################################################################### -# Check if optimizer_prune_level can be accessed with and without @@ sign # -############################################################################### - -SET optimizer_prune_level = 1; -SELECT @@optimizer_prune_level; ---Error ER_UNKNOWN_TABLE -SELECT local.optimizer_prune_level; ---Error ER_UNKNOWN_TABLE -SELECT session.optimizer_prune_level; ---Error ER_BAD_FIELD_ERROR -SELECT optimizer_prune_level = @@session.optimizer_prune_level; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.optimizer_prune_level = @start_global_value; -SELECT @@global.optimizer_prune_level; -SET @@session.optimizer_prune_level = @start_session_value; -SELECT @@session.optimizer_prune_level; - -########################################################## -# END OF optimizer_prune_level TESTS # -########################################################## - diff --git a/mysql-test/t/optimizer_search_depth_basic.test b/mysql-test/t/optimizer_search_depth_basic.test deleted file mode 100644 index 42548c59d40..00000000000 --- a/mysql-test/t/optimizer_search_depth_basic.test +++ /dev/null @@ -1,210 +0,0 @@ -############## mysql-test\t\optimizer_search_depth_basic.test ############### -# # -# Variable Name: optimizer_search_depth # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 62 # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable optimizer_search_depth # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -###################################################################### -# START OF optimizer_search_depth TESTS # -###################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.optimizer_search_depth; -SELECT @start_global_value; -SET @start_session_value = @@session.optimizer_search_depth; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_116_01-------------------------#' -###################################################################### -# Display the DEFAULT value of optimizer_search_depth # -###################################################################### - -SET @@global.optimizer_search_depth = 100; -SET @@global.optimizer_search_depth = DEFAULT; -SELECT @@global.optimizer_search_depth; - -SET @@session.optimizer_search_depth = 200; -SET @@session.optimizer_search_depth = DEFAULT; -SELECT @@session.optimizer_search_depth; - - ---echo '#--------------------FN_DYNVARS_116_02-------------------------#' -###################################################################### -# Check the DEFAULT value of optimizer_search_depth # -###################################################################### - -SET @@global.optimizer_search_depth = DEFAULT; -SELECT @@global.optimizer_search_depth = 62; - -SET @@session.optimizer_search_depth = DEFAULT; -SELECT @@session.optimizer_search_depth = 62; - - ---echo '#--------------------FN_DYNVARS_116_03-------------------------#' -################################################################################ -# Change the value of optimizer_search_depth to a valid value for GLOBAL Scope # -################################################################################ - -SET @@global.optimizer_search_depth = 0; -SELECT @@global.optimizer_search_depth; -SET @@global.optimizer_search_depth = 1; -SELECT @@global.optimizer_search_depth; -SET @@global.optimizer_search_depth = 62; -SELECT @@global.optimizer_search_depth; -SET @@global.optimizer_search_depth = 63; -SELECT @@global.optimizer_search_depth; - - ---echo '#--------------------FN_DYNVARS_116_04-------------------------#' -################################################################################# -# Change the value of optimizer_search_depth to a valid value for SESSION Scope # -################################################################################# - -SET @@session.optimizer_search_depth = 0; -SELECT @@session.optimizer_search_depth; -SET @@session.optimizer_search_depth = 1; -SELECT @@session.optimizer_search_depth; -SET @@session.optimizer_search_depth = 62; -SELECT @@session.optimizer_search_depth; -SET @@session.optimizer_search_depth = 63; -SELECT @@session.optimizer_search_depth; - - ---echo '#------------------FN_DYNVARS_116_05-----------------------#' -################################################################## -# Change the value of optimizer_search_depth to an invalid value # -################################################################## - -SET @@global.optimizer_search_depth = 64; -SELECT @@global.optimizer_search_depth; -SET @@global.optimizer_search_depth = -1; -SELECT @@global.optimizer_search_depth; -SET @@global.optimizer_search_depth = 65536; -SELECT @@global.optimizer_search_depth; ---Error ER_PARSE_ERROR -SET @@global.optimizer_search_depth = 65530.34.; -SELECT @@global.optimizer_search_depth; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.optimizer_search_depth = test; -SELECT @@global.optimizer_search_depth; - -SET @@session.optimizer_search_depth = 64; -SELECT @@session.optimizer_search_depth; -SET @@session.optimizer_search_depth = -2; -SELECT @@session.optimizer_search_depth; ---Error ER_PARSE_ERROR -SET @@session.optimizer_search_depth = 65530.34.; -SET @@session.optimizer_search_depth = 65550; -SELECT @@session.optimizer_search_depth; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.optimizer_search_depth = test; -SELECT @@session.optimizer_search_depth; - - ---echo '#------------------FN_DYNVARS_116_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SELECT @@global.optimizer_search_depth = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='optimizer_search_depth'; - - ---echo '#------------------FN_DYNVARS_116_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.optimizer_search_depth = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='optimizer_search_depth'; - - ---echo '#------------------FN_DYNVARS_116_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.optimizer_search_depth = TRUE; -SELECT @@global.optimizer_search_depth; -SET @@global.optimizer_search_depth = FALSE; -SELECT @@global.optimizer_search_depth; - - ---echo '#---------------------FN_DYNVARS_116_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.optimizer_search_depth = 10; -SELECT @@optimizer_search_depth = @@global.optimizer_search_depth; - - ---echo '#---------------------FN_DYNVARS_116_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@optimizer_search_depth = 10; -SELECT @@optimizer_search_depth = @@local.optimizer_search_depth; -SELECT @@local.optimizer_search_depth = @@session.optimizer_search_depth; - - ---echo '#---------------------FN_DYNVARS_116_11----------------------#' -################################################################################# -# Check if optimizer_search_depth can be accessed with and without @@ sign # -################################################################################# - -SET optimizer_search_depth = 1; -SELECT @@optimizer_search_depth; ---Error ER_UNKNOWN_TABLE -SELECT local.optimizer_search_depth; ---Error ER_UNKNOWN_TABLE -SELECT session.optimizer_search_depth; ---Error ER_BAD_FIELD_ERROR -SELECT optimizer_search_depth = @@session.optimizer_search_depth; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.optimizer_search_depth = @start_global_value; -SELECT @@global.optimizer_search_depth; -SET @@session.optimizer_search_depth = @start_session_value; -SELECT @@session.optimizer_search_depth; - - -########################################################### -# END OF optimizer_search_depth TESTS # -########################################################### - diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index 527a4d398d8..45b13f141f7 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -1,10 +1,14 @@ disable_query_log; -- source include/test_outfile.inc -# Server are started in "var/master-data", so "../tmp" will be "var/tmp" -eval set @tmpdir="../tmp"; +# Server are started in "var/master-data", so "../../tmp" will be "var/tmp" +eval set @tmpdir="../../tmp"; enable_query_log; -- source include/have_outfile.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + + # # test of into outfile|dumpfile # @@ -16,15 +20,15 @@ drop table if exists t1; create table t1 (`a` blob); insert into t1 values("hello world"),("Hello mars"),(NULL); disable_query_log; -eval select * into outfile "../tmp/outfile-test.1" from t1; +eval select * into outfile "../../tmp/outfile-test.1" from t1; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.1")); disable_query_log; -eval select * into dumpfile "../tmp/outfile-test.2" from t1 limit 1; +eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.2")); disable_query_log; -eval select * into dumpfile "../tmp/outfile-test.3" from t1 where a is null; +eval select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.3")); @@ -32,13 +36,13 @@ select load_file(concat(@tmpdir,"/outfile-test.3")); disable_query_log; --error ER_FILE_EXISTS_ERROR -eval select * into outfile "../tmp/outfile-test.1" from t1; +eval select * into outfile "../../tmp/outfile-test.1" from t1; --error ER_FILE_EXISTS_ERROR -eval select * into dumpfile "../tmp/outfile-test.2" from t1; +eval select * into dumpfile "../../tmp/outfile-test.2" from t1; --error ER_FILE_EXISTS_ERROR -eval select * into dumpfile "../tmp/outfile-test.3" from t1; +eval select * into dumpfile "../../tmp/outfile-test.3" from t1; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.not-exist")); --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1 @@ -46,19 +50,19 @@ select load_file(concat(@tmpdir,"/outfile-test.not-exist")); --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3 drop table t1; -# Bug#8191 +# Bug#8191 SELECT INTO OUTFILE insists on FROM clause disable_query_log; -eval select 1 into outfile "../tmp/outfile-test.4"; +eval select 1 into outfile "../../tmp/outfile-test.4"; enable_query_log; select load_file(concat(@tmpdir,"/outfile-test.4")); --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4 # -# Bug #5382: 'explain select into outfile' crashes the server +# Bug#5382 'explain select into outfile' crashes the server # CREATE TABLE t1 (a INT); -EXPLAIN +EXPLAIN SELECT * INTO OUTFILE '/tmp/t1.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' @@ -68,10 +72,10 @@ DROP TABLE t1; # End of 4.1 tests # -# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails +# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails # disable_query_log; -eval SELECT * INTO OUTFILE "../tmp/outfile-test.4" +eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FROM information_schema.schemata LIMIT 0, 5; # enable_query_log; @@ -79,7 +83,7 @@ FROM information_schema.schemata LIMIT 0, 5; use information_schema; # disable_query_log; -eval SELECT * INTO OUTFILE "../tmp/outfile-test.4" +eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' FROM schemata LIMIT 0, 5; enable_query_log; @@ -107,27 +111,31 @@ connect (con28181_1,localhost,user_1,,mysqltest); --error ER_DBACCESS_DENIED_ERROR eval select schema_name -into outfile "../tmp/outfile-test.4" +into outfile "../../tmp/outfile-test.4" fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from information_schema.schemata where schema_name like 'mysqltest'; connection default; +disconnect con28181_1; grant file on *.* to user_1@localhost; connect (con28181_2,localhost,user_1,,mysqltest); eval select schema_name -into outfile "../tmp/outfile-test.4" +into outfile "../../tmp/outfile-test.4" fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from information_schema.schemata where schema_name like 'mysqltest'; connection default; +disconnect con28181_2; --remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4 use test; revoke all privileges on *.* from user_1@localhost; drop user user_1@localhost; drop database mysqltest; +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 6a12e4a4d12..23a300de9e5 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -10,6 +10,8 @@ # --source include/have_partition.inc +SET @old_general_log= @@global.general_log; + --disable_warnings drop table if exists t1, t2; --enable_warnings @@ -1913,3 +1915,6 @@ select count(*) from t1; drop table t1; --echo End of 5.1 tests + + +SET @@global.general_log= @old_general_log; diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index d470fb67b49..41b904b876f 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -121,7 +121,8 @@ partitions 3 partition x2 tablespace ts2, partition x3 tablespace ts3); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +let $MYSQLD_DATADIR= `select @@datadir`; +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by hash, invalid field in function # @@ -217,7 +218,7 @@ partition by hash (a) partitions 2 (partition x1 values less than (4), partition x2 values less than (5)); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by hash, values in error @@ -232,7 +233,7 @@ partition by hash (a) partitions 2 (partition x1 values in (4), partition x2 values in (5)); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by hash, values in error @@ -247,7 +248,7 @@ partition by hash (a) partitions 2 (partition x1 values in (4,6), partition x2 values in (5,7)); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by key, no partitions defined, single field @@ -260,7 +261,7 @@ c int not null, primary key (a,b)) partition by key (a) subpartition by key (b); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by key, no partitions defined, list of fields @@ -273,7 +274,7 @@ c int not null, primary key (a,b)) partition by key (a) subpartition by key (a, b); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined @@ -286,7 +287,7 @@ c int not null, primary key (a,b)) partition by key (a) subpartition by hash (a+b); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by key, no partitions defined, single field @@ -299,7 +300,7 @@ c int not null, primary key (a,b)) partition by key (a) subpartition by key (b); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by key, no partitions defined, list of fields @@ -312,7 +313,7 @@ c int not null, primary key (a,b)) partition by key (a) subpartition by key (a, b); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined @@ -325,7 +326,7 @@ c int not null, primary key (a,b)) partition by key (a) subpartition by hash (a+b); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined, wrong subpartition function @@ -352,7 +353,7 @@ partition by key (a) subpartition by hash (sin(a+b)) (partition x1 (subpartition x11, subpartition x12), partition x2 (subpartition x21, subpartition x22)); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined, wrong subpartition function @@ -381,7 +382,7 @@ partition by range (a) subpartition by key (a,d) (partition x1 values less than (1) (subpartition x11, subpartition x12), partition x2 values less than (2) (subpartition x21, subpartition x22)); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Subpartition by hash, no partitions defined, wrong subpartition function @@ -419,7 +420,7 @@ b int not null, c int not null, primary key(a,b)) partition by range (a); -select load_file('$MYSQLTEST_VARDIR/master-data/test/t1.par'); +select load_file('$MYSQLD_DATADIR/test/t1.par'); # # Partition by range, invalid field in function diff --git a/mysql-test/t/partition_federated.test b/mysql-test/t/partition_federated.test index c8483291228..0fe692ecd01 100644 --- a/mysql-test/t/partition_federated.test +++ b/mysql-test/t/partition_federated.test @@ -3,7 +3,7 @@ # -- source include/have_partition.inc -- source include/not_embedded.inc --- source include/have_federated_db.inc +-- source suite/federated/have_federated_db.inc --disable_warnings drop table if exists t1; diff --git a/mysql-test/t/tx_isolation_func-master.opt b/mysql-test/t/partition_innodb_semi_consistent-master.opt index c15943a7544..e76299453d3 100644 --- a/mysql-test/t/tx_isolation_func-master.opt +++ b/mysql-test/t/partition_innodb_semi_consistent-master.opt @@ -1,3 +1 @@ ---innodb --innodb_lock_wait_timeout=2 ---binlog-format=row
\ No newline at end of file diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test new file mode 100644 index 00000000000..6a6a7cf958e --- /dev/null +++ b/mysql-test/t/partition_innodb_semi_consistent.test @@ -0,0 +1,197 @@ +-- source include/have_partition.inc +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# basic tests of semi-consistent reads +# for verifying Bug#40595: Non-matching rows not released with READ-COMMITTED +# on tables with partitions + +connect (a,localhost,root,,); +connect (b,localhost,root,,); +connection a; +set binlog_format=mixed; +set session transaction isolation level repeatable read; +create table t1(a int not null) +engine=innodb +DEFAULT CHARSET=latin1 +PARTITION BY RANGE(a) +(PARTITION p0 VALUES LESS THAN (20), + PARTITION p1 VALUES LESS THAN MAXVALUE); +insert into t1 values (1),(2),(3),(4),(5),(6),(7); +set autocommit=0; +# this should lock the entire table +select * from t1 where a=3 lock in share mode; +connection b; +set binlog_format=mixed; +set session transaction isolation level repeatable read; +set autocommit=0; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=10 where a=5; +connection a; +#DELETE FROM t1 WHERE a=5; +commit; +connection b; +# perform a semi-consisent read (and unlock non-matching rows) +set session transaction isolation level read committed; +update t1 set a=10 where a=5; +connection a; +-- error ER_LOCK_WAIT_TIMEOUT +select * from t1 where a=2 for update; +# this should lock the records (1),(2) +select * from t1 where a=2 limit 1 for update; +connection b; +# semi-consistent read will skip non-matching locked rows a=1, a=2 +update t1 set a=11 where a=6; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=12 where a=2; +-- error ER_LOCK_WAIT_TIMEOUT +update t1 set a=13 where a=1; +connection a; +commit; +connection b; +update t1 set a=14 where a=1; +commit; +connection a; +--sorted_result +select * from t1; +drop table t1; + +connection default; +disconnect a; +disconnect b; + +# +# Bug #31310: Locked rows silently skipped in read-committed isolation level. +# (This also tests the '*_semi_consistent*' functions in partitioning) +# Copied from include/mix1.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +SET SESSION AUTOCOMMIT = 0; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +set binlog_format=mixed; +--echo # Switch to connection con1 +connection con1; + +eval +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256)) +ENGINE = InnoDB +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (300), + PARTITION p1 VALUES LESS THAN MAXVALUE); +INSERT INTO t1 VALUES (1,2); + +--echo # 1. test for locking: + +BEGIN; +--enable_info +UPDATE t1 SET b = 12 WHERE a = 1; +--disable_info +SELECT * FROM t1; + +--echo # Switch to connection con2 +connection con2; + +--enable_info +--disable_abort_on_error +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET b = 21 WHERE a = 1; +--disable_info + +--echo # Switch to connection con1 +connection con1; +SELECT * FROM t1; +ROLLBACK; + +--echo # 2. test for serialized update: + +CREATE TABLE t2 (a INT); + +TRUNCATE t1; +INSERT INTO t1 VALUES (1,'init'); + +DELIMITER |; +CREATE PROCEDURE p1() +BEGIN + UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; + INSERT INTO t2 VALUES (); +END| +DELIMITER ;| + +BEGIN; +--enable_info +UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1; +--disable_info +SELECT * FROM t1; + +--echo # Switch to connection con2 +connection con2; + +--send CALL p1; + +--echo # Switch to connection con1 +connection con1; +SELECT * FROM t1; +COMMIT; + +let $bug31310 = 1; +while ($bug31310) +{ + let $bug31310= `SELECT 1 - COUNT(*) FROM t2`; +} + +SELECT * FROM t1; + +--echo # Switch to connection con2 +connection con2; +--reap +SELECT * FROM t1; + +--echo # Switch to connection con1 +connection con1; + +--echo # 3. test for updated key column: + +TRUNCATE t1; +TRUNCATE t2; + +INSERT INTO t1 VALUES (1,'init'); + +BEGIN; +--enable_info +UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1; +--disable_info +SELECT * FROM t1; + +--echo # Switch to connection con2 +connection con2; + +--send CALL p1; + +--echo # Switch to connection con1 +connection con1; +SELECT * FROM t1; +COMMIT; + +let $bug31310 = 1; +while ($bug31310) +{ + let $bug31310= `SELECT 1 - COUNT(*) FROM t2`; +} + +SELECT * FROM t1; + +--echo # Switch to connection con2 +connection con2; +SELECT * FROM t1; + +connection default; +disconnect con1; +disconnect con2; +DROP PROCEDURE p1; +DROP TABLE t1, t2; + diff --git a/mysql-test/t/partition_innodb_stmt.test b/mysql-test/t/partition_innodb_stmt.test index 2ed5baee0ac..d6181ce068e 100644 --- a/mysql-test/t/partition_innodb_stmt.test +++ b/mysql-test/t/partition_innodb_stmt.test @@ -1,3 +1,4 @@ +--source include/have_partition.inc --source include/have_binlog_format_statement.inc --source include/have_innodb.inc diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test index 524a2e04b25..e17edf0a4e5 100644 --- a/mysql-test/t/partition_mgm.test +++ b/mysql-test/t/partition_mgm.test @@ -4,6 +4,17 @@ DROP TABLE IF EXISTS t1; --enable_warnings # +# Bug 40389: REORGANIZE PARTITION crashes when only using one partition +# +CREATE TABLE t1 (a INT PRIMARY KEY) +ENGINE MYISAM +PARTITION BY HASH (a) +PARTITIONS 1; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +ALTER TABLE t1 REORGANIZE PARTITION; +DROP TABLE t1; + +# # Bug 21143: mysqld hang when error in number of subparts in # REORGANIZE command # @@ -22,18 +33,19 @@ drop table t1; CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2; SHOW CREATE TABLE t1; --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par +let $MYSQLD_DATADIR= `select @@datadir`; +-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD +-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI +-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYD +-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYI +-- file_exists $MYSQLD_DATADIR/test/t1.frm +-- file_exists $MYSQLD_DATADIR/test/t1.par ALTER TABLE t1 COALESCE PARTITION 1; SHOW CREATE TABLE t1; --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm --- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par +-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD +-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI +-- file_exists $MYSQLD_DATADIR/test/t1.frm +-- file_exists $MYSQLD_DATADIR/test/t1.par drop table t1; # # Bug 20767: REORGANIZE partition crashes diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test index d7108d5af98..333e12e2b16 100644 --- a/mysql-test/t/partition_not_windows.test +++ b/mysql-test/t/partition_not_windows.test @@ -11,8 +11,8 @@ # Bug 20770 Partitions: DATA DIRECTORY clause change in reorganize # doesn't remove old directory +let $MYSQLD_DATADIR= `select @@datadir`; let $data_directory = DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp'; - let $inx_directory = INDEX DIRECTORY = '$MYSQLTEST_VARDIR/tmp'; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR @@ -23,12 +23,12 @@ subpartition by hash (a) (SUBPARTITION subpart00, SUBPARTITION subpart01)); --echo # Checking if file exists before alter ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart01.MYI +--file_exists $MYSQLD_DATADIR/test/t1.frm +--file_exists $MYSQLD_DATADIR/test/t1.par +--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart00.MYD +--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart00.MYI +--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart01.MYD +--file_exists $MYSQLD_DATADIR/test/t1#P#p0#SP#subpart01.MYI --file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart00.MYD --file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart01.MYD --file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p0#SP#subpart00.MYI @@ -42,16 +42,16 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO (SUBPARTITION subpart20, SUBPARTITION subpart21)); --echo # Checking if file exists after alter ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart11.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart11.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart20.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart20.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYD ---file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p2#SP#subpart21.MYI +--file_exists $MYSQLD_DATADIR/test/t1.frm +--file_exists $MYSQLD_DATADIR/test/t1.par +--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart10.MYD +--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart10.MYI +--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart11.MYD +--file_exists $MYSQLD_DATADIR/test/t1#P#p1#SP#subpart11.MYI +--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart20.MYD +--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart20.MYI +--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart21.MYD +--file_exists $MYSQLD_DATADIR/test/t1#P#p2#SP#subpart21.MYI --file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart10.MYD --file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p1#SP#subpart11.MYD --file_exists $MYSQLTEST_VARDIR/tmp/t1#P#p2#SP#subpart20.MYD @@ -93,39 +93,43 @@ set @@sql_mode=@org_mode; # # Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY # ---replace_result $MYSQLTEST_VARDIR TEST_DIR + +let $MYSQLD_DATADIR= `select @@datadir`; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) PARTITION BY KEY (a) -(PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); ---replace_result $MYSQLTEST_VARDIR TEST_DIR +(PARTITION p0 DATA DIRECTORY '$MYSQLD_DATADIR/test'); + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) PARTITION BY KEY (a) -(PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); +(PARTITION p0 INDEX DIRECTORY '$MYSQLD_DATADIR/test'); ---replace_result $MYSQLTEST_VARDIR TEST_DIR +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error ER_WRONG_ARGUMENTS eval CREATE TABLE ts (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) ( PARTITION p0 VALUES LESS THAN (1990) ( SUBPARTITION s0a - DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', + DATA DIRECTORY = '$MYSQLD_DATADIR/test', SUBPARTITION s0b - DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' + DATA DIRECTORY = '$MYSQLD_DATADIR/test' )); ---replace_result $MYSQLTEST_VARDIR TEST_DIR +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error ER_WRONG_ARGUMENTS eval CREATE TABLE ts (id INT, purchased DATE) PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) ( PARTITION p0 VALUES LESS THAN (1990) ( SUBPARTITION s0a - INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test', + INDEX DIRECTORY = '$MYSQLD_DATADIR/test', SUBPARTITION s0b - INDEX DIRECTORY = '$MYSQLTEST_VARDIR/master-data/test' + INDEX DIRECTORY = '$MYSQLD_DATADIR/test' )); # End Windows specific test failures. @@ -165,21 +169,24 @@ INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p2Index', PARTITION p3 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p3Data' INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p3Index' ); + +let $MYSQLD_DATADIR= `select @@datadir`; + --echo # Checking that MyISAM .MYD and .MYI are in test db and data/idx dir ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYD +--file_exists $MYSQLD_DATADIR/test/example#P#p0.MYI +--file_exists $MYSQLD_DATADIR/test/example#P#p0.MYD --file_exists $MYSQLTEST_VARDIR/p0Data/example#P#p0.MYD --file_exists $MYSQLTEST_VARDIR/p0Index/example#P#p0.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYD +--file_exists $MYSQLD_DATADIR/test/example#P#p1.MYI +--file_exists $MYSQLD_DATADIR/test/example#P#p1.MYD --file_exists $MYSQLTEST_VARDIR/p1Data/example#P#p1.MYD --file_exists $MYSQLTEST_VARDIR/p1Index/example#P#p1.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYD +--file_exists $MYSQLD_DATADIR/test/example#P#p2.MYI +--file_exists $MYSQLD_DATADIR/test/example#P#p2.MYD --file_exists $MYSQLTEST_VARDIR/p2Data/example#P#p2.MYD --file_exists $MYSQLTEST_VARDIR/p2Index/example#P#p2.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYI ---file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYD +--file_exists $MYSQLD_DATADIR/test/example#P#p3.MYI +--file_exists $MYSQLD_DATADIR/test/example#P#p3.MYD --file_exists $MYSQLTEST_VARDIR/p3Data/example#P#p3.MYD --file_exists $MYSQLTEST_VARDIR/p3Index/example#P#p3.MYI DROP TABLE example; diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index 31008d2b011..ad102062ef8 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -8,6 +8,22 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings +# +# Bug#40972: some sql execution lead the whole database crashing +# +# Setup so the start is at partition pX and end is at p1 +# Pruning does handle 'bad' dates differently. +CREATE TABLE t1 +(a INT NOT NULL AUTO_INCREMENT, + b DATETIME, + PRIMARY KEY (a,b), + KEY (b)) +PARTITION BY RANGE (to_days(b)) +(PARTITION p0 VALUES LESS THAN (733681) COMMENT = 'LESS THAN 2008-10-01', + PARTITION p1 VALUES LESS THAN (733712) COMMENT = 'LESS THAN 2008-11-01', + PARTITION pX VALUES LESS THAN MAXVALUE); +SELECT a,b FROM t1 WHERE b >= '2008-12-01' AND b < '2009-12-00'; +DROP TABLE t1; # Check if we can infer from condition on partition fields that # no records will match. diff --git a/mysql-test/t/preload_buffer_size_basic.test b/mysql-test/t/preload_buffer_size_basic.test deleted file mode 100644 index 48b1e32676a..00000000000 --- a/mysql-test/t/preload_buffer_size_basic.test +++ /dev/null @@ -1,217 +0,0 @@ -############## mysql-test\t\preload_buffer_size_basic.test ############### -# # -# Variable Name: preload_buffer_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 32768 # -# Range:1024-1073741824 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable preload_buffer_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -################################################################### -# START OF preload_buffer_size TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.preload_buffer_size; -SELECT @start_global_value; -SET @start_session_value = @@session.preload_buffer_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_129_01-------------------------#' -################################################################### -# Display the DEFAULT value of preload_buffer_size # -################################################################### - -SET @@global.preload_buffer_size = 10000; -SET @@global.preload_buffer_size = DEFAULT; -SELECT @@global.preload_buffer_size; - -SET @@session.preload_buffer_size = 20000; -SET @@session.preload_buffer_size = DEFAULT; -SELECT @@session.preload_buffer_size; - - ---echo '#--------------------FN_DYNVARS_129_02-------------------------#' -################################################################### -# Check the DEFAULT value of preload_buffer_size # -################################################################### - -SET @@global.preload_buffer_size = DEFAULT; -SELECT @@global.preload_buffer_size = 32768; - -SET @@session.preload_buffer_size = DEFAULT; -SELECT @@session.preload_buffer_size = 32768; - - ---echo '#--------------------FN_DYNVARS_129_03-------------------------#' -############################################################################# -# Change the value of preload_buffer_size to a valid value for GLOBAL Scope # -############################################################################# - -SET @@global.preload_buffer_size = 1024; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = 1025; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = 1073741824; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = 1073741823; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = 65536; -SELECT @@global.preload_buffer_size; - ---echo '#--------------------FN_DYNVARS_129_04-------------------------#' -############################################################################## -# Change the value of preload_buffer_size to a valid value for SESSION Scope # -############################################################################## - -SET @@session.preload_buffer_size = 1024; -SELECT @@session.preload_buffer_size; -SET @@session.preload_buffer_size = 1025; -SELECT @@session.preload_buffer_size; -SET @@session.preload_buffer_size = 1073741824; -SELECT @@session.preload_buffer_size; -SET @@session.preload_buffer_size = 1073741823; -SELECT @@session.preload_buffer_size; -SET @@session.preload_buffer_size = 655536; -SELECT @@session.preload_buffer_size; - ---echo '#------------------FN_DYNVARS_129_05-----------------------#' -############################################################### -# Change the value of preload_buffer_size to an invalid value # -############################################################### - -SET @@global.preload_buffer_size = 64; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = -1; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = 1023; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = 1073741825; -SELECT @@global.preload_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.preload_buffer_size = 65530.34.; -SELECT @@global.preload_buffer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.preload_buffer_size = test; -SELECT @@global.preload_buffer_size; - -SET @@session.preload_buffer_size = 64; -SELECT @@session.preload_buffer_size; -SET @@session.preload_buffer_size = -2; -SELECT @@session.preload_buffer_size; ---Error ER_PARSE_ERROR -SET @@session.preload_buffer_size = 65530.34.; -SET @@session.preload_buffer_size = 1023; -SELECT @@session.preload_buffer_size; -SET @@session.preload_buffer_size = 1073741825; -SELECT @@session.preload_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.preload_buffer_size = test; -SELECT @@session.preload_buffer_size; - - ---echo '#------------------FN_DYNVARS_129_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SELECT @@global.preload_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='preload_buffer_size'; - - ---echo '#------------------FN_DYNVARS_129_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.preload_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='preload_buffer_size'; - - ---echo '#------------------FN_DYNVARS_129_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.preload_buffer_size = TRUE; -SELECT @@global.preload_buffer_size; -SET @@global.preload_buffer_size = FALSE; -SELECT @@global.preload_buffer_size; - - ---echo '#---------------------FN_DYNVARS_129_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.preload_buffer_size = 2048; -SELECT @@preload_buffer_size = @@global.preload_buffer_size; - - ---echo '#---------------------FN_DYNVARS_129_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@preload_buffer_size = 5000; -SELECT @@preload_buffer_size = @@local.preload_buffer_size; -SELECT @@local.preload_buffer_size = @@session.preload_buffer_size; - - ---echo '#---------------------FN_DYNVARS_129_11----------------------#' -############################################################################## -# Check if preload_buffer_size can be accessed with and without @@ sign # -############################################################################## - -SET preload_buffer_size = 1024; -SELECT @@preload_buffer_size; ---Error ER_UNKNOWN_TABLE -SELECT local.preload_buffer_size; ---Error ER_UNKNOWN_TABLE -SELECT session.preload_buffer_size; ---Error ER_BAD_FIELD_ERROR -SELECT preload_buffer_size = @@session.preload_buffer_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.preload_buffer_size = @start_global_value; -SELECT @@global.preload_buffer_size; -SET @@session.preload_buffer_size = @start_session_value; -SELECT @@session.preload_buffer_size; - - -######################################################## -# END OF preload_buffer_size TESTS # -######################################################## - diff --git a/mysql-test/t/profiling.test b/mysql-test/t/profiling.test index 5cb3f66aa2b..275c2d77c4a 100644 --- a/mysql-test/t/profiling.test +++ b/mysql-test/t/profiling.test @@ -14,6 +14,7 @@ select @@profiling; set global profiling = ON; # But size is okay +set @start_value= @@global.profiling_history_size; set global profiling_history_size=100; show global variables like 'profil%'; @@ -261,6 +262,6 @@ drop function if exists f1; ## last thing in the file set session profiling = OFF; - +set global profiling_history_size= @start_value; ## --echo End of 5.0 tests diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 3e1a41d32c8..91cb6eef8ad 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1665,7 +1665,7 @@ DROP PROCEDURE IF EXISTS p1; let $iterations= 100; --disable_query_log --disable_result_log -while ($iterations > 0) +while ($iterations) { --error ER_PARSE_ERROR PREPARE stmt FROM "CREATE PROCEDURE p1()"; diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 95cbd908933..3ad3f394840 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -576,7 +576,7 @@ prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; # rename must fail, t7 does not exist # Clean up the filename here because embedded server reports whole path ---replace_result $MYSQLTEST_VARDIR . master-data/ '' t7.frm t7 +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' t7.frm t7 --error 1017 execute stmt1 ; create table t7 (a int) ; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 88287e53b34..7841e7274dd 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -300,7 +300,7 @@ select * from t1; select * from t1; show status like "Qcache_queries_in_cache"; insert delayed into t1 values (4); ---sleep 5 # Wait for insert delayed to be executed. +--sleep 5 # Wait for insert delayed to be executed. select a from t1; show status like "Qcache_queries_in_cache"; drop table t1; @@ -410,10 +410,10 @@ create table t1(id int auto_increment primary key); insert into t1 values (NULL), (NULL), (NULL); select * from t1 where id=2; alter table t1 rename to t2; --- error 1146 +--error ER_NO_SUCH_TABLE select * from t1 where id=2; drop table t2; --- error 1146 +--error ER_NO_SUCH_TABLE select * from t1 where id=2; # @@ -423,7 +423,7 @@ create table t1 (word char(20) not null); select * from t1; show status like "Qcache_queries_in_cache"; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval load data infile '$MYSQLTEST_VARDIR/std_data_ln/words.dat' into table t1; +eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1; show status like "Qcache_queries_in_cache"; select count(*) from t1; drop table t1; @@ -435,11 +435,14 @@ create table t1 (a int); insert into t1 values (1),(2),(3); show status like "Qcache_queries_in_cache"; select * from t1 into outfile "query_cache.out.file"; ---error 1086 +--error ER_FILE_EXISTS_ERROR select * from t1 into outfile "query_cache.out.file"; select * from t1 limit 1 into dumpfile "query_cache.dump.file"; show status like "Qcache_queries_in_cache"; drop table t1; +let $datadir=`select @@datadir`; +--remove_file $datadir/test/query_cache.dump.file +--remove_file $datadir/test/query_cache.out.file # # test of SQL_SELECT_LIMIT @@ -537,7 +540,7 @@ drop table t1; # If at least one of the above variables has changed, # the cached query can't be reused. In the below test # absolutely the same query is used several times, -# SELECT should fetch different results for every instance. +# SELECT should fetch different results for every instance. # No hits should be produced. # New cache entry should appear for every SELECT. # @@ -554,21 +557,21 @@ show status like "Qcache_queries_in_cache"; # Change collation_connection and run the same query again # set collation_connection=koi8r_bin; -SELECT a,'Â','â'='Â' FROM t1; +SELECT a,'Â','â'='Â' FROM t1; show status like "Qcache_hits"; show status like "Qcache_queries_in_cache"; # # Now change character_set_client and run the same query again # set character_set_client=cp1251; -SELECT a,'Â','â'='Â' FROM t1; +SELECT a,'Â','â'='Â' FROM t1; show status like "Qcache_hits"; show status like "Qcache_queries_in_cache"; # # And finally change character_set_results and run the same query again # set character_set_results=cp1251; -SELECT a,'Â','â'='Â' FROM t1; +SELECT a,'Â','â'='Â' FROM t1; show status like "Qcache_hits"; show status like "Qcache_queries_in_cache"; SET NAMES default; @@ -602,12 +605,12 @@ insert into t1 set c = repeat('x',24); insert into t1 set c = concat(repeat('x',24),'x'); insert into t1 set c = concat(repeat('x',24),'w'); insert into t1 set c = concat(repeat('x',24),'y'); -set max_sort_length=200; +set max_sort_length=200; select c from t1 order by c, id; reset query cache; set max_sort_length=20; select c from t1 order by c, id; -set max_sort_length=200; +set max_sort_length=200; select c from t1 order by c, id; set max_sort_length=default; # sql_mode @@ -801,9 +804,10 @@ create procedure `p1`() begin select a, f1() from t1; end// +SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; call p1()// -SET GLOBAL log_bin_trust_function_creators = 0; +SET GLOBAL log_bin_trust_function_creators = @old_log_bin_trust_function_creators; drop procedure p1// drop function f1// @@ -1016,7 +1020,7 @@ set GLOBAL query_cache_size= default; # -# Bug #28897 UUID() returns non-unique values when query cache is enabled +# Bug#28897 UUID() returns non-unique values when query cache is enabled # set GLOBAL query_cache_size=1000000; @@ -1025,7 +1029,7 @@ create table t1 (a char); insert into t1 values ('c'); let $q1= `select UUID(), a from t1`; -let $q2= `select UUID(), a from t1`; +let $q2= `select UUID(), a from t1`; # disabling the logging of the query because the UUIDs are different each run. --disable_query_log @@ -1046,7 +1050,7 @@ create table t1 (a char); insert into t1 values ('c'); let $q1= `select RAND() from t1 union select sql_cache 1 from t1;`; -let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`; +let $q2= `select RAND() from t1 union select sql_cache 1 from t1;`; # disabling the logging of the query because the times are different each run. --disable_query_log @@ -1182,75 +1186,6 @@ DROP TABLE t1; SET GLOBAL query_cache_size= default; # -# Bug #28249 Query Cache returns wrong result with concurrent insert / certain lock -# ---echo Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock -connect (user1,localhost,root,,test,,); -connect (user2,localhost,root,,test,,); -connect (user3,localhost,root,,test,,); - -connection user1; - -set GLOBAL query_cache_type=1; -set GLOBAL query_cache_limit=10000; -set GLOBAL query_cache_min_res_unit=0; -set GLOBAL query_cache_size= 100000; - -flush tables; ---disable_warnings -drop table if exists t1, t2; ---enable_warnings -create table t1 (a int); -create table t2 (a int); -insert into t1 values (1),(2),(3); -connection user2; ---echo Locking table T2 with a write lock. -lock table t2 write; - -connection user1; ---echo Select blocked by write lock. ---send select *, (select count(*) from t2) from t1; ---echo Sleeing is ok, because selecting should be done very fast. -sleep 5; - -connection user3; ---echo Inserting into table T1. -insert into t1 values (4); - -connection user2; ---echo Unlocking the tables. -unlock tables; - -connection user1; ---echo Collecting result from previously blocked select. -# -# Since the lock ordering rule in thr_multi_lock depends on -# pointer values, from execution to execution we might have -# different lock order, and therefore, sometimes lock t1 and block -# on t2, and sometimes block on t2 right away. In the second case, -# the following insert succeeds, and only then this select can -# proceed, and we actually test nothing, as the very first select -# returns 4 rows right away. -# It's fine to have a test case that covers the problematic area -# at least once in a while. -# We, however, need to disable the result log here to make the -# test repeatable. ---disable_result_log ---reap ---enable_result_log ---echo Next select should contain 4 rows, as the insert is long finished. -select *, (select count(*) from t2) from t1; -reset query cache; -select *, (select count(*) from t2) from t1; - -drop table t1,t2; - -connection default; -disconnect user1; -disconnect user2; -disconnect user3; - -# --echo # --echo # Bug#25132 disabled query cache: Qcache_free_blocks = 1 --echo # @@ -1260,7 +1195,7 @@ set global query_cache_type=0; show status like 'Qcache_free_blocks'; --echo Restore default values. -# Bug #28211 RENAME DATABASE and query cache don't play nicely together +# Bug#28211 RENAME DATABASE and query cache don't play nicely together # # TODO: enable these tests when RENAME DATABASE is implemented. # --disable_warnings @@ -1278,7 +1213,7 @@ show status like 'Qcache_free_blocks'; # show status like 'Qcache_queries_in_cache'; # drop database db2; # set global query_cache_size=default; -# +# # --disable_warnings # drop database if exists db1; # drop database if exists db3; @@ -1326,6 +1261,33 @@ DROP TABLE t1; SET GLOBAL concurrent_insert= @save_concurrent_insert; SET GLOBAL query_cache_size= default; +# +# Bug#36326: nested transaction and select +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +FLUSH STATUS; +SET GLOBAL query_cache_size=1048576; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +SELECT * FROM t1; +BEGIN; +SELECT * FROM t1; +COMMIT; +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +SHOW STATUS LIKE "Qcache_hits"; +SELECT * FROM t1; +BEGIN; +SELECT * FROM t1; +COMMIT; +SHOW STATUS LIKE "Qcache_hits"; +DROP TABLE t1; +SET GLOBAL query_cache_size= default; + --echo End of 5.0 tests # diff --git a/mysql-test/t/query_cache_28249.test b/mysql-test/t/query_cache_28249.test new file mode 100644 index 00000000000..3cf6c89369e --- /dev/null +++ b/mysql-test/t/query_cache_28249.test @@ -0,0 +1,123 @@ +### t/query_cache_28249.test ### +# +# Test for +# Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock +# +# Last modification: +# 2008-11-27 mleich - Move this test out of query_cache.test +# - Fix Bug#40179 Test main.query_cache failing randomly on Pushbuild, +# test weakness +# - Minor improvements (comments,formatting etc.) +# + +--source include/have_query_cache.inc + +SET @query_cache_type= @@global.query_cache_type; +SET @query_cache_limit= @@global.query_cache_limit; +SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit; +SET @query_cache_size= @@global.query_cache_size; + +--echo # Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock +--echo # Establish connections user1,user2,user3 (user=root) +connect (user1,localhost,root,,test,,); +connect (user2,localhost,root,,test,,); +connect (user3,localhost,root,,test,,); + +--echo # Switch to connection user1 +connection user1; + +SET GLOBAL query_cache_type=1; +SET GLOBAL query_cache_limit=10000; +SET GLOBAL query_cache_min_res_unit=0; +SET GLOBAL query_cache_size= 100000; + +FLUSH TABLES; +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); + +--echo # Switch to connection user2 +connection user2; +LOCK TABLE t2 WRITE; + +--echo # Switch to connection user1 +connection user1; +--echo # "send" the next select, "reap" the result later. +--echo # The select will be blocked by the write lock on the t1. +let $select_for_qc = +SELECT *, (SELECT COUNT(*) FROM t2) FROM t1; +send; +eval $select_for_qc; + +--echo # Switch to connection user3 +connection user3; +# Typical information_schema.processlist content after sufficient sleep time +# ID USER COMMAND TIME STATE INFO +# .... +# 2 root Query 5 Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1 +# .... +# XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +# The values marked with 'X' must be reached. +--echo # Poll till the select of connection user1 is blocked by the write lock on t1. +let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist +WHERE state = 'Locked' + AND info = '$select_for_qc'; +--source include/wait_condition.inc +eval +SELECT user,command,state,info FROM information_schema.processlist +WHERE state = 'Locked' + AND info = '$select_for_qc'; +INSERT INTO t1 VALUES (4); + +--echo # Switch to connection user2 +connection user2; +UNLOCK TABLES; + +--echo # Switch to connection user1 +connection user1; +# +# Since the lock ordering rule in thr_multi_lock depends on +# pointer values, from execution to execution we might have +# different lock order, and therefore, sometimes lock t1 and block +# on t2, and sometimes block on t2 right away. In the second case, +# the following insert succeeds, and only then this select can +# proceed, and we actually test nothing, as the very first select +# returns 4 rows right away. +# It's fine to have a test case that covers the problematic area +# at least once in a while. +--echo # Collecting ("reap") the result from the previously blocked select. +--echo # The printing of the result (varies between 3 and 4 rows) set has to be suppressed. +--disable_result_log +--reap +--enable_result_log + +--echo # Switch to connection user3 +connection user3; +--echo # The next select enforces that effects of "concurrent_inserts" like the +--echo # record with a = 4 is missing in result sets can no more happen. +SELECT 1 FROM t1 WHERE a = 4; + +--echo # Switch to connection user1 +connection user1; +--echo # The next result set must contain 4 rows. +# If not, we have a regression of Bug#28249 +eval $select_for_qc; +RESET QUERY CACHE; +eval $select_for_qc; + +DROP TABLE t1,t2; + +--echo # Switch to connection default + close connections user1,user2,user3 +connection default; +disconnect user1; +disconnect user2; +disconnect user3; + +SET GLOBAL query_cache_type= @query_cache_type; +SET GLOBAL query_cache_limit= @query_cache_limit; +SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit; +SET GLOBAL query_cache_size= @query_cache_size; + diff --git a/mysql-test/t/query_cache_limit_func.test b/mysql-test/t/query_cache_limit_func.test deleted file mode 100644 index 8dd5cf42d3d..00000000000 --- a/mysql-test/t/query_cache_limit_func.test +++ /dev/null @@ -1,173 +0,0 @@ -############# mysql-test\t\Query_cache_limit_func.test ######################## -# # -# Variable Name: Query_cache_limit # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: NUMERIC # -# Default Value: 1048576 # -# Min Value: 0 # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "Query_cache_limit" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en # -# /server-system-variables.html#option_mysqld_Query_cache_limit # -# # -############################################################################### - - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @global_query_cache_limit = @@global.query_cache_limit; - ---echo ** warnings ** ---disable_warnings -DROP TABLE IF EXISTS t; - ---enable_warnings -#creating table# - ---echo ** creating table ** - -CREATE TABLE t -( -id INT AUTO_INCREMENT PRIMARY KEY, -c TEXT(30) -); - -#inserting value# - ---echo **inserting value ** - -INSERT INTO t set c = repeat('x',29); -INSERT INTO t set c = concat(repeat('x',28),'r','x'); -INSERT INTO t set c = concat(repeat('x',28),'s','y'); -INSERT INTO t set c = concat(repeat('x',28),'g','w'); - -# Reset cache & flush status ---echo ** Reset cache values ** -FLUSH STATUS; -RESET QUERY CACHE; - -# set query cache type value to on and allocating cache size ---echo ** On query_cache_type ** -SET GLOBAL query_cache_type = ON; - ---echo ** Allocating cache size ** -SET GLOBAL query_cache_size = 131072; - -# reset values ---echo ** Reset values -SET GLOBAL query_cache_size = 0; -SET GLOBAL query_cache_size = 131072; -SET GLOBAL query_cache_type = ON; - ---echo '#---------------------FN_DYNVARS_132_01----------------------#' -# -#Check if results are cacheing on default value # -# - -# Reset cache & flush status ---echo ** Reset cache values ** -FLUSH STATUS; -RESET QUERY CACHE; - - -#fetching results# ---echo ** fetching results ** -SELECT * FROM t; - -# Check status ---echo ** check status on not setting query_cache_limit value ** - -SHOW STATUS LIKE 'Qcache_not_cached'; -SHOW STATUS LIKE 'Qcache_queries_in_cache'; - - ---echo '#---------------------FN_DYNVARS_132_02----------------------#' -# -#Check if results are cacheing on setting value to 0 i.e. no caching# -# - -# Reset cache & flush status ---echo ** Reset cache values ** -FLUSH STATUS; -RESET QUERY CACHE; - -#set cache limit ---echo ** set cache limit ** -SET @@GLOBAL.query_cache_limit=0; - -#fetching results# ---echo ** fetching results ** -SELECT * FROM t; - -# Check status after setting value# ---echo ** Check status after setting value ** -#let $newcachevalue1= query_get_value(SHOW STATUS LIKE 'Qcache_queries_in_cache', Value, 1); -SHOW STATUS LIKE 'Qcache_not_cached'; ---echo 1 Expected -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - - ---echo '#---------------------FN_DYNVARS_132_03----------------------#' -# -# Check if setting to 0 makes any difference to the cache or not # -# - -#set cache limit to default ---echo ** set cache limit ** -SET @@GLOBAL.query_cache_limit=DEFAULT; - -# Reset cache & flush status ---echo ** Reset cache values ** -FLUSH STATUS; -RESET QUERY CACHE; - -#fetching results# ---echo ** fetching results ** -SELECT * FROM t; - -SHOW STATUS LIKE 'Qcache_not_cached'; ---echo 0 Expected -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - -SET @@GLOBAL.query_cache_limit=0; - -SHOW STATUS LIKE 'Qcache_not_cached'; ---echo 0 Expected -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - -#fetching results# ---echo ** fetching results ** -SELECT * FROM t; - -# Check status after setting value# ---echo ** Check status after setting value ** - -SHOW STATUS LIKE 'Qcache_not_cached'; ---echo 0 Expected -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - -# -# Cleanup -# - -SET @@GLOBAL.query_cache_limit = @global_query_cache_limit; - ---disable_warnings -DROP TABLE IF EXISTS t; ---enable_warnings diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test index 929b93e10d5..c3889ef0267 100644 --- a/mysql-test/t/query_cache_notembedded.test +++ b/mysql-test/t/query_cache_notembedded.test @@ -183,6 +183,8 @@ drop table t1; # # bug#14767: INSERT in SF + concurrent SELECT with query cache # +connection default; +SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; reset query cache; @@ -224,7 +226,10 @@ disconnect con2; connection default; set GLOBAL query_cache_size=0; -SET GLOBAL log_bin_trust_function_creators = 0; + +# End of 5.0 tests + +SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators; # # Bug #30269 Query cache eats memory diff --git a/mysql-test/t/query_cache_type_basic.test b/mysql-test/t/query_cache_type_basic.test deleted file mode 100644 index ba7e26a3065..00000000000 --- a/mysql-test/t/query_cache_type_basic.test +++ /dev/null @@ -1,228 +0,0 @@ -################ mysql-test\t\query_cache_type_basic.test ##################### -# # -# Variable Name: query_cache_type # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: 1 # -# Range: 0,1 & 2 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable query_cache_type # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF query_cache_type TESTS # -######################################################################## - - -########################################################################### -# Saving initial value of query_cache_type in a temporary variable # -########################################################################### - -SET @global_start_value = @@global.query_cache_type; -SELECT @global_start_value; - -SET @session_start_value = @@session.query_cache_type; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_134_01------------------------#' -######################################################################## -# Display the DEFAULT value of query_cache_type # -######################################################################## - -SET @@global.query_cache_type = 0; -SET @@global.query_cache_type = DEFAULT; -SELECT @@global.query_cache_type; - -SET @@session.query_cache_type = 0; -SET @@session.query_cache_type = DEFAULT; -SELECT @@session.query_cache_type; - - ---echo '#---------------------FN_DYNVARS_134_02-------------------------#' -######################################################### -# Check if NULL or empty value is accepeted # -######################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = NULL; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = ''; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_type = NULL; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_type = ''; - ---echo '#--------------------FN_DYNVARS_134_03------------------------#' -######################################################################## -# Change the value of query_cache_type to a valid value # -######################################################################## - -SET @@global.query_cache_type = OFF; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = ON; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = DEMAND; -SELECT @@global.query_cache_type; - -SET @@session.query_cache_type = OFF; -SELECT @@session.query_cache_type; - -SET @@session.query_cache_type = ON; -SELECT @@session.query_cache_type; - -SET @@session.query_cache_type = DEMAND; -SELECT @@session.query_cache_type; - - ---echo '#--------------------FN_DYNVARS_134_04-------------------------#' -########################################################################### -# Change the value of query_cache_type to invalid value # -########################################################################### - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = ONDEMAND; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = 'ON,OFF'; - -SET @@global.query_cache_type = 'OF'; -SELECT @@global.query_cache_type; - ---echo 'Bug# 34828: OF is taken as OFF.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = YES; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = ' '; - - ---echo '#-------------------FN_DYNVARS_134_05----------------------------#' -######################################################################### -# Check if the value in session Table matches value in variable # -######################################################################### - -SELECT @@session.query_cache_type = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_type'; - ---echo '#----------------------FN_DYNVARS_134_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.query_cache_type = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_type'; - - ---echo '#---------------------FN_DYNVARS_134_07-------------------------#' -################################################################### -# Check if numbers can be used on variable # -################################################################### - -# test if variable accepts 0,1,2 -SET @@global.query_cache_type = 0; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 1; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 2; -SELECT @@global.query_cache_type; - -# use of decimal values - -SET @@global.query_cache_type = 0.4; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 1.0; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 1.1; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 1.5; -SELECT @@global.query_cache_type; - -SET @@global.query_cache_type = 2.49; -SELECT @@global.query_cache_type; - -SET @@session.query_cache_type = 0.5; -SELECT @@session.query_cache_type; - -SET @@session.query_cache_type = 1.6; -SELECT @@session.query_cache_type; - - ---echo 'Bug: Decimal values can be used within the range [0.0-2.5). Values'; ---echo 'are rounded to 0,1,2 as evident from outcome.'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_type = 3; - - ---echo '#---------------------FN_DYNVARS_134_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.query_cache_type = TRUE; -SELECT @@global.query_cache_type; -SET @@global.query_cache_type = FALSE; -SELECT @@global.query_cache_type; - ---echo '#---------------------FN_DYNVARS_134_09----------------------#' -###################################################################### -# Check if query_cache_type can be accessed with and without @@ sign # -###################################################################### - -SET query_cache_type = 'ON'; - ---Error ER_PARSE_ERROR -SET session.query_cache_type = 'OFF'; ---Error ER_PARSE_ERROR -SET global.query_cache_type = 'DEMAND'; - -SET session query_cache_type = 1; -SELECT @@query_cache_type; - -SET global query_cache_type = 0; -SELECT @@global.query_cache_type; - -############################## -# Restore initial value # -############################## - -SET @@global.query_cache_type = @global_start_value; -SELECT @@global.query_cache_type; - -SET @@session.query_cache_type = @session_start_value; -SELECT @@session.query_cache_type; - -######################################################################## -# END OF query_cache_type TESTS # -######################################################################## diff --git a/mysql-test/t/query_cache_type_func.test b/mysql-test/t/query_cache_type_func.test deleted file mode 100644 index 64f332eb7c0..00000000000 --- a/mysql-test/t/query_cache_type_func.test +++ /dev/null @@ -1,314 +0,0 @@ -############# mysql-test\t\query_cache_type_func.test ######################### -# # -# Variable Name: query_cache_type # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: ON # -# Values: ON, OFF, DEMAND # -# # -# # -# Creation Date: 2008-02-20 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "query_cache_type" # -# that checks behavior of this variable in the following ways # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_query_cache_type # -# # -############################################################################### - ---echo ** Setup ** ---echo - -# Setup -# - -# -# Save initial value -# - ---echo ** Connecting to con0 using root ** -connect (con0,localhost,root,,); ---echo ** Connection con0 ** -connection con0; - -SET @start_global_value = @@GLOBAL.query_cache_type; -SET @start_session_value = @@SESSION.query_cache_type; - -# -# Creating test table -# - -CREATE TABLE t1(id int, value varchar(10)); - -INSERT INTO t1 VALUES(1, 'val1'); -INSERT INTO t1 VALUES(2, 'val2'); -INSERT INTO t1 VALUES(3, 'val3'); - -# -# Clearing the query cache and setting up cache size -# - -SET @@GLOBAL.query_cache_size = 65536; - ---echo FLUSHING CACHE -SET @@GLOBAL.query_cache_size = 0; -SET @@GLOBAL.query_cache_size = 65536; - -# -# SESSION SCOPE -# - ---echo ** TESTING SESSION SCOPE ** - ---echo '#--------------------FN_DYNVARS_135_01-------------------------#' -# -# Testing default value it should be ON by default -# - -SET @@query_cache_type = DEFAULT; -SELECT @@query_cache_type; ---echo ON Expected - ---echo '#--------------------FN_DYNVARS_135_02-------------------------#' -# -# Testing valid possible values -# - ---error ER_WRONG_VALUE_FOR_VAR -SET @@query_cache_type = NULL; ---echo Expected error: Wrong value for variable - -SET @@query_cache_type = ON; -SELECT @@query_cache_type; ---echo ON Expected - -SET @@query_cache_type = OFF; -SELECT @@query_cache_type; ---echo OFF Expected - -SET @@query_cache_type = DEMAND; -SELECT @@query_cache_type; ---echo DEMAND Expected - ---error ER_WRONG_VALUE_FOR_VAR -SET @@query_cache_type = XYZ; ---echo Expected error: Wrong value for variable - - -# -# TESTING FOR VALUE ON or 1 -# - ---echo ** Turning cache to ON ** - -SET @@query_cache_type = ON; - ---echo '#--------------------FN_DYNVARS_135_03-------------------------#' -# -# TESTING CACHE ADDITION -# - ---echo ** CACHE ADDITION ** ---echo - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - -SELECT value FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 2 Expected - ---echo '#--------------------FN_DYNVARS_135_04-------------------------#' -# -# TESTING CACHE HIT -# - ---echo ** CACHE HIT ** - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 2 Expected - -SELECT SQL_CACHE value FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 3 Expected - -SELECT SQL_NO_CACHE value FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 3 Expected - ---echo '#--------------------FN_DYNVARS_135_05-------------------------#' -# -# Testing with store procedure -# - ---echo Testing with store procedure - -delimiter |; - -CREATE PROCEDURE testProcHit() -BEGIN - SELECT * FROM t1; - SELECT SQL_CACHE value FROM t1; -END| - -delimiter ;| - -CALL testProcHit(); - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo Expected value : 3 ---echo ================== ---echo Bug#35388: Stored procedure execution causes improper behavior of query cache. - - ---echo '#--------------------FN_DYNVARS_135_06-------------------------#' -# -# TESTING FOR VALUE OFF or 0 -# - ---echo FLUSHING CACHE -SET @@GLOBAL.query_cache_size = 0; -SET @@GLOBAL.query_cache_size = 65536; - ---echo ** Turning cache to OFF ** - -SET @@query_cache_type = OFF; -SELECT @@query_cache_type; - -SELECT id FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - ---echo '#--------------------FN_DYNVARS_135_07-------------------------#' -# -# TESTING QUERY WITH SQL_CACHE -# - -SELECT SQL_CACHE id FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - -SELECT SQL_CACHE * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - ---echo '#--------------------FN_DYNVARS_135_08-------------------------#' -# -# TESTING FOR VALUE DEMAND or 2 -# - ---echo FLUSHING CACHE -SET @@GLOBAL.query_cache_size = 0; -SET @@GLOBAL.query_cache_size = 65536; - ---echo ** Turning cache to DEMAND ** - -SET @@query_cache_type = DEMAND; -SELECT @@query_cache_type; - ---echo '#--------------------FN_DYNVARS_135_09-------------------------#' -# -# TESTING NORMAL QUERY -# - -SELECT value,id FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - -SELECT SQL_CACHE * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - -# -# GLOBAL SCOPE -# - ---echo ** TESTING GLOBAL SCOPE ** - ---echo '#--------------------FN_DYNVARS_135_10-------------------------#' -# -# Turning global cache to OFF -# - -SET @@GLOBAL.query_cache_type = OFF; - ---echo ** Connecting con1 using root ** -connect (con1,localhost,root,,); - ---echo ** Connection con1 ** -connection con1; - -SELECT @@query_cache_type; ---echo OFF Expected - ---echo '#--------------------FN_DYNVARS_135_11-------------------------#' -# -# Turning global cache to DEMAND -# -SET @@GLOBAL.query_cache_type = DEMAND; - ---echo ** Connecting con2 using root ** -connect (con2,localhost,root,,); - ---echo ** Connection con2 ** -connection con2; - -SELECT @@query_cache_type; ---echo DEMAND Expected - ---echo '#--------------------FN_DYNVARS_135_12-------------------------#' -# -# Turning global cache to ON -# -SET @@GLOBAL.query_cache_type = ON; - ---echo ** Connecting con3 using root ** -connect (con3,localhost,root,,); ---echo ** Connection con3 ** -connection con3; - -SELECT @@query_cache_type; ---echo ON Expected - ---echo ---echo ** Cleanup ** ---echo -# -# Cleanup -# - ---echo Disconnecting con1,con2,con3 -disconnect con1; -disconnect con2; -disconnect con3; - ---echo ** Connection con0 ** -connection con0; - -SET @@GLOBAL.query_cache_type = @start_global_value; -SET @@SESSION.query_cache_type = @start_session_value; - -DROP TABLE t1; - -DROP PROCEDURE testProcHit; - ---echo Disconnecting con0 -disconnect con0; diff --git a/mysql-test/t/query_cache_wlock_invalidate_basic.test b/mysql-test/t/query_cache_wlock_invalidate_basic.test deleted file mode 100644 index f253c1b4f43..00000000000 --- a/mysql-test/t/query_cache_wlock_invalidate_basic.test +++ /dev/null @@ -1,231 +0,0 @@ -########### mysql-test\t\query_cache_wlock_invalidate_basic.test ############## -# # -# Variable Name: query_cache_wlock_invalidate # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Range: TRUE, FALSE # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable # -# query_cache_wlock_invalidate that checks the behavior of this # -# variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF query_cache_wlock_invalidate TESTS # -######################################################################## - - -############################################################################### -# Saving initial value of query_cache_wlock_invalidate in a temporary variable# -############################################################################### - -SET @session_start_value = @@session.query_cache_wlock_invalidate; -SELECT @session_start_value; - -SET @global_start_value = @@global.query_cache_wlock_invalidate; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_135_01------------------------#' -######################################################################## -# Display the DEFAULT value of query_cache_wlock_invalidate # -######################################################################## - -SET @@session.query_cache_wlock_invalidate = 1; -SET @@session.query_cache_wlock_invalidate = DEFAULT; -SELECT @@session.query_cache_wlock_invalidate; - -SET @@global.query_cache_wlock_invalidate = 1; -SET @@global.query_cache_wlock_invalidate = DEFAULT; -SELECT @@global.query_cache_wlock_invalidate; - ---echo '#---------------------FN_DYNVARS_135_02-------------------------#' -########################################################################### -# Check if query_cache_wlock_invalidate can be accessed with and without -# @@ sign -########################################################################### - -SET query_cache_wlock_invalidate = 1; -SELECT @@query_cache_wlock_invalidate; - ---Error ER_UNKNOWN_TABLE -SELECT session.query_cache_wlock_invalidate; - ---Error ER_UNKNOWN_TABLE -SELECT local.query_cache_wlock_invalidate; - ---Error ER_UNKNOWN_TABLE -SELECT global.query_cache_wlock_invalidate; - -#using another syntax for accessing system variables -SET session query_cache_wlock_invalidate = 0; -SELECT @@session.query_cache_wlock_invalidate; - -SET global query_cache_wlock_invalidate = 0; -SELECT @@global.query_cache_wlock_invalidate; - - ---echo '#--------------------FN_DYNVARS_135_03------------------------#' -########################################################################## -# change the value of query_cache_wlock_invalidate to a valid value # -########################################################################## -# for session -SET @@session.query_cache_wlock_invalidate = 0; -SELECT @@session.query_cache_wlock_invalidate; -SET @@session.query_cache_wlock_invalidate = 1; -SELECT @@session.query_cache_wlock_invalidate; - -# for global -SET @@global.query_cache_wlock_invalidate = 0; -SELECT @@global.query_cache_wlock_invalidate; -SET @@global.query_cache_wlock_invalidate = 1; -SELECT @@global.query_cache_wlock_invalidate; - - ---echo '#--------------------FN_DYNVARS_135_04-------------------------#' -########################################################################### -# Change the value of query_cache_wlock_invalidate to invalid value # -########################################################################### - -# for session ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_wlock_invalidate = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_wlock_invalidate = 1.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_wlock_invalidate = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_wlock_invalidate = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_wlock_invalidate = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_wlock_invalidate = ÕN; - -SET @@session.query_cache_wlock_invalidate = OF; -SELECT @@session.query_cache_wlock_invalidate; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.query_cache_wlock_invalidate = ÓFF; - -# for global - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_wlock_invalidate = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_wlock_invalidate = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_wlock_invalidate = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_wlock_invalidate = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_wlock_invalidate = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_wlock_invalidate = ÕN; - -SET @@global.query_cache_wlock_invalidate = OF; -SELECT @@global.query_cache_wlock_invalidate; - ---echo 'Bug 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.query_cache_wlock_invalidate = ÓFF; - - ---echo '#-------------------FN_DYNVARS_135_05----------------------------#' -########################################################################### -# Test if changing global variable effects session and vice versa # -########################################################################### - -SET @@global.query_cache_wlock_invalidate = 0; -SET @@session.query_cache_wlock_invalidate = 1; -SELECT @@global.query_cache_wlock_invalidate AS res_is_0; - -SET @@global.query_cache_wlock_invalidate = 0; -SELECT @@session.query_cache_wlock_invalidate AS res_is_1; - ---echo '#----------------------FN_DYNVARS_135_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.query_cache_wlock_invalidate = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_wlock_invalidate'; -SELECT @@global.query_cache_wlock_invalidate; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_wlock_invalidate'; - ---echo '#----------------------FN_DYNVARS_135_07------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@session.query_cache_wlock_invalidate = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_wlock_invalidate'; -SELECT @@session.query_cache_wlock_invalidate; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_wlock_invalidate'; - ---echo '#---------------------FN_DYNVARS_135_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.query_cache_wlock_invalidate = OFF; -SELECT @@session.query_cache_wlock_invalidate; -SET @@session.query_cache_wlock_invalidate = ON; -SELECT @@session.query_cache_wlock_invalidate; - -SET @@global.query_cache_wlock_invalidate = OFF; -SELECT @@global.query_cache_wlock_invalidate; -SET @@global.query_cache_wlock_invalidate = ON; -SELECT @@global.query_cache_wlock_invalidate; - ---echo '#---------------------FN_DYNVARS_135_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.query_cache_wlock_invalidate = TRUE; -SELECT @@session.query_cache_wlock_invalidate; -SET @@session.query_cache_wlock_invalidate = FALSE; -SELECT @@session.query_cache_wlock_invalidate; - -SET @@global.query_cache_wlock_invalidate = TRUE; -SELECT @@global.query_cache_wlock_invalidate; -SET @@global.query_cache_wlock_invalidate = FALSE; -SELECT @@global.query_cache_wlock_invalidate; - -############################## -# Restore initial value # -############################## - -SET @@session.query_cache_wlock_invalidate = @session_start_value; -SELECT @@session.query_cache_wlock_invalidate; - -SET @@global.query_cache_wlock_invalidate = @global_start_value; -SELECT @@global.query_cache_wlock_invalidate; - -############################################################### -# END OF query_cache_wlock_invalidate TESTS # -############################################################### diff --git a/mysql-test/t/query_cache_wlock_invalidate_func.test b/mysql-test/t/query_cache_wlock_invalidate_func.test deleted file mode 100644 index 83b0c446b28..00000000000 --- a/mysql-test/t/query_cache_wlock_invalidate_func.test +++ /dev/null @@ -1,285 +0,0 @@ -############# mysql-test\t\query_cache_wlock_invalidate_func.test #################### -# # -# Variable Name: query_cache_wlock_invalidate # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Values: TRUE / 1, FALSE / 0 # -# # -# # -# Creation Date: 2008-02-21 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "query_cache_wlock_invalidate" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Cache behaviors # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_query_cache_wlock_invalidate # -# # -###################################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - -# disabled due to differences in the result ---disable_ps_protocol -# -# Save initial value -# ---echo ** Connecting con0 using root ** -connect (con0,localhost,root,,); ---echo ** Connecting con1 using root ** -connect (con1, localhost, root,,); ---echo ** Connection con0 ** -connection con0; - -SET @start_global_value = @@GLOBAL.query_cache_wlock_invalidate; -SET @start_session_value = @@SESSION.query_cache_wlock_invalidate; - -SET @old_cache_size = @@GLOBAL.query_cache_size; -SET @old_cache_type = @@GLOBAL.query_cache_type; - -# -# Creating test table -# - -CREATE TABLE t1(id int, value varchar(10)); - -INSERT INTO t1 VALUES(1, 'val1'); -INSERT INTO t1 VALUES(2, 'val2'); -INSERT INTO t1 VALUES(3, 'val3'); - -# -# Clearing the query cache and setting up cache size -# - -SET GLOBAL query_cache_size = 131072; - ---echo FLUSHING CACHE -SET GLOBAL query_cache_size = 0; -SET GLOBAL query_cache_size = 131072; - -SET GLOBAL query_cache_type = ON; - -# -# Testing for value ON -# ---echo Testing for value ON - ---echo ** Connection con0 ** -connection con0; - -SET SESSION query_cache_wlock_invalidate = ON; - ---echo ** Connection con1 ** -connection con1; - -SET SESSION query_cache_wlock_invalidate = ON; - ---echo '#----------------------------FN_DYNVARS_136_01--------------#' -# -# Testing for cache invalidation -# - ---echo Testing for cache invalidation - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - -LOCK TABLE t1 WRITE; - -UNLOCK TABLES; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 0 Expected - ---echo '#----------------------------FN_DYNVARS_136_02-----------------------#' -# -# Testing for blockage of access -# - -disable_result_log; - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; - -enable_result_log; - ---echo ** Connection con1 ** -connection con1; - -SELECT * FROM t1; - ---echo ** Connection con0 ** -connection con0; - -LOCK TABLE t1 WRITE; - ---echo ** Connection con1 ** -connection con1; - ---echo ** Asynchronous Execution ** -send SELECT * FROM t1; - ---echo ** Connection con0 ** -connection con0; - ---echo Sleeping 2 Seconds before unlock ---sleep 2 -UNLOCK TABLES; - ---echo ** Connection con1 ** -connection con1; ---echo ** Asynchronous Result ** -reap; - -# -# Testing for value OFF -# ---echo Testing for value OFF - ---echo ** Connection con0 ** -connection con0; - -SET SESSION query_cache_wlock_invalidate = OFF; - ---echo ** Connection con1 ** -connection con1; - -SET SESSION query_cache_wlock_invalidate = OFF; - ---echo '#----------------------------FN_DYNVARS_136_03------------------#' -# -# Testing for cache invalidation -# - ---echo Testing for cache invalidation - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - -LOCK TABLE t1 WRITE; - -UNLOCK TABLES; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - ---echo '#----------------------------FN_DYNVARS_136_04---------------------#' -# -# Testing for blockage of access -# - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Qcache_queries_in_cache'; ---echo 1 Expected - ---echo ** Connection con1 ** -connection con1; - -SELECT * FROM t1; - ---echo ** Connection con0 ** -connection con0; - -LOCK TABLE t1 WRITE; - ---echo ** Connection con1 ** -connection con1; - ---echo ** Should not be blocked ** -SELECT * FROM t1; - ---echo ** Connection con0 ** -connection con0; - ---echo Sleeping 2 Seconds before unlock ---sleep 2 -UNLOCK TABLES; - ---echo ** Connection con1 ** -connection con1; - ---echo '#----------------------------FN_DYNVARS_136_05------------------------#' -# -# Session data integrity check & GLOBAL Value check -# - -SET GLOBAL query_cache_wlock_invalidate = OFF; - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); ---echo ** Connection con_int1 ** -connection con_int1; - -SELECT @@SESSION.query_cache_wlock_invalidate; ---echo Expected Value : 0 / OFF; -SET SESSION query_cache_wlock_invalidate = ON; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); ---echo ** Connection con_int2 ** -connection con_int2; - -SELECT @@SESSION.query_cache_wlock_invalidate; ---echo Expected Value : 0 / OFF; - -SET SESSION query_cache_wlock_invalidate = OFF; - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.query_cache_wlock_invalidate; ---echo Expected Value : 1 / ON; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.query_cache_wlock_invalidate; ---echo Expected Value : 0 / OFF; - -SELECT @@GLOBAL.query_cache_wlock_invalidate; ---echo Expected Value : 0 / OFF; - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - -# -# Cleanup -# ---echo ---echo CLEANUP - ---echo ** Connection con0 ** -connection con0; - -SET @@GLOBAL.query_cache_wlock_invalidate = @start_global_value; -SET @@SESSION.query_cache_wlock_invalidate = @start_session_value ; -SET @@GLOBAL.query_cache_size = @old_cache_size; -SET @@GLOBAL.query_cache_type = @old_cache_type; - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con0, con1 -disconnect con0; -disconnect con1; - -DROP TABLE t1; - ---enable_ps_protocol - diff --git a/mysql-test/t/query_prealloc_size_func.test b/mysql-test/t/query_prealloc_size_func.test deleted file mode 100644 index 4f1e3e63e16..00000000000 --- a/mysql-test/t/query_prealloc_size_func.test +++ /dev/null @@ -1,86 +0,0 @@ -############# mysql-test\t\query_prealloc_size_func.test ###################### -# # -# Variable Name: query_prealloc_size # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: integer # -# Default Value: 8192 # -# Values: 8192-4294967295 # -# # -# # -# Creation Date: 2008-02-22 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "query_prealloc_size" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Cache behaviors # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_query_prealloc_size # -# # -############################################################################### - - - ---echo ** Setup ** ---echo -# -# Setup -# - -# -# Save initial value -# - -CREATE TABLE t1 (id int auto_increment primary key, val text(200)); - -INSERT INTO t1 values(NULL,'a'); -INSERT INTO t1 values(NULL,'b'); -INSERT INTO t1 values(NULL,'c'); -INSERT INTO t1 values(NULL,'d'); - -SELECT * FROM t1 ORDER BY val; - -SET SESSION query_prealloc_size = 8192; - - ---echo '#----------------------------FN_DYNVARS_137_05-----------------#' -# -# Session data integrity check & GLOBAL Value check -# - -SET GLOBAL query_prealloc_size = 8192; - -connect (con_int1,localhost,root,,); -connection con_int1; - -SELECT @@SESSION.query_prealloc_size; ---echo Expected Value : 8192; -SET SESSION query_prealloc_size = 16384; - -connect (con_int2,localhost,root,,); -connection con_int2; - -SELECT @@SESSION.query_prealloc_size; ---echo Expected Value : 8192; - -SET SESSION query_prealloc_size = 8192; - -connection con_int1; -SELECT @@SESSION.query_prealloc_size; ---echo Expected Value : 16384; - -connection con_int2; -SELECT @@SESSION.query_prealloc_size; ---echo Expected Value : 8192; - -SELECT @@GLOBAL.query_prealloc_size; ---echo Expected Value : 8192; - -connection default; -disconnect con_int1; -disconnect con_int2; - diff --git a/mysql-test/t/read_buffer_size_basic.test b/mysql-test/t/read_buffer_size_basic.test deleted file mode 100644 index 405bb9da6d8..00000000000 --- a/mysql-test/t/read_buffer_size_basic.test +++ /dev/null @@ -1,209 +0,0 @@ -############## mysql-test\t\read_buffer_size_basic.test ############### -# # -# Variable Name: read_buffer_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 131072 # -# Range: 8200-2147479552 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable read_buffer_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -###################################################################### -# START OF read_buffer_size TESTS # -###################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.read_buffer_size; -SELECT @start_global_value; -SET @start_session_value = @@session.read_buffer_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_138_01-------------------------#' -###################################################################### -# Display the DEFAULT value of read_buffer_size # -###################################################################### - -SET @@global.read_buffer_size = 1000; -SET @@global.read_buffer_size = DEFAULT; -SELECT @@global.read_buffer_size; - -SET @@session.read_buffer_size = 2000; -SET @@session.read_buffer_size = DEFAULT; -SELECT @@session.read_buffer_size; - - ---echo '#--------------------FN_DYNVARS_138_02-------------------------#' -###################################################################### -# Check the DEFAULT value of read_buffer_size # -###################################################################### - -SET @@global.read_buffer_size = DEFAULT; -SELECT @@global.read_buffer_size = 131072; - -SET @@session.read_buffer_size = DEFAULT; -SELECT @@session.read_buffer_size = 131072; - - ---echo '#--------------------FN_DYNVARS_138_03-------------------------#' -################################################################################ -# Change the value of read_buffer_size to a valid value for GLOBAL Scope # -################################################################################ - -SET @@global.read_buffer_size = 8201; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; -SET @@global.read_buffer_size = 8200; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; -SET @@global.read_buffer_size = 2147479552; -SELECT @@global.read_buffer_size; -SET @@global.read_buffer_size = 2147479551; -SELECT @@global.read_buffer_size; - ---echo '#--------------------FN_DYNVARS_138_04-------------------------#' -################################################################################### -# Change the value of read_buffer_size to a valid value for SESSION Scope # -################################################################################### - -SET @@session.read_buffer_size = 8200; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; -SET @@session.read_buffer_size = 8201; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; -SET @@session.read_buffer_size = 2147479552; -SELECT @@session.read_buffer_size; -SET @@session.read_buffer_size = 2147479551; -SELECT @@session.read_buffer_size; - - ---echo '#------------------FN_DYNVARS_138_05-----------------------#' -################################################################## -# Change the value of read_buffer_size to an invalid value # -################################################################## - -SET @@global.read_buffer_size = 8199; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; -SET @@global.read_buffer_size = -1024; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; -SET @@global.read_buffer_size = 2147479553; -SELECT @@global.read_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.read_buffer_size = 65530.34.; -SELECT @@global.read_buffer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.read_buffer_size = test; -SELECT @@global.read_buffer_size; - -SET @@session.read_buffer_size = 8199; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; -SET @@session.read_buffer_size = -2; -SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ; ---Error ER_PARSE_ERROR -SET @@session.read_buffer_size = 65530.34.; -SET @@session.read_buffer_size = 2147479553; -SELECT @@session.read_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.read_buffer_size = test; -SELECT @@session.read_buffer_size; - - ---echo '#------------------FN_DYNVARS_138_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.read_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='read_buffer_size'; - ---echo '#------------------FN_DYNVARS_138_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.read_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='read_buffer_size'; - - ---echo '#------------------FN_DYNVARS_138_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.read_buffer_size = TRUE; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; -SET @@global.read_buffer_size = FALSE; -SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ; -echo 'Bug: FN_DYNVARS_138_08- Errors are not coming on assigning TRUE/FALSE to variable'; - - ---echo '#---------------------FN_DYNVARS_138_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.read_buffer_size = 9000; -SELECT @@read_buffer_size = @@global.read_buffer_size; - - ---echo '#---------------------FN_DYNVARS_138_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@read_buffer_size = 9000; -SELECT @@read_buffer_size = @@local.read_buffer_size; -SELECT @@local.read_buffer_size = @@session.read_buffer_size; - - ---echo '#---------------------FN_DYNVARS_138_11----------------------#' -################################################################################### -# Check if read_buffer_size can be accessed with and without @@ sign # -################################################################################### - -SET read_buffer_size = 9100; -SELECT @@read_buffer_size= 8200 OR @@read_buffer_size= 8228 ; ---Error ER_UNKNOWN_TABLE -SELECT local.read_buffer_size; ---Error ER_UNKNOWN_TABLE -SELECT session.read_buffer_size; ---Error ER_BAD_FIELD_ERROR -SELECT read_buffer_size = @@session.read_buffer_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.read_buffer_size = @start_global_value; -SELECT @@global.read_buffer_size; -SET @@session.read_buffer_size = @start_session_value; -SELECT @@session.read_buffer_size; - - -############################################################# -# END OF read_buffer_size TESTS # -############################################################# diff --git a/mysql-test/t/read_only_basic.test b/mysql-test/t/read_only_basic.test deleted file mode 100644 index 917842256b1..00000000000 --- a/mysql-test/t/read_only_basic.test +++ /dev/null @@ -1,173 +0,0 @@ -############## mysql-test\t\read_only_basic.test ############### -# # -# Variable Name: read_only # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 0 # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable read_only # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -################################################################ -# START OF read_only TESTS # -################################################################ - - -################################################################ -# Saving initial value of read_only in a temporary variable # -################################################################ - -SET @start_value = @@global.read_only; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_139_01------------------------#' -################################################################ -# Display the DEFAULT value of read_only # -################################################################ - -SET @@global.read_only = 1; -SET @@global.read_only = DEFAULT; -SELECT @@global.read_only; - - ---echo '#---------------------FN_DYNVARS_139_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.read_only = @start_value; -SELECT @@global.read_only = 0; - - ---echo '#--------------------FN_DYNVARS_139_03------------------------#' -################################################################# -# Change the value of read_only to a valid value # -################################################################# - -SET @@global.read_only = 0; -SELECT @@global.read_only; -SET @@global.read_only = 1; -SELECT @@global.read_only; -SET @@global.read_only = TRUE; -SELECT @@global.read_only; -SET @@global.read_only = FALSE; -SELECT @@global.read_only; -SET @@global.read_only = ON; -SELECT @@global.read_only; -SET @@global.read_only = OFF; -SELECT @@global.read_only; - ---echo '#--------------------FN_DYNVARS_139_04-------------------------#' -#################################################################### -# Change the value of read_only to invalid value # -#################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.read_only = -1; -SELECT @@global.read_only; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.read_only = 4294967296; -SELECT @@global.read_only; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.read_only = 10240022115; -SELECT @@global.read_only; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.read_only = 10000.01; -SELECT @@global.read_only; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.read_only = -1024; -SELECT @@global.read_only; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.read_only = 42949672950; -SELECT @@global.read_only; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.read_only = 'test'; -SELECT @@global.read_only; - - ---echo '#-------------------FN_DYNVARS_139_05----------------------------#' -#################################################################### -# Test if accessing session read_only gives error # -#################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.read_only = 0; -SELECT @@read_only; - - ---echo '#----------------------FN_DYNVARS_139_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.read_only = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='read_only'; - -SELECT @@read_only = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='read_only'; - - ---echo '#---------------------FN_DYNVARS_139_07----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.read_only = 1; -SELECT @@read_only = @@global.read_only; - - ---echo '#---------------------FN_DYNVARS_139_08----------------------#' -################################################################### -# Check if read_only can be accessed with and without @@ sign # -################################################################### - ---Error ER_GLOBAL_VARIABLE -SET read_only = 1; -SELECT @@read_only; ---Error ER_PARSE_ERROR -SET local.read_only = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.read_only; ---Error ER_PARSE_ERROR -SET global.read_only = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.read_only; ---Error ER_BAD_FIELD_ERROR -SELECT read_only = @@session.read_only; - - -############################## -# Restore initial value # -############################## - -SET @@global.read_only = @start_value; -SELECT @@global.read_only; - - -################################################################# -# END OF read_only TESTS # -################################################################# - diff --git a/mysql-test/t/read_only_func.test b/mysql-test/t/read_only_func.test deleted file mode 100644 index c8fb932544b..00000000000 --- a/mysql-test/t/read_only_func.test +++ /dev/null @@ -1,151 +0,0 @@ -############ mysql-test\t\read_only_func.test ################################## -# # -#Variable Name: read_only # -#Scope: SESSION # -#Access Type: Dynamic # -#Data Type: BOOLEAN # -#Default Value: OFF # -#Values: ON, OFF # -# # -# # -#Creation Date: 2008-03-02 # -#Author: Sharique Abdullah # -# # -#Description: Test Cases of Dynamic System Variable "read_only" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html# -# option_mysqld_read_only # -# # -################################################################################ - ---echo ** Setup ** ---echo -# -# Setup -# - ---source include/not_embedded.inc - -SET @default_read_only = @@read_only; - ---echo '#--------------------FN_DYNVARS_140_01-------------------------#' -################################### -#Setting Read only value ON # -################################### - -SET Global read_only=ON; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -################################## -# Creating table # -################################## - - -# creating table -CREATE TABLE t1 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name BLOB -); - -################################## -# Inserting values # -################################## - - -INSERT into t1(name) values("aaassssssssddddddddffffff"); - -################################### -# Updating values # -################################### - -update t1 set name="jfjdf" where id=1; - -############################################### -# Select to see wether value is updated or not# -############################################### - -select * from t1 where id=1; - ---echo '#--------------------FN_DYNVARS_140_02-------------------------#' -######################################### -#Creating user without Super privilege # -######################################### - - ---echo ** Creating new user with out super privilege** -CREATE user sameea; ---echo ** Connecting connn using username 'sameea' ** -CONNECT (connn,localhost,sameea,,); - ---Error ER_SPECIFIC_ACCESS_DENIED_ERROR -SET Global read_ONLY=ON; ---Error ER_OPTION_PREVENTS_STATEMENT -CREATE TABLE t2 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name BLOB -); - -# With ps-protocol the error is ER_NO_SUCH_TABLE ---echo not updating values ---Error ER_OPTION_PREVENTS_STATEMENT,ER_NO_SUCH_TABLE -INSERT into t2(name) values("aaassssssssddddddddffffff"); - - ---Error ER_OPTION_PREVENTS_STATEMENT,ER_NO_SUCH_TABLE -UPDATE t2 SET name="samia" where id=1; - ---echo '#--------------------FN_DYNVARS_140_03-------------------------#' - -########################### -# Testing temporary table # -########################### -CREATE TEMPORARY TABLE t3(a int); - ---echo '#--------------------FN_DYNVARS_140_04-------------------------#' -########################### -# Turning read_only OFF # -########################### ---echo ** Connection default ** -connection default; - -SET Global read_only=OFF; ---echo ** Connection connn ** -connection connn; - -CREATE TABLE t2 -( -id INT NOT NULL auto_increment, -PRIMARY KEY (id), -name BLOB -); ---echo updating values -INSERT into t2(name) values("aaassssssssdddddddd"); - -UPDATE t2 SET name="samia" where id=1; - -# -# Cleanup -# ---echo ** Connection default ** -connection default; - ---echo ** Disconnecting connn ** -DISCONNECT connn; - -DROP USER sameea; - -DROP TABLE t1; -DROP TABLE t2; -SET global read_only = @default_read_only; - ---disable_info ---enable_warnings diff --git a/mysql-test/t/read_rnd_buffer_size_basic.test b/mysql-test/t/read_rnd_buffer_size_basic.test deleted file mode 100644 index e3d2a4b89f7..00000000000 --- a/mysql-test/t/read_rnd_buffer_size_basic.test +++ /dev/null @@ -1,209 +0,0 @@ -############## mysql-test\t\read_rnd_buffer_size_basic.test ############### -# # -# Variable Name: read_rnd_buffer_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:262144 # -# Range: 8200-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable read_rnd_buffer_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -###################################################################### -# START OF read_rnd_buffer_size TESTS # -###################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.read_rnd_buffer_size; -SELECT @start_global_value; -SET @start_session_value = @@session.read_rnd_buffer_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_140_01-------------------------#' -###################################################################### -# Display the DEFAULT value of read_rnd_buffer_size # -###################################################################### - -SET @@global.read_rnd_buffer_size = 1000; -SET @@global.read_rnd_buffer_size = DEFAULT; -SELECT @@global.read_rnd_buffer_size; - -SET @@session.read_rnd_buffer_size = 2000; -SET @@session.read_rnd_buffer_size = DEFAULT; -SELECT @@session.read_rnd_buffer_size; - - ---echo '#--------------------FN_DYNVARS_140_02-------------------------#' -###################################################################### -# Check the DEFAULT value of read_rnd_buffer_size # -###################################################################### - -SET @@global.read_rnd_buffer_size = DEFAULT; -SELECT @@global.read_rnd_buffer_size = 262144; - -SET @@session.read_rnd_buffer_size = DEFAULT; -SELECT @@session.read_rnd_buffer_size = 262144; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - - ---echo '#--------------------FN_DYNVARS_140_03-------------------------#' -################################################################################ -# Change the value of read_rnd_buffer_size to a valid value for GLOBAL Scope # -################################################################################ - -SET @@global.read_rnd_buffer_size = 8201; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; -SET @@global.read_rnd_buffer_size = 8200; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; -SET @@global.read_rnd_buffer_size = 2147479552; -SELECT @@global.read_rnd_buffer_size; -SET @@global.read_rnd_buffer_size = 2147479551; -SELECT @@global.read_rnd_buffer_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_140_04-------------------------#' -################################################################################### -# Change the value of read_rnd_buffer_size to a valid value for SESSION Scope # -################################################################################### - -SET @@session.read_rnd_buffer_size = 8200; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; -SET @@session.read_rnd_buffer_size = 8201; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; -SET @@session.read_rnd_buffer_size = 2147479552; -SELECT @@session.read_rnd_buffer_size; -SET @@session.read_rnd_buffer_size = 2147479551; -SELECT @@session.read_rnd_buffer_size; - - ---echo '#------------------FN_DYNVARS_140_05-----------------------#' -################################################################## -# Change the value of read_rnd_buffer_size to an invalid value # -################################################################## - -SET @@global.read_rnd_buffer_size = 8199; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; -SET @@global.read_rnd_buffer_size = -1024; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; -SET @@global.read_rnd_buffer_size = 2147479553; -SELECT @@global.read_rnd_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.read_rnd_buffer_size = 65530.34.; -SELECT @@global.read_rnd_buffer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.read_rnd_buffer_size = test; -SELECT @@global.read_rnd_buffer_size; - -SET @@session.read_rnd_buffer_size = 8199; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; -SET @@session.read_rnd_buffer_size = -2; -SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228; ---Error ER_PARSE_ERROR -SET @@session.read_rnd_buffer_size = 65530.34.; -SET @@session.read_rnd_buffer_size = 2147479553; -SELECT @@session.read_rnd_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.read_rnd_buffer_size = test; -SELECT @@session.read_rnd_buffer_size; - - ---echo '#------------------FN_DYNVARS_140_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.read_rnd_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='read_rnd_buffer_size'; - ---echo '#------------------FN_DYNVARS_140_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.read_rnd_buffer_size = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='read_rnd_buffer_size'; - - ---echo '#------------------FN_DYNVARS_140_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.read_rnd_buffer_size = TRUE; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; -SET @@global.read_rnd_buffer_size = FALSE; -SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228; - - ---echo '#---------------------FN_DYNVARS_140_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.read_rnd_buffer_size = 9000; -SELECT @@read_rnd_buffer_size = @@global.read_rnd_buffer_size; - - ---echo '#---------------------FN_DYNVARS_140_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@read_rnd_buffer_size = 9000; -SELECT @@read_rnd_buffer_size = @@local.read_rnd_buffer_size; -SELECT @@local.read_rnd_buffer_size = @@session.read_rnd_buffer_size; - - ---echo '#---------------------FN_DYNVARS_140_11----------------------#' -################################################################################### -# Check if read_rnd_buffer_size can be accessed with and without @@ sign # -################################################################################### - -SET read_rnd_buffer_size = 9100; -SELECT @@read_rnd_buffer_size= 8200 OR @@read_rnd_buffer_size= 8228; ---Error ER_UNKNOWN_TABLE -SELECT local.read_rnd_buffer_size; ---Error ER_UNKNOWN_TABLE -SELECT session.read_rnd_buffer_size; ---Error ER_BAD_FIELD_ERROR -SELECT read_rnd_buffer_size = @@session.read_rnd_buffer_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.read_rnd_buffer_size = @start_global_value; -SELECT @@global.read_rnd_buffer_size; -SET @@session.read_rnd_buffer_size = @start_session_value; -SELECT @@session.read_rnd_buffer_size; - - -############################################################# -# END OF read_rnd_buffer_size TESTS # -############################################################# diff --git a/mysql-test/t/relay_log_purge_basic.test b/mysql-test/t/relay_log_purge_basic.test deleted file mode 100644 index 7e4d6a51440..00000000000 --- a/mysql-test/t/relay_log_purge_basic.test +++ /dev/null @@ -1,164 +0,0 @@ -############## mysql-test\t\relay_log_purge_basic.test ######################## -# # -# Variable Name: relay_log_purge # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: TRUE # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable relay_log_purge # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_relay_log_purge # -# # -############################################################################### - ---source include/not_embedded.inc ---source include/load_sysvars.inc - -##################################################################### -# START OF relay_log_purge TESTS # -##################################################################### - - -####################################################################### -# Saving initial value of relay_log_purge in a temporary variable # -####################################################################### - -SET @start_value = @@global.relay_log_purge; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_141_01------------------------#' -############################################################# -# Display the DEFAULT value of relay_log_purge # -############################################################# - -SET @@global.relay_log_purge = FALSE; -SET @@global.relay_log_purge = DEFAULT; -SELECT @@global.relay_log_purge; - - ---echo '#---------------------FN_DYNVARS_141_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.relay_log_purge = @start_value; -SELECT @@global.relay_log_purge = TRUE; - - ---echo '#--------------------FN_DYNVARS_141_03------------------------#' -############################################################# -# Change the value of relay_log_purge to a valid value # -############################################################# - -SET @@global.relay_log_purge = ON; -SELECT @@global.relay_log_purge; -SET @@global.relay_log_purge = OFF; -SELECT @@global.relay_log_purge; -SET @@global.relay_log_purge = 0; -SELECT @@global.relay_log_purge; -SET @@global.relay_log_purge = 1; -SELECT @@global.relay_log_purge; -SET @@global.relay_log_purge = TRUE; -SELECT @@global.relay_log_purge; -SET @@global.relay_log_purge = FALSE; -SELECT @@global.relay_log_purge; - ---echo '#--------------------FN_DYNVARS_141_04-------------------------#' -########################################################################### -# Change the value of relay_log_purge to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.relay_log_purge = ''; - - ---echo '#-------------------FN_DYNVARS_141_05----------------------------#' -########################################################################### -# Test if accessing session relay_log_purge gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.relay_log_purge = 1; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.relay_log_purge; - - ---echo '#----------------------FN_DYNVARS_141_06------------------------#' -##################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -##################################################################### - -SELECT @@global.relay_log_purge = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='relay_log_purge'; - ---echo '#---------------------FN_DYNVARS_141_07----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same session variable # -############################################################################### - -SET @@global.relay_log_purge = 1; -SELECT @@relay_log_purge = @@global.relay_log_purge; - - ---echo '#---------------------FN_DYNVARS_141_08----------------------#' -########################################################################## -# Check if relay_log_purge can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET relay_log_purge = 1; ---Error ER_PARSE_ERROR -SET global.relay_log_purge = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.relay_log_purge; ---Error ER_BAD_FIELD_ERROR -SELECT relay_log_purge = @@session.relay_log_purge; - - -############################## -# Restore initial value # -############################## - -SET @@global.relay_log_purge = @start_value; -SELECT @@global.relay_log_purge; - - -############################################################# -# END OF relay_log_purge TESTS # -############################################################# diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index 94a9fda6757..eb2ca7992a6 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -29,7 +29,8 @@ repair table t1 use_frm; create table t1 engine=myisam SELECT 1,"table 1"; flush tables; -system echo 1 > $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; +let $MYSQLD_DATADIR= `select @@datadir`; +system echo 1 > $MYSQLD_DATADIR/test/t1.MYI ; repair table t1; repair table t1 use_frm; drop table t1; @@ -119,9 +120,10 @@ DROP TABLE t1; # --echo # Test with a saved table from 4.1 ---copy_file std_data/bug36055.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm ---copy_file std_data/bug36055.MYD $MYSQLTEST_VARDIR/master-data/test/t1.MYD ---copy_file std_data/bug36055.MYI $MYSQLTEST_VARDIR/master-data/test/t1.MYI +let $MYSQLD_DATADIR= `select @@datadir`; +--copy_file std_data/bug36055.frm $MYSQLD_DATADIR/test/t1.frm +--copy_file std_data/bug36055.MYD $MYSQLD_DATADIR/test/t1.MYD +--copy_file std_data/bug36055.MYI $MYSQLD_DATADIR/test/t1.MYI --replace_column 12 # 13 # SHOW TABLE STATUS LIKE 't1'; diff --git a/mysql-test/t/rpl_init_slave_func-slave.opt b/mysql-test/t/rpl_init_slave_func-slave.opt deleted file mode 100644 index 337e8a60d97..00000000000 --- a/mysql-test/t/rpl_init_slave_func-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---init-slave="set global max_connections=500" diff --git a/mysql-test/t/rpl_init_slave_func.test b/mysql-test/t/rpl_init_slave_func.test deleted file mode 100644 index b3d647f4394..00000000000 --- a/mysql-test/t/rpl_init_slave_func.test +++ /dev/null @@ -1,96 +0,0 @@ -###################### mysql-test\t\init_slave_func.test ##################### -# # -# Variable Name: init_slave # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-03-08 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable init_slave # -# that checks the behavior of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - -source include/master-slave.inc; - ---echo '#--------------------FN_DYNVARS_037_01-------------------------#' -################################################################## -# Check if setting init_slave is changed in every new connection # -################################################################## - -SET @@global.init_slave = "SET @a = 10"; - ---echo 'connect (con1,localhost,root,,)' -connect (con1,localhost,root,,); ---echo 'connection con1' -connection con1; -SELECT @@global.init_slave; -disconnect con1; ---echo 'connection master' -connection master; - ---echo '#--------------------FN_DYNVARS_037_02-------------------------#' -#################################################### -# Begin the functionality Testing of init_slave # -#################################################### - -#==================================================== ---echo 'check if value in slave opt file is executed' -#==================================================== -save_master_pos; ---echo 'connection slave' -connection slave; -sleep 1; -show variables like 'init_slave'; -show variables like 'max_connections'; -sync_with_master; -reset master; - -#=============================================================== ---echo 'check if value in slave opt file doesnt apply to master' -#=============================================================== - ---echo 'connection master' -connection master; -show variables like 'init_slave'; -show variables like 'max_connections'; -save_master_pos; ---echo 'connection slave' -connection slave; -sync_with_master; - -#======================================================= ---echo 'try creating a temporary variable in init_slave' -#======================================================= - -SET @@global.init_slave = "SET @a=5"; - -stop slave; ---wait_for_slave_to_stop -reset slave; -# Clean up old test tables ---disable_warnings -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ---enable_warnings -start slave; - -SHOW VARIABLES LIKE 'init_slave'; -SELECT @a; - ---echo 'Bug#35365 SET statement in init_slave not execute if slave is restarted' - -# Restore value -set global max_connections= default; - -################################################## -# End of functionality Testing for init_slave # -################################################## - diff --git a/mysql-test/t/rpl_max_binlog_size_func-master.opt b/mysql-test/t/rpl_max_binlog_size_func-master.opt deleted file mode 100644 index bff213dfb0b..00000000000 --- a/mysql-test/t/rpl_max_binlog_size_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---log --log-bin=mylog.log - diff --git a/mysql-test/t/rpl_max_binlog_size_func.test b/mysql-test/t/rpl_max_binlog_size_func.test deleted file mode 100644 index df22b253009..00000000000 --- a/mysql-test/t/rpl_max_binlog_size_func.test +++ /dev/null @@ -1,38 +0,0 @@ -source include/have_log_bin.inc; - -############################################################################### -# Begin the functionality testing of max_binlog_size # -############################################################################### ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - - -#============================================================== ---echo '--- check if log file is rotated after 4096 bytes ----' -#============================================================== - -SET @@global.max_binlog_size = 4096; -CREATE TABLE t1(a CHAR(5)); - -# around 50 records are required to rotate bin log -let $a = 50; ---disable_query_log -while ($a){ -INSERT INTO t1 VALUES ('mysql'); -dec $a; -} ---enable_query_log - ---sleep 2 - -# if log file is not created then this will fail ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---file_exists $MYSQLTEST_VARDIR/master-data/mylog.000002 - ---echo 'mylog.000002 exists' - -############################################################################### -# End of functionality testing for max_binlog_size # -############################################################################### - diff --git a/mysql-test/t/secure_auth_basic.test b/mysql-test/t/secure_auth_basic.test deleted file mode 100644 index b52f219097b..00000000000 --- a/mysql-test/t/secure_auth_basic.test +++ /dev/null @@ -1,170 +0,0 @@ -################ mysql-test\t\secure_auth_basic.test ########################## -# # -# Variable Name: secure_auth # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Valid Values: TRUE, FALSE # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable secure_auth # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF secure_auth TESTS # -######################################################################## - - -############################################################################### -# Saving initial value of secure_auth in a temporary variable # -############################################################################### - -SET @global_start_value = @@global.secure_auth; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_143_01------------------------#' -######################################################################## -# Display the DEFAULT value of secure_auth # -######################################################################## - -SET @@global.secure_auth = 1; -SET @@global.secure_auth = DEFAULT; -SELECT @@global.secure_auth; - ---echo '#---------------------FN_DYNVARS_143_02-------------------------#' -############################################################################# -# Check if secure_auth can be accessed with and without @@ sign # -############################################################################# - ---Error ER_GLOBAL_VARIABLE -SET secure_auth = 1; -SELECT @@secure_auth; ---Error ER_UNKNOWN_TABLE -SELECT global.secure_auth; - -SET global secure_auth = 1; -SELECT @@global.secure_auth; - - ---echo '#--------------------FN_DYNVARS_143_03------------------------#' -######################################################################## -# Change the value of secure_auth to a valid value # -######################################################################## - -SET @@global.secure_auth = 0; -SELECT @@global.secure_auth; -SET @@global.secure_auth = 1; -SELECT @@global.secure_auth; - - ---echo '#--------------------FN_DYNVARS_143_04-------------------------#' -########################################################################### -# Change the value of secure_auth to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = YES; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = OOF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = ' 1'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.secure_auth = NO; - - ---echo '#-------------------FN_DYNVARS_143_05----------------------------#' -########################################################################### -# Test if accessing session secure_auth gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.secure_auth = 0; ---Error ER_GLOBAL_VARIABLE -SET @@secure_auth = 0; ---Error ER_GLOBAL_VARIABLE -SET @@local.secure_auth = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.secure_auth; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@local.secure_auth; - ---echo '#----------------------FN_DYNVARS_143_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='secure_auth'; - - ---echo '#----------------------FN_DYNVARS_143_07------------------------#' -######################################################################## -# Check if the value in GLOBAL Table matches value in variable # -######################################################################## - -SELECT @@global.secure_auth = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='secure_auth'; -SELECT @@global.secure_auth; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='secure_auth'; - ---echo '#---------------------FN_DYNVARS_143_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@global.secure_auth = OFF; -SELECT @@global.secure_auth; -SET @@global.secure_auth = ON; -SELECT @@global.secure_auth; - ---echo '#---------------------FN_DYNVARS_143_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.secure_auth = TRUE; -SELECT @@global.secure_auth; -SET @@global.secure_auth = FALSE; -SELECT @@global.secure_auth; - -############################## -# Restore initial value # -############################## - -SET @@global.secure_auth = @global_start_value; -SELECT @@global.secure_auth; - -############################################################### -# END OF secure_auth TESTS # -############################################################### diff --git a/mysql-test/t/secure_auth_func-master.opt b/mysql-test/t/secure_auth_func-master.opt deleted file mode 100644 index 38ba956df15..00000000000 --- a/mysql-test/t/secure_auth_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---secure-auth - diff --git a/mysql-test/t/secure_auth_func.test b/mysql-test/t/secure_auth_func.test deleted file mode 100644 index 10dc383035d..00000000000 --- a/mysql-test/t/secure_auth_func.test +++ /dev/null @@ -1,132 +0,0 @@ -############# mysql-test\t\secure_auth_func.test ########################## -# # -# Variable Name: secure_auth # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Values: TRUE / 1, FALSE / 0 # -# # -# # -# Creation Date: 2008-02-22 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "secure_auth " # -# that checks behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Cache behaviors # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_secure_auth # -# # -########################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - ---source include/not_embedded.inc - -# -# Save initial value -# - -SET @old_secure_auth = @@GLOBAL.secure_auth; - ---echo '#--------------------FN_DYNVARS_144_01-------------------------#' -# -# Testing command line option value -# - -SELECT @@GLOBAL.secure_auth; ---echo 1 / ON Expected - ---echo '#--------------------FN_DYNVARS_144_02-------------------------#' -# -# Value OFF -# -SET GLOBAL secure_auth = OFF; - -# -# Creating user with password in NEW format -# -CREATE USER 'testUser'@'localhost' IDENTIFIED BY 'newpass'; - ---echo ** Connecting con_user1 using testUser ** -connect (con_user1,localhost,testUser,newpass,); - ---echo ** Connection default** -connection default; - -# -# Setting password in OLD format -# -SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass'); - ---echo ** Connecting con_user2 using testUser ** -connect (con_user2,localhost,testUser,newpass,); - ---echo ** Connection default** -connection default; - ---echo '#--------------------FN_DYNVARS_144_03-------------------------#' -# -# Value ON -# -SET GLOBAL secure_auth = ON; - -# -# Setting password in NEW format -# -SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass'); - ---echo ** Connecting con_user3 using testUser ** -connect (con_user3,localhost,testUser,newpass,); ---echo ** Connection default ** -connection default; - -# -# Setting password in OLD format -# -SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass'); - ---echo ** Connecting con_user4 using testUser ** ---disable_query_log ---error ER_SERVER_IS_IN_SECURE_AUTH_MODE -connect (con_user4,localhost,testUser,newpass,); ---enable_query_log ---echo Expected error "Server is in secure auth mode" - ---echo ** Connection default** -connection default; - -# -# Setting password back in NEW format -# -SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass'); - ---echo ** Connecting con_user4 using testUser ** -connect (con_user4,localhost,testUser,newpass,); - ---echo ** Connection default ** -connection default; - -# -# Cleanup -# - -SET GLOBAL secure_auth = @old_secure_auth; - ---echo Disconnecting Connections con_user1, con_user2, con_user3, con_user4 -disconnect con_user1; -disconnect con_user2; -disconnect con_user3; -disconnect con_user4; - -REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testUser'@'localhost'; - -DROP USER 'testUser'@'localhost'; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 30abb797e83..ccdb53ec11f 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3690,6 +3690,42 @@ SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; SHOW STATUS LIKE 'Handler_read%'; DROP TABLE t1, t2; +# +# Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error +# +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', + f2 int(11) NOT NULL default '0', + f3 bigint(20) NOT NULL default '0', + f4 varchar(255) NOT NULL default '', + PRIMARY KEY (f1), + KEY key1 (f4), + KEY key2 (f2)); +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', + f2 enum('A1','A2','A3') NOT NULL default 'A1', + f3 int(11) NOT NULL default '0', + PRIMARY KEY (f1), + KEY key1 (f3)); +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', + f2 datetime NOT NULL default '1980-01-01 00:00:00', + PRIMARY KEY (f1)); + +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); + +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 + JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; + +drop table t1, t2, t3; --echo End of 5.0 tests # @@ -3701,3 +3737,36 @@ SELECT a FROM t1 ORDER BY a LIMIT 2; SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; DROP TABLE t1; + +# +# Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store , +# Field_varstring::store +# + +CREATE TABLE A (date_key date); + +CREATE TABLE C ( + pk int, + int_nokey int, + int_key int, + date_key date NOT NULL, + date_nokey date, + varchar_key varchar(1) +); + +INSERT INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); + +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); + +SELECT COUNT(DISTINCT 1) FROM C + WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +SELECT date_nokey FROM C + WHERE int_key IN (SELECT 1 FROM A) + HAVING date_nokey = '10:41:7' + ORDER BY date_key; + +DROP TABLE A,C; + +--echo End of 5.1 tests diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 765a69aaa5f..116298a9c80 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -422,14 +422,15 @@ DROP TABLE t1; flush tables; # Create a junk frm file on disk -system echo "this is a junk file for test" >> $MYSQLTEST_VARDIR/master-data/test/t1.frm ; +let $MYSQLD_DATADIR= `select @@datadir`; +system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ; --replace_column 6 # 7 # 8 # 9 # SHOW TABLE STATUS like 't1'; --error 1033 show create table t1; drop table if exists t1; --error 1,0 ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm +--remove_file $MYSQLD_DATADIR/test/t1.frm # # BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar diff --git a/mysql-test/t/slave_allow_batching_basic.test b/mysql-test/t/slave_allow_batching_basic.test deleted file mode 100644 index cf31917933a..00000000000 --- a/mysql-test/t/slave_allow_batching_basic.test +++ /dev/null @@ -1,167 +0,0 @@ -############## mysql-test\t\slave_allow_batching_basic.test #################### -# # -# Variable Name: slave_allow_batching # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable slave_allow_batching # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ - ---source include/load_sysvars.inc - -######################################################################## -# START OF slave_allow_batching TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of slave_allow_batching in a temporary variable # -################################################################################ - ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SET @global_start_value = @@global.slave_allow_batching; - ---echo 'Bug: This variable is not supported in mysql version 5.1.22' - ---echo '#--------------------FN_DYNVARS_145_01------------------------#' -######################################################################## -# Display the DEFAULT value of slave_allow_batching # -######################################################################## - -#SET @@global.slave_allow_batching = 1; -#SET @@global.slave_allow_batching = DEFAULT; -#SELECT @@global.slave_allow_batching; - ---echo '#---------------------FN_DYNVARS_145_02-------------------------#' -############################################################################# -# Check if slave_allow_batching can be accessed with and without @@ sign # -############################################################################# - -#--Error ER_GLOBAL_VARIABLE -#SET slave_allow_batching = 1; -#SELECT @@slave_allow_batching; -#--Error ER_UNKNOWN_TABLE -#SELECT global.slave_allow_batching; -# -#SET global slave_allow_batching = 1; -#SELECT @@global.slave_allow_batching; - - ---echo '#--------------------FN_DYNVARS_145_03------------------------#' -######################################################################## -# Change the value of slave_allow_batching to a valid value # -######################################################################## - -#SET @@global.slave_allow_batching = 0; -#SELECT @@global.slave_allow_batching; -#SET @@global.slave_allow_batching = 1; -#SELECT @@global.slave_allow_batching; - - ---echo '#--------------------FN_DYNVARS_145_04-------------------------#' -########################################################################### -# Change the value of slave_allow_batching to invalid value # -########################################################################### - -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = -1; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = 2; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = "T"; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = "Y"; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = YES; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = ONN; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = OOF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = 0FF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = ' 1'; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.slave_allow_batching = NO; - - ---echo '#-------------------FN_DYNVARS_145_05----------------------------#' -########################################################################### -# Test if accessing session slave_allow_batching gives error # -########################################################################### - -#--Error ER_GLOBAL_VARIABLE -#SET @@session.slave_allow_batching = 0; -#--Error ER_GLOBAL_VARIABLE -#SET @@slave_allow_batching = 0; -#--Error ER_GLOBAL_VARIABLE -#SET @@local.slave_allow_batching = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@session.slave_allow_batching; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@local.slave_allow_batching; - ---echo '#----------------------FN_DYNVARS_145_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -#SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching'; - - ---echo '#----------------------FN_DYNVARS_145_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -#SELECT @@global.slave_allow_batching = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching'; -#SELECT @@global.slave_allow_batching; -#SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slave_allow_batching'; -#--echo 'Bug: value in information schema does not match' - ---echo '#---------------------FN_DYNVARS_145_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -#SET @@global.slave_allow_batching = OFF; -#SELECT @@global.slave_allow_batching; -#SET @@global.slave_allow_batching = ON; -#SELECT @@global.slave_allow_batching; - ---echo '#---------------------FN_DYNVARS_145_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -#SET @@global.slave_allow_batching = TRUE; -#SELECT @@global.slave_allow_batching; -#SET @@global.slave_allow_batching = FALSE; -#SELECT @@global.slave_allow_batching; - -############################## -# Restore initial value # -############################## - -#SET @@global.slave_allow_batching = @global_start_value; -#SELECT @@global.slave_allow_batching; - -############################################################### -# END OF slave_allow_batching TESTS # -############################################################### diff --git a/mysql-test/t/slave_compressed_protocol_basic.test b/mysql-test/t/slave_compressed_protocol_basic.test deleted file mode 100644 index 29a3227a8f5..00000000000 --- a/mysql-test/t/slave_compressed_protocol_basic.test +++ /dev/null @@ -1,167 +0,0 @@ -############# mysql-test\t\slave_compressed_protocol_basic.test ############### -# # -# Variable Name: slave_compressed_protocol # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: FALSE # -# Range: TRUE, FALSE # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable slave_compressed_protocol# -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/not_embedded.inc ---source include/load_sysvars.inc -######################################################################## -# START OF slave_compressed_protocol TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of slave_compressed_protocol in a temporary variable # -############################################################################## - -SET @global_start_value = @@global.slave_compressed_protocol; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_147_01------------------------#' -######################################################################## -# Display the DEFAULT value of slave_compressed_protocol # -######################################################################## - -SET @@global.slave_compressed_protocol = 1; -SET @@global.slave_compressed_protocol = DEFAULT; -SELECT @@global.slave_compressed_protocol; - ---echo '#---------------------FN_DYNVARS_147_02-------------------------#' -############################################################################### -# Check if slave_compressed_protocol can be accessed with and without @@ sign # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET slave_compressed_protocol = 1; -SELECT @@slave_compressed_protocol; ---Error ER_UNKNOWN_TABLE -SELECT global.slave_compressed_protocol; - -SET global slave_compressed_protocol = 1; -SELECT @@global.slave_compressed_protocol; - - ---echo '#--------------------FN_DYNVARS_147_03------------------------#' -######################################################################## -# Change the value of slave_compressed_protocol to a valid value # -######################################################################## - -SET @@global.slave_compressed_protocol = 0; -SELECT @@global.slave_compressed_protocol; -SET @@global.slave_compressed_protocol = 1; -SELECT @@global.slave_compressed_protocol; - - ---echo '#--------------------FN_DYNVARS_147_04-------------------------#' -########################################################################### -# Change the value of slave_compressed_protocol to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = "1.00"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = YES; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = ' 1'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slave_compressed_protocol = NO; - - ---echo '#-------------------FN_DYNVARS_147_05----------------------------#' -########################################################################### -# Test if accessing session slave_compressed_protocol gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.slave_compressed_protocol = 0; ---Error ER_GLOBAL_VARIABLE -SET @@slave_compressed_protocol = 0; ---Error ER_GLOBAL_VARIABLE -SET @@local.slave_compressed_protocol = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.slave_compressed_protocol; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@local.slave_compressed_protocol; - ---echo '#----------------------FN_DYNVARS_147_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='slave_compressed_protocol'; - ---echo '#----------------------FN_DYNVARS_147_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.slave_compressed_protocol = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slave_compressed_protocol'; -SELECT @@global.slave_compressed_protocol; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slave_compressed_protocol'; - ---echo '#---------------------FN_DYNVARS_147_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@global.slave_compressed_protocol = OFF; -SELECT @@global.slave_compressed_protocol; -SET @@global.slave_compressed_protocol = ON; -SELECT @@global.slave_compressed_protocol; - ---echo '#---------------------FN_DYNVARS_147_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.slave_compressed_protocol = TRUE; -SELECT @@global.slave_compressed_protocol; -SET @@global.slave_compressed_protocol = FALSE; -SELECT @@global.slave_compressed_protocol; - -############################## -# Restore initial value # -############################## - -SET @@global.slave_compressed_protocol = @global_start_value; -SELECT @@global.slave_compressed_protocol; - -############################################################### -# END OF slave_compressed_protocol TESTS # -############################################################### diff --git a/mysql-test/t/slave_exec_mode_basic.test b/mysql-test/t/slave_exec_mode_basic.test deleted file mode 100644 index 5c5b4e7da1b..00000000000 --- a/mysql-test/t/slave_exec_mode_basic.test +++ /dev/null @@ -1,41 +0,0 @@ -############## mysql-test\t\slave_exec_mode_basic.test ######################### -# # -# Variable Name: slave_exec_mode # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable slave_exec_mode # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ - ---source include/load_sysvars.inc - -######################################################################## -# START OF slave_exec_mode TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of slave_exec_mode in a temporary variable # -######################################################################## -SET @start_value = @@global.slave_exec_mode; ---echo 'This variable is not supported in version 5.1.22. It is introduced in 5.1.24' - -######################################################################## -# END OF slave_exec_mode TESTS # -######################################################################## diff --git a/mysql-test/t/slave_net_timeout_basic.test b/mysql-test/t/slave_net_timeout_basic.test deleted file mode 100644 index 5662eec3957..00000000000 --- a/mysql-test/t/slave_net_timeout_basic.test +++ /dev/null @@ -1,187 +0,0 @@ -################## mysql-test\t\slave_net_timeout_basic.test ################## -# # -# Variable Name: slave_net_timeout # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 3600 # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable slave_net_timeout # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/not_embedded.inc ---source include/load_sysvars.inc -########################################################### -# START OF slave_net_timeout TESTS # -########################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.slave_net_timeout; -SELECT @start_global_value; - ---echo '#--------------------FN_DYNVARS_146_01-------------------------#' -########################################################### -# Display the DEFAULT value of slave_net_timeout # -########################################################### - -SET @@global.slave_net_timeout = 500000; -SET @@global.slave_net_timeout = DEFAULT; -SELECT @@global.slave_net_timeout; - ---echo '#--------------------FN_DYNVARS_146_02-------------------------#' -############################################################ -# Check the DEFAULT value of slave_net_timeout # -############################################################ - -SET @@global.slave_net_timeout = DEFAULT; -SELECT @@global.slave_net_timeout = 3600; - ---echo '#--------------------FN_DYNVARS_146_03-------------------------#' -########################################################################### -# Change the value of slave_net_timeout to a valid value for GLOBAL Scope # -########################################################################### - -SET @@global.slave_net_timeout = 0; -SELECT @@global.slave_net_timeout; -SET @@global.slave_net_timeout = 1; -SELECT @@global.slave_net_timeout; -SET @@global.slave_net_timeout = 15; -SELECT @@global.slave_net_timeout; -SET @@global.slave_net_timeout = 1024; -SELECT @@global.slave_net_timeout; -SET @@global.slave_net_timeout = 3600+1; -SELECT @@global.slave_net_timeout; -SET @@global.slave_net_timeout = 2147483648; -SELECT @@global.slave_net_timeout; -SET @@global.slave_net_timeout = 2147483648*2-1; -SELECT @@global.slave_net_timeout; - - ---echo '#--------------------FN_DYNVARS_146_04-------------------------#' -############################################################################### -# Check if variable can be access with session scope # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@slave_net_timeout = 2; - ---Error ER_GLOBAL_VARIABLE -SET @@session.slave_net_timeout = 3; - ---Error ER_GLOBAL_VARIABLE -SET @@local.slave_net_timeout = 4; - - - ---echo '#------------------FN_DYNVARS_146_05-----------------------#' -############################################################# -# Change the value of slave_net_timeout to an invalid value # -############################################################# - -SET @@global.slave_net_timeout = -1; -SELECT @@global.slave_net_timeout; - -SET @@global.slave_net_timeout = -2147483648; -SELECT @@global.slave_net_timeout; - -SET @@global.slave_net_timeout = 2147483649*2; -SELECT @@global.slave_net_timeout; - ---Error ER_PARSE_ERROR -SET @@global.slave_net_timeout = 65530.34.; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slave_net_timeout = 100s; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slave_net_timeout = 7483649.56; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slave_net_timeout = 0.6; - ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#------------------FN_DYNVARS_146_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SET @@global.slave_net_timeout = 3000; -SELECT @@global.slave_net_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slave_net_timeout'; - - ---echo '#------------------FN_DYNVARS_146_07-----------------------#' -########################################################################### -# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # -########################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='slave_net_timeout'; - - ---echo '#------------------FN_DYNVARS_146_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.slave_net_timeout = TRUE; -SELECT @@global.slave_net_timeout; -SET @@global.slave_net_timeout = FALSE; -SELECT @@global.slave_net_timeout; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -############################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -############################################################################### - - -SET @@global.slave_net_timeout = 60*60; -SELECT @@slave_net_timeout = @@global.slave_net_timeout; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -########################################################################## -# Check if slave_net_timeout can be accessed without @@ sign and scope # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET slave_net_timeout = 2048; ---Error ER_BAD_FIELD_ERROR -SELECT slave_net_timeout; - -SELECT @@slave_net_timeout; - -#verifying another another syntax for setting value -SET global slave_net_timeout = 99; - -#################################### -# Restore initial value # -#################################### - -SET @@global.slave_net_timeout = @start_global_value; -SELECT @@global.slave_net_timeout; - -################################################ -# END OF slave_net_timeout TESTS # -################################################ - diff --git a/mysql-test/t/slow_launch_time_basic.test b/mysql-test/t/slow_launch_time_basic.test deleted file mode 100644 index 6289a91abb3..00000000000 --- a/mysql-test/t/slow_launch_time_basic.test +++ /dev/null @@ -1,177 +0,0 @@ -############## mysql-test\t\slow_launch_time_basic.test ############### -# # -# Variable Name: slow_launch_time # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 2 # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable slow_launch_time # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF slow_launch_time TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of slow_launch_time in a temporary variable # -######################################################################## - -SET @start_value = @@global.slow_launch_time; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_150_01------------------------#' -######################################################################## -# Display the DEFAULT value of slow_launch_time # -######################################################################## - -SET @@global.slow_launch_time = 99; -SET @@global.slow_launch_time = DEFAULT; -SELECT @@global.slow_launch_time; - - ---echo '#---------------------FN_DYNVARS_150_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.slow_launch_time = @start_value; -SELECT @@global.slow_launch_time = 2; - - ---echo '#--------------------FN_DYNVARS_150_03------------------------#' -######################################################################## -# Change the value of slow_launch_time to a valid value # -######################################################################## - -SET @@global.slow_launch_time = 0; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = 1; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = 31536000; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = 31535999; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = 65536; -SELECT @@global.slow_launch_time; - ---echo '#--------------------FN_DYNVARS_150_04-------------------------#' -########################################################################### -# Change the value of slow_launch_time to invalid value # -########################################################################### - -SET @@global.slow_launch_time = -1; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = 31536001; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = 10240022115; -SELECT @@global.slow_launch_time; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slow_launch_time = 10000.01; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = -1024; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = 42949672950; -SELECT @@global.slow_launch_time; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slow_launch_time = ON; -SELECT @@global.slow_launch_time; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slow_launch_time = 'test'; -SELECT @@global.slow_launch_time; - - ---echo '#-------------------FN_DYNVARS_150_05----------------------------#' -########################################################################### -# Test if accessing session slow_launch_time gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.slow_launch_time = 0; -SELECT @@slow_launch_time; - - ---echo '#----------------------FN_DYNVARS_150_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.slow_launch_time = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slow_launch_time'; - -SELECT @@slow_launch_time = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='slow_launch_time'; - - ---echo '#---------------------FN_DYNVARS_150_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.slow_launch_time = TRUE; -SELECT @@global.slow_launch_time; -SET @@global.slow_launch_time = FALSE; -SELECT @@global.slow_launch_time; - - ---echo '#---------------------FN_DYNVARS_150_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.slow_launch_time = 1; -SELECT @@slow_launch_time = @@global.slow_launch_time; - - ---echo '#---------------------FN_DYNVARS_150_09----------------------#' -########################################################################## -# Check if slow_launch_time can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET slow_launch_time = 1; -SELECT @@slow_launch_time; ---Error ER_PARSE_ERROR -SET local.slow_launch_time = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.slow_launch_time; ---Error ER_PARSE_ERROR -SET global.slow_launch_time = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.slow_launch_time; ---Error ER_BAD_FIELD_ERROR -SELECT slow_launch_time = @@session.slow_launch_time; - - -############################## -# Restore initial value # -############################## - -SET @@global.slow_launch_time = @start_value; -SELECT @@global.slow_launch_time; - - -######################################################################## -# END OF slow_launch_time TESTS # -######################################################################## diff --git a/mysql-test/t/slow_launch_time_func.test b/mysql-test/t/slow_launch_time_func.test deleted file mode 100644 index c9a7d28bb8a..00000000000 --- a/mysql-test/t/slow_launch_time_func.test +++ /dev/null @@ -1,104 +0,0 @@ -############# mysql-test\t\slow_launch_time_func.test ########################## -# # -# Variable Name: slow_launch_time # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: NUMERIC # -# Default Value: 2 # -# Values: - # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Last change: 2008-09-09 mleich Reimplementation of this test # -# - Fix Bug#36874 : main.slow_launch_time_func test fails # -# randomly # -# - Fix other failures and streamline the test # -# # -# Description: Test Cases of Dynamic System Variable "slow_launch_time " # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: # -# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # -# option_mysqld_slow_launch_time # -# # -################################################################################ - -# -# Setup -# - ---source include/not_embedded.inc - -SET @global_slow_launch_time = @@GLOBAL.slow_launch_time; - ---echo ** Connection default ** -connection default; - ---echo '#--------------------FN_DYNVARS_124_01-------------------------#' - -######################################################################## -# Reveal that a new connect gets counted as "slow launched thread" if # -# @@GLOBAL.slow_launch_time = 0. # -# The value of slow_launch_threads must be increased by 1. # -######################################################################## - -SET @@GLOBAL.slow_launch_time=0; -SELECT @@GLOBAL.slow_launch_time; - -let $value_before= - query_get_value(show status like 'slow_launch_threads', Value, 1); ---echo ** Connecting conn1 using username 'root' ** -CONNECT (conn1,localhost,root,,); -let $value_after= - query_get_value(show status like 'slow_launch_threads', Value, 1); -if (!`SELECT $value_after = $value_before + 1`) -{ - --echo ERROR: Subtest FN_DYNVARS_124_01 failed - --echo A new connect should be counted as 'slow_launch_thread' if - --echo @@GLOBAL.slow_launch_time=0 - SELECT @@GLOBAL.slow_launch_time; - echo Number of slow_launch_threads before new connect: $value_before; - echo Number of slow_launch_threads after new connect: $value_after; -} ---echo ** Switch to connection default and disconnect conn1 ** -connection default; -disconnect conn1; - ---echo '#--------------------FN_DYNVARS_124_02-------------------------#' - -######################################################################## -# Reveal that a new connect gets not counted as "slow launched thread" # -# if @@GLOBAL.slow_launch_time is sufficient big. # -# The value of slow_launch_threads must not change. # -######################################################################## - -SET @@GLOBAL.slow_launch_time= 1000; -SELECT @@GLOBAL.slow_launch_time; - -let $value_before= - query_get_value(show status like 'slow_launch_threads', Value, 1); ---echo ** Connecting conn2 using username 'root' ** -CONNECT (conn2,localhost,root,,); -let $value_after= - query_get_value(show status like 'slow_launch_threads', Value, 1); -if (!`SELECT $value_after = $value_before`) -{ - --echo ERROR: Subtest FN_DYNVARS_124_02 failed - --echo A new connect must not be counted as 'slow_launch_thread' if - --echo @@GLOBAL.slow_launch_time is sufficient big. - SELECT @@GLOBAL.slow_launch_time; - echo Number of slow_launch_threads before new connect: $value_before; - echo Number of slow_launch_threads after new connect: $value_after; -} - -# -# Cleanup -# - ---echo ** Switch to connection default and disconnect conn2 ** -connection default; -disconnect conn2; -SET @@GLOBAL.slow_launch_time = @global_slow_launch_time; diff --git a/mysql-test/t/slow_query_log_basic.test b/mysql-test/t/slow_query_log_basic.test deleted file mode 100644 index 3a1b2fbd9e7..00000000000 --- a/mysql-test/t/slow_query_log_basic.test +++ /dev/null @@ -1,170 +0,0 @@ -##################### mysql-test\t\slow_query_log_basic.test ################### -# # -# Variable Name: slow_query_log # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: OFF # -# Valid Values: ON, OFF # -# # -# # -# Creation Date: 2008-03-16 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "slow_query_log" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-options.html#option_mysqld_event-scheduler # -# # -################################################################################ - ---source include/load_sysvars.inc - -########################################################### -# START OF slow_query_log TESTS # -########################################################### - - -###################################################################### -# Saving initial value of slow_query_log in a temporary variable # -###################################################################### - -SET @start_value = @@global.slow_query_log; -SELECT @start_value; - - ---echo '#---------------------FN_DYNVARS_004_01-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.slow_query_log = DEFAULT; -SELECT @@global.slow_query_log = 0; - - ---echo '#--------------------FN_DYNVARS_004_02------------------------#' -###################################################################### -# Change the value of slow_query_log to a valid value # -###################################################################### - -SET @@global.slow_query_log = ON; -SELECT @@global.slow_query_log; -SET @@global.slow_query_log = OFF; -SELECT @@global.slow_query_log; - ---echo '#--------------------FN_DYNVARS_004_03-------------------------#' -###################################################################### -# Change the value of slow_query_log to invalid value # -###################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.slow_query_log = ''; - - ---echo '#-------------------FN_DYNVARS_004_04----------------------------#' -################################################################## -# Test if accessing session slow_query_log gives error # -################################################################## - ---Error ER_GLOBAL_VARIABLE -SET @@session.slow_query_log = OFF; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.slow_query_log; - - ---echo '#----------------------FN_DYNVARS_004_05------------------------#' -############################################################################## -# Check if the value in GLOBAL Tables matches values in variable # -############################################################################## - -SELECT @@global.slow_query_log = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slow_query_log'; - - ---echo '#---------------------FN_DYNVARS_004_06----------------------#' -################################################################ -# Check if 0 and 1 values can be used on variable # -################################################################ - -SET @@global.slow_query_log = 0; -SELECT @@global.slow_query_log; -SET @@global.slow_query_log = 1; -SELECT @@global.slow_query_log; - ---echo '#---------------------FN_DYNVARS_004_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.slow_query_log = TRUE; -SELECT @@global.slow_query_log; -SET @@global.slow_query_log = FALSE; -SELECT @@global.slow_query_log; - ---echo '#---------------------FN_DYNVARS_004_08----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@global.slow_query_log = ON; -SELECT @@slow_query_log = @@global.slow_query_log; - ---echo '#---------------------FN_DYNVARS_004_09----------------------#' -###################################################################### -# Check if slow_query_log can be accessed with and without @@ sign # -###################################################################### ---Error ER_GLOBAL_VARIABLE -SET slow_query_log = ON; ---Error ER_PARSE_ERROR -SET local.slow_query_log = OFF; ---Error ER_UNKNOWN_TABLE -SELECT local.slow_query_log; ---Error ER_PARSE_ERROR -SET global.slow_query_log = ON; ---Error ER_UNKNOWN_TABLE -SELECT global.slow_query_log; ---Error ER_BAD_FIELD_ERROR -SELECT slow_query_log = @@session.slow_query_log; - - - -############################## -# Restore initial value # -############################## - -SET @@global.slow_query_log = @start_value; -SELECT @@global.slow_query_log; - - -#################################################### -# END OF slow_query_log TESTS # -#################################################### diff --git a/mysql-test/t/slow_query_log_file_basic-master.opt b/mysql-test/t/slow_query_log_file_basic-master.opt deleted file mode 100644 index aca191f7fea..00000000000 --- a/mysql-test/t/slow_query_log_file_basic-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-slow-queries=slowtest.log diff --git a/mysql-test/t/slow_query_log_file_basic.test b/mysql-test/t/slow_query_log_file_basic.test deleted file mode 100644 index 2620cd5eabc..00000000000 --- a/mysql-test/t/slow_query_log_file_basic.test +++ /dev/null @@ -1,72 +0,0 @@ -################### mysql-test\t\slow_query_log_file_basic.test ################ -# # -# Variable Name: slow_query_log_file # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Filename # -# Default Value: host_name-slow.log # -# Valid Values: # -# # -# # -# Creation Date: 2008-03-16 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "slow_query_log_file" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_slow_query_log_file # -# # -################################################################################ - ---source include/load_sysvars.inc - -########################################################### -# START OF slow_query_log_file TESTS # -########################################################### - - -########################################################################### -# Saving initial value of slow_query_log_file in a temporary variable # -########################################################################### - -SET @start_value = @@global.slow_query_log_file; -SELECT @start_value; - - ---echo '#---------------------FN_DYNVARS_004_01-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.slow_query_log_file = DEFAULT; -SELECT RIGHT(@@global.slow_query_log_file,15); - - ---echo '#--------------------FN_DYNVARS_004_02------------------------#' -####################################################################### -# Change the value of slow_query_log_file to a invalid value # -####################################################################### - -# Assumed text if no quotes or numbers. -SET @@global.slow_query_log_file = mytest.log; ---error ER_WRONG_TYPE_FOR_VAR -SET @@global.slow_query_log_file = 12; - ---echo '#----------------------FN_DYNVARS_004_03------------------------#' -############################################################################## -# Check if the value in GLOBAL Tables matches values in variable # -############################################################################## - -SELECT @@global.slow_query_log_file = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slow_query_log_file'; - - -##################################################### -# END OF slow_query_log_file TESTS # -##################################################### diff --git a/mysql-test/t/slow_query_log_file_func-master.opt b/mysql-test/t/slow_query_log_file_func-master.opt deleted file mode 100644 index e5b1c0948b0..00000000000 --- a/mysql-test/t/slow_query_log_file_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---log-slow-queries=my_slow_test.log - diff --git a/mysql-test/t/slow_query_log_file_func.test b/mysql-test/t/slow_query_log_file_func.test deleted file mode 100644 index 519932b34b0..00000000000 --- a/mysql-test/t/slow_query_log_file_func.test +++ /dev/null @@ -1,32 +0,0 @@ -########### mysql-test\t\slow_query_log_file_func.test ######################### -# # -# Variable Name: slow_query_log_file # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Boolean # -# Default Value: OFF # -# Valid Values: ON, OFF # -# # -# # -# Creation Date: 2008-03-17 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "slow_query_log_file" # -# that checks functionality of this variable # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_slow_query_log_file # -# # -################################################################################ - - ---echo '#--------------------FN_DYNVARS_018_01-------------------------#' -#################################################################### -# Verifying log file after setting it in opt file # -#################################################################### - ---echo ## --file_exists var/master-data/my_slow_test.log ## ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---file_exists $MYSQLTEST_VARDIR/master-data/my_slow_test.log - ---echo ## This case should pass because we have set this filename in opt file ## diff --git a/mysql-test/t/slow_query_log_func.test b/mysql-test/t/slow_query_log_func.test deleted file mode 100644 index 9bcbeb14fd7..00000000000 --- a/mysql-test/t/slow_query_log_func.test +++ /dev/null @@ -1,39 +0,0 @@ - -# save -SET @global_slow_query_log = @@global.slow_query_log; -SET @global_log_output = @@global.log_output; -############################################################################### -# Begin the functionality testing for slow_query_log # -############################################################################### - -SET @@session.long_query_time=1; - -SET @@global.log_output = 'TABLE'; - -#========================================= ---echo '----When slow_query_log = OFF----' -#========================================= - -SET @@global.slow_query_log = OFF; -TRUNCATE mysql.slow_log; -SELECT sleep(2); - -SELECT count(*) FROM mysql.slow_log; - -#========================================= ---echo '----When slow_query_log = ON-----' -#========================================= - -SET @@global.slow_query_log = ON; -TRUNCATE mysql.slow_log; -SELECT sleep(2); - -SELECT count(*) FROM mysql.slow_log; - -#restore -SET @@global.log_output = @global_log_output; -SET @global.slow_query_log = @global_slow_query_log; - -############################################################################### -# End of the functionality test for slow_query_log # -############################################################################### diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 56d99c4435c..14c38a2fdb4 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -13,9 +13,10 @@ -- source include/not_embedded.inc # Backup proc table ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD ---copy_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI +let $MYSQLD_DATADIR= `select @@datadir`; +--copy_file $MYSQLD_DATADIR/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm +--copy_file $MYSQLD_DATADIR/mysql/proc.MYD $MYSQLTEST_VARDIR/tmp/proc.MYD +--copy_file $MYSQLD_DATADIR/mysql/proc.MYI $MYSQLTEST_VARDIR/tmp/proc.MYI use test; @@ -50,8 +51,8 @@ insert into t1 values (0); flush table mysql.proc; # Thrashing the .frm file ---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm ---write_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm +--remove_file $MYSQLD_DATADIR/mysql/proc.frm +--write_file $MYSQLD_DATADIR/mysql/proc.frm saljdfa EOF --replace_result $MYSQLTEST_VARDIR . master-data// '' '\\' '/' @@ -67,9 +68,9 @@ insert into t1 values (0); flush table mysql.proc; # Drop the mysql.proc table ---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm ---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD ---remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI +--remove_file $MYSQLD_DATADIR/mysql/proc.frm +--remove_file $MYSQLD_DATADIR/mysql/proc.MYD +--remove_file $MYSQLD_DATADIR/mysql/proc.MYI --error ER_NO_SUCH_TABLE call bug14233(); --error ER_NO_SUCH_TABLE @@ -78,9 +79,9 @@ create view v1 as select bug14233_f(); insert into t1 values (0); # Restore mysql.proc ---copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLTEST_VARDIR/master-data/mysql/proc.frm ---copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLTEST_VARDIR/master-data/mysql/proc.MYD ---copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLTEST_VARDIR/master-data/mysql/proc.MYI +--copy_file $MYSQLTEST_VARDIR/tmp/proc.frm $MYSQLD_DATADIR/mysql/proc.frm +--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYD $MYSQLD_DATADIR/mysql/proc.MYD +--copy_file $MYSQLTEST_VARDIR/tmp/proc.MYI $MYSQLD_DATADIR/mysql/proc.MYI --remove_file $MYSQLTEST_VARDIR/tmp/proc.frm --remove_file $MYSQLTEST_VARDIR/tmp/proc.MYD --remove_file $MYSQLTEST_VARDIR/tmp/proc.MYI @@ -152,5 +153,5 @@ drop function bug14233_1; drop function bug14233_2; drop procedure bug14233_3; # Assert: These should show nothing. -show procedure status; -show function status; +show procedure status where db=DATABASE(); +show function status where db=DATABASE(); diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 5437f3a156f..8d7c6d75a34 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -6,6 +6,10 @@ drop table if exists t1, t2; --enable_warnings +# Backup the mysql.proc table +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval SELECT * FROM mysql.proc INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/proc.txt'; + # Make sure we don't have any procedures left. delete from mysql.proc; @@ -2425,3 +2429,9 @@ delimiter ;$$ #--enable_warnings #create procedure bugNNNN... #create function bugNNNN... + +# +# CLEANUP and RESTORE +# +LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc; +remove_file $MYSQLTEST_VARDIR/tmp/proc.txt; diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 91de14116d4..b372c05b6e3 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -243,11 +243,11 @@ disconnect con2user1; disconnect con3anon; disconnect con4user2; use test; -select type,db,name from mysql.proc; +select type,db,name from mysql.proc where db like 'db%'; drop database db1_secret; drop database db2; # Make sure the routines are gone -select type,db,name from mysql.proc; +select type,db,name from mysql.proc where db like 'db%'; # Get rid of the users delete from mysql.user where user='user1' or user='user2'; delete from mysql.user where user='' and host='%'; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 05bccae67aa..d57fe777953 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -703,7 +703,7 @@ drop procedure into_test4| --disable_warnings drop procedure if exists into_outfile| --enable_warnings ---replace_result $MYSQLTEST_VARDIR .. +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create procedure into_outfile(x char(16), y int) begin insert into test.t1 values (x, y); @@ -722,7 +722,7 @@ drop procedure into_outfile| --disable_warnings drop procedure if exists into_dumpfile| --enable_warnings ---replace_result $MYSQLTEST_VARDIR .. +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval create procedure into_dumpfile(x char(16), y int) begin insert into test.t1 values (x, y); @@ -1540,7 +1540,7 @@ begin end| show create procedure opp| --replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' -show procedure status like '%p%'| +show procedure status where name like '%p%' and db='test'| # This isn't the fastest way in the world to compute prime numbers, so # don't be too ambitious. ;-) @@ -1558,7 +1558,7 @@ drop table t3| drop procedure opp| drop procedure ip| --replace_column 4 'root@localhost' 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' -show procedure status like '%p%'| +show procedure status where name like '%p%' and db='test'| # Fibonacci, for recursion test. (Yet Another Numerical series :) @@ -2280,7 +2280,7 @@ drop procedure if exists bug2267_1| --enable_warnings create procedure bug2267_1() begin - show procedure status; + show procedure status where db='test'; end| --disable_warnings @@ -2288,7 +2288,7 @@ drop procedure if exists bug2267_2| --enable_warnings create procedure bug2267_2() begin - show function status; + show function status where db='test'; end| --disable_warnings @@ -5261,9 +5261,9 @@ drop procedure if exists bug13012| create procedure bug13012() BEGIN REPAIR TABLE t1; - BACKUP TABLE t1 to '../tmp'; + BACKUP TABLE t1 to '../../tmp'; DROP TABLE t1; - RESTORE TABLE t1 FROM '../tmp'; + RESTORE TABLE t1 FROM '../../tmp'; END| call bug13012()| --enable_warnings diff --git a/mysql-test/t/sql_auto_is_null_basic.test b/mysql-test/t/sql_auto_is_null_basic.test deleted file mode 100644 index a843b88bf85..00000000000 --- a/mysql-test/t/sql_auto_is_null_basic.test +++ /dev/null @@ -1,101 +0,0 @@ - - -################## mysql-test\t\sql_auto_is_null_basic.test ################### -# # -# Variable Name: sql_auto_is_null # -# Scope: Session # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable sql_auto_is_null # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_044_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### - -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected - ---echo '#---------------------BS_STVARS_044_02----------------------#' -# -# Test case for Bug #35433 -# -#################################################################### -# Check if Value can set # -#################################################################### - - -#--error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@SESSION.sql_auto_is_null=1; ---ECHO "BUG:It should give error on setting this variable as it is readonly variable" ---echo Expected error 'Read only variable' - -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_044_03----------------------#' -################################################################# -# Check if the value in SESSION Table matches value in variable # -################################################################# - -SELECT @@SESSION.sql_auto_is_null = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_auto_is_null'; ---echo 1 Expected - -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_auto_is_null'; ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_044_04----------------------#' -################################################################################ -# Check if accessing variable with and without SESSION point to same variable # -################################################################################ -SELECT @@sql_auto_is_null = @@SESSION.sql_auto_is_null; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_044_05----------------------#' -################################################################################ -# Check if sql_auto_is_null can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@sql_auto_is_null); ---echo 1 Expected -SELECT COUNT(@@local.sql_auto_is_null); ---echo 1 Expected -SELECT COUNT(@@SESSION.sql_auto_is_null); ---echo 1 Expected - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@GLOBAL.sql_auto_is_null); ---echo Expected error 'Variable is a SESSION variable' - ---error ER_BAD_FIELD_ERROR -SELECT COUNT(sql_auto_is_null = @@GLOBAL.sql_auto_is_null); ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/sql_big_selects_basic.test b/mysql-test/t/sql_big_selects_basic.test deleted file mode 100644 index dd83a19230a..00000000000 --- a/mysql-test/t/sql_big_selects_basic.test +++ /dev/null @@ -1,174 +0,0 @@ -############## mysql-test\t\sql_big_selects_basic.test ######################## -# # -# Variable Name: sql_big_selects # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_big_selects # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF sql_big_selects TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of sql_big_selects in a temporary variable # -################################################################################ - -SET @session_start_value = @@session.sql_big_selects; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_153_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_big_selects # -######################################################################## - -SET @@session.sql_big_selects = 0; -SET @@session.sql_big_selects = DEFAULT; -SELECT @@session.sql_big_selects; - - ---echo '#---------------------FN_DYNVARS_153_02-------------------------#' -############################################################################# -# Check if sql_big_selects can be accessed with and without @@ sign # -############################################################################# - -SET sql_big_selects = 1; -SELECT @@sql_big_selects; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_big_selects; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_big_selects; - -SET session sql_big_selects = 0; -SELECT @@session.sql_big_selects; - - ---echo '#--------------------FN_DYNVARS_153_03------------------------#' -##################################################################### -# change the value of sql_big_selects to a valid value # -##################################################################### - -SET @@session.sql_big_selects = 0; -SELECT @@session.sql_big_selects; -SET @@session.sql_big_selects = 1; -SELECT @@session.sql_big_selects; - - ---echo '#--------------------FN_DYNVARS_153_04-------------------------#' -######################################################################## -# Change the value of sql_big_selects to invalid value # -######################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = ÕN; - -SET @@session.sql_big_selects = OF; -SELECT @@session.sql_big_selects; - ---echo 'Bug # 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_selects = NO; - - ---echo '#-------------------FN_DYNVARS_153_05----------------------------#' -######################################################################## -# Test if accessing global sql_big_selects gives error # -######################################################################## - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_big_selects = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_big_selects; - ---echo '#----------------------FN_DYNVARS_153_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_big_selects'; - ---echo '#----------------------FN_DYNVARS_153_07------------------------#' -######################################################################## -# Check if the value in GLOBAL Table matches value in variable # -######################################################################## - -SELECT @@session.sql_big_selects = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_big_selects'; -SELECT @@session.sql_big_selects; - -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_big_selects'; - ---echo '#---------------------FN_DYNVARS_153_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_big_selects = OFF; -SELECT @@session.sql_big_selects; -SET @@session.sql_big_selects = ON; -SELECT @@session.sql_big_selects; - ---echo '#---------------------FN_DYNVARS_153_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_big_selects = TRUE; -SELECT @@session.sql_big_selects; -SET @@session.sql_big_selects = FALSE; -SELECT @@session.sql_big_selects; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_big_selects = @session_start_value; -SELECT @@session.sql_big_selects; - -############################################################ -# END OF sql_big_selects TESTS # -############################################################ - diff --git a/mysql-test/t/sql_big_selects_func.test b/mysql-test/t/sql_big_selects_func.test deleted file mode 100644 index 4aefda5e15e..00000000000 --- a/mysql-test/t/sql_big_selects_func.test +++ /dev/null @@ -1,133 +0,0 @@ -############# mysql-test\t\sql_big_selects_func.test ###################### -# # -# Variable Name: sql_big_selects # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_big_selects" # -# that checks behavior of this variable in the following ways# -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -########################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @session_sql_big_selects = @@SESSION.sql_big_selects; -SET @session_max_join_size = @@SESSION.max_join_size; -SET @global_max_join_size = @@GLOBAL.max_join_size; -SET SQL_MAX_JOIN_SIZE=9; - -# -# Create tables -# - -CREATE TEMPORARY TABLE t1(a varchar(20) not null, b varchar(20)); -CREATE TEMPORARY TABLE t2(a varchar(20) null, b varchar(20)); - -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa1','bb'); -INSERT INTO t1 VALUES('aa2','bb'); -INSERT INTO t1 VALUES('aa3','bb'); -INSERT INTO t1 VALUES('aa4','bb'); - -INSERT INTO t2 VALUES('aa','bb'); -INSERT INTO t2 VALUES('aa1','bb'); -INSERT INTO t2 VALUES('aa2','bb'); -INSERT INTO t2 VALUES('aa3','bb'); -INSERT INTO t2 VALUES('aa4','bb'); - ---echo '#--------------------FN_DYNVARS_154_01-------------------------#' -# -# Testing fail condition -# - ---echo Expected error "Too big select" ---error ER_TOO_BIG_SELECT -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo Expected error The SELECT would examine more than MAX_JOIN_SIZE rows. - ---echo '#--------------------FN_DYNVARS_154_02-------------------------#' -# -# Testing pass conditions -# - -SET SESSION SQL_BIG_SELECTS = 1; - -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo This should work - -SET SESSION SQL_BIG_SELECTS = 0; - -DELETE FROM t2 WHERE a = 'aa4'; -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo This should work - ---echo '#--------------------FN_DYNVARS_154_03-------------------------#' -# -# Session data integrity check -# - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; - -SELECT @@SESSION.sql_big_selects; ---echo 1 Expected -SET SESSION sql_big_selects = 0; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; - -SELECT @@SESSION.sql_big_selects; ---echo 1 Expected - -SET SESSION sql_big_selects = 1; - ---echo ** Connection con_int1 ** -connection con_int1; - -SELECT @@SESSION.sql_big_selects; ---echo 0 Expected - ---echo ** Connection con_int2 ** -connection con_int2; - -SELECT @@SESSION.sql_big_selects; ---echo 1 Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - -# -# Cleanup -# - - -SET @@SESSION.sql_big_selects = @session_sql_big_selects; -SET @@SESSION.max_join_size = @session_max_join_size; -SET @@GLOBAL.max_join_size = @global_max_join_size; - -DROP TABLE t1; -DROP TABLE t2; diff --git a/mysql-test/t/sql_big_tables_basic.test b/mysql-test/t/sql_big_tables_basic.test deleted file mode 100644 index 4e3dbdc9504..00000000000 --- a/mysql-test/t/sql_big_tables_basic.test +++ /dev/null @@ -1,175 +0,0 @@ -###################### mysql-test\t\sql_big_tables_basic.test ################# -# # -# Variable Name: sql_big_tables # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Valid Values : 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_big_tables # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF sql_big_tables TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of sql_big_tables in a temporary variable # -############################################################################## - -SET @session_start_value = @@session.sql_big_tables; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_154_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_big_tables # -######################################################################## - -SET @@session.sql_big_tables = 0; -SET @@session.sql_big_tables = DEFAULT; -SELECT @@session.sql_big_tables; - -SET @@session.sql_big_tables = 1; -SET @@session.sql_big_tables = DEFAULT; -SELECT @@session.sql_big_tables; - - ---echo '#---------------------FN_DYNVARS_154_02-------------------------#' -############################################################################# -# Check if sql_big_tables can be accessed with and without @@ sign # -############################################################################# - -SET sql_big_tables = 1; -SELECT @@sql_big_tables; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_big_tables; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_big_tables; - -SET session sql_big_tables = 0; -SELECT @@session.sql_big_tables; - - ---echo '#--------------------FN_DYNVARS_154_03------------------------#' -######################################################################## -# change the value of sql_big_tables to a valid value # -######################################################################## - -SET @@session.sql_big_tables = 0; -SELECT @@session.sql_big_tables; -SET @@session.sql_big_tables = 1; -SELECT @@session.sql_big_tables; - - ---echo '#--------------------FN_DYNVARS_154_04-------------------------#' -########################################################################### -# Change the value of sql_big_tables to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = ÕN; - -SET @@session.sql_big_tables = OF; -SELECT @@session.sql_big_tables; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_big_tables = NO; - - ---echo '#-------------------FN_DYNVARS_154_05----------------------------#' -########################################################################### -# Test if accessing global sql_big_tables gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_big_tables = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_big_tables; - ---echo '#----------------------FN_DYNVARS_154_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_big_tables'; - ---echo '#----------------------FN_DYNVARS_154_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_big_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_big_tables'; -SELECT @@session.sql_big_tables; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_big_tables'; - ---echo '#---------------------FN_DYNVARS_154_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_big_tables = OFF; -SELECT @@session.sql_big_tables; -SET @@session.sql_big_tables = ON; -SELECT @@session.sql_big_tables; - ---echo '#---------------------FN_DYNVARS_154_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_big_tables = TRUE; -SELECT @@session.sql_big_tables; -SET @@session.sql_big_tables = FALSE; -SELECT @@session.sql_big_tables; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_big_tables = @session_start_value; -SELECT @@session.sql_big_tables; - -############################################################### -# END OF sql_big_tables TESTS # -############################################################### diff --git a/mysql-test/t/sql_big_tables_func.test b/mysql-test/t/sql_big_tables_func.test deleted file mode 100644 index 5f919fac2c7..00000000000 --- a/mysql-test/t/sql_big_tables_func.test +++ /dev/null @@ -1,146 +0,0 @@ -############# mysql-test\t\sql_big_tables_func.test ######################## -# # -# Variable Name: sql_big_tables # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 0 FALSE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_big_tables" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -############################################################################ - -# Due to difference in the result the ps-protocol is disabled ---disable_ps_protocol - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @old_big_tables = @@SESSION.sql_big_tables; - -# -# Create tables -# - -CREATE TABLE t1(a varchar(20), b varchar(20)); - -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); - ---echo '#--------------------FN_DYNVARS_155_01-------------------------#' -# -# TRUE mode -# - -SET SESSION sql_big_tables = 1; - -let $diskTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1); -let $totalTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1); - -eval SET @diskTableCount = $diskTablesBig; -eval SET @tempTableCount = $totalTablesBig; - -SELECT * FROM (SELECT ta.a as a, tb.b as b -FROM t1 as ta INNER JOIN t1 as tb ON ta.a = tb.a) sub; - -let $newDiskTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1); -let $newTotalTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1); - -eval SET @diskTableCount = $newDiskTablesBig - @diskTableCount; -eval SET @tempTableCount = $newTotalTablesBig - @tempTableCount; - -SELECT @diskTableCount; ---echo 1 Expected -SELECT @tempTableCount; ---echo 1 Expected - ---echo '#--------------------FN_DYNVARS_155_02-------------------------#' -# -# FALSE mode -# - -SET SESSION sql_big_tables = 0; - -let $diskTables = query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1); -let $totalTables = query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1); - -eval SET @diskTableCount = $diskTables; -eval SET @tempTableCount = $totalTables; - -SELECT * FROM (SELECT ta.b as a, tb.a as b FROM t1 as ta INNER JOIN t1 as tb ON ta.a = tb.a) sub; - -let $newDiskTables= query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1); -let $newTotalTables= query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1); - -eval SET @diskTableCount = $newDiskTables - @diskTableCount; -eval SET @tempTableCount = $newTotalTables - @tempTableCount; - -SELECT @diskTableCount; ---echo 0 Expected -SELECT @tempTableCount; ---echo 1 Expected - ---echo '#--------------------FN_DYNVARS_155_03-------------------------#' -# -# Session data integrity check -# ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); ---echo ** Connection con_int1 ** -connection con_int1; - -SELECT @@SESSION.sql_big_tables; ---echo 0 / FALSE Expected; -SET SESSION sql_big_tables = FALSE; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); ---echo ** Connection con_int2 ** -connection con_int2; - -SELECT @@SESSION.sql_big_tables; ---echo 0 / FALSE Expected; - -SET SESSION sql_big_tables = TRUE; - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_big_tables; ---echo 0 / FALSE Expected; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_big_tables; ---echo 1 / TRUE Expected; - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - -# -# Cleanup -# - -SET SESSION sql_big_tables = @old_big_tables; - -DROP TABLE t1; - ---enable_ps_protocol - diff --git a/mysql-test/t/sql_buffer_result_basic.test b/mysql-test/t/sql_buffer_result_basic.test deleted file mode 100644 index f5a5e323fc4..00000000000 --- a/mysql-test/t/sql_buffer_result_basic.test +++ /dev/null @@ -1,184 +0,0 @@ -############## mysql-test\t\sql_buffer_result_basic.test ###################### -# # -# Variable Name: sql_buffer_result # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Valid Values : 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_buffer_result # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF sql_buffer_result TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of sql_buffer_result in a temporary variable # -################################################################################ - -SET @session_start_value = @@session.sql_buffer_result; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_155_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_buffer_result # -######################################################################## - -SET @@session.sql_buffer_result = 0; -SET @@session.sql_buffer_result = DEFAULT; -SELECT @@session.sql_buffer_result; - -SET @@session.sql_buffer_result = 1; -SET @@session.sql_buffer_result = DEFAULT; -SELECT @@session.sql_buffer_result; - - ---echo '#---------------------FN_DYNVARS_155_02-------------------------#' -############################################################################# -# Check if sql_buffer_result can be accessed with and without @@ sign # -############################################################################# - -SET sql_buffer_result = 1; -SELECT @@sql_buffer_result; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_buffer_result; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_buffer_result; - -SET session sql_buffer_result = 0; -SELECT @@session.sql_buffer_result; - - ---echo '#--------------------FN_DYNVARS_155_03------------------------#' -######################################################################## -# change the value of sql_buffer_result to a valid value # -######################################################################## - -SET @@session.sql_buffer_result = 0; -SELECT @@session.sql_buffer_result; -SET @@session.sql_buffer_result = 1; -SELECT @@session.sql_buffer_result; - - ---echo '#--------------------FN_DYNVARS_155_04-------------------------#' -########################################################################### -# Change the value of sql_buffer_result to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = "TRU"; - -SET @@session.sql_buffer_result = 0.4; -SELECT @@session.sql_buffer_result; - -SET @@session.sql_buffer_result = 1.4; -SELECT @@session.sql_buffer_result; - ---echo 'Bug: Decimal values are accepted and rounded to an integer before'; ---echo 'assingment.'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = ÕN; - -SET @@session.sql_buffer_result = OF; -SELECT @@session.sql_buffer_result; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_buffer_result = NO; - - ---echo '#-------------------FN_DYNVARS_155_05----------------------------#' -########################################################################### -# Test if accessing global sql_buffer_result gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_buffer_result = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_buffer_result; - ---echo '#----------------------FN_DYNVARS_155_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_buffer_result'; - ---echo '#----------------------FN_DYNVARS_155_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_buffer_result = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_buffer_result'; -SELECT @@session.sql_buffer_result; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_buffer_result'; - ---echo '#---------------------FN_DYNVARS_155_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_buffer_result = OFF; -SELECT @@session.sql_buffer_result; -SET @@session.sql_buffer_result = ON; -SELECT @@session.sql_buffer_result; - ---echo '#---------------------FN_DYNVARS_155_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_buffer_result = TRUE; -SELECT @@session.sql_buffer_result; -SET @@session.sql_buffer_result = FALSE; -SELECT @@session.sql_buffer_result; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_buffer_result = @session_start_value; -SELECT @@session.sql_buffer_result; - -############################################################### -# END OF sql_buffer_result TESTS # -############################################################### diff --git a/mysql-test/t/sql_buffer_result_func.test b/mysql-test/t/sql_buffer_result_func.test deleted file mode 100644 index 4530545b8f0..00000000000 --- a/mysql-test/t/sql_buffer_result_func.test +++ /dev/null @@ -1,130 +0,0 @@ -############# mysql-test\t\sql_buffer_result_func.test ##################### -# # -# Variable Name: sql_buffer_result # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 0 FALSE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_buffer_result" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -############################################################################ - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @original_sql_buffer_result = @@sql_buffer_result; - -# -# Create tables -# - -CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20)); - -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa','bb'); - ---echo '#--------------------FN_DYNVARS_156_01-------------------------#' -# -# TRUE mode -# - -SET SESSION sql_buffer_result = 1; - -SHOW STATUS LIKE 'Created_tmp_tables'; ---echo Expected value : 0. - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Created_tmp_tables'; ---echo Expected value : 1. - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Created_tmp_tables'; ---echo Expected value : 2. - ---echo '#--------------------FN_DYNVARS_156_02-------------------------#' -# -# FALSE mode -# - -SET SESSION sql_buffer_result = 0; - -SHOW STATUS LIKE 'Created_tmp_tables'; ---echo Expected value : 2. - -SELECT * FROM t1; - -SHOW STATUS LIKE 'Created_tmp_tables'; ---echo Expected value : 2. - ---echo '#--------------------FN_DYNVARS_156_03-------------------------#' -# -# Session data integrity check -# ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; - -SELECT @@SESSION.sql_buffer_result; ---echo 0 / FALSE Expected - -SET SESSION sql_buffer_result = FALSE; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; - -SELECT @@SESSION.sql_buffer_result; ---echo 0 / FALSE Expected - -SET SESSION sql_buffer_result = TRUE; - ---echo ** Connection con_int1 ** -connection con_int1; - -SELECT @@SESSION.sql_buffer_result; ---echo 0 / FALSE Expected - ---echo ** Connection con_int2 ** -connection con_int2; - -SELECT @@SESSION.sql_buffer_result; ---echo 1 / TRUE Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# ---echo ** Cleanup ** - -SET @@sql_buffer_result = @original_sql_buffer_result; - -DROP TABLE t1; diff --git a/mysql-test/t/sql_log_bin_basic.test b/mysql-test/t/sql_log_bin_basic.test deleted file mode 100644 index 0f6d9e1e126..00000000000 --- a/mysql-test/t/sql_log_bin_basic.test +++ /dev/null @@ -1,174 +0,0 @@ -####################### mysql-test\t\sql_log_bin_basic.test ################### -# # -# Variable Name: sql_log_bin # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Valid Values: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_log_bin # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF sql_log_bin TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of sql_log_bin in a temporary variable # -############################################################################## - -SET @session_start_value = @@session.sql_log_bin; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_156_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_log_bin # -######################################################################## - -SET @@session.sql_log_bin = 0; -SET @@session.sql_log_bin = DEFAULT; -SELECT @@session.sql_log_bin; - -SET @@session.sql_log_bin = 1; -SET @@session.sql_log_bin = DEFAULT; -SELECT @@session.sql_log_bin; - - ---echo '#---------------------FN_DYNVARS_156_02-------------------------#' -############################################################################# -# Check if sql_log_bin can be accessed with and without @@ sign # -############################################################################# - -SET sql_log_bin = 1; -SELECT @@sql_log_bin; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_log_bin; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_log_bin; - -SET session sql_log_bin = 0; -SELECT @@session.sql_log_bin; - - ---echo '#--------------------FN_DYNVARS_156_03------------------------#' -######################################################################## -# change the value of sql_log_bin to a valid value # -######################################################################## - -SET @@session.sql_log_bin = 0; -SELECT @@session.sql_log_bin; -SET @@session.sql_log_bin = 1; -SELECT @@session.sql_log_bin; - - ---echo '#--------------------FN_DYNVARS_156_04-------------------------#' -########################################################################### -# Change the value of sql_log_bin to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = ÕN; - -SET @@session.sql_log_bin = OF; -SELECT @@session.sql_log_bin; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_bin = NO; - - ---echo '#-------------------FN_DYNVARS_156_05----------------------------#' -########################################################################### -# Test if accessing global sql_log_bin gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_log_bin = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_log_bin; - ---echo '#----------------------FN_DYNVARS_156_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_log_bin'; - ---echo '#----------------------FN_DYNVARS_156_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_log_bin = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_log_bin'; -SELECT @@session.sql_log_bin; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_log_bin'; - ---echo '#---------------------FN_DYNVARS_156_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_log_bin = OFF; -SELECT @@session.sql_log_bin; -SET @@session.sql_log_bin = ON; -SELECT @@session.sql_log_bin; - ---echo '#---------------------FN_DYNVARS_156_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_log_bin = TRUE; -SELECT @@session.sql_log_bin; -SET @@session.sql_log_bin = FALSE; -SELECT @@session.sql_log_bin; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_log_bin = @session_start_value; -SELECT @@session.sql_log_bin; - -############################################################### -# END OF sql_log_bin TESTS # -############################################################### diff --git a/mysql-test/t/sql_log_off_basic.test b/mysql-test/t/sql_log_off_basic.test deleted file mode 100644 index bcf9e87c1dd..00000000000 --- a/mysql-test/t/sql_log_off_basic.test +++ /dev/null @@ -1,175 +0,0 @@ -################# mysql-test\t\sql_log_off_basic.test ######################### -# # -# Variable Name: sql_log_off # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_log_off # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF sql_log_off TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of sql_log_off in a temporary variable # -################################################################################ - -SET @session_start_value = @@session.sql_log_off; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_157_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_log_off # -######################################################################## - -SET @@session.sql_log_off = 0; -SET @@session.sql_log_off = DEFAULT; -SELECT @@session.sql_log_off; - -SET @@session.sql_log_off = 1; -SET @@session.sql_log_off = DEFAULT; -SELECT @@session.sql_log_off; - - ---echo '#---------------------FN_DYNVARS_157_02-------------------------#' -############################################################################# -# Check if sql_log_off can be accessed with and without @@ sign # -############################################################################# - -SET sql_log_off = 1; -SELECT @@sql_log_off; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_log_off; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_log_off; - -SET session sql_log_off = 0; -SELECT @@session.sql_log_off; - - ---echo '#--------------------FN_DYNVARS_157_03------------------------#' -######################################################################## -# change the value of sql_log_off to a valid value # -######################################################################## - -SET @@session.sql_log_off = 0; -SELECT @@session.sql_log_off; -SET @@session.sql_log_off = 1; -SELECT @@session.sql_log_off; - - ---echo '#--------------------FN_DYNVARS_157_04-------------------------#' -########################################################################### -# Change the value of sql_log_off to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = ÕN; - -SET @@session.sql_log_off = OF; -SELECT @@session.sql_log_off; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_log_off = NO; - - ---echo '#-------------------FN_DYNVARS_157_05----------------------------#' -########################################################################### -# Test if accessing global sql_log_off gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_log_off = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_log_off; - ---echo '#----------------------FN_DYNVARS_157_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_log_off'; - ---echo '#----------------------FN_DYNVARS_157_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_log_off = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_log_off'; -SELECT @@session.sql_log_off; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_log_off'; - ---echo '#---------------------FN_DYNVARS_157_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_log_off = OFF; -SELECT @@session.sql_log_off; -SET @@session.sql_log_off = ON; -SELECT @@session.sql_log_off; - ---echo '#---------------------FN_DYNVARS_157_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_log_off = TRUE; -SELECT @@session.sql_log_off; -SET @@session.sql_log_off = FALSE; -SELECT @@session.sql_log_off; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_log_off = @session_start_value; -SELECT @@session.sql_log_off; - -############################################################### -# END OF sql_log_off TESTS # -############################################################### diff --git a/mysql-test/t/sql_log_off_func.test b/mysql-test/t/sql_log_off_func.test deleted file mode 100644 index fb06a12b264..00000000000 --- a/mysql-test/t/sql_log_off_func.test +++ /dev/null @@ -1,115 +0,0 @@ -############# mysql-test\t\sql_log_off_func.test ########################## -# # -# Variable Name: sql_log_off # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 0 FALSE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_log_off" # -# that checks behavior of this variable in the following ways# -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -########################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @default_sql_log_off = @@sql_log_off; - -# -# Create tables -# - -CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20)); - -INSERT INTO t1 VALUES('aa1','bb'); -INSERT INTO t1 VALUES('aa2','bb'); -INSERT INTO t1 VALUES('aa3','bb'); -INSERT INTO t1 VALUES('aa4','bb'); -INSERT INTO t1 VALUES('aa5','bb'); - ---echo '#--------------------FN_DYNVARS_158_01-------------------------#' -# -# Value ON -# - -SET SESSION sql_log_off = ON; - -UPDATE t1 SET a = 'aa1-updated' WHERE a = 'aa1'; - ---echo Checking if log contains the executed statement -SELECT argument FROM mysql.general_log WHERE argument = 'UPDATE t1 SET a = \'aa1-updated\' WHERE a = \'aa1\''; - ---echo '#--------------------FN_DYNVARS_158_02-------------------------#' -# -# Value OFF -# - -SET SESSION sql_log_off = OFF; - -# With ps-protocol the UPDATE is executed twice ---disable_ps_protocol -UPDATE t1 SET a = 'aa1' WHERE a = 'aa1-updated'; ---enable_ps_protocol - ---echo Checking if log contains the executed statement -SELECT argument FROM mysql.general_log WHERE argument = 'UPDATE t1 SET a = \'aa1\' WHERE a = \'aa1-updated\''; - ---echo '#--------------------FN_DYNVARS_158_03--------------------------#' -# -# Session data integrity check -# ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_log_off; ---echo 0 / FALSE Expected - -SET SESSION sql_log_off = FALSE; ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_log_off; ---echo 0 / FALSE Expected - -SET SESSION sql_log_off = TRUE; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_log_off; ---echo 1 / TRUE Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_log_off; ---echo 0 / FALSE Expected - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# - -SET SESSION sql_log_off = @default_sql_log_off; - -DROP TABLE t1; diff --git a/mysql-test/t/sql_low_priority_updates_basic.test b/mysql-test/t/sql_low_priority_updates_basic.test deleted file mode 100644 index 499723b636d..00000000000 --- a/mysql-test/t/sql_low_priority_updates_basic.test +++ /dev/null @@ -1,233 +0,0 @@ -############## mysql-test\t\sql_low_priority_updates_basic.test ############### -# # -# Variable Name: sql_low_priority_updates # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Valid Values: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_low_priority_updates # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF sql_low_priority_updates TESTS # -######################################################################## - - -############################################################################### -# Saving initial value of sql_low_priority_updates in a temporary variable # -############################################################################### - -SET @session_start_value = @@session.sql_low_priority_updates; -SELECT @session_start_value; - -SET @global_start_value = @@global.sql_low_priority_updates; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_159_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_low_priority_updates # -######################################################################## - -SET @@session.sql_low_priority_updates = 1; -SET @@session.sql_low_priority_updates = DEFAULT; -SELECT @@session.sql_low_priority_updates; - -SET @@global.sql_low_priority_updates = 1; ---Error ER_NO_DEFAULT -SET @@global.sql_low_priority_updates = DEFAULT; - ---echo 'Bug: DEFAULT value is only associated with session' - - ---echo '#---------------------FN_DYNVARS_159_02-------------------------#' -#################################################################################### -# Check if sql_low_priority_updates can be accessed with and without @@ sign # -#################################################################################### - -SET sql_low_priority_updates = 1; -SELECT @@sql_low_priority_updates; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_low_priority_updates; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_low_priority_updates; - ---Error ER_UNKNOWN_TABLE -SELECT global.sql_low_priority_updates; - -#using another syntax for accessing system variables -SET session sql_low_priority_updates = 0; -SELECT @@session.sql_low_priority_updates; - -SET global sql_low_priority_updates = 0; -SELECT @@global.sql_low_priority_updates; - - ---echo '#--------------------FN_DYNVARS_159_03------------------------#' -########################################################################## -# change the value of sql_low_priority_updates to a valid value # -########################################################################## -# for session -SET @@session.sql_low_priority_updates = 0; -SELECT @@session.sql_low_priority_updates; -SET @@session.sql_low_priority_updates = 1; -SELECT @@session.sql_low_priority_updates; - -# for global -SET @@global.sql_low_priority_updates = 0; -SELECT @@global.sql_low_priority_updates; -SET @@global.sql_low_priority_updates = 1; -SELECT @@global.sql_low_priority_updates; - - ---echo '#--------------------FN_DYNVARS_159_04-------------------------#' -########################################################################### -# Change the value of sql_low_priority_updates to invalid value # -########################################################################### - -# for session ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_low_priority_updates = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_low_priority_updates = 1.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_low_priority_updates = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_low_priority_updates = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_low_priority_updates = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_low_priority_updates = ÕN; - -SET @@session.sql_low_priority_updates = OF; -SELECT @@session.sql_low_priority_updates; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_low_priority_updates = ÓFF; - -# for global - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_low_priority_updates = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_low_priority_updates = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_low_priority_updates = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_low_priority_updates = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_low_priority_updates = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_low_priority_updates = ÕN; - -SET @@global.sql_low_priority_updates = OF; -SELECT @@global.sql_low_priority_updates; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_low_priority_updates = ÓFF; - - ---echo '#-------------------FN_DYNVARS_159_05----------------------------#' -########################################################################### -# Test if changing global variable effects session and vice versa # -########################################################################### - -SET @@global.sql_low_priority_updates = 0; -SET @@session.sql_low_priority_updates = 1; -SELECT @@global.sql_low_priority_updates AS res_is_0; - -SET @@global.sql_low_priority_updates = 0; -SELECT @@session.sql_low_priority_updates AS res_is_1; - ---echo '#----------------------FN_DYNVARS_159_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.sql_low_priority_updates = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_low_priority_updates'; -SELECT @@global.sql_low_priority_updates; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_low_priority_updates'; - ---echo '#----------------------FN_DYNVARS_159_07------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@session.sql_low_priority_updates = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_low_priority_updates'; -SELECT @@session.sql_low_priority_updates; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_low_priority_updates'; - ---echo '#---------------------FN_DYNVARS_159_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_low_priority_updates = OFF; -SELECT @@session.sql_low_priority_updates; -SET @@session.sql_low_priority_updates = ON; -SELECT @@session.sql_low_priority_updates; - -SET @@global.sql_low_priority_updates = OFF; -SELECT @@global.sql_low_priority_updates; -SET @@global.sql_low_priority_updates = ON; -SELECT @@global.sql_low_priority_updates; - ---echo '#---------------------FN_DYNVARS_159_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_low_priority_updates = TRUE; -SELECT @@session.sql_low_priority_updates; -SET @@session.sql_low_priority_updates = FALSE; -SELECT @@session.sql_low_priority_updates; - -SET @@global.sql_low_priority_updates = TRUE; -SELECT @@global.sql_low_priority_updates; -SET @@global.sql_low_priority_updates = FALSE; -SELECT @@global.sql_low_priority_updates; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_low_priority_updates = @session_start_value; -SELECT @@session.sql_low_priority_updates; - -SET @@global.sql_low_priority_updates = @global_start_value; -SELECT @@global.sql_low_priority_updates; - -########################################################### -# END OF sql_low_priority_updates TESTS # -########################################################### - diff --git a/mysql-test/t/sql_low_priority_updates_func.test b/mysql-test/t/sql_low_priority_updates_func.test deleted file mode 100644 index 6ff684af6cd..00000000000 --- a/mysql-test/t/sql_low_priority_updates_func.test +++ /dev/null @@ -1,240 +0,0 @@ -############# mysql-test\t\sql_low_priority_updates_func.test ################# -# # -# Variable Name: sql_low_priority_updates # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable sql_low_priority_updates# -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -############################################################################### - ---source include/not_embedded.inc - -################################################################ -# sql_low_priority_updates was renamed to low_priority_updates # -################################################################ - ---echo ** Setup ** ---echo -# -# Setup -# ---echo ** Connecting con0 using root ** -connect (con0,localhost,root,,); ---echo ** Connecting con1 using root ** -connect (con1,localhost,root,,); - ---echo ** Connection default ** -connection default; - -SET @global_low_priority_updates = @@GLOBAL.low_priority_updates; -SET @session_low_priority_updates = @@SESSION.low_priority_updates; - -# -# Create Table -# - -CREATE TABLE t1 (a varchar(100)); - ---echo '#--------------------FN_DYNVARS_160_01-------------------------#' -# -# Value ON -# - ---echo ** Connection con0 ** -connection con0; -SET SESSION low_priority_updates = ON; ---echo ** Connection con1 ** -connection con1; -SET SESSION low_priority_updates = ON; ---echo ** Connection default ** -connection default; -SET SESSION low_priority_updates = ON; - -INSERT INTO t1 VALUES('1'); -INSERT INTO t1 VALUES('2'); -INSERT INTO t1 VALUES('3'); -INSERT INTO t1 VALUES('4'); -INSERT INTO t1 VALUES('5'); -INSERT INTO t1 VALUES('6'); - -LOCK TABLE t1 WRITE; - ---echo ** Connection con1 ** -connection con1; - ---echo ** Asynchronous Execution ** -delimiter |; - -send -UPDATE t1 SET a = CONCAT(a,"-updated");| - -delimiter ;| - ---echo ** Connection con0 ** -connection con0; - ---echo ** Asynchronous Execution ** -delimiter |; - -send -LOCK TABLE t1 READ; -SELECT * FROM t1; -UNLOCK TABLES;| - -delimiter ;| - ---echo ** Connection default ** -connection default; - ---echo Sleeping for 1 secs ---sleep 1 - -UNLOCK TABLES; - ---echo ** Connection con0 ** -connection con0; ---echo ** Asynchronous Result ** -reap; - ---echo Expected values of a without -updated; - ---echo ** Connection default ** -connection default; - -DELETE FROM t1; - ---echo '#--------------------FN_DYNVARS_160_02-------------------------#' -# -# Value ON -# - ---echo ** Connection con0 ** -connection con0; -SET SESSION low_priority_updates = OFF; ---echo ** Connection con1 ** -connection con1; -SET SESSION low_priority_updates = OFF; ---echo ** Connection default** -connection default; -SET SESSION low_priority_updates = OFF; - -INSERT INTO t1 VALUES('1'); -INSERT INTO t1 VALUES('2'); -INSERT INTO t1 VALUES('3'); -INSERT INTO t1 VALUES('4'); -INSERT INTO t1 VALUES('5'); -INSERT INTO t1 VALUES('6'); - -LOCK TABLE t1 WRITE; - ---echo ** Connection con1 ** -connection con1; - ---echo ** Asynchronous Execution ** -delimiter |; - -send -UPDATE t1 SET a = CONCAT(a,"-updated");| - -delimiter ;| - ---echo ** Connection con0 ** -connection con0; - ---echo ** Asynchronous Execution ** -delimiter |; - -send -LOCK TABLE t1 READ; -SELECT * FROM t1; -UNLOCK TABLES;| - -delimiter ;| - ---echo ** Connection default ** -connection default; - ---echo Sleeping for 1 secs ---sleep 1 - -UNLOCK TABLES; - ---echo ** Connection con0 ** -connection con0; ---echo ** Asynchronous Result ** -reap; ---echo Expected values of a with -updated; - ---echo ** Connection default** -connection default; - -DELETE FROM t1; - ---echo '#--------------------FN_DYNVARS_160_03-------------------------#' -# -# Session data integrity check & GLOBAL Value check -# - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.low_priority_updates; ---echo 1 / TRUE Expected - -SET SESSION low_priority_updates = FALSE; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.low_priority_updates; ---echo 1 / TRUE Expected - -SET SESSION low_priority_updates = TRUE; - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.low_priority_updates; ---echo 0 / FALSE Expected - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.low_priority_updates; ---echo 1 / TRUE Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - -# -# Cleanup -# - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con0, con1 -disconnect con0; -disconnect con1; - -DROP TABLE t1; - -SET @@GLOBAL.low_priority_updates = @global_low_priority_updates; -SET @@SESSION.low_priority_updates = @session_low_priority_updates; diff --git a/mysql-test/t/sql_max_join_size_func.test b/mysql-test/t/sql_max_join_size_func.test deleted file mode 100644 index 17b7d911b94..00000000000 --- a/mysql-test/t/sql_max_join_size_func.test +++ /dev/null @@ -1,133 +0,0 @@ -############# mysql-test\t\sql_max_join_size_func.test #################### -# # -# Variable Name: sql_max_join_size # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 4294967295 # -# Values: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_max_join_size" # -# that checks behavior of this variable in the following ways# -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system # -# -variables.html#option_mysqld_max_join_size # -# # -########################################################################### - ---echo ** Setup ** -# -# Setup -# - -SET @session_max_join_size = @@SESSION.sql_max_join_size; -SET @global_max_join_size = @@GLOBAL.sql_max_join_size; -SET @session_sql_big_selects = @@SESSION.sql_big_selects; - -# -# Create tables -# - -CREATE TEMPORARY TABLE t1(a varchar(20) not null, b varchar(20)); -CREATE TEMPORARY TABLE t2(a varchar(20) null, b varchar(20)); - -INSERT INTO t1 VALUES('aa','bb'); -INSERT INTO t1 VALUES('aa1','bb'); -INSERT INTO t1 VALUES('aa2','bb'); -INSERT INTO t1 VALUES('aa3','bb'); -INSERT INTO t1 VALUES('aa4','bb'); - -INSERT INTO t2 VALUES('aa','bb'); -INSERT INTO t2 VALUES('aa1','bb'); -INSERT INTO t2 VALUES('aa2','bb'); -INSERT INTO t2 VALUES('aa3','bb'); -INSERT INTO t2 VALUES('aa4','bb'); - ---echo '#--------------------FN_DYNVARS_161_01-------------------------#' -# -# Testing fail condition -# - -SET SESSION sql_max_join_size=9; ---error ER_TOO_BIG_SELECT -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo Expected error The SELECT would examine more than MAX_JOIN_SIZE rows. - ---echo '#--------------------FN_DYNVARS_161_02-------------------------#' -# -# Testing pass conditions -# - -SET SESSION SQL_BIG_SELECTS = 1; - -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo This should work - -SET SESSION sql_max_join_size=DEFAULT; - -DELETE FROM t2 WHERE a = 'aa4'; -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo This should work - ---echo '#----------------------------FN_DYNVARS_136_05-------------------------#' -# -# Session data integrity check & GLOBAL Value check -# - -SET GLOBAL sql_max_join_size = 4; ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_max_join_size; ---echo 4 Expected - -SET SESSION sql_max_join_size = 2; ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_max_join_size; ---echo 4 Expected - -SET SESSION sql_max_join_size = 10; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_max_join_size; ---echo 10 Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_max_join_size; ---echo 2 Expected - - -SELECT @@GLOBAL.sql_max_join_size; ---echo 4 Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# - -SET @@SESSION.sql_max_join_size = @session_max_join_size; -SET @@GLOBAL.sql_max_join_size = @global_max_join_size ; -SET @@SESSION.sql_big_selects = @session_sql_big_selects; - -DROP TABLE t1; -DROP TABLE t2; diff --git a/mysql-test/t/sql_mode_basic.test b/mysql-test/t/sql_mode_basic.test deleted file mode 100644 index 24f1e8aefcb..00000000000 --- a/mysql-test/t/sql_mode_basic.test +++ /dev/null @@ -1,413 +0,0 @@ -#################### mysql-test\t\sql_mode_basic.test ######################### -# # -# Variable Name: sql_mode # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: YES # -# Valid Values : ANSI, STRICT_TRANS_TABLES, TRADITIONAL, # -# ERROR_FOR_DIVISION_BY_ZERO, ANSI_QUOTES, HIGH_NOT_PRECEDENCE,# -# IGNORE_SPACE, NO_AUTO_CREATE_USER, ONLY_FULL_GROUP_BY, # -# NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES, # -# NO_UNSIGNED_SUBTRACTION, OFF # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_mode # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################ -# START OF sql_mode TESTS # -################################################################ - - -################################################################### -# Saving initial value of sql_mode in a temporary variable # -################################################################### - -SET @global_start_value = @@global.sql_mode; -SELECT @global_start_value; - -SET @session_start_value = @@session.sql_mode; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_152_01------------------------#' -################################################################ -# Display the DEFAULT value of sql_mode # -################################################################ - -SET @@global.sql_mode = ANSI; -SET @@global.sql_mode = DEFAULT; -SELECT @@global.sql_mode; - -SET @@session.sql_mode = ANSI; -SET @@session.sql_mode = DEFAULT; -SELECT @@session.sql_mode; - ---echo 'Bug# 34876: Default values for both session and global sql_mode is ""'; ---echo 'and not OFF.'; - ---echo '#---------------------FN_DYNVARS_152_02-------------------------#' -######################################################### -# Check if NULL or empty value is accepeted # -######################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = NULL; - -# resets sql mode to nothing -SET @@global.sql_mode = ''; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = ' '; -SELECT @@global.sql_mode; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = NULL; - -SET @@session.sql_mode = ''; -SELECT @@session.sql_mode; - -SET @@session.sql_mode = ' '; -SELECT @@session.sql_mode; - - ---echo '#--------------------FN_DYNVARS_152_03------------------------#' -######################################################################## -# Change the value of sql_mode to a valid value # -######################################################################## - -# sql modes ref: http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html - ---echo 'Bug: Incomplete sql modes valid values at:'; ---echo 'http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html'; - -# check valid values for global - -SET @@global.sql_mode = ANSI; -SELECT @@global.sql_mode; -SET @@global.sql_mode = STRICT_TRANS_TABLES; -SELECT @@global.sql_mode; -SET @@global.sql_mode = TRADITIONAL; -SELECT @@global.sql_mode; -SET @@global.sql_mode = ALLOW_INVALID_DATES; -SELECT @@global.sql_mode; -SET @@global.sql_mode = ANSI_QUOTES; -SELECT @@global.sql_mode; -SET @@global.sql_mode = ERROR_FOR_DIVISION_BY_ZERO; -SELECT @@global.sql_mode; -SET @@global.sql_mode = HIGH_NOT_PRECEDENCE; -SELECT @@global.sql_mode; -SET @@global.sql_mode = IGNORE_SPACE; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_AUTO_CREATE_USER; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_AUTO_VALUE_ON_ZERO; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_BACKSLASH_ESCAPES; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_DIR_IN_CREATE; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_FIELD_OPTIONS; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_KEY_OPTIONS; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_TABLE_OPTIONS; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_UNSIGNED_SUBTRACTION; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_ZERO_DATE; -SELECT @@global.sql_mode; -SET @@global.sql_mode = NO_ZERO_IN_DATE; -SELECT @@global.sql_mode; -SET @@global.sql_mode = ONLY_FULL_GROUP_BY; -SELECT @@global.sql_mode; -SET @@global.sql_mode = PIPES_AS_CONCAT; -SELECT @@global.sql_mode; -SET @@global.sql_mode = REAL_AS_FLOAT; -SELECT @@global.sql_mode; -SET @@global.sql_mode = STRICT_ALL_TABLES; -SELECT @@global.sql_mode; -SET @@global.sql_mode = STRICT_TRANS_TABLES; -SELECT @@global.sql_mode; -SET @@global.sql_mode = DB2; -SELECT @@global.sql_mode; -SET @@global.sql_mode = MAXDB; -SELECT @@global.sql_mode; -SET @@global.sql_mode = MSSQL; -SELECT @@global.sql_mode; -SET @@global.sql_mode = MYSQL323; -SELECT @@global.sql_mode; -SET @@global.sql_mode = MYSQL40; -SELECT @@global.sql_mode; -SET @@global.sql_mode = ORACLE; -SELECT @@global.sql_mode; -SET @@global.sql_mode = POSTGRESQL; -SELECT @@global.sql_mode; -SET @@global.sql_mode = TRADITIONAL; -SELECT @@global.sql_mode; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = OFF; ---echo 'Bug: OFF is documented as an sql mode but infact it is not'; - -#check valid values for session -SET @@session.sql_mode = ANSI; -SELECT @@session.sql_mode; -SET @@session.sql_mode = STRICT_TRANS_TABLES; -SELECT @@session.sql_mode; -SET @@session.sql_mode = TRADITIONAL; -SELECT @@session.sql_mode; -SET @@session.sql_mode = ALLOW_INVALID_DATES; -SELECT @@session.sql_mode; -SET @@session.sql_mode = ANSI_QUOTES; -SELECT @@session.sql_mode; -SET @@session.sql_mode = ERROR_FOR_DIVISION_BY_ZERO; -SELECT @@session.sql_mode; -SET @@session.sql_mode = HIGH_NOT_PRECEDENCE; -SELECT @@session.sql_mode; -SET @@session.sql_mode = IGNORE_SPACE; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_AUTO_CREATE_USER; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_AUTO_VALUE_ON_ZERO; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_BACKSLASH_ESCAPES; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_DIR_IN_CREATE; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_ENGINE_SUBSTITUTION; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_FIELD_OPTIONS; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_KEY_OPTIONS; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_TABLE_OPTIONS; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_UNSIGNED_SUBTRACTION; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_ZERO_DATE; -SELECT @@session.sql_mode; -SET @@session.sql_mode = NO_ZERO_IN_DATE; -SELECT @@session.sql_mode; -SET @@session.sql_mode = ONLY_FULL_GROUP_BY; -SELECT @@session.sql_mode; -SET @@session.sql_mode = PIPES_AS_CONCAT; -SELECT @@session.sql_mode; -SET @@session.sql_mode = REAL_AS_FLOAT; -SELECT @@session.sql_mode; -SET @@session.sql_mode = STRICT_ALL_TABLES; -SELECT @@session.sql_mode; -SET @@session.sql_mode = STRICT_TRANS_TABLES; -SELECT @@session.sql_mode; -SET @@session.sql_mode = DB2; -SELECT @@session.sql_mode; -SET @@session.sql_mode = MAXDB; -SELECT @@session.sql_mode; -SET @@session.sql_mode = MSSQL; -SELECT @@session.sql_mode; -SET @@session.sql_mode = MYSQL323; -SELECT @@session.sql_mode; -SET @@session.sql_mode = MYSQL40; -SELECT @@session.sql_mode; -SET @@session.sql_mode = ORACLE; -SELECT @@session.sql_mode; -SET @@session.sql_mode = POSTGRESQL; -SELECT @@session.sql_mode; -SET @@session.sql_mode = TRADITIONAL; -SELECT @@session.sql_mode; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = OFF; - -SET @@global.sql_mode = '?'; -SELECT @@global.sql_mode; - -SET @@session.sql_mode = '?'; -SELECT @@session.sql_mode; - ---echo 'Bug# 34834: ? is acceptable as a valid sql mode.' - - ---echo '#--------------------FN_DYNVARS_152_04-------------------------#' -########################################################################### -# Change the value of sql_mode to invalid value # -########################################################################### - -# invalid values for global ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = ASCII; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = NON_TRADITIONAL; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = 'OF'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = NONE; ---Error ER_WRONG_VALUE_FOR_VAR - -#invalid values for session - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = ANSI_SINGLE_QUOTES; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = 'ON'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = 'OF'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = DISABLE; - - ---echo '#-------------------FN_DYNVARS_152_05----------------------------#' -######################################################################### -# Check if the value in session Table matches value in variable # -######################################################################### - -SELECT @@session.sql_mode = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_mode'; - ---echo '#----------------------FN_DYNVARS_152_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.sql_mode = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_mode'; - - ---echo '#---------------------FN_DYNVARS_152_07-------------------------#' -################################################################### -# Check if numbers can be used on variable # -################################################################### - -# test if variable accepts 0,1,2 -SET @@global.sql_mode = 0; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 1; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 2; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 3; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 50000; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 500000; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 4294967295; -SELECT @@global.sql_mode; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sql_mode = 4294967296; - -# use of decimal values - -SET @@global.sql_mode = 0.4; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 1.0; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 40000.1; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 1.5; -SELECT @@global.sql_mode; - -SET @@global.sql_mode = 124567.49; -SELECT @@global.sql_mode; - -SET @@session.sql_mode = 50000000.5; -SELECT @@session.sql_mode; - -SET @@session.sql_mode = 4294967295.4; -SELECT @@session.sql_mode; - ---echo 'Bug: Decimal values can be used within the range [0.0-4294967295.5).'; ---echo 'Values are rounded to numeric values as evident from outcome.'; - - ---echo '#---------------------FN_DYNVARS_152_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.sql_mode = TRUE; -SELECT @@global.sql_mode; -SET @@global.sql_mode = FALSE; -SELECT @@global.sql_mode; - ---echo '#---------------------FN_DYNVARS_152_09----------------------#' -######################################################################### -# Check if sql_mode can be accessed with and without @@ sign # -######################################################################### - - -SET sql_mode = 'ANSI'; - ---Error ER_PARSE_ERROR -SET session.sql_mode = 'ANSI'; ---Error ER_PARSE_ERROR -SET global.sql_mode = 'ANSI'; - -SET session sql_mode = 1; -SELECT @@sql_mode; - -SET global sql_mode = 0; -SELECT @@global.sql_mode; - ---echo '#---------------------FN_DYNVARS_152_10----------------------#' -####################################################################### -# Check if sql_mode values can be combined as specified # -####################################################################### - -SET @@session.sql_mode = 'TRADITIONAL,ALLOW_INVALID_DATES,ANSI_QUOTES'; -SELECT @@session.sql_mode; - -SET @@global.sql_mode = 'ONLY_FULL_GROUP_BY,PIPES_AS_CONCAT,REAL_AS_FLOAT,ORACLE,POSTGRESQL'; -SELECT @@global.sql_mode; - -#try combining invalid mode with correct mode ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,HIGH_OR_PRECEDENCE, -IGNORE_SPACE'; - -############################## -# Restore initial value # -############################## - -SET @@global.sql_mode = @global_start_value; -SELECT @@global.sql_mode; - -SET @@session.sql_mode = @session_start_value; -SELECT @@session.sql_mode; - -################################################################ -# END OF sql_mode TESTS # -################################################################ - diff --git a/mysql-test/t/sql_mode_func.test b/mysql-test/t/sql_mode_func.test deleted file mode 100644 index 5bb804c26da..00000000000 --- a/mysql-test/t/sql_mode_func.test +++ /dev/null @@ -1,200 +0,0 @@ -############# mysql-test\t\sql_mode_func.test ###################################### -# # -# Variable Name: sql_mode # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: enumeration # -# Values: ALLOW_INVALID_DATES, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, # -# HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_CREATE_USER, # -# NO_AUTO_VALUE_ON_ZERO, NO_BACKSLASH_ESCAPES, NO_DIR_IN_CREATE, # -# NO_ENGINE_SUBSTITUTION, NO_FIELD_OPTIONS, NO_KEY_OPTIONS, # -# NO_TABLE_OPTIONS, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, # -# NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, REAL_AS_FLOAT# -# STRICT_ALL_TABLES, STRICT_TRANS_TABLES, OFF # -# # -# # -# Creation Date: 2008-02-22 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_mode" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_sql_mode # -# # -#################################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - -# -# Save initial value -# - -SET @sql_mode_session = @@SESSION.sql_mode; -SET @sql_mode_global = @@GLOBAL.sql_mode; - -# -# Create tables -# - -CREATE TEMPORARY TABLE t1(a varchar(20) not null, b varchar(20)); -CREATE TEMPORARY TABLE t2(a varchar(20) null, b varchar(20)); - ---echo '#--------------------FN_DYNVARS_153_01-------------------------#' -# -#ANSI mode -# ---echo ANSI mode - - -SET SESSION sql_mode = ANSI; - -SELECT @@SESSION.sql_mode; - -INSERT INTO t1 VALUES('t1a1','t1b1'); -INSERT INTO t1 VALUES('t1a2','t1b2'); -INSERT INTO t1 VALUES('t1a3','t1b3'); -INSERT INTO t1 VALUES('t1a4','t1b4'); - -INSERT INTO t2 VALUES('t2a1','t2b1'); -INSERT INTO t2 VALUES('t2a2','t2b2'); -INSERT INTO t2 VALUES('t2a3','t2b3'); -INSERT INTO t2 VALUES('t2a4','t2b4'); - ---error ER_INVALID_GROUP_FUNC_USE -SELECT * FROM t1 WHERE t1.a IN (SELECT MAX(t1.b) FROM t2); ---echo Expected error for invalid group function - -# -# Reset -# - -SET SESSION sql_mode = @sql_mode_session; -SET GLOBAL sql_mode = @sql_mode_global; - ---echo '#--------------------FN_DYNVARS_153_02-------------------------#' -# -#STRICT_TRANS_TABLES mode -# ---echo STRICT_TRANS_TABLES mode - -DELETE FROM t1; -DELETE FROM t2; - -SET SESSION sql_mode = STRICT_TRANS_TABLES; - -SELECT @@SESSION.sql_mode; - -INSERT INTO t1 VALUES('t1a1','t1b1'); -INSERT INTO t1 VALUES('t1a2','t1b2'); -INSERT INTO t1 VALUES('t1a3','t1b3'); -INSERT INTO t1 VALUES('t1a4','t1b4'); - -INSERT INTO t2 VALUES(NULL,'t2b1'); -INSERT INTO t2 VALUES('t2a2','t2b2'); -INSERT INTO t2 VALUES('t2a3','t2b3'); -INSERT INTO t2 VALUES('t2a4','t2b4'); - ---error ER_BAD_NULL_ERROR -INSERT INTO t1 SELECT * FROM t2; ---echo Expected error Bad NULL value - -SELECT * FROM t1 WHERE a = 't2a2'; ---echo Should return no rows in columns a,b; - -# -# Reset -# - -SET SESSION sql_mode = @sql_mode_session; -SET GLOBAL sql_mode = @sql_mode_global; - ---echo '#--------------------FN_DYNVARS_153_03-------------------------#' -# -#TRADITIONAL mode -# ---echo TRADITIONAL mode - -SET SESSION sql_mode = TRADITIONAL; - -SELECT @@SESSION.sql_mode; - -INSERT INTO t1 VALUES('t1a1','t1b1'); -INSERT INTO t1 VALUES('t1a2','t1b2'); -INSERT INTO t1 VALUES('t1a3','t1b3'); -INSERT INTO t1 VALUES('t1a4','t1b4'); - -INSERT INTO t2 VALUES(NULL,'t2b1'); -INSERT INTO t2 VALUES('t2a2','t2b2'); -INSERT INTO t2 VALUES('t2a3','t2b3'); -INSERT INTO t2 VALUES('t2a4','t2b4'); - ---error ER_BAD_NULL_ERROR -INSERT INTO t1 SELECT * FROM t2; ---echo Expected error Bad NULL value - -SELECT * FROM t1 WHERE a = 't2a2'; ---echo Should return no rows in columns a,b; - - ---echo '#-------------------FN_DYNVARS_153_04-------------------------#' -# -# Session data integrity check & GLOBAL Value check -# - -SET GLOBAL sql_mode = ''; ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_mode; ---echo '' Expected - -SET SESSION sql_mode = 'TRADITIONAL'; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_mode; ---echo '' Expected - -SET SESSION sql_mode = 'ANSI'; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_mode; ---echo 'REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ANSI' Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_mode; ---echo 'STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, TRADITIONAL' Expected - - -SELECT @@GLOBAL.sql_mode; ---echo '' Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - -# -# Cleanup -# - -SET SESSION sql_mode = @sql_mode_session; -SET GLOBAL sql_mode = @sql_mode_global; - -DROP TABLE t1; -DROP TABLE t2; diff --git a/mysql-test/t/sql_notes_basic.test b/mysql-test/t/sql_notes_basic.test deleted file mode 100644 index 984dca34e46..00000000000 --- a/mysql-test/t/sql_notes_basic.test +++ /dev/null @@ -1,176 +0,0 @@ -################### mysql-test\t\sql_notes_basic.test ######################### -# # -# Variable Name: sql_notes # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Valid Values: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_notes # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF sql_notes TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of sql_notes in a temporary variable # -############################################################################## - -SET @session_start_value = @@session.sql_notes; -SELECT @session_start_value; - - ---echo '#--------------------FN_DYNVARS_161_01------------------------#' -###################################################################### -# Display the DEFAULT value of sql_notes # -###################################################################### - -SET @@session.sql_notes = 0; -SET @@session.sql_notes = DEFAULT; -SELECT @@session.sql_notes; - -SET @@session.sql_notes = 1; -SET @@session.sql_notes = DEFAULT; -SELECT @@session.sql_notes; - - ---echo '#---------------------FN_DYNVARS_161_02-------------------------#' -########################################################################### -# Check if sql_notes can be accessed with and without @@ sign # -########################################################################### - -SET sql_notes = 1; -SELECT @@sql_notes; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_notes; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_notes; - -SET session sql_notes = 0; -SELECT @@session.sql_notes; - - ---echo '#--------------------FN_DYNVARS_161_03------------------------#' -###################################################################### -# change the value of sql_notes to a valid value # -###################################################################### - -SET @@session.sql_notes = 0; -SELECT @@session.sql_notes; -SET @@session.sql_notes = 1; -SELECT @@session.sql_notes; - - ---echo '#--------------------FN_DYNVARS_161_04-------------------------#' -######################################################################### -# Change the value of sql_notes to invalid value # -######################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = ÕN; - -SET @@session.sql_notes = OF; -SELECT @@session.sql_notes; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_notes = NO; - - ---echo '#-------------------FN_DYNVARS_161_05----------------------------#' -######################################################################### -# Test if accessing global sql_notes gives error # -######################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_notes = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_notes; - ---echo '#----------------------FN_DYNVARS_161_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_notes'; - ---echo '#----------------------FN_DYNVARS_161_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_notes = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_notes'; -SELECT @@session.sql_notes; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_notes'; - ---echo '#---------------------FN_DYNVARS_161_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_notes = OFF; -SELECT @@session.sql_notes; -SET @@session.sql_notes = ON; -SELECT @@session.sql_notes; - ---echo '#---------------------FN_DYNVARS_161_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_notes = TRUE; -SELECT @@session.sql_notes; -SET @@session.sql_notes = FALSE; -SELECT @@session.sql_notes; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_notes = @session_start_value; -SELECT @@session.sql_notes; - -############################################################# -# END OF sql_notes TESTS # -############################################################# - diff --git a/mysql-test/t/sql_notes_func.test b/mysql-test/t/sql_notes_func.test deleted file mode 100644 index f7c521d3736..00000000000 --- a/mysql-test/t/sql_notes_func.test +++ /dev/null @@ -1,134 +0,0 @@ -############# mysql-test\t\sql_notes_func.test ############################ -# # -# Variable Name: sql_notes # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_notes" # -# that checks behavior of this variable in the following ways# -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -########################################################################### - -# Due to suppressed warnings the pc-protocol is disabled ---disable_ps_protocol - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @default_sql_notes = @@sql_notes; - ---echo '#--------------------FN_DYNVARS_162_01-------------------------#' -# -# Value ON -# - -SET SESSION sql_notes = ON; - ---echo creating a temporary table -CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20)); ---echo conditionally dropping the table twice so that a note generates - -DROP TABLE IF EXISTS t1; - -SELECT @@warning_count; ---echo 0 Expected - -# -#This line generates A Note warning -# -DROP TABLE IF EXISTS t1; - -SELECT @@warning_count; ---echo 1 Expected - ---echo '#--------------------FN_DYNVARS_162_02-------------------------#' -# -# Value OFF -# - -SET SESSION sql_notes = OFF; - ---echo creating a temporary table -CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20)); ---echo conditionally dropping the table twice so that a note generates - -DROP TABLE IF EXISTS t1; - -SELECT @@warning_count; ---echo 0 Expected - -# -#This line generates A Note warning -# -DROP TABLE IF EXISTS t1; - -SELECT @@warning_count; ---echo 0 Expected - ---echo '#------------------FN_DYNVARS_162_03---------------------------#' -# -# Session data integrity check & GLOBAL Value check -# - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_notes; ---echo 1 / TRUE Expected - -SET SESSION sql_notes = FALSE; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_notes; ---echo 1 / TRUE Expected - -SET SESSION sql_notes = TRUE; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_notes; ---echo 1 / TRUE Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_notes; ---echo 0 / FALSE Expected - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# - -SET SESSION sql_notes = @default_sql_notes; - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - ---enable_ps_protocol - diff --git a/mysql-test/t/sql_quote_show_create_basic.test b/mysql-test/t/sql_quote_show_create_basic.test deleted file mode 100644 index 1919b3ee642..00000000000 --- a/mysql-test/t/sql_quote_show_create_basic.test +++ /dev/null @@ -1,176 +0,0 @@ -############## mysql-test\t\sql_quote_show_create_basic.test ################## -# # -# Variable Name: sql_quote_show_create # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Valid Values: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_quote_show_create # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -####################################################################### -# START OF sql_quote_show_create TESTS # -####################################################################### - - -############################################################################## -# Saving initial value of sql_quote_show_create in a temporary variable # -############################################################################## - -SET @session_start_value = @@session.sql_quote_show_create; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_162_01------------------------#' -###################################################################### -# Display the DEFAULT value of sql_quote_show_create # -###################################################################### - -SET @@session.sql_quote_show_create = 0; -SET @@session.sql_quote_show_create = DEFAULT; -SELECT @@session.sql_quote_show_create; - -SET @@session.sql_quote_show_create = 1; -SET @@session.sql_quote_show_create = DEFAULT; -SELECT @@session.sql_quote_show_create; - - ---echo '#---------------------FN_DYNVARS_162_02-------------------------#' -############################################################################# -# Check if sql_quote_show_create can be accessed with and without @@ sign # -############################################################################# - -SET sql_quote_show_create = 1; -SELECT @@sql_quote_show_create; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_quote_show_create; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_quote_show_create; - -SET session sql_quote_show_create = 0; -SELECT @@session.sql_quote_show_create; - - ---echo '#--------------------FN_DYNVARS_162_03------------------------#' -######################################################################## -# change the value of sql_quote_show_create to a valid value # -######################################################################## - -SET @@session.sql_quote_show_create = 0; -SELECT @@session.sql_quote_show_create; -SET @@session.sql_quote_show_create = 1; -SELECT @@session.sql_quote_show_create; - - ---echo '#--------------------FN_DYNVARS_162_04-------------------------#' -########################################################################## -# Change the value of sql_quote_show_create to invalid value # -########################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = ÕN; - -SET @@session.sql_quote_show_create = OF; -SELECT @@session.sql_quote_show_create; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_quote_show_create = NO; - - ---echo '#-------------------FN_DYNVARS_162_05----------------------------#' -########################################################################## -# Test if accessing global sql_quote_show_create gives error # -########################################################################## - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_quote_show_create = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_quote_show_create; - ---echo '#----------------------FN_DYNVARS_162_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_quote_show_create'; - ---echo '#----------------------FN_DYNVARS_162_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_quote_show_create = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_quote_show_create'; -SELECT @@session.sql_quote_show_create; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_quote_show_create'; - ---echo '#---------------------FN_DYNVARS_162_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_quote_show_create = OFF; -SELECT @@session.sql_quote_show_create; -SET @@session.sql_quote_show_create = ON; -SELECT @@session.sql_quote_show_create; - ---echo '#---------------------FN_DYNVARS_162_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_quote_show_create = TRUE; -SELECT @@session.sql_quote_show_create; -SET @@session.sql_quote_show_create = FALSE; -SELECT @@session.sql_quote_show_create; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_quote_show_create = @session_start_value; -SELECT @@session.sql_quote_show_create; - -############################################################### -# END OF sql_quote_show_create TESTS # -############################################################### diff --git a/mysql-test/t/sql_quote_show_create_func.test b/mysql-test/t/sql_quote_show_create_func.test deleted file mode 100644 index 6350771a0da..00000000000 --- a/mysql-test/t/sql_quote_show_create_func.test +++ /dev/null @@ -1,114 +0,0 @@ -############# mysql-test\t\sql_quote_show_create_func.test ################# -# # -# Variable Name: sql_quote_show_create # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable sql_quote_show_create# -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -############################################################################ - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @default_sql_quote_show_create = @@sql_quote_show_create; - -# -# Creating tables -# - -CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20)); - ---echo '#-----------------------------FN_DYNVARS_163_01------------------------------------#' -# -# Value TRUE -# - -SET SESSION sql_quote_show_create = TRUE; - -SHOW CREATE DATABASE test; ---echo EXPECTING identifiers test TO BE quoted like 'test' - -SHOW CREATE TABLE t1; ---echo EXPECTING identifiers a, b, t1 TO BE quoted like 'a','b','t1' - - ---echo '#-----------------------------FN_DYNVARS_163_02------------------------------------#' -# -# Value FALSE -# - -SET SESSION sql_quote_show_create = FALSE; - -SHOW CREATE DATABASE test; ---echo EXPECTING identifiers test NOT TO BE quoted like 'test' - -SHOW CREATE TABLE t1; ---echo EXPECTING identifiers a, b, t1 NOT TO BE quoted like 'a','b','t1' - ---echo '#----------------------------FN_DYNVARS_163_03--------------------------------------#' -# -# Session data integrity check -# - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_quote_show_create; ---echo 1 / TRUE Expected - -SET SESSION sql_quote_show_create = FALSE; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_quote_show_create; ---echo 1 / TRUE Expected - -SET SESSION sql_quote_show_create = TRUE; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_quote_show_create; ---echo 1 / TRUE Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_quote_show_create; ---echo 0 / FALSE Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# ---echo ---echo Cleanup - -SET @@sql_quote_show_create = @default_sql_quote_show_create; - -DROP TABLE t1; diff --git a/mysql-test/t/sql_safe_updates_basic.test b/mysql-test/t/sql_safe_updates_basic.test deleted file mode 100644 index 489b42949a0..00000000000 --- a/mysql-test/t/sql_safe_updates_basic.test +++ /dev/null @@ -1,175 +0,0 @@ -############## mysql-test\t\sql_safe_updates_basic.test ####################### -# # -# Variable Name: sql_safe_updates # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Range: 0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_safe_updates # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF sql_safe_updates TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of sql_safe_updates in a temporary variable # -################################################################################ - -SET @session_start_value = @@session.sql_safe_updates; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_163_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_safe_updates # -######################################################################## - -SET @@session.sql_safe_updates = 0; -SET @@session.sql_safe_updates = DEFAULT; -SELECT @@session.sql_safe_updates; - -SET @@session.sql_safe_updates = 1; -SET @@session.sql_safe_updates = DEFAULT; -SELECT @@session.sql_safe_updates; - - ---echo '#---------------------FN_DYNVARS_163_02-------------------------#' -############################################################################# -# Check if sql_safe_updates can be accessed with and without @@ sign # -############################################################################# - -SET sql_safe_updates = 1; -SELECT @@sql_safe_updates; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_safe_updates; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_safe_updates; - -SET session sql_safe_updates = 0; -SELECT @@session.sql_safe_updates; - - ---echo '#--------------------FN_DYNVARS_163_03------------------------#' -######################################################################## -# change the value of sql_safe_updates to a valid value # -######################################################################## - -SET @@session.sql_safe_updates = 0; -SELECT @@session.sql_safe_updates; -SET @@session.sql_safe_updates = 1; -SELECT @@session.sql_safe_updates; - - ---echo '#--------------------FN_DYNVARS_163_04-------------------------#' -########################################################################### -# Change the value of sql_safe_updates to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = ÕN; - -SET @@session.sql_safe_updates = OF; -SELECT @@session.sql_safe_updates; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_safe_updates = NO; - - ---echo '#-------------------FN_DYNVARS_163_05----------------------------#' -########################################################################### -# Test if accessing global sql_safe_updates gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_safe_updates = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_safe_updates; - ---echo '#----------------------FN_DYNVARS_163_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_safe_updates'; - ---echo '#----------------------FN_DYNVARS_163_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_safe_updates = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_safe_updates'; -SELECT @@session.sql_safe_updates; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_safe_updates'; - ---echo '#---------------------FN_DYNVARS_163_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_safe_updates = OFF; -SELECT @@session.sql_safe_updates; -SET @@session.sql_safe_updates = ON; -SELECT @@session.sql_safe_updates; - ---echo '#---------------------FN_DYNVARS_163_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_safe_updates = TRUE; -SELECT @@session.sql_safe_updates; -SET @@session.sql_safe_updates = FALSE; -SELECT @@session.sql_safe_updates; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_safe_updates = @session_start_value; -SELECT @@session.sql_safe_updates; - -############################################################### -# END OF sql_safe_updates TESTS # -############################################################### diff --git a/mysql-test/t/sql_safe_updates_func.test b/mysql-test/t/sql_safe_updates_func.test deleted file mode 100644 index a8ce3a8d0f7..00000000000 --- a/mysql-test/t/sql_safe_updates_func.test +++ /dev/null @@ -1,202 +0,0 @@ -############# mysql-test\t\sql_safe_updates_func.test ##################### -# # -# Variable Name: sql_safe_updates # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: 1 TRUE # -# Values: 1 TRUE, 0 FALSE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_safe_updates" # -# that checks behavior of this variable in the following ways# -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -########################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @default_sql_safe_updates = @@sql_safe_updates; - -# -# Creating tables -# - -CREATE TEMPORARY TABLE t1(a int PRIMARY KEY, b varchar(20)); - -INSERT INTO t1 VALUES(1, 'val1'); -INSERT INTO t1 VALUES(2, 'val2'); -INSERT INTO t1 VALUES(3, 'val3'); -INSERT INTO t1 VALUES(4, 'val4'); -INSERT INTO t1 VALUES(5, 'val5'); -INSERT INTO t1 VALUES(6, 'val6'); -INSERT INTO t1 VALUES(7, 'val7'); -INSERT INTO t1 VALUES(8, 'val8'); -INSERT INTO t1 VALUES(9, 'val9'); - - - ---echo '#-----------------------------FN_DYNVARS_164_01------------------------------------#' ---echo ---echo Value ON ---echo -# -# Value ON -# - -SET SESSION sql_safe_updates = ON; - ---echo '#-----------------------------FN_DYNVARS_164_02------------------------------------#' -# -# Without WHERE Clause -# ---echo Expected error : Update without key in safe mode ---error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE -DELETE FROM t1; -SELECT * FROM t1; - -PREPARE stmt FROM 'DELETE FROM t1;'; ---echo Expected error : Update without key in safe mode ---error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE -EXECUTE stmt; -DEALLOCATE PREPARE stmt; - ---echo '#-----------------------------FN_DYNVARS_164_03------------------------------------#' -# -# With a LIMIT Clause -# ---echo Expected error : Update without key in safe mode ---error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE -DELETE FROM t1 LIMIT 2; -SELECT * FROM t1; - ---echo '#-----------------------------FN_DYNVARS_164_04------------------------------------#' -# -# With a no key WHERE Clause -# ---echo Expected error : Update without key in safe mode ---error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE -DELETE FROM t1 WHERE b='val1'; -SELECT * FROM t1; - ---echo '#-----------------------------FN_DYNVARS_164_05------------------------------------#' -# -# With a key WHERE Clause -# ---echo This one should work -DELETE FROM t1 WHERE a=1; -SELECT * FROM t1; - ---echo ---echo Value OFF ---echo -# -# Value OFF -# - -SET SESSION sql_safe_updates = OFF; - ---echo '#-----------------------------FN_DYNVARS_164_06------------------------------------#' -# -# With a no key WHERE Clause -# ---echo This one should work -DELETE FROM t1 WHERE b='val1'; -SELECT * FROM t1; - ---echo '#-----------------------------FN_DYNVARS_164_07------------------------------------#' -# -# With a key WHERE Clause -# ---echo This one should work -DELETE FROM t1 WHERE a=1; -SELECT * FROM t1; - ---echo '#-----------------------------FN_DYNVARS_164_08------------------------------------#' -# -# With a LIMIT Clause -# ---echo This one should work -DELETE FROM t1 LIMIT 2; -SELECT * FROM t1; - ---echo '#-----------------------------FN_DYNVARS_164_09------------------------------------#' -# -# Without WHERE Clause -# ---echo This one should work ---echo DELETE FROM t1; ---error ER_MIXING_NOT_ALLOWED -#DELETE FROM t1; ---echo Bug#35392 Unexpected error occurs in this statement Can't change size of the file ---echo statement is remarked because the error is uncatchable by testing framework -SELECT * FROM t1; - -PREPARE stmt FROM 'DELETE FROM t1;'; ---echo Expected error : Update without key in safe mode ---error ER_MIXING_NOT_ALLOWED -#EXECUTE stmt; ---echo Bug#35392 Unexpected error occurs in this statement Can't change size of the file ---echo statement is remarked because the error is uncatchable by testing framework -DEALLOCATE PREPARE stmt; - - ---echo '#----------------------------FN_DYNVARS_164_10--------------------------------------#' -# -# Session data integrity check -# - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_safe_updates; ---echo 0 / FALSE Expected - -SET SESSION sql_safe_updates = FALSE; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_safe_updates; ---echo 0 / FALSE Expected - -SET SESSION sql_safe_updates = TRUE; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_safe_updates; ---echo 1 / TRUE Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_safe_updates; ---echo 0 / FALSE Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# - -SET SESSION sql_safe_updates = @default_sql_safe_updates; - -DROP TABLE t1; diff --git a/mysql-test/t/sql_select_limit_func.test b/mysql-test/t/sql_select_limit_func.test deleted file mode 100644 index ed582949aa0..00000000000 --- a/mysql-test/t/sql_select_limit_func.test +++ /dev/null @@ -1,209 +0,0 @@ -############# mysql-test\t\sql_select_limit_func.test ##################### -# # -# Variable Name: sql_select_limit # -# Scope: GLOBAL, SESSION # -# Access Type: Dynamic # -# Data Type: NUMERIC # -# Default Value: 4294967295 # -# Values: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_select_limit" # -# that checks behavior of this variable in the following ways# -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -########################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @session_sql_select_limit = @@SESSION.sql_select_limit; -SET @global_sql_select_limit = @@GLOBAL.sql_select_limit; - -# -# Creating tables -# - -CREATE TEMPORARY TABLE t1(a int PRIMARY KEY, b varchar(20)); -CREATE TEMPORARY TABLE t2(a int PRIMARY KEY, b varchar(20)); -CREATE TEMPORARY TABLE t3(a int PRIMARY KEY, b varchar(20)); - -INSERT INTO t1 VALUES(1, 'val1'); -INSERT INTO t1 VALUES(2, 'val2'); -INSERT INTO t1 VALUES(3, 'val3'); -INSERT INTO t1 VALUES(4, 'val4'); -INSERT INTO t1 VALUES(5, 'val5'); -INSERT INTO t1 VALUES(6, 'val6'); -INSERT INTO t1 VALUES(7, 'val7'); -INSERT INTO t1 VALUES(8, 'val8'); -INSERT INTO t1 VALUES(9, 'val9'); - -INSERT INTO t2 VALUES(5, 'val5'); -INSERT INTO t2 VALUES(6, 'val6'); -INSERT INTO t2 VALUES(7, 'val7'); -INSERT INTO t2 VALUES(8, 'val8'); -INSERT INTO t2 VALUES(9, 'val9'); - - - ---echo '#-----------------------------FN_DYNVARS_165_01-----------------#' ---echo ---echo Value DEFAULT ---echo -# -# Value DEFAULT -# - ---enable_info - -SET SESSION sql_select_limit = DEFAULT; - -SELECT * FROM t1; ---echo Expecting affected rows: 9 - -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo Expecting affected rows: 5 - - ---echo '#-----------------------------FN_DYNVARS_165_02---------------#' -# -# Small value -# - -SET SESSION sql_select_limit = 2; - -SELECT * FROM t1; ---echo Expecting affected rows: 2 - -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ---echo Expecting affected rows: 2 - ---echo '#-----------------------------FN_DYNVARS_165_03---------------#' -# -# Small value with LIMIT Clause -# - -SET SESSION sql_select_limit = 2; - -SELECT * FROM t1 LIMIT 4; ---echo Expecting affected rows: 4 - -SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a LIMIT 3; ---echo Expecting affected rows: 3 - ---echo '#-----------------------------FN_DYNVARS_165_04----------------#' -# -# Small value with Store procedure -# - -SET SESSION sql_select_limit = 2; - -delimiter |; - -CREATE PROCEDURE TestProc() -BEGIN - SELECT * FROM t1; -END| -delimiter ;| - -call TestProc(); ---echo Expecting affected rows: 9 - -DROP PROCEDURE TestProc; - -delimiter |; - -CREATE PROCEDURE TestProc() -BEGIN - SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; -END| -delimiter ;| - -call TestProc(); ---echo Expecting affected rows: 5 - -DROP PROCEDURE TestProc; - ---echo '#-----------------------------FN_DYNVARS_165_05-----------------#' -# -# Small value with Non result producing SELECT statements -# - -SET SESSION sql_select_limit = 2; - -CREATE TEMPORARY TABLE t4(a int PRIMARY KEY, b varchar(20)) SELECT * FROM t2; ---echo Expecting Records: 5 - -INSERT INTO t3 SELECT * FROM t1; ---echo Expecting Records: 9 - ---echo '#-----------------------------FN_DYNVARS_165_06---------------------#' -# -# Session data integrity check & GLOBAL Value check -# ---disable_info - -SET GLOBAL sql_select_limit = 2; - ---echo ** Connecting con_int2 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_select_limit; ---echo 2 Expected - -SET SESSION sql_select_limit = 10; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_select_limit; ---echo 2 Expected - -SET SESSION sql_select_limit = 12; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_select_limit; ---echo 12 Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_select_limit; ---echo 10 Expected - -SELECT @@GLOBAL.sql_select_limit; ---echo 2 Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# - ---disable_info - -SET @@SESSION.sql_select_limit = @session_sql_select_limit; -SET @@GLOBAL.sql_select_limit = @global_sql_select_limit; - -DROP TABLE t1; -DROP TABLE t2; -DROP TABLE t3; -DROP TABLE t4; diff --git a/mysql-test/t/sql_slave_skip_counter_basic.test b/mysql-test/t/sql_slave_skip_counter_basic.test deleted file mode 100644 index e7d9098aee9..00000000000 --- a/mysql-test/t/sql_slave_skip_counter_basic.test +++ /dev/null @@ -1,109 +0,0 @@ -############## mysql-test\t\sql_slave_skip_counter_basic.test ################# -# # -# Variable Name: sql_slave_skip_counter # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_slave_skip_counter # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/not_embedded.inc ---source include/load_sysvars.inc - -################################################################ -# START OF sql_slave_skip_counter TESTS # -################################################################ - ---echo '#--------------------FN_DYNVARS_165_01-------------------------#' -############################################################# -# Try accessing initial value # -############################################################# - ---Error ER_VAR_CANT_BE_READ -SET @start_global_value = @@global.sql_slave_skip_counter; ---Error ER_VAR_CANT_BE_READ -SELECT @@global.sql_slave_skip_counter; - ---echo 'Info:This value is write only. Value can not be read' - ---echo '#--------------------FN_DYNVARS_165_02-------------------------#' -################################################################### -# Try setting DEFAULT value to variable # -################################################################### - ---Error ER_NO_DEFAULT -SET @@global.sql_slave_skip_counter = DEFAULT; - - ---echo '#--------------------FN_DYNVARS_165_03-------------------------#' -################################################################### -# Try setting any valid value to variable # -################################################################### - -SET @@global.sql_slave_skip_counter = 0; -SET @@global.sql_slave_skip_counter = 5; -SET @@global.sql_slave_skip_counter = 1024; -SET @@global.sql_slave_skip_counter = 2147483648; -SET @@global.sql_slave_skip_counter = 2147483648*2; -SET @@global.sql_slave_skip_counter = 2147483648*2-1; -SET @@global.sql_slave_skip_counter = 4294967295*4294967295; - - ---echo '#--------------------FN_DYNVARS_165_03-------------------------#' -################################################################### -# Checking invalid value for variable # -################################################################### - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sql_slave_skip_counter = '5'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sql_slave_skip_counter = 5.5; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sql_slave_skip_counter = -.5; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sql_slave_skip_counter = -.0; - - ---echo '#--------------------FN_DYNVARS_165_03-------------------------#' -################################################################### -# Try retrieving value from Information Schema # -################################################################### - -SET @@global.sql_slave_skip_counter = 1024; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_slave_skip_counter'; - - ---echo '#--------------------FN_DYNVARS_165_03-------------------------#' -################################################################### -# Checking if variable is accessible with session scope # -################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@sql_slave_skip_counter = 10; ---Error ER_GLOBAL_VARIABLE -SET @@session.sql_slave_skip_counter = 12; ---Error ER_GLOBAL_VARIABLE -SET @@local.sql_slave_skip_counter = 13; - -######################################################## -# END OF sql_slave_skip_counter TESTS # -######################################################## - diff --git a/mysql-test/t/sql_warnings_basic.test b/mysql-test/t/sql_warnings_basic.test deleted file mode 100644 index f740403ceda..00000000000 --- a/mysql-test/t/sql_warnings_basic.test +++ /dev/null @@ -1,182 +0,0 @@ -################# mysql-test\t\sql_warnings_basic.test ######################## -# # -# Variable Name: sql_warnings # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Valid Values:0,1 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable sql_warnings # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - - -######################################################################## -# START OF sql_warnings TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of sql_warnings in a temporary variable # -############################################################################## - -SET @session_start_value = @@session.sql_warnings; -SELECT @session_start_value; - - ---echo '#--------------------FN_DYNVARS_166_01------------------------#' -######################################################################## -# Display the DEFAULT value of sql_warnings # -######################################################################## - -SET @@session.sql_warnings = 0; -SET @@session.sql_warnings = DEFAULT; -SELECT @@session.sql_warnings; - -SET @@session.sql_warnings = 1; -SET @@session.sql_warnings = DEFAULT; -SELECT @@session.sql_warnings; - - ---echo '#---------------------FN_DYNVARS_166_02-------------------------#' -############################################################################# -# Check if sql_warnings can be accessed with and without @@ sign # -############################################################################# - -SET sql_warnings = 1; -SELECT @@sql_warnings; - ---Error ER_UNKNOWN_TABLE -SELECT session.sql_warnings; - ---Error ER_UNKNOWN_TABLE -SELECT local.sql_warnings; - -SET session sql_warnings = 0; -SELECT @@session.sql_warnings; - - ---echo '#--------------------FN_DYNVARS_166_03------------------------#' -######################################################################## -# change the value of sql_warnings to a valid value # -######################################################################## - -SET @@session.sql_warnings = 0; -SELECT @@session.sql_warnings; -SET @@session.sql_warnings = 1; -SELECT @@session.sql_warnings; - - ---echo '#--------------------FN_DYNVARS_166_04-------------------------#' -########################################################################### -# Change the value of sql_warnings to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = -0.6; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = 1.9; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = TRÜE; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = ÕN; - -SET @@session.sql_warnings = OF; -SELECT @@session.sql_warnings; - ---echo 'Bug# 34828: OF is taken as OFF and a value of 0 is set.' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = ÓFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = '¹'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.sql_warnings = NO; - - ---echo '#-------------------FN_DYNVARS_166_05----------------------------#' -########################################################################### -# Test if accessing global sql_warnings gives error # -########################################################################### - ---Error ER_LOCAL_VARIABLE -SET @@global.sql_warnings = 0; - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@global.sql_warnings; - - ---echo '#----------------------FN_DYNVARS_166_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sql_warnings'; - - ---echo '#----------------------FN_DYNVARS_166_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@session.sql_warnings = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_warnings'; -SELECT @@session.sql_warnings; -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='sql_warnings'; ---echo 'Bug: value in information schema does not match' - ---echo '#---------------------FN_DYNVARS_166_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@session.sql_warnings = OFF; -SELECT @@session.sql_warnings; -SET @@session.sql_warnings = ON; -SELECT @@session.sql_warnings; - ---echo '#---------------------FN_DYNVARS_166_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@session.sql_warnings = TRUE; -SELECT @@session.sql_warnings; -SET @@session.sql_warnings = FALSE; -SELECT @@session.sql_warnings; - -############################## -# Restore initial value # -############################## - -SET @@session.sql_warnings = @session_start_value; -SELECT @@session.sql_warnings; - - -############################################################### -# END OF sql_warnings TESTS # -############################################################### diff --git a/mysql-test/t/sql_warnings_func.test b/mysql-test/t/sql_warnings_func.test deleted file mode 100644 index e7705d1f146..00000000000 --- a/mysql-test/t/sql_warnings_func.test +++ /dev/null @@ -1,120 +0,0 @@ -############# mysql-test\t\sql_warnings_func.test ######################### -# # -# Variable Name: sql_warnings # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: BOOLEAN # -# Default Value: FALSE 0 # -# Values: TRUE 1, FALSE 0 # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "sql_warnings" # -# that checks behavior of this variable in the following ways# -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -########################################################################### - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @default_sql_warnings = @@sql_warnings; - -# -# Creating tables -# - -CREATE TEMPORARY TABLE t1(a varchar(5), b varchar(20)); - ---enable_info ---disable_warnings - ---echo '#-----------------------------FN_DYNVARS_167_01------------#' -# -# Value DEFAULT -# -SET @@sql_warnings = DEFAULT; - -INSERT INTO t1 VALUES('abcdef', 'val1'); - ---echo '#-----------------------------FN_DYNVARS_167_02------------------#' -# -# OFF value -# - -SET @@sql_warnings = 0; - -INSERT INTO t1 VALUES('abcdef', 'val1'); - ---echo '#-----------------------------FN_DYNVARS_167_03---------------#' -# -# ON value -# - -SET @@sql_warnings = 1; - -INSERT INTO t1 VALUES('abcdef', 'val1'); - - ---echo '#----------------------------FN_DYNVARS_167_04---------------#' -# -# Session data integrity check Value check -# - ---disable_info - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_warnings; ---echo 0 / FALSE Expected - -SET SESSION sql_warnings = FALSE; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_warnings; ---echo 0 / FALSE Expected - -SET SESSION sql_warnings = TRUE; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.sql_warnings; ---echo 1 / TRUE Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.sql_warnings; ---echo 0 / FALSE Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# - -DROP TABLE t1; - -SET @@sql_warnings = @default_sql_warnings; - ---disable_info ---enable_warnings diff --git a/mysql-test/t/ssl_ca_basic.test b/mysql-test/t/ssl_ca_basic.test deleted file mode 100644 index c369f1f0894..00000000000 --- a/mysql-test/t/ssl_ca_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\ssl_ca_basic.test ############################# -# # -# Variable Name: ssl_ca # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable ssl_ca # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - --- source include/have_ssl.inc - ---echo '#---------------------BS_STVARS_045_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.ssl_ca); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_045_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.ssl_ca=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.ssl_ca); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_045_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.ssl_ca = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_ca'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.ssl_ca); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_ca'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_045_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@ssl_ca = @@GLOBAL.ssl_ca; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_045_05----------------------#' -################################################################################ -# Check if ssl_ca can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@ssl_ca); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.ssl_ca); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.ssl_ca); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.ssl_ca); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT ssl_ca = @@SESSION.ssl_ca; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/ssl_capath_basic.test b/mysql-test/t/ssl_capath_basic.test deleted file mode 100644 index c32b572fb1b..00000000000 --- a/mysql-test/t/ssl_capath_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\ssl_capath_basic.test ######################### -# # -# Variable Name: ssl_capath # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable ssl_capath # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_046_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.ssl_capath); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_046_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.ssl_capath=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.ssl_capath); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_046_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.ssl_capath = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_capath'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.ssl_capath); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_capath'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_046_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@ssl_capath = @@GLOBAL.ssl_capath; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_046_05----------------------#' -################################################################################ -# Check if ssl_capath can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@ssl_capath); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.ssl_capath); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.ssl_capath); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.ssl_capath); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT ssl_capath = @@SESSION.ssl_capath; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/ssl_cert_basic.test b/mysql-test/t/ssl_cert_basic.test deleted file mode 100644 index c3b69bd495f..00000000000 --- a/mysql-test/t/ssl_cert_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\ssl_cert_basic.test ########################### -# # -# Variable Name: ssl_cert # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable ssl_cert # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - --- source include/have_ssl.inc - ---echo '#---------------------BS_STVARS_047_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.ssl_cert); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_047_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.ssl_cert=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.ssl_cert); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_047_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.ssl_cert = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_cert'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.ssl_cert); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_cert'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_047_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@ssl_cert = @@GLOBAL.ssl_cert; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_047_05----------------------#' -################################################################################ -# Check if ssl_cert can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@ssl_cert); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.ssl_cert); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.ssl_cert); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.ssl_cert); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT ssl_cert = @@SESSION.ssl_cert; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/ssl_cipher_basic.test b/mysql-test/t/ssl_cipher_basic.test deleted file mode 100644 index 425f7aae442..00000000000 --- a/mysql-test/t/ssl_cipher_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\ssl_cipher_basic.test ######################### -# # -# Variable Name: ssl_cipher # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable ssl_cipher # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_048_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.ssl_cipher); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_048_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.ssl_cipher=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.ssl_cipher); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_048_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.ssl_cipher = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_cipher'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.ssl_cipher); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_cipher'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_048_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@ssl_cipher = @@GLOBAL.ssl_cipher; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_048_05----------------------#' -################################################################################ -# Check if ssl_cipher can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@ssl_cipher); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.ssl_cipher); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.ssl_cipher); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.ssl_cipher); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT ssl_cipher = @@SESSION.ssl_cipher; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/ssl_key_basic.test b/mysql-test/t/ssl_key_basic.test deleted file mode 100644 index 4616f281c27..00000000000 --- a/mysql-test/t/ssl_key_basic.test +++ /dev/null @@ -1,102 +0,0 @@ - - -################## mysql-test\t\ssl_key_basic.test ############################ -# # -# Variable Name: ssl_key # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable ssl_key # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - --- source include/have_ssl.inc - ---echo '#---------------------BS_STVARS_049_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.ssl_key); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_049_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.ssl_key=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.ssl_key); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_049_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.ssl_key = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_key'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.ssl_key); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='ssl_key'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_049_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@ssl_key = @@GLOBAL.ssl_key; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_049_05----------------------#' -################################################################################ -# Check if ssl_key can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@ssl_key); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.ssl_key); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.ssl_key); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.ssl_key); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT ssl_key = @@SESSION.ssl_key; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index bc241423417..69ae56ff9a2 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -4,6 +4,9 @@ # embedded server causes different stat -- source include/not_embedded.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + # Disable concurrent inserts to avoid sporadic test failures as it might # affect the the value of variables used throughout the test case. set @old_concurrent_insert= @@global.concurrent_insert; @@ -88,7 +91,7 @@ show status like 'last_query_cost'; drop table t1; # -# Test for Bug #15933 max_used_connections is wrong after FLUSH STATUS +# Test for Bug#15933 max_used_connections is wrong after FLUSH STATUS # if connections are cached # # @@ -188,7 +191,7 @@ disconnect con1; # -# Bug #30377: EXPLAIN loses last_query_cost when used with UNION +# Bug#30377 EXPLAIN loses last_query_cost when used with UNION # CREATE TABLE t1 ( a INT ); @@ -238,8 +241,10 @@ let $tmp_table2 = `show global status like 'Created_tmp_tables'`; --disable_query_log eval select substring_index('$rnd_next2',0x9,-1)-substring_index('$rnd_next',0x9,-1) as rnd_diff, substring_index('$tmp_table2',0x9,-1)-substring_index('$tmp_table',0x9,-1) as tmp_table_diff; --enable_query_log +disconnect con1; +connection default; -# +# # Bug#30252 Com_create_function is not incremented. # flush status; @@ -259,7 +264,7 @@ drop function f1; show status like 'Com%function'; # -# Bug#37908: Skipped access right check caused server crash. +# Bug#37908 Skipped access right check caused server crash. # connect (root, localhost, root,,test); connection root; @@ -271,28 +276,75 @@ insert into db37908.t1 values(1); grant usage,execute on test.* to mysqltest_1@localhost; delimiter |; create procedure proc37908() begin select 1; end | -create function func37908() returns int sql security invoker +create function func37908() returns int sql security invoker return (select * from db37908.t1 limit 1)| delimiter ;| - + connect (user1,localhost,mysqltest_1,,test); connection user1; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR select * from db37908.t1; ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR show status where variable_name ='uptime' and 2 in (select * from db37908.t1); ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR show procedure status where name ='proc37908' and 1 in (select f1 from db37908.t1); ---error 1142 +--error ER_TABLEACCESS_DENIED_ERROR show function status where name ='func37908' and 1 in (select func37908()); -connection root; +connection default; +disconnect user1; +disconnect root; drop database db37908; drop procedure proc37908; drop function func37908; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +DROP USER mysqltest_1@localhost; +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc + +# +# Bug#41131 "Questions" fails to increment - ignores statements instead stored procs +# +connect (con1,localhost,root,,); +connection con1; +--disable_warnings +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +--enable_warnings +DELIMITER $$; +CREATE FUNCTION f1() RETURNS INTEGER +BEGIN + DECLARE foo INTEGER; + DECLARE bar INTEGER; + SET foo=1; + SET bar=2; + RETURN foo; +END $$ +CREATE PROCEDURE p1() + BEGIN + SELECT 1; +END $$ +DELIMITER ;$$ +let $org_queries= `SHOW STATUS LIKE 'Queries'`; +SELECT f1(); +CALL p1(); +let $new_queries= `SHOW STATUS LIKE 'Queries'`; +--disable_query_log +let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`; +--enable_query_log +eval SELECT $diff; +disconnect con1; +connection default; +DROP PROCEDURE p1; +DROP FUNCTION f1; + # End of 5.1 tests # Restore global concurrent_insert value. Keep in the end of the test file. --connection default set @@global.concurrent_insert= @old_concurrent_insert; + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc + diff --git a/mysql-test/t/status2.test b/mysql-test/t/status2.test new file mode 100644 index 00000000000..2d1541c54f2 --- /dev/null +++ b/mysql-test/t/status2.test @@ -0,0 +1,68 @@ +--source include/not_embedded.inc + +--echo # +--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines +--echo # +FLUSH STATUS; +DELIMITER $$; +CREATE FUNCTION testQuestion() RETURNS INTEGER +BEGIN + DECLARE foo INTEGER; + DECLARE bar INTEGER; + SET foo=1; + SET bar=2; + RETURN foo; +END $$ +CREATE PROCEDURE testQuestion2() +BEGIN + SELECT 1; +END $$ +DELIMITER ;$$ +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings +CREATE TABLE t1 (c1 INT); +CREATE TABLE t2 (c1 INT); +CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND + DO INSERT INTO t1 VALUES(1); + +--echo Assert Questions == 7 +SHOW STATUS LIKE 'Questions'; +SELECT testQuestion(); +--echo Assert Questions == 9 +SHOW STATUS LIKE 'Questions'; +CALL testQuestion2(); +--echo Assert Questions == 11 +SHOW STATUS LIKE 'Questions'; +SELECT 1; +--echo Assert Questions == 13 +SHOW STATUS LIKE 'Questions'; +connect (con1,localhost,root,,); +connection con1; +SELECT 1; +connection default; +disconnect con1; +--echo Assert Questions == 14 +SHOW STATUS LIKE 'Questions'; +DELIMITER $$; +CREATE TRIGGER trigg1 AFTER INSERT ON t1 + FOR EACH ROW BEGIN + INSERT INTO t2 VALUES (1); + END; +$$ +DELIMITER ;$$ +--echo Assert Questions == 16 +SHOW STATUS LIKE 'Questions'; +INSERT INTO t1 VALUES (1); +--echo Assert Questions == 18 +SHOW STATUS LIKE 'Questions'; +# TODO: Uncomment the lines below when FLUSH GLOBAL STATUS is implemented. +# FLUSH STATUS; +# SHOW GLOBAL STATUS LIKE 'Questions'; +DROP PROCEDURE testQuestion2; +DROP TRIGGER trigg1; +DROP FUNCTION testQuestion; +DROP EVENT ev1; +DROP TABLE t1,t2; +--echo End of 6.0 tests + diff --git a/mysql-test/t/storage_engine_basic-master.opt b/mysql-test/t/storage_engine_basic-master.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/t/storage_engine_basic-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/t/storage_engine_basic.test b/mysql-test/t/storage_engine_basic.test deleted file mode 100644 index 689afcd1010..00000000000 --- a/mysql-test/t/storage_engine_basic.test +++ /dev/null @@ -1,180 +0,0 @@ -############## 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/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 = MYISAM; - ---Error ER_NO_DEFAULT -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_TYPE_FOR_VAR -SET @@global.storage_engine = -1024; - ---Error ER_PARSE_ERROR -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_PARSE_ERROR -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; - - -#################################### -# 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 # -############################################################# - diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 486f7ce7897..f2ce045840c 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -1199,6 +1199,15 @@ show create table t1; drop table t1; # +# Bug #39591: Crash if table comment is longer than 62 characters +# + +#60 chars, 120 (+1) bytes (UTF-8 with 2-byte chars) +CREATE TABLE t3 (f1 INT) COMMENT 'כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן'; +SHOW CREATE TABLE t3; +DROP TABLE t3; + +# # Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode # set sql_mode= 'traditional'; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 493857fb463..9dcb645b28d 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1041,13 +1041,14 @@ DROP TABLE t1; create table t1 (a int, b decimal(13, 3)); insert into t1 values (1, 0.123); -let $outfile = $MYSQLTEST_VARDIR/master-data/test/subselect.out.file.1; +let $outfile_abs= $MYSQLTEST_VARDIR/tmp/subselect.out.file.1; +let $outfile_rel= ../../tmp/subselect.out.file.1; --error 0,1 ---remove_file $outfile -select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1; +--remove_file $outfile_abs +eval select a, (select max(b) from t1) into outfile "$outfile_rel" from t1; delete from t1; -load data infile "subselect.out.file.1" into table t1; ---remove_file $outfile +eval load data infile "$outfile_rel" into table t1; +--remove_file $outfile_abs select * from t1; drop table t1; @@ -3391,4 +3392,39 @@ DELETE FROM v3; DROP VIEW v1,v2,v3; DROP TABLE t1,t2; +--echo # +--echo # BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result +--echo # +create table t1(id integer primary key, g integer, v integer, s char(1)); +create table t2(id integer primary key, g integer, v integer, s char(1)); +insert into t1 values + (10, 10, 10, 'l'), + (20, 20, 20, 'l'), + (40, 40, 40, 'l'), + (41, 40, null, 'l'), + (50, 50, 50, 'l'), + (51, 50, null, 'l'), + (60, 60, 60, 'l'), + (61, 60, null, 'l'), + (70, 70, 70, 'l'), + (90, 90, null, 'l'); +insert into t2 values + (10, 10, 10, 'r'), + (30, 30, 30, 'r'), + (50, 50, 50, 'r'), + (60, 60, 60, 'r'), + (61, 60, null, 'r'), + (70, 70, 70, 'r'), + (71, 70, null, 'r'), + (80, 80, 80, 'r'), + (81, 80, null, 'r'), + (100,100,null, 'r'); + +select * +from t1 +where v in(select v + from t2 + where t1.g=t2.g) is unknown; +drop table t1, t2; + --echo End of 5.1 tests. diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test index 7c3d5013b8d..bf461f83a20 100644 --- a/mysql-test/t/subselect3.test +++ b/mysql-test/t/subselect3.test @@ -640,6 +640,35 @@ WHERE NULL NOT IN ( DROP TABLE t1; +# +# Bug #39069: <row constructor> IN <table-subquery> seriously messed up +# + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (11); + +--echo # 2nd and 3rd columns should be same +SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1 GROUP BY t1.a; +SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1 GROUP BY t1.a; +SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1; +SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1; + +# The x alias is used below to workaround bug #40674. +# Regression tests for sum function on outer column in subselect from dual: +SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 22), ROW(11, 12) IN (SELECT MAX(x), 22) FROM t1; +--echo # 2nd and 3rd columns should be same for x == 11 only +SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 12), ROW(11, 12) IN (SELECT MAX(x), 12) FROM t1; + +DROP TABLE t1; + +--echo # both columns should be same +SELECT ROW(1,2) = (SELECT NULL, NULL), ROW(1,2) IN (SELECT NULL, NULL); +SELECT ROW(1,2) = (SELECT 1, NULL), ROW(1,2) IN (SELECT 1, NULL); +SELECT ROW(1,2) = (SELECT NULL, 2), ROW(1,2) IN (SELECT NULL, 2); +SELECT ROW(1,2) = (SELECT NULL, 1), ROW(1,2) IN (SELECT NULL, 1); +SELECT ROW(1,2) = (SELECT 1, 1), ROW(1,2) IN (SELECT 1, 1); +SELECT ROW(1,2) = (SELECT 1, 2), ROW(1,2) IN (SELECT 1, 2); + --echo End of 5.0 tests # diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index b13640e7f3b..c805dd40fe8 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -176,14 +176,15 @@ drop table t1; # # Bug #29325: create table overwrites .MYD file of other table (datadir) # +let $MYSQLD_DATADIR= `select @@datadir`; SET SESSION keep_files_on_create = TRUE; ---write_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD +--write_file $MYSQLD_DATADIR/test/t1.MYD EOF --disable_abort_on_error --error 1,1,ER_TABLE_EXISTS_ERROR CREATE TABLE t1 (a INT) ENGINE MYISAM; --error 0,1 ---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD; +--remove_file $MYSQLD_DATADIR/test/t1.MYD; --enable_abort_on_error SET SESSION keep_files_on_create = FALSE; CREATE TABLE t1 (a INT) ENGINE MYISAM; @@ -199,34 +200,35 @@ DROP TABLE t1; # home directory is symlinked, e.g. mysql-test-run --mem. # This will be fixed in 6.0 only. # ---replace_result $MYSQLTEST_VARDIR TEST_DIR +let $MYSQLD_DATADIR= `select @@datadir`; +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error 0,ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) -INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql'; +INDEX DIRECTORY='$MYSQLD_DATADIR/mysql'; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings # ---replace_result $MYSQLTEST_VARDIR TEST_DIR +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error 0,ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) -DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test'; +DATA DIRECTORY='$MYSQLD_DATADIR/test'; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings # ---replace_result $MYSQLTEST_VARDIR TEST_DIR +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error 0,ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) -DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/'; +DATA DIRECTORY='$MYSQLD_DATADIR/'; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings # ---replace_result $MYSQLTEST_VARDIR TEST_DIR +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --error 0,ER_WRONG_ARGUMENTS eval CREATE TABLE t1(a INT) -INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data'; +INDEX DIRECTORY='$MYSQLD_DATADIR'; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings @@ -240,6 +242,7 @@ INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data_var'; # BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is # silently ignored # + SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE'; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; diff --git a/mysql-test/t/sync_frm_basic.test b/mysql-test/t/sync_frm_basic.test deleted file mode 100644 index 6c00182a805..00000000000 --- a/mysql-test/t/sync_frm_basic.test +++ /dev/null @@ -1,163 +0,0 @@ -############## mysql-test\t\sync_frm_basic.test ############################### -# # -# Variable Name: sync_frm # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: TRUE # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable sync_frm # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -############################################################## -# START OF sync_frm TESTS # -############################################################## - - -################################################################ -# Saving initial value of sync_frm in a temporary variable # -################################################################ - -SET @start_value = @@global.sync_frm; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_169_01------------------------#' -###################################################### -# Display the DEFAULT value of sync_frm # -###################################################### - -SET @@global.sync_frm = FALSE; -SET @@global.sync_frm = DEFAULT; -SELECT @@global.sync_frm; - - ---echo '#---------------------FN_DYNVARS_169_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.sync_frm = DEFAULT; -SELECT @@global.sync_frm = TRUE; - - ---echo '#--------------------FN_DYNVARS_169_03------------------------#' -###################################################### -# Change the value of sync_frm to a valid value # -###################################################### - -SET @@global.sync_frm = ON; -SELECT @@global.sync_frm; -SET @@global.sync_frm = OFF; -SELECT @@global.sync_frm; -SET @@global.sync_frm = 0; -SELECT @@global.sync_frm; -SET @@global.sync_frm = 1; -SELECT @@global.sync_frm; -SET @@global.sync_frm = TRUE; -SELECT @@global.sync_frm; -SET @@global.sync_frm = FALSE; -SELECT @@global.sync_frm; - ---echo '#--------------------FN_DYNVARS_169_04-------------------------#' -#################################################################### -# Change the value of sync_frm to invalid value # -#################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = TRUEF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = TRUE_F; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = FALSE0; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = OON; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = ONN; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = OOFF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = ' '; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = " "; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.sync_frm = ''; - - ---echo '#-------------------FN_DYNVARS_169_05----------------------------#' -#################################################################### -# Test if accessing session sync_frm gives error # -#################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.sync_frm = 1; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.sync_frm; - - ---echo '#----------------------FN_DYNVARS_169_06------------------------#' -#################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -#################################################################### - -SELECT @@global.sync_frm = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sync_frm'; - ---echo '#---------------------FN_DYNVARS_169_07----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same session variable # -############################################################################### - -SET @@global.sync_frm = 1; -SELECT @@sync_frm = @@global.sync_frm; - - ---echo '#---------------------FN_DYNVARS_169_08----------------------#' -################################################################### -# Check if sync_frm can be accessed with and without @@ sign # -################################################################### - ---Error ER_GLOBAL_VARIABLE -SET sync_frm = 1; -SELECT @@sync_frm; ---Error ER_PARSE_ERROR -SET global.sync_frm = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.sync_frm; ---Error ER_BAD_FIELD_ERROR -SELECT sync_frm = @@session.sync_frm; - - -############################## -# Restore initial value # -############################## - -SET @@global.sync_frm = @start_value; -SELECT @@global.sync_frm; - - -###################################################### -# END OF sync_frm TESTS # -###################################################### diff --git a/mysql-test/t/system_mysql_db.test b/mysql-test/t/system_mysql_db.test index e3d58ab7139..398a222b642 100644 --- a/mysql-test/t/system_mysql_db.test +++ b/mysql-test/t/system_mysql_db.test @@ -6,11 +6,6 @@ # depends on the presence of the log tables (which are CSV-based). --source include/have_csv.inc -# First delete some tables maybe left over from previous tests ---disable_warnings -drop table if exists t1,t1aa,t2aa; ---enable_warnings - -- disable_query_log use mysql; -- enable_query_log diff --git a/mysql-test/t/system_mysql_db_fix30020.test b/mysql-test/t/system_mysql_db_fix30020.test index dc68f469d3a..0a7d9dad7c9 100644 --- a/mysql-test/t/system_mysql_db_fix30020.test +++ b/mysql-test/t/system_mysql_db_fix30020.test @@ -21,10 +21,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`) # mysql_fix_system_tables which should be ignored. # Instead, concentrate on the errors in r/system_mysql_db.reject ---disable_warnings -drop table if exists t1,t1aa,t2aa; ---enable_warnings - -- disable_result_log -- disable_query_log @@ -108,4 +104,5 @@ time_zone_transition_type, general_log, slow_log, event, ndb_binlog_index; # check that we dropped all system tables show tables; +exit; # End of 4.1 tests diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test index 419a9cd1827..440fcc8aa8a 100644 --- a/mysql-test/t/system_mysql_db_fix40123.test +++ b/mysql-test/t/system_mysql_db_fix40123.test @@ -18,10 +18,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) # mysql_fix_system_tables which should be ignored. # Instead, concentrate on the errors in r/system_mysql_db.reject ---disable_warnings -drop table if exists t1,t1aa,t2aa; ---enable_warnings - -- disable_result_log -- disable_query_log diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test index 80365cfdff4..4924c625d57 100644 --- a/mysql-test/t/system_mysql_db_fix50030.test +++ b/mysql-test/t/system_mysql_db_fix50030.test @@ -18,10 +18,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) # mysql_fix_system_tables which should be ignored. # Instead, concentrate on the errors in r/system_mysql_db.reject ---disable_warnings -drop table if exists t1,t1aa,t2aa; ---enable_warnings - -- disable_result_log -- disable_query_log diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test index 1eed4d671ef..d88c4edba93 100644 --- a/mysql-test/t/system_mysql_db_fix50117.test +++ b/mysql-test/t/system_mysql_db_fix50117.test @@ -18,10 +18,6 @@ if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) # mysql_fix_system_tables which should be ignored. # Instead, concentrate on the errors in r/system_mysql_db.reject ---disable_warnings - drop table if exists t1,t1aa,t2aa; ---enable_warnings - -- disable_result_log -- disable_query_log diff --git a/mysql-test/t/system_time_zone_basic.test b/mysql-test/t/system_time_zone_basic.test deleted file mode 100644 index 0dfc850d227..00000000000 --- a/mysql-test/t/system_time_zone_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\system_time_zone_basic.test ################### -# # -# Variable Name: system_time_zone # -# Scope: Global # -# Access Type: Static # -# Data Type: string # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable system_time_zone # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_050_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.system_time_zone); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_050_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.system_time_zone=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.system_time_zone); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_050_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.system_time_zone = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='system_time_zone'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.system_time_zone); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='system_time_zone'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_050_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@system_time_zone = @@GLOBAL.system_time_zone; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_050_05----------------------#' -################################################################################ -# Check if system_time_zone can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@system_time_zone); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.system_time_zone); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.system_time_zone); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.system_time_zone); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT system_time_zone = @@SESSION.system_time_zone; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/table_definition_cache_basic.test b/mysql-test/t/table_definition_cache_basic.test deleted file mode 100644 index 741079091bc..00000000000 --- a/mysql-test/t/table_definition_cache_basic.test +++ /dev/null @@ -1,159 +0,0 @@ -############## mysql-test\t\table_definition_cache_basic.test ################## -# # -# Variable Name: table_definition_cache # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 400 # -# Range: 1 - 524288 # -# # -# # -# Creation Date: 2008-03-16 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "table_definition_cache" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_table_definition_cache # -# # -################################################################################ - ---source include/load_sysvars.inc - -############################################################### -# START OF table_definition_cache TESTS # -############################################################### - -############################################################################## -# Saving initial value of table_definition_cache in a temporary variable # -############################################################################## - -SET @start_value = @@global.table_definition_cache; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_019_01------------------------#' -####################################################################### -# Display the DEFAULT value of table_definition_cache # -####################################################################### - -SET @@global.table_definition_cache = 100; -SET @@global.table_definition_cache = DEFAULT; -SELECT @@global.table_definition_cache; - - ---echo '#---------------------FN_DYNVARS_019_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.table_definition_cache = DEFAULT; -SELECT @@global.table_definition_cache = 400; - - ---echo '#--------------------FN_DYNVARS_019_03------------------------#' -############################################################################## -# Change the value of table_definition_cache to a valid value # -############################################################################## - -SET @@global.table_definition_cache = 1; -SELECT @@global.table_definition_cache; -SET @@global.table_definition_cache = 2; -SELECT @@global.table_definition_cache; -SET @@global.table_definition_cache = 524287; -SELECT @@global.table_definition_cache; -SET @@global.table_definition_cache = 524288; -SELECT @@global.table_definition_cache; - - ---echo '#--------------------FN_DYNVARS_019_04-------------------------#' -################################################################################# -# Change the value of table_definition_cache to invalid value # -################################################################################# - -SET @@global.table_definition_cache = 0; -SELECT @@global.table_definition_cache; -SET @@global.table_definition_cache = -1024; -SELECT @@global.table_definition_cache; -SET @@global.table_definition_cache = 524289; -SELECT @@global.table_definition_cache; -SET @@global.table_definition_cache = 42949672950; -SELECT @@global.table_definition_cache; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_definition_cache = 21221204.10; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_definition_cache = ON; - - ---echo '#-------------------FN_DYNVARS_019_05----------------------------#' -################################################################################# -# Test if accessing session table_definition_cache gives error # -################################################################################# - ---Error ER_GLOBAL_VARIABLE -SET @@session.table_definition_cache = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.table_definition_cache; - - ---echo '#----------------------FN_DYNVARS_019_06------------------------#' -#################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -#################################################################### - -SELECT @@global.table_definition_cache = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='table_definition_cache'; - - ---echo '#---------------------FN_DYNVARS_019_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.table_definition_cache = TRUE; -SELECT @@global.table_definition_cache; -SET @@global.table_definition_cache = FALSE; -SELECT @@global.table_definition_cache; - - ---echo '#---------------------FN_DYNVARS_019_08----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same global variable # -############################################################################### - -SET @@global.table_definition_cache = 5; -SELECT @@table_definition_cache = @@global.table_definition_cache; - ---echo '#---------------------FN_DYNVARS_019_09----------------------#' -################################################################################ -# Check if table_definition_cache can be accessed with and without @@ sign # -################################################################################ - ---Error ER_GLOBAL_VARIABLE -SET table_definition_cache = 1; ---Error ER_PARSE_ERROR -SET global.table_definition_cache = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.table_definition_cache; ---Error ER_BAD_FIELD_ERROR -SELECT table_definition_cache = @@session.table_definition_cache; - -############################## -# Restore initial value # -############################## - -SET @@global.table_definition_cache = @start_value; -SELECT @@global.table_definition_cache; - - -################################################################ -# END OF table_definition_cache TESTS # -################################################################ - diff --git a/mysql-test/t/table_lock_wait_timeout_basic.test b/mysql-test/t/table_lock_wait_timeout_basic.test deleted file mode 100644 index 43186c70874..00000000000 --- a/mysql-test/t/table_lock_wait_timeout_basic.test +++ /dev/null @@ -1,172 +0,0 @@ -############## mysql-test\t\table_lock_wait_timeout_basic.test ################ -# # -# Variable Name: table_lock_wait _timeout # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 50 # -# Range: 1-1073741824 # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable table_lock_wait_timeout # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_table_lock_wait_timeout # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF table_lock_wait_timeout TESTS # -######################################################################## - - -########################################################################## -# Saving initial value of table_lock_wait_timeout in a temporary variable# -########################################################################## - -SET @start_value = @@global.table_lock_wait_timeout; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_001_01------------------------#' -######################################################################## -# Display the DEFAULT value of table_lock_wait_timeout # -######################################################################## - -SET @@global.table_lock_wait_timeout = 99; -SET @@global.table_lock_wait_timeout = DeFAULT; -SELECT @@global.table_lock_wait_timeout; - - ---echo '#---------------------FN_DYNVARS_001_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.table_lock_wait_timeout =Default; -SELECT @@global.table_lock_wait_timeout = 50; - ---echo '#--------------------FN_DYNVARS_001_03------------------------#' -######################################################################## -# Change the value of table_lock_wait_timeout to a valid value # -######################################################################## - - -SET @@global.table_lock_wait_timeout = 8; -SELECT @@global.table_lock_wait_timeout ; - -SET @@global.table_lock_wait_timeout = 1; -SELECT @@global.table_lock_wait_timeout ; -SET @@global.table_lock_wait_timeout = 1073741824; -SELECT @@global.table_lock_wait_timeout ; -SET @@global.table_lock_wait_timeout = 18000; -SELECT @@global.table_lock_wait_timeout ; -SET @@global.table_lock_wait_timeout = 65535; -SELECT @@global.table_lock_wait_timeout ; - - - ---echo '#--------------------FN_DYNVARS_001_04-------------------------#' -######################################################################### -# Change the value of table_lock_wait_timeout to invalid value # -######################################################################### - -SET @@global.table_lock_wait_timeout = -1; - -SET @@global.table_lock_wait_timeout= 100000000000; - -SET @@global.table_lock_wait_timeout= -1024; - -SET @@global.table_lock_wait_timeout= 0; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_lock_wait_timeout= 10000.01; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_lock_wait_timeout= ON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_lock_wait_timeout= 'test'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_lock_wait_timeout= ''; - - ---echo '#-------------------FN_DYNVARS_001_05----------------------------#' -########################################################################### -# Test if accessing session table_lock_wait_timeout gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.table_lock_wait_timeout= 0; -SELECT @@table_lock_wait_timeout; - - ---echo '#----------------------FN_DYNVARS_001_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.table_lock_wait_timeout= VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='table_lock_wait_timeout'; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.table_lock_wait_timeout= TRUE; -SELECT @@global.table_lock_wait_timeout; - -SET @@global.table_lock_wait_timeout= FALSE; -SELECT @@global.table_lock_wait_timeout; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same global variable # -############################################################################### - -SET @@global.table_lock_wait_timeout= 10; -SELECT @@table_lock_wait_timeout= @@global.table_lock_wait_timeout; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################### -# Check if table_lock_wait_timeout can be accessed with and without @@ sign # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET table_lock_wait_timeout= 8; ---Error ER_PARSE_ERROR -SET global.table_lock_wait_timeout= 10; ---Error ER_UNKNOWN_TABLE -SELECT global.table_lock_wait_timeout; ---Error ER_BAD_FIELD_ERROR -SELECT table_lock_wait_timeout= @@session.table_lock_wait_timeout; - - -############################## -# Restore initial value # -############################## - -SET @@global.table_lock_wait_timeout= @start_value; -SELECT @@global.table_lock_wait_timeout; - - -######################################################################## -# END OF table_lock_wait_timeout TESTS # -######################################################################## - - diff --git a/mysql-test/t/table_open_cache_basic.test b/mysql-test/t/table_open_cache_basic.test deleted file mode 100644 index c32463ca030..00000000000 --- a/mysql-test/t/table_open_cache_basic.test +++ /dev/null @@ -1,177 +0,0 @@ -############## mysql-test\t\table_open_cache_basic.test ####################### -# # -# Variable Name: table_open_cache # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 400 # -# Range: 64-524288 # -# # -# # -# Creation Date: 2008-02-13 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable table_open_cache # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_table_open_cache # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF table_open_cache TESTS # -######################################################################## - - -########################################################################## -# Saving initial value of table_open_cache in a temporary variable # -########################################################################## - -SET @start_value = @@global.table_open_cache ; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_001_01------------------------#' -######################################################################## -# Display the DEFAULT value of table_open_cache # -######################################################################## - -SET @@global.table_open_cache = 99; -SET @@global.table_open_cache = DeFAULT; -SELECT @@global.table_open_cache; - - ---echo '#---------------------FN_DYNVARS_001_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.table_open_cache = Default; -SELECT @@global.table_open_cache = 400; - ---echo '#--------------------FN_DYNVARS_001_03------------------------#' -######################################################################## -# Change the value of table_open_cache to a valid value # -######################################################################## - - -SET @@global.table_open_cache = 8; -SELECT @@global.table_open_cache ; - -SET @@global.table_open_cache = 1; -SELECT @@global.table_open_cache ; - -SET @@global.table_open_cache = 1073741824; -SELECT @@global.table_open_cache ; - -SET @@global.table_open_cache = 18000; -SELECT @@global.table_open_cache ; -SET @@global.table_open_cache = 65535; -SELECT @@global.table_open_cache ; - - - ---echo '#--------------------FN_DYNVARS_001_04-------------------------#' -####################################################################### -# Change the value of table_open_cache to invalid value # -####################################################################### - -SET @@global.table_open_cache = -1; -SELECT @@global.table_open_cache ; - -SET @@global.table_open_cache = 100000000000; -SELECT @@global.table_open_cache ; - -SET @@global.table_open_cache = -1024; -SELECT @@global.table_open_cache ; - -SET @@global.table_open_cache = 0; -SELECT @@global.table_open_cache ; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_open_cache = 10000.01; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_open_cache = ON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_open_cache= 'test'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.table_open_cache = ''; - - ---echo '#-------------------FN_DYNVARS_001_05----------------------------#' -########################################################################### -# Test if accessing session table_open_cache gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.table_open_cache = 0; - - ---echo '#----------------------FN_DYNVARS_001_06------------------------#' -#################################################################### -# Check if the value in GLOBAL Tables matches values in variable # -#################################################################### - -SELECT @@global.table_open_cache = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='table_open_cache '; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.table_open_cache = TRUE; -SELECT @@global.table_open_cache ; - -SET @@global.table_open_cache = FALSE; -SELECT @@global.table_open_cache ; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################## -# Check if accessing variable without SCOPE points to same session variable # -############################################################################## - -SET @@global.table_open_cache = 10; -SELECT @@table_open_cache = @@global.table_open_cache ; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -########################################################################## -# Check if table_open_cache can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET table_open_cache = 8; ---Error ER_PARSE_ERROR -SET global.table_open_cache = 10; ---Error ER_UNKNOWN_TABLE -SELECT global.table_open_cache ; ---Error ER_BAD_FIELD_ERROR -SELECT table_open_cache = @@session.table_open_cache ; - - -############################## -# Restore initial value # -############################## - -SET @@global.table_open_cache = @start_value; -SELECT @@global.table_open_cache ; - - -################################################################## -# END OF table_open_cache TESTS # -################################################################## - diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 4ab8a982e63..2bfa4936c91 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -204,4 +204,35 @@ DELETE FROM t1; SELECT * FROM t1; DROP TABLE t1; +# +# Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites locking type of temp table +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +CREATE TEMPORARY TABLE t1 (a INT); +CREATE TEMPORARY TABLE t2 LIKE t1; + +DELIMITER |; +CREATE FUNCTION f1() RETURNS INT + BEGIN + return 1; + END| +DELIMITER ;| + +INSERT INTO t2 SELECT * FROM t1; +INSERT INTO t1 SELECT f1(); + +CREATE TABLE t3 SELECT * FROM t1; +INSERT INTO t1 SELECT f1(); + +UPDATE t1,t2 SET t1.a = t2.a; +INSERT INTO t2 SELECT f1(); + +DROP TABLE t1,t2,t3; +DROP FUNCTION f1; + --echo End of 5.1 tests diff --git a/mysql-test/t/thread_cache_size_func.test b/mysql-test/t/thread_cache_size_func.test deleted file mode 100644 index fe9f4242c0d..00000000000 --- a/mysql-test/t/thread_cache_size_func.test +++ /dev/null @@ -1,118 +0,0 @@ -############# mysql-test\t\thread_cache_size_func.test ########################## -# # -# Variable Name: thread_cache_size # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: Enumeration # -# Default Value: 0 # -# Values: 0-16384 # -# # -# # -# Creation Date: 2008-03-02 # -# Author: Sharique Abdullah # -# # -# Modified: HHunger 2008-08-27 Reduced test to needed function and inserted # -# wait-loops # -# # -# Description: Test Cases of Dynamic System Variable "thread_cache_size" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: # -# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # -# # -################################################################################# - -# -# Setup -# - ---source include/not_embedded.inc - -SET @global_thread_cache_size = @@GLOBAL.thread_cache_size; - -FLUSH STATUS; - --- ECHO '# Test1#' -SET @@GLOBAL.thread_cache_size=3; -SHOW STATUS LIKE 'Threads_cached'; ---echo 0 Expected - -################################## -# Make 4 connections # -################################## - ---echo ** Connecting conn1 using username 'root' ** -CONNECT (conn1,localhost,root,,); ---echo ** Connecting conn2 using username 'root' ** -CONNECT (conn2,localhost,root,,); ---echo ** Connecting conn3 using username 'root' ** -CONNECT (conn3,localhost,root,,); ---echo ** Connecting conn4 using username 'root' ** -CONNECT (conn4,localhost,root,,); - ---echo ** Connection default ** -CONNECTION default; - -# Wait until all connections done -let $wait_condition= SELECT COUNT(*)= 5 FROM INFORMATION_SCHEMA.PROCESSLIST; ---source include/wait_condition.inc - -SHOW STATUS LIKE 'Threads_cached'; ---echo 0 Expected - -#################################### -#Disconnecting all the connections # -#################################### - ---echo ** Disconnecting conn1,conn2,conn3,conn4 ** -DISCONNECT conn1; -DISCONNECT conn2; -DISCONNECT conn3; -DISCONNECT conn4; - -# -# Checking the status -# - -# Wait until all disconnects ready -let $wait_condition= SELECT COUNT(*)= 1 FROM INFORMATION_SCHEMA.PROCESSLIST; ---source include/wait_condition.inc - -SHOW STATUS LIKE 'Threads_cached'; ---echo 3 Expected - -# -# Decreasing cache size to 1 -# -SET @@GLOBAL.thread_cache_size= 1; - ---echo ** Connecting conn1 using username 'root' ** -CONNECT (conn1,localhost,root,,); ---echo ** Connecting conn2 using username 'root' ** -CONNECT (conn2,localhost,root,,); - ---echo connection default; -CONNECTION default; - -# Wait until all connects ready -let $wait_condition= SELECT COUNT(*)= 3 FROM INFORMATION_SCHEMA.PROCESSLIST; ---source include/wait_condition.inc - ---echo ** Disconnecting conn1,conn2 ** -DISCONNECT conn1; -DISCONNECT conn2; - -# Wait until all disconnects ready -let $wait_condition= SELECT COUNT(*)= 1 FROM INFORMATION_SCHEMA.PROCESSLIST; ---source include/wait_condition.inc - -SHOW STATUS LIKE 'Threads_cached'; ---echo 1 Expected - -# -# Cleanup -# - -SET @@GLOBAL.thread_cache_size = @global_thread_cache_size; - diff --git a/mysql-test/t/thread_handling_basic.test b/mysql-test/t/thread_handling_basic.test deleted file mode 100644 index bcad003ce93..00000000000 --- a/mysql-test/t/thread_handling_basic.test +++ /dev/null @@ -1,107 +0,0 @@ - - -################## mysql-test\t\thread_handling_basic.test #################### -# # -# Variable Name: thread_handling # -# Scope: Global # -# Access Type: Static # -# Data Type: enumeration # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable thread_handling # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_051_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.thread_handling); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_051_02----------------------#' -# -# Test case for Bug #35433 -# -#################################################################### -# Check if Value can set # -#################################################################### - - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.thread_handling=1; - ---ECHO Expected error ER_INCORRECT_GLOBAL_LOCAL_VAR - -SELECT COUNT(@@GLOBAL.thread_handling); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_051_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.thread_handling = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='thread_handling'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.thread_handling); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='thread_handling'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_051_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@thread_handling = @@GLOBAL.thread_handling; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_051_05----------------------#' -################################################################################ -# Check if thread_handling can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@thread_handling); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.thread_handling); ---echo Bug:Variable is global so it can not be accessed by local there should be error ER_INCORRECT_GLOBAL_LOCAL_VAR ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.thread_handling); ---ECHO Bug:Variable is global so it can not be accessed by session there should be error ER_INCORRECT_GLOBAL_LOCAL_VAR ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.thread_handling); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT thread_handling = @@SESSION.thread_handling; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/time_zone_basic.test b/mysql-test/t/time_zone_basic.test deleted file mode 100644 index 32616e97534..00000000000 --- a/mysql-test/t/time_zone_basic.test +++ /dev/null @@ -1,325 +0,0 @@ -################### mysql-test\t\time_zone_basic.test ######################### -# # -# Variable Name: time_zone # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: SYSTEM # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable time_zone # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -####################################################################### -# START OF time_zone TESTS # -####################################################################### - - -####################################################################### -# Saving initial value of time_zone in a temporary variable # -####################################################################### - -SET @global_start_value = @@global.time_zone; -SELECT @global_start_value; - -SET @session_start_value = @@session.time_zone; -SELECT @session_start_value; - - ---echo '#--------------------FN_DYNVARS_001_01------------------------#' -######################################################################## -# Display the DEFAULT value of time_zone # -######################################################################## - -SET @@time_zone = "+02:00"; -SET @@time_zone = DEFAULT; -SELECT @@time_zone; - -SET @@global.time_zone = "-00:30"; -SET @@global.time_zone = DEFAULT; -SELECT @@global.time_zone; - - ---echo '#---------------------FN_DYNVARS_001_02-------------------------#' -############################################################################## -# see if setting global value changes session value and vice versa # -############################################################################## - -SET @@session.time_zone = "+02:00"; -SELECT @@session.time_zone; -SET @@global.time_zone = "+05:00"; -SELECT @@global.time_zone; -SELECT @@session.time_zone AS res_is_02_00; - -SET @@session.time_zone = "-02:00"; -SELECT @@session.time_zone; -SELECT @@global.time_zone AS res_is_05_00; -# composite check -SELECT @@global.time_zone=@@session.time_zone AS res_is_false; - - ---echo '#--------------------FN_DYNVARS_001_03------------------------#' -######################################################################## -# Change the value of time_zone to a valid value # -######################################################################## - -# for session scope - -SET @@time_zone = "+13:00"; -SELECT @@time_zone; -SET @@time_zone = "-12:00"; -SELECT @@time_zone; -SET @@time_zone = "+12:59"; -SELECT @@time_zone; -SET @@time_zone = "-11:30"; -SELECT @@time_zone; -SET @@time_zone = "+00:00"; -SELECT @@time_zone; -SET @@time_zone = "-12:59"; -SELECT @@time_zone; -SET @@time_zone = "-00:00"; -SELECT @@time_zone; -SET @@time_zone = "+10:00"; -SELECT @@time_zone; -SET @@time_zone = "+0:0"; -SELECT @@time_zone; -SET @@time_zone = "-10:00"; -SELECT @@time_zone; -SET @@time_zone = "+2:00"; -SELECT @@time_zone; - -# for global scope - -SET @@global.time_zone = "+13:00"; -SELECT @@global.time_zone; -SET @@global.time_zone = "-12:00"; -SELECT @@global.time_zone; -SET @@global.time_zone = "+12:59"; -SELECT @@global.time_zone; -SET @@global.time_zone = "-11:30"; -SELECT @@global.time_zone; -SET @@global.time_zone = "+00:00"; -SELECT @@global.time_zone; -SET @@global.time_zone = "-12:59"; -SELECT @@global.time_zone; -SET @@global.time_zone = "-00:00"; -SELECT @@global.time_zone; -SET @@global.time_zone = "+10:00"; -SELECT @@global.time_zone; -SET @@global.time_zone = "+0:0"; -SELECT @@global.time_zone; -SET @@global.time_zone = "-10:00"; -SELECT @@global.time_zone; -SET @@global.time_zone = "+2:00"; -SELECT @@global.time_zone; - - -# these test are dependant on values stored in mysql.time_zone_name - -#SET @@time_zone = "africa/cairo"; -#SELECT @@time_zone; -#SET @@time_zone = "America/Aruba"; -#SELECT @@time_zone; -# -#SET @@time_zone = "Etc/GMT-14"; -#SELECT @@time_zone; -# -#SET @@time_zone = "GMT-0"; -#SELECT @@time_zone; -# -#SET @@time_zone = "UTC"; -#SELECT @@time_zone; - -#--echo 'Bug: Region and zone values cant be set in time_zone. Although values are loaded in mysql.time_zone_name' - ---echo '#--------------------FN_DYNVARS_001_04-------------------------#' -########################################################################### -# Change the value of time_zone to invalid value # -########################################################################### - -# for session scope - ---Error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = "+24:00"; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = "+23:59"; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = "+13:01"; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = "-13:01"; - -# for global scope - ---Error ER_UNKNOWN_TIME_ZONE -SET @@global.time_zone = "+24:00"; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@global.time_zone = "+23:59"; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@global.time_zone = "+13:01"; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@global.time_zone = "-13:01"; - - -#checking time zone names not in mysql.time_zone_name. These test may succeed -#depending on timezone stored - -#SET @@time_zone = "london"; -#SELECT @@time_zone; -# -#SET @@time_zone = "GMT+14"; -#SELECT @@time_zone; - - ---echo '#-------------------FN_DYNVARS_001_05----------------------------#' -########################################################################### -# Assign System time zone to variable for session and global # -########################################################################### - -SET @@global.time_zone = 'SYSTEM'; -SELECT @@global.time_zone; - -SET @@time_zone = 'SYSTEM'; -SELECT @@time_zone; - ---echo '#----------------------FN_DYNVARS_001_06------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@time_zone = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='time_zone'; - - ---echo '#----------------------FN_DYNVARS_001_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.time_zone = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='time_zone'; - - ---echo '#---------------------FN_DYNVARS_001_08-------------------------#' -############################################################################# -# Check if ON, OFF, TRUE and FALSE values can be used on variable # -############################################################################# -# for session scope ---Error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = OFF; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = ON; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@time_zone = TRUE; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@time_zone = FALSE; - -# for global scope ---Error ER_UNKNOWN_TIME_ZONE -SET @@global.time_zone = OFF; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@global.time_zone = ON; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.time_zone = TRUE; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.time_zone = FALSE; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -##################################################################### -# Check if Numbers and empty values can be used on variable # -##################################################################### -# for session scope ---Error ER_WRONG_TYPE_FOR_VAR -SET @@time_zone = 1; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@time_zone = +0200; - ---Error ER_PARSE_ERROR -SET @@time_zone = GMT+; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = ""; - -# for global scope ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.time_zone = 1; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.time_zone = +0200; - ---Error ER_PARSE_ERROR -SET @@global.time_zone = GMT+; - ---Error ER_UNKNOWN_TIME_ZONE -SET @@global.time_zone = ""; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points -# to same session variable -############################################################################## - -SET @@time_zone = '+02:30'; -SELECT @@time_zone = @@local.time_zone and @@time_zone = @@session.time_zone; -SET @@time_zone = '-01:30'; -SELECT @@time_zone = @@local.time_zone and @@time_zone = @@session.time_zone; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -#################################################################### -# Check if time_zone can be accessed with and without @@ sign # -#################################################################### - -SET time_zone = "+01:00"; -SELECT @@time_zone; ---Error ER_UNKNOWN_TABLE -SELECT local.time_zone; ---Error ER_UNKNOWN_TABLE -SELECT session.time_zone; ---Error ER_BAD_FIELD_ERROR -SELECT time_zone = @@session.time_zone; - -############################## -# Restore initial value # -############################## - -SET @@time_zone = @session_start_value; -SELECT @@time_zone; - -SET @@global.time_zone = @global_start_value; -SELECT @@global.time_zone; - -####################################################################### -# END OF time_zone TESTS # -####################################################################### diff --git a/mysql-test/t/time_zone_func.test b/mysql-test/t/time_zone_func.test deleted file mode 100644 index 1d9bc954d8a..00000000000 --- a/mysql-test/t/time_zone_func.test +++ /dev/null @@ -1,188 +0,0 @@ -############# mysql-test\t\time_zone_func.test ############################# -# # -# Variable Name: time_zone # -# Scope: GLOBAL, SESSION # -# Access Type: Dynamic # -# Data Type: STRING # -# Default Value: TRUE 1, FALSE 0 # -# Values: FALSE 0 # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "time_zone" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -############################################################################ - ---echo ** Setup ** ---echo -# -# Setup -# - -SET @session_time_zone = @@SESSION.time_zone; -SET @global_time_zone = @@GLOBAL.time_zone; - -CREATE TABLE t1 (a datetime); -CREATE TABLE t2 (a timestamp); - ---echo '#-----------------------------FN_DYNVARS_177_01--------------------#' -# -# Value DEFAULT -# -SET @@time_zone = DEFAULT; - -SELECT @@time_zone; ---echo SYSTEM Expected - ---echo '#-----------------------------FN_DYNVARS_177_02-------------------#' -# -# Testing difference values -# - -SET @@time_zone = '+05:00'; - -SELECT @@time_zone; ---echo +05:00 Expected - -SET @@time_zone = '-01:00'; - -SELECT @@time_zone; ---echo -01:00 Expected - -SET @@time_zone = '+00:00'; - -SELECT @@time_zone; ---echo +00:00 Expected - -SET @@time_zone = '-00:00'; - -SELECT @@time_zone; ---echo -00:00 Expected - ---echo '#-----------------------------FN_DYNVARS_177_03----------------#' -# -# Setting possible values -# - -SET @@time_zone = '+00:00'; - -INSERT INTO t1 VALUES('2008-03-05 16:28:00'); -INSERT INTO t1 VALUES('1970-01-01 00:05:00'),('1970-01-01 01:05:00'); -INSERT INTO t2 VALUES(20080305162800); -INSERT INTO t2 VALUES(19730101235900); -INSERT INTO t2 VALUES('1970-01-01 00:05:00'),('1970-01-01 01:05:00'); -INSERT INTO t2 VALUES(19700101000500); - -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - -SET @@time_zone = 'MET'; - -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - -SET @@time_zone = '+05:00'; - -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - -SET @@time_zone = '+06:00'; -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - -SET @@time_zone = '+01:00'; - -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - -SET @@time_zone = '+02:00'; - -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - -SET @@time_zone = '+00:00'; - -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - -SET @@time_zone = '+06:00'; - -SELECT a,UNIX_TIMESTAMP(a) FROM t1; -SELECT a,UNIX_TIMESTAMP(a) FROM t2; - ---echo Potential Feature: upon recovery of timezone, ---echo the original value of the timestamp should be recovered. - ---echo '#-----------------------------FN_DYNVARS_177_04--------------------#' -# -# Testing invalid values -# ---error ER_UNKNOWN_TIME_ZONE -SET @@time_zone = '6'; - - ---echo '#-----------------------------FN_DYNVARS_177_05---------------#' -# -# Session data integrity check & GLOBAL Value check -# - -SET GLOBAL time_zone = 'SYSTEM'; - ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.time_zone; ---echo SYSTEM Expected - -SET SESSION time_zone = '+05:00'; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.time_zone; ---echo SYSTEM Expected - -SET SESSION time_zone = '-10:00'; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.time_zone; ---echo -10:00 Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.time_zone; ---echo +05:00 Expected - - -SELECT @@GLOBAL.time_zone; ---echo SYSTEM Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - - -# -# Cleanup -# - - -SET @@SESSION.time_zone = @session_time_zone; -SET @@GLOBAL.time_zone = @global_time_zone; - -DROP TABLE t1; -DROP TABLE t2; diff --git a/mysql-test/t/timed_mutexes_basic.test b/mysql-test/t/timed_mutexes_basic.test deleted file mode 100644 index b0eb41afb49..00000000000 --- a/mysql-test/t/timed_mutexes_basic.test +++ /dev/null @@ -1,169 +0,0 @@ -################## mysql-test\t\timed_mutexes_basic.test ###################### -# # -# Variable Name: timed_mutexes # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: OFF # -# Valid Values: ON, OFF # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable timed_mutexes # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF timed_mutexes TESTS # -######################################################################## - - -############################################################################## -# Saving initial value of timed_mutexes in a temporary variable # -############################################################################## - -SET @global_start_value = @@global.timed_mutexes; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_177_01------------------------#' -######################################################################## -# Display the DEFAULT value of timed_mutexes # -######################################################################## - -SET @@global.timed_mutexes = 1; -SET @@global.timed_mutexes = DEFAULT; -SELECT @@global.timed_mutexes; - ---echo '#---------------------FN_DYNVARS_177_02-------------------------#' -############################################################################# -# Check if timed_mutexes can be accessed with and without @@ sign # -############################################################################# - ---Error ER_GLOBAL_VARIABLE -SET timed_mutexes = 1; -SELECT @@timed_mutexes; ---Error ER_UNKNOWN_TABLE -SELECT global.timed_mutexes; - -SET global timed_mutexes = 1; -SELECT @@global.timed_mutexes; - - ---echo '#--------------------FN_DYNVARS_177_03------------------------#' -######################################################################## -# Change the value of timed_mutexes to a valid value # -######################################################################## - -SET @@global.timed_mutexes = 0; -SELECT @@global.timed_mutexes; -SET @@global.timed_mutexes = 1; -SELECT @@global.timed_mutexes; - - ---echo '#--------------------FN_DYNVARS_177_04-------------------------#' -########################################################################### -# Change the value of timed_mutexes to invalid value # -########################################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = 2; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = "T"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = "Y"; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = _true; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = 0N; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = 1+1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = 0FF; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = '0'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.timed_mutexes = N; - - ---echo '#-------------------FN_DYNVARS_177_05----------------------------#' -########################################################################### -# Test if accessing session timed_mutexes gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.timed_mutexes = 0; ---Error ER_GLOBAL_VARIABLE -SET @@timed_mutexes = 0; ---Error ER_GLOBAL_VARIABLE -SET @@local.timed_mutexes = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.timed_mutexes; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@local.timed_mutexes; - ---echo '#----------------------FN_DYNVARS_177_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='timed_mutexes'; - - ---echo '#----------------------FN_DYNVARS_177_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.timed_mutexes = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='timed_mutexes'; -SELECT @@global.timed_mutexes; - -SELECT VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='timed_mutexes'; - ---echo '#---------------------FN_DYNVARS_177_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -SET @@global.timed_mutexes = OFF; -SELECT @@global.timed_mutexes; -SET @@global.timed_mutexes = ON; -SELECT @@global.timed_mutexes; - ---echo '#---------------------FN_DYNVARS_177_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.timed_mutexes = TRUE; -SELECT @@global.timed_mutexes; -SET @@global.timed_mutexes = FALSE; -SELECT @@global.timed_mutexes; - -############################## -# Restore initial value # -############################## - -SET @@global.timed_mutexes = @global_start_value; -SELECT @@global.timed_mutexes; - -############################################################### -# END OF timed_mutexes TESTS # -############################################################### diff --git a/mysql-test/t/timestamp_func.test b/mysql-test/t/timestamp_func.test deleted file mode 100644 index e119f1b6253..00000000000 --- a/mysql-test/t/timestamp_func.test +++ /dev/null @@ -1,50 +0,0 @@ -############# mysql-test\t\timestamp_func.test ############################# -# # -# Variable Name: timestamp # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: INTEGER # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Modified: HHunger 2008-08-28 Reimplemented the test completely. # -# # -# Description: Test Cases of Dynamic System Variable "timestamp" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -############################################################################ - -# Change timestamp which must have an effect on now(), but not on sysdate(). -# Use Unix epoch timestamp -# All comparisons must deliver true(1) -# Exception: --sysdate-is-now switches off this behaviour and must not be set. - ---echo ** Connecting con1 using root ** -connect (con1,localhost,root,,); -SELECT date(now()) = date(sysdate()); -SET @@session.timestamp = 1100000000; -SELECT date(now()) != date(sysdate()); - -# Assure that setting of the variable has no effect on other session. ---echo ** Connecting con0 using root ** -connect (con0,localhost,root,,); -SELECT @@session.timestamp != 1100000000; -SET @@session.timestamp = 1000000000; -SELECT date(now()) != date(sysdate()); - ---echo ** Connection con1 ** -connection con1; -SELECT @@session.timestamp != 1000000000; -SELECT @@session.timestamp = 1100000000; - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con0, con1 -disconnect con0; -disconnect con1; - diff --git a/mysql-test/t/timestamp_sysdate_is_now_func-master.opt b/mysql-test/t/timestamp_sysdate_is_now_func-master.opt deleted file mode 100644 index 97a58d28032..00000000000 --- a/mysql-test/t/timestamp_sysdate_is_now_func-master.opt +++ /dev/null @@ -1 +0,0 @@ ---sysdate-is-now diff --git a/mysql-test/t/timestamp_sysdate_is_now_func.test b/mysql-test/t/timestamp_sysdate_is_now_func.test deleted file mode 100644 index 7ca3b4cddac..00000000000 --- a/mysql-test/t/timestamp_sysdate_is_now_func.test +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################ -# # -# Variable Name: timestamp with sysdate-is-now # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: INTEGER # -# # -# # -# Creation Date: 2008-11-25 # -# Author: Horst Hunger # -# # -# Description: Test Cases of Dynamic System Variable "timestamp" # -# that checks behavior of this variable in the following ways # -# * Like timstamp_func, but with set "sysdate-is-now". # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -############################################################################ - -# Use Unix epoch timestamp -# Due to "--sysdate-is-now" timestamp must have an effect on both. -# See also timestamp_func.test. - ---echo ** Connecting con1 using root ** -connect (con1,localhost,root,,); -SELECT date(now()) = date(sysdate()); -SET @@session.timestamp = 1100000000; -SELECT date(now()) != date(sysdate()); - -# Assure that setting of the variable has no effect on other session. ---echo ** Connecting con0 using root ** -connect (con0,localhost,root,,); -SELECT @@session.timestamp != 1100000000; -SET @@session.timestamp = 1000000000; -SELECT date(now()) != date(sysdate()); - ---echo ** Connection con1 ** -connection con1; -SELECT @@session.timestamp != 1000000000; -SELECT @@session.timestamp = 1100000000; - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con0, con1 -disconnect con0; -disconnect con1; - diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index 4f70539ca8d..15ddceb8d68 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -228,6 +228,7 @@ drop table t1; # Test for bug #11081 "Using a CONVERT_TZ function in a stored function # or trigger fails". # +SET @old_log_bin_trust_function_creators = @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; create table t1 (ldt datetime, udt datetime); @@ -243,7 +244,7 @@ select ldt, f1(udt) as ldt2 from t1; drop table t1; drop function f1; -SET GLOBAL log_bin_trust_function_creators = 0; +SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; # End of 5.0 tests diff --git a/mysql-test/t/tmpdir_basic.test b/mysql-test/t/tmpdir_basic.test deleted file mode 100644 index 5e9d08c4876..00000000000 --- a/mysql-test/t/tmpdir_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\tmpdir_basic.test ############################# -# # -# Variable Name: tmpdir # -# Scope: Global # -# Access Type: Static # -# Data Type: filename # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable tmpdir # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_052_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.tmpdir); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_052_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.tmpdir=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.tmpdir); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_052_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.tmpdir = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='tmpdir'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.tmpdir); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='tmpdir'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_052_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@tmpdir = @@GLOBAL.tmpdir; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_052_05----------------------#' -################################################################################ -# Check if tmpdir can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@tmpdir); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.tmpdir); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.tmpdir); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.tmpdir); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT tmpdir = @@SESSION.tmpdir; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test index 9f7fd8bc505..bf119cd89e6 100644 --- a/mysql-test/t/trigger-compat.test +++ b/mysql-test/t/trigger-compat.test @@ -60,8 +60,9 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 --echo --echo ---> patching t1.TRG... ---exec grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG ---exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG +let $MYSQLD_DATADIR= `select @@datadir`; +--exec grep -v 'definers=' $MYSQLD_DATADIR/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG +--exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLD_DATADIR/mysqltest_db1/t1.TRG # # Create a new trigger. diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index c57178c1928..6974a4cc5da 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -472,11 +472,11 @@ create trigger trg1 before insert on t1 for each row set new.k = new.i; create trigger trg2 after insert on t1 for each row set @b:= "Fired"; set @b:=""; # Test triggers with file with separators -load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, i); +load data infile '../../std_data/rpl_loaddata.dat' into table t1 (@a, i); select *, @b from t1; set @b:=""; # Test triggers with fixed size row file -load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, j); select *, @b from t1; # This also will drop triggers drop table t1; @@ -510,7 +510,7 @@ delete from t1 where i = 2; select * from t1; # Should fail and insert only 1 row --error ER_BAD_FIELD_ERROR -load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); select * from t1; --error ER_BAD_FIELD_ERROR insert into t1 select 3, 3; @@ -567,7 +567,7 @@ select * from t1; delete from t1; select * from t1; --error ER_BAD_FIELD_ERROR -load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); +load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (i, k); select * from t1; --error ER_BAD_FIELD_ERROR insert into t1 select 3, 3; @@ -1141,12 +1141,13 @@ select trigger_schema, trigger_name, event_object_schema, event_object_table, action_statement from information_schema.triggers where event_object_schema = 'test'; # Trick which makes update of second .TRN file impossible -write_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; +let $MYSQLD_DATADIR= `select @@datadir`; +write_file $MYSQLD_DATADIR/test/t1_ai.TRN~; dummy EOF -chmod 0000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; +chmod 0000 $MYSQLD_DATADIR/test/t1_ai.TRN~; # Normalize the datadir path; the embedded server doesn't chdir to datadir ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' --error 1 rename table t1 to t2; # 't1' should be still there and triggers should work correctly @@ -1155,8 +1156,8 @@ select @a, @b; select trigger_schema, trigger_name, event_object_schema, event_object_table, action_statement from information_schema.triggers where event_object_schema = 'test'; -chmod 0600 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; -remove_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; +chmod 0600 $MYSQLD_DATADIR/test/t1_ai.TRN~; +remove_file $MYSQLD_DATADIR/test/t1_ai.TRN~; # Let us check that updates to .TRN files were rolled back too drop trigger t1_bi; drop trigger t1_ai; @@ -1189,7 +1190,7 @@ insert into t1 (a) values create trigger t2_ai after insert on t2 for each row set @a:= (select max(a) from t2); insert into t2 select * from t1; -load data infile '../std_data_ln/words.dat' into table t1 (a); +load data infile '../../std_data/words.dat' into table t1 (a); drop trigger t1_ai; drop trigger t2_ai; # Test that the problem for functions is fixed as well @@ -1199,7 +1200,7 @@ insert into t1 values ("And",f1()),("the",f1()),("mome", f1()),("raths",f1()),("outgrabe",f1()); create function f2() returns int return (select max(b) from t2); insert into t2 select a, f2() from t1; -load data infile '../std_data_ln/words.dat' into table t1 (a) set b:= f1(); +load data infile '../../std_data/words.dat' into table t1 (a) set b:= f1(); drop function f1; drop function f2; drop table t1, t2; diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test index 5d2ab84adaf..9588ec6e3ed 100644 --- a/mysql-test/t/trigger_notembedded.test +++ b/mysql-test/t/trigger_notembedded.test @@ -360,10 +360,11 @@ CREATE TRIGGER trg5 BEFORE DELETE ON t1 SET @a = 5; # Replace definers with the "weird" definers +let MYSQLD_DATADIR= `select @@datadir`; perl; use strict; use warnings; -my $fname= "$ENV{'MYSQLTEST_VARDIR'}/master-data/mysqltest_db1/t1.TRG"; +my $fname= "$ENV{'MYSQLD_DATADIR'}/mysqltest_db1/t1.TRG"; open(FILE, "<", $fname) or die; my @content= grep($_ !~ /^definers=/, <FILE>); close FILE; diff --git a/mysql-test/t/tx_isolation_basic.test b/mysql-test/t/tx_isolation_basic.test deleted file mode 100644 index 136a9b4331e..00000000000 --- a/mysql-test/t/tx_isolation_basic.test +++ /dev/null @@ -1,251 +0,0 @@ -################# mysql-test\t\tx_isolation_basic.test ######################## -# # -# Variable Name: tx_isolation # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: enumeration # -# Default Value: REPEATABLE-READ # -# Valid Values: READ-UNCOMMITTED, READCOMMITTED, REPEATABLE-READ,SERIALIZABLE # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable tx_isolation # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF tx_isolation TESTS # -######################################################################## - - -######################################################################### -# Saving initial value of tx_isolation in a temporary variable # -######################################################################### - -SET @global_start_value = @@global.tx_isolation; -SELECT @global_start_value; - -SET @session_start_value = @@session.tx_isolation; -SELECT @session_start_value; - ---echo '#--------------------FN_DYNVARS_183_01------------------------#' -#################################################################### -# Display the DEFAULT value of tx_isolation # -#################################################################### - -SET @@global.tx_isolation = 'READ-UNCOMMITTED'; ---Error ER_NO_DEFAULT -SET @@global.tx_isolation = DEFAULT; ---echo 'Bug# 34878: Documentation specifies a DEFAULT value of REPEATABLE-READ'; ---echo 'where as DEFAULT is not supported here.'; - -SET @@session.tx_isolation = 'SERIALIZABLE'; -SET @@session.tx_isolation = DEFAULT; -SELECT @@session.tx_isolation; ---echo 'Bug# 34876: Documentation specifies a DEFAULT value of REPEATABLE-READ'; ---echo 'where as DEFAULT here as no effect.'; - ---echo '#---------------------FN_DYNVARS_183_02-------------------------#' -######################################################### -# Check if NULL or empty value is accepeted # -######################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.tx_isolation = NULL; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.tx_isolation = ''; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.tx_isolation = NULL; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.tx_isolation = ''; - ---echo '#--------------------FN_DYNVARS_183_03------------------------#' -##################################################################### -# Change the value of tx_isolation to a valid value # -##################################################################### - -SET @@global.tx_isolation = 'READ-UNCOMMITTED'; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 'read-COMMITTED'; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 'REPEATABLE-READ'; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 'SERIALIZable'; -SELECT @@global.tx_isolation; - - -SET @@session.tx_isolation = 'READ-UNCOMMITTED'; -SELECT @@session.tx_isolation; - -SET @@session.tx_isolation = 'READ-COMMITTED'; -SELECT @@session.tx_isolation; - -SET @@session.tx_isolation = 'REPEATABLE-READ'; -SELECT @@session.tx_isolation; - -SET @@session.tx_isolation = 'serializable'; -SELECT @@session.tx_isolation; - - ---echo '#--------------------FN_DYNVARS_183_04-------------------------#' -####################################################################### -# Change the value of tx_isolation to invalid value # -####################################################################### - -# for global scope ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.tx_isolation = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.tx_isolation = READUNCOMMITTED; - - -SET @@global.tx_isolation = 'REPEATABLE'; -SELECT @@global.tx_isolation; ---echo 'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.tx_isolation = OFF; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.tx_isolation = ON; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.tx_isolation = 'NON-SERIALIZABLE'; - -# for session scope - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@tx_isolation = -1; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@tx_isolation = READUNCOMMITTED; - -SET @@tx_isolation = 'REPEATABLE'; -SELECT @@tx_isolation; ---echo 'Bug# 34833: REPEATABLE is not documented as as valid tx_isolation level' - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@tx_isolation = 'NONE'; ---Error ER_WRONG_VALUE_FOR_VAR -SET @@tx_isolation = 'ALL'; - ---echo '#-------------------FN_DYNVARS_183_05----------------------------#' -######################################################################### -# Check if the value in session Table matches value in variable # -######################################################################### - -SELECT @@session.tx_isolation = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='tx_isolation'; - ---echo '#----------------------FN_DYNVARS_183_06------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.tx_isolation = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='tx_isolation'; - - ---echo '#---------------------FN_DYNVARS_183_07-------------------------#' -################################################################### -# Check if numbers can be used on variable # -################################################################### - -# test if variable accepts 0,1,2 -SET @@global.tx_isolation = 0; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 1; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 2; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 3; -SELECT @@global.tx_isolation; - -# use of decimal values - -SET @@global.tx_isolation = 0.4; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 1.1; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 1.5; -SELECT @@global.tx_isolation; - -SET @@global.tx_isolation = 2.9; -SELECT @@global.tx_isolation; - -SET @@session.tx_isolation = 3.49; -SELECT @@session.tx_isolation; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.tx_isolation = 3.6; - ---echo 'Bug: Decimal values can be used within the range [0.0-3.5).'; ---echo 'Values are rounded to 0,1,2,3 as evident from outcome.'; - - ---echo '#---------------------FN_DYNVARS_183_08----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.tx_isolation = TRUE; -SELECT @@global.tx_isolation; -SET @@global.tx_isolation = FALSE; -SELECT @@global.tx_isolation; - ---echo '#---------------------FN_DYNVARS_183_09----------------------#' -######################################################################## -# Check if tx_isolation can be accessed with and without @@ sign # -######################################################################## - -SET tx_isolation = 'REPEATABLE-READ'; - ---Error ER_PARSE_ERROR -SET session.tx_isolation = 'REPEATABLE-READ'; ---Error ER_PARSE_ERROR -SET global.tx_isolation = 'REPEATABLE-READ'; -#using SET SESSION|GLOBAL syntax -SET session tx_isolation = 'REPEATABLE-READ'; -SELECT @@tx_isolation; - -SET global tx_isolation = 'REPEATABLE-READ'; -SELECT @@global.tx_isolation; - -############################## -# Restore initial value # -############################## - -SET @@global.tx_isolation = @global_start_value; -SELECT @@global.tx_isolation; - -SET @@session.tx_isolation = @session_start_value; -SELECT @@session.tx_isolation; - -#################################################################### -# END OF tx_isolation TESTS # -#################################################################### - diff --git a/mysql-test/t/tx_isolation_func.test b/mysql-test/t/tx_isolation_func.test deleted file mode 100644 index 1fd2e323db8..00000000000 --- a/mysql-test/t/tx_isolation_func.test +++ /dev/null @@ -1,416 +0,0 @@ -############# mysql-test\t\tx_isolation_func.test ####################################### -# # -# Variable Name: tx_isolation # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: ENUMERATION # -# Default Value: REPEATABLE-READ # -# Values: READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE # -# # -# # -# Creation Date: 2008-02-25 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable "tx_isolation" # -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html # -# # -######################################################################################### - ---source include/have_innodb.inc - ---echo ** Setup ** -# -# Setup -# - -SET @session_tx_isolation = @@SESSION.tx_isolation; -SET @global_tx_isolation = @@GLOBAL.tx_isolation; - -# -# Creating connections -# - ---echo ** Connecting con0 using root ** -connect (con0,localhost,root,,); - ---echo ** Connection con0 ** -connection con0; - -SET SESSION AUTOCOMMIT = OFF; - ---echo ** Connecting con1 using root ** -connect (con1, localhost, root,,); - ---echo ** Connection con1 ** -connection con1; - -SET SESSION AUTOCOMMIT = OFF; - ---echo ** Connection default ** -connection default; - -# -# Creating tables -# - -CREATE TABLE t1 (a int PRIMARY KEY, b int) ENGINE=INNODB; - -INSERT INTO t1 VALUES(2, 2); -INSERT INTO t1 VALUES(4, 4); -INSERT INTO t1 VALUES(6, 6); -INSERT INTO t1 VALUES(8, 8); -INSERT INTO t1 VALUES(16, 16); -INSERT INTO t1 VALUES(18, 18); -INSERT INTO t1 VALUES(20, 20); -INSERT INTO t1 VALUES(22, 22); -INSERT INTO t1 VALUES(24, 24); - ---echo '#----------------------------FN_DYNVARS_184_01--------------------------------------#' -# -# Testing for value READ-UNCOMMITTED -# ---echo ** Connection con0 ** -connection con0; -SET SESSION tx_isolation = 'READ-UNCOMMITTED'; -set binlog_format=mixed; - ---echo ** Connection con1 ** -connection con1; -SET SESSION tx_isolation = 'READ-UNCOMMITTED'; -set binlog_format=mixed; - -# -# Testing WHERE on keys using IN clause -# ---echo ** Connection con0 ** -connection con0; - -START TRANSACTION; - -SELECT * FROM t1 WHERE a IN (2,4,6,8) FOR UPDATE; -UPDATE t1 SET b = 10 WHERE a IN (2,4,6,8); - ---echo ** Connection con1 ** -connection con1; - -START TRANSACTION; - -SELECT * FROM t1; - -INSERT INTO t1 VALUES(1, 1); -INSERT INTO t1 VALUES(3, 3); - -SELECT * FROM t1; - -COMMIT; - ---echo ** Connection con0 ** -connection con0; - -DELETE FROM t1 WHERE a = 1 OR a = 3; - -COMMIT; - ---echo '#----------------------------FN_DYNVARS_184_02--------------------------------------#' -# -# Testing WHERE on keys using # on even rows -# - ---echo ** Connection con0 ** -connection con0; - -START TRANSACTION; - -SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE; -UPDATE t1 SET b = 10 WHERE a % 2 = 0; - ---echo ** Connection con1 ** -connection con1; - -START TRANSACTION; - -SELECT * FROM t1; - ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(23, 23); - ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(25, 25); ---echo Bug: Only even rows are being locked, error 1205 should'nt have occured - -SELECT * FROM t1; - -COMMIT; - ---echo ** Connection con0 ** -connection con0; - -COMMIT; - ---echo '#----------------------------FN_DYNVARS_184_03--------------------------------------#' -# -# Testing for value READ-COMMITTED -# ---echo ** Connection con0 ** -connection con0; -SET SESSION tx_isolation = 'READ-COMMITTED'; - ---echo ** Connection con1 ** -connection con1; -SET SESSION tx_isolation = 'READ-COMMITTED'; - -# -# Testing WHERE on keys using % on even rows -# ---echo ** Connection con0 ** -connection con0; - -START TRANSACTION; - -SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE; -UPDATE t1 SET b = 11 WHERE a % 2 = 0; - ---echo ** Connection con1 ** -connection con1; - -START TRANSACTION; - -SELECT * FROM t1; - -INSERT INTO t1 VALUES(5, 5); -INSERT INTO t1 VALUES(7, 7); - -SELECT * FROM t1; - -COMMIT; - ---echo ** Connection con0 ** -connection con0; - -COMMIT; - - ---echo '#----------------------------FN_DYNVARS_184_04--------------------------------------#' -# -# Testing for value REPEATABLE-READ -# ---echo ** Connection con0 ** -connection con0; -SET SESSION tx_isolation = 'REPEATABLE-READ'; - ---echo ** Connection con1 ** -connection con1; -SET SESSION tx_isolation = 'REPEATABLE-READ'; - -# -# Testing WHERE on keys using % on even rows -# ---echo ** Connection con0 ** -connection con0; - -START TRANSACTION; - -SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE; -UPDATE t1 SET b = 12 WHERE a % 2 = 0; - ---echo ** Connection con1 ** -connection con1; - -START TRANSACTION; - -SELECT * FROM t1; - ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(9, 9); ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(13, 13); ---echo Expected error "Lock wait timeout" - -SELECT * FROM t1; - -COMMIT; - ---echo ** Connection con0 ** -connection con0; - -COMMIT; - ---echo '#----------------------------FN_DYNVARS_184_05--------------------------------------#' -# -# Testing WHERE on keys using IN clause -# ---echo ** Connection con0 ** -connection con0; - -START TRANSACTION; - -SELECT * FROM t1 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0 FOR UPDATE; -UPDATE t1 SET b = 13 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0; - ---echo ** Connection con1 ** -connection con1; - -START TRANSACTION; - -SELECT * FROM t1; - ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(9, 9); ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(13, 13); ---echo Expected error "Lock wait timeout" - -SELECT * FROM t1; - -COMMIT; - ---echo ** Connection con0 ** -connection con0; - -COMMIT; - ---echo '#----------------------------FN_DYNVARS_184_06--------------------------------------#' -# -# Testing WHERE on keys using IN clause -# ---echo ** Connection con0 ** -connection con0; - -START TRANSACTION; - -SELECT * FROM t1 WHERE a IN (2,4,6,8) = 0 FOR UPDATE; -UPDATE t1 SET b = 14 WHERE a IN (2,4,6,8) = 0; - ---echo ** Connection con1 ** -connection con1; - -START TRANSACTION; - -SELECT * FROM t1; - ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(9, 9); ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(13, 13); ---echo Expected error "Lock wait timeout" - -SELECT * FROM t1; - -COMMIT; - ---echo ** Connection con0 ** -connection con0; - -COMMIT; - ---echo '#----------------------------FN_DYNVARS_184_07--------------------------------------#' -# -# Testing for value SERIALIZABLE -# ---echo ** Connection con0 ** -connection con0; -SET SESSION tx_isolation = 'SERIALIZABLE'; - ---echo ** Connection con0 ** -connection con1; -SET SESSION tx_isolation = 'SERIALIZABLE'; - -# -# Testing WHERE on keys using # on even rows -# ---echo ** Connection con0 ** -connection con0; - -START TRANSACTION; - -SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE; -UPDATE t1 SET b = 15 WHERE a % 2 = 0; - ---echo ** Connection con0 ** -connection con1; - -START TRANSACTION; - ---error ER_LOCK_WAIT_TIMEOUT -SELECT * FROM t1; - ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(15, 15); ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1 VALUES(17, 17); - ---error ER_LOCK_WAIT_TIMEOUT -SELECT * FROM t1; - -COMMIT; - ---echo ** Connection con0 ** -connection con0; - -COMMIT; - - ---echo '#----------------------------FN_DYNVARS_184_08--------------------------------------#' -# -# Session data integrity check & GLOBAL Value check -# - -SET GLOBAL tx_isolation = 'READ-UNCOMMITTED'; ---echo ** Connecting con_int1 using root ** -connect (con_int1,localhost,root,,); - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.tx_isolation; ---echo READ-UNCOMMITTED Expected - -SET SESSION tx_isolation = 'SERIALIZABLE'; - ---echo ** Connecting con_int2 using root ** -connect (con_int2,localhost,root,,); - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.tx_isolation; ---echo READ-UNCOMMITTED Expected - -SET SESSION tx_isolation = 'REPEATABLE-READ'; - ---echo ** Connection con_int2 ** -connection con_int2; -SELECT @@SESSION.tx_isolation; ---echo REPEATABLE-READ Expected - ---echo ** Connection con_int1 ** -connection con_int1; -SELECT @@SESSION.tx_isolation; ---echo SERIALIZABLE Expected - - -SELECT @@GLOBAL.tx_isolation; ---echo READ-UNCOMMITTED Expected - ---echo ** Connection default ** -connection default; - ---echo Disconnecting Connections con_int1, con_int2 -disconnect con_int1; -disconnect con_int2; - -# -# Cleanup -# - -SET @@SESSION.tx_isolation = @session_tx_isolation; -SET @@GLOBAL.tx_isolation = @global_tx_isolation; - ---echo ** Connection default ** -connection default; ---echo Disconnecting Connections con0, con1 -disconnect con0; -disconnect con1; - -DROP TABLE t1; diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 5793846a0b2..dc5120db430 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -352,6 +352,51 @@ SELECT HEX(b1), HEX(b2), i2 FROM t2 DROP TABLE t1, t2; +# +# Bug #35796 SHOW CREATE TABLE and default value for BIT field +# +CREATE TABLE IF NOT EXISTS t1 ( +f1 bit(2) NOT NULL default b'10', +f2 bit(14) NOT NULL default b'11110000111100' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--error ER_INVALID_DEFAULT +CREATE TABLE IF NOT EXISTS t1 ( +f1 bit(2) NOT NULL default b'' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + + +# +# Bug#31399 Wrong query result when doing join buffering over BIT fields +# +create table t1bit7 (a1 bit(7) not null) engine=MyISAM; +create table t2bit7 (b1 bit(7)) engine=MyISAM; + +insert into t1bit7 values (b'1100000'); +insert into t1bit7 values (b'1100001'); +insert into t1bit7 values (b'1100010'); +insert into t2bit7 values (b'1100001'); +insert into t2bit7 values (b'1100010'); +insert into t2bit7 values (b'1100110'); + +select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; +drop table t1bit7, t2bit7; + +create table t1bit7 (a1 bit(15) not null) engine=MyISAM; +create table t2bit7 (b1 bit(15)) engine=MyISAM; + +insert into t1bit7 values (b'110000011111111'); +insert into t1bit7 values (b'110000111111111'); +insert into t1bit7 values (b'110001011111111'); +insert into t2bit7 values (b'110000111111111'); +insert into t2bit7 values (b'110001011111111'); +insert into t2bit7 values (b'110011011111111'); + +select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; +drop table t1bit7, t2bit7; + --echo End of 5.0 tests # diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 35e5b30ecb8..460da1c1614 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -308,20 +308,20 @@ create table t1 (id integer auto_increment unique,imagem LONGBLOB not null defau insert into t1 (id) values (1); # We have to clean up the path in the results for safe comparison eval select - charset(load_file('../std_data_ln/words.dat')), - collation(load_file('../std_data_ln/words.dat')), - coercibility(load_file('../std_data_ln/words.dat')); + charset(load_file('../../std_data/words.dat')), + collation(load_file('../../std_data/words.dat')), + coercibility(load_file('../../std_data/words.dat')); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval explain extended select - charset(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')), - collation(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')), - coercibility(load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat')); + charset(load_file('$MYSQLTEST_VARDIR/std_data/words.dat')), + collation(load_file('$MYSQLTEST_VARDIR/std_data/words.dat')), + coercibility(load_file('$MYSQLTEST_VARDIR/std_data/words.dat')); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval update t1 set imagem=load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') where id=1; +eval update t1 set imagem=load_file('$MYSQLTEST_VARDIR/std_data/words.dat') where id=1; select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; drop table t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval create table t1 select load_file('$MYSQLTEST_VARDIR/std_data_ln/words.dat') l; +eval create table t1 select load_file('$MYSQLTEST_VARDIR/std_data/words.dat') l; # We mask out the Privileges column because it differs for embedded server --replace_column 8 # show full fields from t1; diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 9bc428c3715..aec60bc2dee 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -62,7 +62,7 @@ drop table t1; # Test of date and not null # -create table t1 (date date); +create table t1 (date date); insert into t1 values ("2000-08-10"),("2000-08-11"); select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1; drop table t1; @@ -75,9 +75,12 @@ CREATE TABLE t1(AFIELD INT); INSERT INTO t1 VALUES(1); CREATE TABLE t2(GMT VARCHAR(32)); INSERT INTO t2 VALUES('GMT-0800'); -SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD; +SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)) +FROM t1, t2 GROUP BY t1.AFIELD; INSERT INTO t1 VALUES(1); -SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD; +SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)), + DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ', t2.GMT)) +FROM t1,t2 GROUP BY t1.AFIELD; drop table t1,t2; # @@ -90,7 +93,7 @@ SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1; DROP TABLE t1; # -# Bug 4937: different date -> string conversion when using SELECT ... UNION +# Bug#4937: different date -> string conversion when using SELECT ... UNION # and INSERT ... SELECT ... UNION # @@ -141,7 +144,7 @@ select * from t1; drop table t1; # -# Bug #30942: select str_to_date from derived table returns varying results +# Bug#30942: select str_to_date from derived table returns varying results # CREATE TABLE t1 ( a INT @@ -155,10 +158,22 @@ DROP TABLE t1; # -# Bug #31221: Optimizer incorrectly identifies impossible WHERE clause +# Bug#31221: Optimizer incorrectly identifies impossible WHERE clause # -CREATE TABLE t1 (a DATE, b int, PRIMARY KEY (a,b)); +CREATE TABLE t1 (a DATE, b INT, PRIMARY KEY (a,b)); +## The current sub test could fail (difference to expected result) if we +## have just reached midnight. +## (Bug#41776 type_date.test may fail if run around midnight) +## Therefore we sleep a bit if we are too close to midnight. +## The complete test itself needs in average less than 1 second. +## Therefore a time_distance to midnight of 5 seconds should be sufficient. +if (`SELECT CURTIME() > SEC_TO_TIME(24 * 3600 - 5)`) +{ + # We are here when CURTIME() is between '23:59:56' and '23:59:59'. + # So a sleep time of 5 seconds brings us between '00:00:01' and '00:00:04'. + --real_sleep 5 +} INSERT INTO t1 VALUES (DATE(NOW()), 1); SELECT COUNT(*) FROM t1 WHERE a = NOW(); EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW(); @@ -174,7 +189,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE a = NOW(); DROP TABLE t1; # -# Bug #28687: Search fails on '0000-00-00' date after sql_mode change +# Bug#28687: Search fails on '0000-00-00' date after sql_mode change # CREATE TABLE t1 (a DATE); diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 9aa8c00d24a..53bcf44061d 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -252,4 +252,19 @@ insert into t1 values (2e30), (-2e30); select f1 + 0e0 from t1; drop table t1; +# +# Bug #27483: Casting 'scientific notation type' to 'unsigned bigint' fails on +# windows. +# + +create table t1(d double, u bigint unsigned); + +insert into t1(d) values (9.22337203685479e18), + (1.84e19); + +update t1 set u = d; +select u from t1; + +drop table t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 27922a16a37..e8374e0ebfc 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -324,7 +324,7 @@ insert into t1 (a, c) values (4, '2004-04-04 00:00:00'), select * from t1; drop table t1; -# End of 4.1 tests +--echo End of 4.1 tests # Restore timezone to default set time_zone= @@global.time_zone; @@ -339,3 +339,21 @@ PRIMARY KEY (`id`) show fields from t1; select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COLUMN_NAME='posted_on'; drop table t1; + +# +# Bug#41370: TIMESTAMP field does not accepts NULL from FROM_UNIXTIME() +# + +CREATE TABLE t1 ( f1 INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, + f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + f3 TIMESTAMP); +INSERT INTO t1 (f2,f3) VALUES (NOW(), "0000-00-00 00:00:00"); +INSERT INTO t1 (f2,f3) VALUES (NOW(), NULL); +INSERT INTO t1 (f2,f3) VALUES (NOW(), ASCII(NULL)); +INSERT INTO t1 (f2,f3) VALUES (NOW(), FROM_UNIXTIME('9999999999')); +INSERT INTO t1 (f2,f3) VALUES (NOW(), TIME(NULL)); +UPDATE t1 SET f2=NOW(), f3=FROM_UNIXTIME('9999999999') WHERE f1=1; +SELECT f1,f2-f3 FROM t1; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/type_varchar.test b/mysql-test/t/type_varchar.test index 1eb949a21e3..9098881e379 100644 --- a/mysql-test/t/type_varchar.test +++ b/mysql-test/t/type_varchar.test @@ -3,7 +3,8 @@ drop table if exists t1, t2; --enable_warnings create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text); -copy_file $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLTEST_VARDIR/master-data/test/vchar.frm; +let $MYSQLD_DATADIR= `select @@datadir`; +copy_file $MYSQL_TEST_DIR/std_data/vchar.frm $MYSQLD_DATADIR/test/vchar.frm; truncate table vchar; show create table t1; show create table vchar; @@ -162,8 +163,8 @@ create table t3 ( en varchar(255) character set utf8, cz varchar(255) character set utf8 ); -remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm; -copy_file $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLTEST_VARDIR/master-data/test/t3.frm; +remove_file $MYSQLD_DATADIR/test/t3.frm; +copy_file $MYSQL_TEST_DIR/std_data/14897.frm $MYSQLD_DATADIR/test/t3.frm; truncate table t3; insert into t3 (id, en, cz) values (1,'en string 1','cz string 1'), diff --git a/mysql-test/t/unique_checks_basic.test b/mysql-test/t/unique_checks_basic.test deleted file mode 100644 index 55308adcc82..00000000000 --- a/mysql-test/t/unique_checks_basic.test +++ /dev/null @@ -1,170 +0,0 @@ -############## mysql-test\t\unique_checks_basic.test ########################## -# # -# Variable Name: unique_checks # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable unique_checks # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_UNIQUE_CHECKS # -# # -############################################################################### - ---source include/load_sysvars.inc -######################################################################## -# START OF transaction_allow_batching TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_session_value = @@session.unique_checks; -SELECT @start_session_value; - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -############################################################ -# Display the DEFAULT value of unique_checks # -############################################################ - - -SET @@session.unique_checks= 1; -SET @@session.unique_checks= DEFAULT; -SELECT @@session.unique_checks; - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -############################################################# -# Check the DEFAULT value of unique_checks # -############################################################# - - -SET @@session.unique_checks = DEFAULT; -SELECT @@session.unique_checks =1; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -######################################################################## -# Change the value of unique_checks to a valid value for SESSION Scope # -######################################################################## - -SET @@session.unique_checks =1; -SELECT @@session.unique_checks; - -SET @@session.unique_checks = 0; -SELECT @@session.unique_checks; - -SET @@session.unique_checks = True; -SELECT @@session.unique_checks; - -SET @@session.unique_checks = False; -SELECT @@session.unique_checks; - -SET @@session.unique_checks = "ON"; -SELECT @@session.unique_checks; - -SET @@session.unique_checks = "OFF"; -SELECT @@session.unique_checks; - - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -########################################################### -# Change the value of 'unique_checks' to an invalid value # -########################################################### - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = 'No'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = "yes"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = yes; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = NO; - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = "True"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = "False"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = "Test"; - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = 'test'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.unique_checks = 123456789031; - - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.unique_checks = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='unique_checks'; - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## -SET @@unique_checks = 1; -SELECT @@unique_checks = @@local.unique_checks; -SELECT @@local.unique_checks = @@session.unique_checks; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -######################################################################## -# Check if unique_checks can be accessed with and without @@ sign # -######################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET unique_checks = 1027; -SELECT @@unique_checks; - ---Error ER_UNKNOWN_TABLE -SELECT local.unique_checks; - ---Error ER_UNKNOWN_TABLE -SELECT session.unique_checks; - ---Error ER_BAD_FIELD_ERROR -SELECT unique_checks = @@session.unique_checks; - - -#################################### -# Restore initial value # -#################################### - - -SET @@session.unique_checks = @start_session_value; -SELECT @@session.unique_checks; - - -################################################## -# END OF unique_checks TESTS # -################################################## - diff --git a/mysql-test/t/updatable_views_with_limit_basic.test b/mysql-test/t/updatable_views_with_limit_basic.test deleted file mode 100644 index 61a45793d39..00000000000 --- a/mysql-test/t/updatable_views_with_limit_basic.test +++ /dev/null @@ -1,275 +0,0 @@ -############## mysql-test\t\updatable_views_with_limit_basic.test ############# -# # -# Variable Name: updatable_views_with_limit # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: 1 # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Sharique Abdullah # -# # -# Description: Test Case of Dynamic System Variable updatable_views_with_limit# -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_updatable_views_with_limit # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF updatable_views_with_limit TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.updatable_views_with_limit; -SELECT @start_global_value; -SET @start_session_value = @@session.updatable_views_with_limit; -SELECT @start_session_value; - - - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -######################################################################## -# Display the DEFAULT value of updatable_views_with_limit # -######################################################################## - -SET @@global.updatable_views_with_limit = 'NO'; -SET @@global.updatable_views_with_limit = DEFAULT; -SELECT @@global.updatable_views_with_limit; - - -SET @@session.updatable_views_with_limit = 'NO'; -SET @@session.updatable_views_with_limit = DEFAULT; -SELECT @@session.updatable_views_with_limit; - - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of updatable_views_with_limit # -######################################################################## - -SET @@global.updatable_views_with_limit = DEFAULT; -SELECT @@global.updatable_views_with_limit = 'Yes'; - -SET @@session.updatable_views_with_limit = DEFAULT; -SELECT @@session.updatable_views_with_limit ='Yes'; - - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.updatable_views_with_limit = NO; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = 'NO'; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = YES; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = 'YES'; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = "NO"; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = "YES"; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = 1; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = 0; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = TRUE; -SELECT @@global.updatable_views_with_limit; - -SET @@global.updatable_views_with_limit = False; -SELECT @@global.updatable_views_with_limit; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################### -# Change the value of variable to a valid value for SESSION Scope # -################################################################### - -SET @@session.updatable_views_with_limit = NO; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = 'NO'; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = YES; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = 'YES'; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = "YES"; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = "NO"; -SELECT @@session.updatable_views_with_limit; - - - -SET @@session.updatable_views_with_limit =1; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = 0; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = True; -SELECT @@session.updatable_views_with_limit; - -SET @@session.updatable_views_with_limit = False; -SELECT @@session.updatable_views_with_limit; - - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -######################################################################## -# Change the value of 'updatable_views_with_limit' to an invalid value # -######################################################################## - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.updatable_views_with_limit = "TRUE"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.updatable_views_with_limit = -1024; - - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.updatable_views_with_limit = 2345; - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.updatable_views_with_limit = "FALSE"; - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.updatable_views_with_limit = 65530.34; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@global.updatable_views_with_limit ="Testing"; - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.updatable_views_with_limit = "ON"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.updatable_views_with_limit = "OFF"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.updatable_views_with_limit = "True"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.updatable_views_with_limit = "False"; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.updatable_views_with_limit = "Test"; - - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.updatable_views_with_limit = 'test'; - ---Error ER_WRONG_VALUE_FOR_VAR -SET @@session.updatable_views_with_limit = 123456789031; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.updatable_views_with_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='updatable_views_with_limit'; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.updatable_views_with_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='updatable_views_with_limit'; - - - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -########################################################################### -# Check if global and session variable are independent of each other # -########################################################################### - -SET @@global.updatable_views_with_limit = NO; -SET @@session.updatable_views_with_limit = YES; -SELECT @@updatable_views_with_limit = @@global.updatable_views_with_limit; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## - -SET @@updatable_views_with_limit = YES; -SELECT @@updatable_views_with_limit = @@local.updatable_views_with_limit; -SELECT @@local.updatable_views_with_limit = @@session.updatable_views_with_limit; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################ -# Check if variable can be accessed with and without @@ sign # -################################################################ - ---Error ER_WRONG_VALUE_FOR_VAR -SET updatable_views_with_limit = 1027; -SELECT @@updatable_views_with_limit; - - ---Error ER_UNKNOWN_TABLE -SELECT local.updatable_views_with_limit; - ---Error ER_UNKNOWN_TABLE -SELECT session.updatable_views_with_limit; - ---Error ER_BAD_FIELD_ERROR -SELECT updatable_views_with_limit = @@session.updatable_views_with_limit; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.updatable_views_with_limit = @start_global_value; -SELECT @@global.updatable_views_with_limit; -SET @@session.updatable_views_with_limit = @start_session_value; -SELECT @@session.updatable_views_with_limit; - - -############################################################# -# END OF updatable_views_with_limit TESTS # -############################################################# - diff --git a/mysql-test/t/updatable_views_with_limit_func.test b/mysql-test/t/updatable_views_with_limit_func.test deleted file mode 100644 index 2e1a3f97346..00000000000 --- a/mysql-test/t/updatable_views_with_limit_func.test +++ /dev/null @@ -1,143 +0,0 @@ -############ mysql-test\t\updatable_views_with_limit_func.test ################# -# # -#Variable Name: updatable_views_with_limit # -#Scope: SESSION # -#Access Type: Dynamic # -#Data Type: Enumeration # -#Default Value: - # -#Values: - # -# # -# # -#Creation Date: 2008-03-02 # -#Author: Sharique Abdullah # -# # -#Description: Test Cases of Dynamic System Variable "updatable_views_with_limit# -# that checks behavior of this variable in the following ways # -# * Functionality based on different values # -# # -#Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html# -#option_mysqld_updatable_views_with_limit # -# # -################################################################################ - -# -# Setup -# - -SET @session_updatable_views_with_limit = @@Session.UPDATABLE_VIEWS_WITH_LIMIT; - - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -################################ -# Creating table # -################################ - -CREATE TABLE t1 (a INT, b INT, c INT, PRIMARY KEY(a,b)); - -################################## -# Inserting values in the table # -################################## - - -INSERT INTO t1 VALUES (10,2,-1), (20,3,-2), - (30,4,-3), (40,5,-4); - - -#################################### -# Creating views # -#################################### -CREATE VIEW v1 (x,y) AS SELECT a, c FROM t1; - - ---echo ** Connecting test_con1 using username 'root' ** -CONNECT (test_con1,localhost,root,,); ---echo ** Connection test_con1 ** -CONNECTION test_con1; - -SET @@Session.UPDATABLE_VIEWS_WITH_LIMIT=YES; - -# -# Testing WITH a limit clause -# - ---echo Warning expected, 'View does not contain complete key of the table' -UPDATE v1 SET x=x+6 LIMIT 1; - -SELECT * FROM t1; - -# -# Testing WITHOUT a limit clause -# - -UPDATE v1 SET x=x+5; - -SELECT * FROM t1; - ---echo ** Connecting test_con2 using username 'root' ** -CONNECT (test_con2,localhost,root,,); ---echo ** Connection test_con2 ** -CONNECTION test_con2; - -SET @@Session.UPDATABLE_VIEWS_WITH_LIMIT=NO; - -SELECT @@SESSION.UPDATABLE_VIEWS_WITH_LIMIT; - ---ERROR ER_NON_UPDATABLE_TABLE -UPDATE v1 SET x=x+10 LIMIT 1; ---echo Expected error 'Non updatable table' - -SELECT * FROM t1; - - ---echo '#---------------------FN_DYNVARS_039_01----------------------#' -###################################### -# Setting value to NO # -###################################### - -SET UPDATABLE_VIEWS_WITH_LIMIT=NO; - --- error ER_NON_UPDATABLE_TABLE -UPDATE v1 SET x=x+1 LIMIT 1; ---echo Expected error 'Non updatable table' - -SET UPDATABLE_VIEWS_WITH_LIMIT=0; - --- error ER_NON_UPDATABLE_TABLE -UPDATE v1 SET x=x+1 LIMIT 1; ---echo Expected error 'Non updatable table' - ---echo '#---------------------FN_DYNVARS_039_02----------------------#' -###################################### -# Setting value to Default # -###################################### - ---echo Warning expected, 'View does not contain complete key of the table' -SET UPDATABLE_VIEWS_WITH_LIMIT=DEFAULT; -UPDATE v1 SET x=x+1 LIMIT 1; - - ---echo Warning expected, 'View does not contain complete key of the table' -SET UPDATABLE_VIEWS_WITH_LIMIT=YES; -UPDATE v1 SET x=x+2 LIMIT 1; - -# -# Cleanup -# - ---echo ** Connection default ** -connection default; - ---echo ** Disconnecting test_con1, test_con2 ** -disconnect test_con1; -disconnect test_con2; - -SET @@SESSION.updatable_views_with_limit = @session_updatable_views_with_limit; - ---disable_warnings -DROP VIEW IF EXISTS v1; -DROP TABLE IF EXISTS t1; ---enable_warnings - diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test index ce40ec8ed77..a96d1f47cb2 100644 --- a/mysql-test/t/upgrade.test +++ b/mysql-test/t/upgrade.test @@ -52,7 +52,8 @@ drop table `txu#p#p1`; # Check if old tables work # -system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm; +let $MYSQLD_DATADIR= `select @@datadir`; +system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLD_DATADIR/test/t1.frm; truncate t1; drop table t1; @@ -70,11 +71,11 @@ create table tabc.t1 (a int); FLUSH TABLES; # Manually make a 5.0 database from the template ---mkdir $MYSQLTEST_VARDIR/master-data/a-b-c ---copy_file $MYSQLTEST_VARDIR/master-data/tabc/db.opt $MYSQLTEST_VARDIR/master-data/a-b-c/db.opt ---copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.frm $MYSQLTEST_VARDIR/master-data/a-b-c/t1.frm ---copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYD $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYD ---copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYI $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYI +--mkdir $MYSQLD_DATADIR/a-b-c +--copy_file $MYSQLD_DATADIR/tabc/db.opt $MYSQLD_DATADIR/a-b-c/db.opt +--copy_file $MYSQLD_DATADIR/tabc/t1.frm $MYSQLD_DATADIR/a-b-c/t1.frm +--copy_file $MYSQLD_DATADIR/tabc/t1.MYD $MYSQLD_DATADIR/a-b-c/t1.MYD +--copy_file $MYSQLD_DATADIR/tabc/t1.MYI $MYSQLD_DATADIR/a-b-c/t1.MYI show databases like '%a-b-c%'; ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME; diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index 70f2f0fa7a6..0098f237de9 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -16,9 +16,9 @@ source include/show_binlog_events.inc; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +let $MYSQLD_DATADIR= `select @@datadir`; flush logs; ---exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 +--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 drop table t1; # End of 4.1 tests diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index 5d916e410e3..fd4e538ea6c 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -285,4 +285,15 @@ set @lastid=-1; select @lastid != id, @lastid, @lastid := id from t1; drop table t1; +# +# Bug#42188: crash and/or memory corruption with user variables in trigger +# + +CREATE TABLE t1 (i INT); +CREATE TRIGGER t_after_insert AFTER INSERT ON t1 FOR EACH ROW SET @bug42188 = 10; +INSERT INTO t1 VALUES (1); +--change_user root,,test +INSERT INTO t1 VALUES (1); +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index 1db561183a7..1f9f7b5412d 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -47,12 +47,13 @@ drop table t1; # # Test with a saved table from 4.1 -copy_file std_data/bug19371.frm $MYSQLTEST_VARDIR/master-data/test/t1.frm; -chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.frm; -copy_file std_data/bug19371.MYD $MYSQLTEST_VARDIR/master-data/test/t1.MYD; -chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYD; -copy_file std_data/bug19371.MYI $MYSQLTEST_VARDIR/master-data/test/t1.MYI; -chmod 0777 $MYSQLTEST_VARDIR/master-data/test/t1.MYI; +let $MYSQLD_DATADIR= `select @@datadir`; +copy_file std_data/bug19371.frm $MYSQLD_DATADIR/test/t1.frm; +chmod 0777 $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/bug19371.MYD $MYSQLD_DATADIR/test/t1.MYD; +chmod 0777 $MYSQLD_DATADIR/test/t1.MYD; +copy_file std_data/bug19371.MYI $MYSQLD_DATADIR/test/t1.MYI; +chmod 0777 $MYSQLD_DATADIR/test/t1.MYI; # Everything _looks_ fine show create table t1; diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test index 823fecb8791..7cc068c68c7 100644 --- a/mysql-test/t/variables-notembedded.test +++ b/mysql-test/t/variables-notembedded.test @@ -28,6 +28,7 @@ set global slave_net_timeout=default; # sql_slave_skip_counter is write-only, so we can't save previous # value and restore it here. That's ok, because it's normally 0. set global sql_slave_skip_counter= 0; +set @@global.slave_net_timeout= @my_slave_net_timeout; # # Bug#28234 - global/session scope - documentation vs implementation diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 828cb3a2916..a54ac497c4c 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -6,7 +6,7 @@ drop table if exists t1,t2; --enable_warnings # -# Bug #19263: variables.test doesn't clean up after itself (I/II -- save) +# Bug#19263: variables.test doesn't clean up after itself (I/II -- save) # set @my_binlog_cache_size =@@global.binlog_cache_size; set @my_connect_timeout =@@global.connect_timeout; @@ -24,6 +24,7 @@ set @my_max_heap_table_size =@@global.max_heap_table_size; set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads; set @my_max_join_size =@@global.max_join_size; set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size; +set @my_myisam_max_sort_file_size =@@global.myisam_max_sort_file_size; set @my_net_buffer_length =@@global.net_buffer_length; set @my_net_write_timeout =@@global.net_write_timeout; set @my_net_read_timeout =@@global.net_read_timeout; @@ -34,7 +35,7 @@ set @my_server_id =@@global.server_id; set @my_slow_launch_time =@@global.slow_launch_time; set @my_storage_engine =@@global.storage_engine; set @my_thread_cache_size =@@global.thread_cache_size; - +set @my_max_allowed_packet =@@global.max_allowed_packet; # case insensitivity tests (new in 5.0) set @`test`=1; select @test, @`test`, @TEST, @`TEST`, @"teSt"; @@ -197,46 +198,46 @@ SELECT @@version_compile_os LIKE 'non-existent'; # The following should give errors ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set big_tables=OFFF; ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set big_tables="OFFF"; ---error 1193 +--error ER_UNKNOWN_SYSTEM_VARIABLE set unknown_variable=1; ---error 1232 +--error ER_WRONG_TYPE_FOR_VAR set max_join_size="hello"; ---error 1286 +--error ER_UNKNOWN_STORAGE_ENGINE set storage_engine=UNKNOWN_TABLE_TYPE; ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set storage_engine=MERGE, big_tables=2; show local variables like 'storage_engine'; ---error 1229 +--error ER_GLOBAL_VARIABLE set SESSION query_cache_size=10000; ---error 1230 +--error ER_NO_DEFAULT set GLOBAL storage_engine=DEFAULT; ---error 1115 +--error ER_UNKNOWN_CHARACTER_SET set character_set_client=UNKNOWN_CHARACTER_SET; ---error 1273 +--error ER_UNKNOWN_COLLATION set collation_connection=UNKNOWN_COLLATION; ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set character_set_client=NULL; ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set collation_connection=NULL; ---error 1228 +--error ER_LOCAL_VARIABLE set global autocommit=1; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@global.timestamp; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR set @@version=''; ---error 1229 +--error ER_GLOBAL_VARIABLE set @@concurrent_insert=1; ---error 1228 +--error ER_LOCAL_VARIABLE set @@global.sql_auto_is_null=1; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@global.sql_auto_is_null; ---error 1229 +--error ER_GLOBAL_VARIABLE set myisam_max_sort_file_size=100; ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set @@SQL_WARNINGS=NULL; # Test setting all variables @@ -367,23 +368,23 @@ drop table t1,t2; # error conditions # ---error 1193 +--error ER_UNKNOWN_SYSTEM_VARIABLE select @@xxxxxxxxxx; select 1; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.key_buffer_size; ---error 1229 +--error ER_GLOBAL_VARIABLE set ft_boolean_syntax = @@init_connect; ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set global ft_boolean_syntax = @@init_connect; ---error 1229 +--error ER_GLOBAL_VARIABLE set init_connect = NULL; set global init_connect = NULL; ---error 1229 +--error ER_GLOBAL_VARIABLE set ft_boolean_syntax = @@init_connect; ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set global ft_boolean_syntax = @@init_connect; # Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as @@ -416,15 +417,15 @@ select @a, @b; # # Bug#2586:Disallow global/session/local as structured var. instance names # ---error 1064 +--error ER_PARSE_ERROR set @@global.global.key_buffer_size= 1; ---error 1064 +--error ER_PARSE_ERROR set GLOBAL global.key_buffer_size= 1; ---error 1064 +--error ER_PARSE_ERROR SELECT @@global.global.key_buffer_size; ---error 1064 +--error ER_PARSE_ERROR SELECT @@global.session.key_buffer_size; ---error 1064 +--error ER_PARSE_ERROR SELECT @@global.local.key_buffer_size; # BUG#5135: cannot turn on log_warnings with SET in 4.1 (and 4.0) @@ -515,27 +516,27 @@ select @@lc_time_names; --echo *** LC_TIME_NAMES: testing with string expressions set lc_time_names=concat('de','_','DE'); select @@lc_time_names; ---error 1105 +--error ER_UNKNOWN_ERROR set lc_time_names=concat('de','+','DE'); select @@lc_time_names; --echo LC_TIME_NAMES: testing with numeric expressions set @@lc_time_names=1+2; select @@lc_time_names; ---error 1232 +--error ER_WRONG_TYPE_FOR_VAR set @@lc_time_names=1/0; select @@lc_time_names; set lc_time_names=en_US; --echo LC_TIME_NAMES: testing NULL and a negative number: ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set lc_time_names=NULL; ---error 1105 +--error ER_UNKNOWN_ERROR set lc_time_names=-1; select @@lc_time_names; --echo LC_TIME_NAMES: testing locale with the last ID: set lc_time_names=108; select @@lc_time_names; --echo LC_TIME_NAMES: testing a number beyond the valid ID range: ---error 1105 +--error ER_UNKNOWN_ERROR set lc_time_names=109; select @@lc_time_names; --echo LC_TIME_NAMES: testing that 0 is en_US: @@ -577,7 +578,7 @@ select @@query_prealloc_size = @test; # Bug#31588 buffer overrun when setting variables # # Buffer-size Off By One. Should throw valgrind-warning without fix #31588. ---error 1231 +--error ER_WRONG_VALUE_FOR_VAR set global sql_mode=repeat('a',80); --echo End of 4.1 tests @@ -595,9 +596,9 @@ drop table t1; # Bug #10339: read only variables. # ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR set @@warning_count=1; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR set @@global.error_count=1; # @@ -615,9 +616,9 @@ select @@max_heap_table_size > 0; # Bug #11775 Variable character_set_system does not exist (sometimes) # select @@character_set_system; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR set global character_set_system = latin1; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR set @@global.version_compile_os='234'; # @@ -728,7 +729,7 @@ select @@@; # Don't actually output, since it depends on the system --replace_column 1 # select @@hostname; ---error 1238 +--error ER_INCORRECT_GLOBAL_LOCAL_VAR set @@hostname= "anothername"; --replace_column 2 # show variables like 'hostname'; @@ -748,7 +749,7 @@ set global delayed_queue_size =@my_delayed_queue_size; set global flush =@my_flush; set global flush_time =@my_flush_time; set global key_buffer_size =@my_key_buffer_size; -set global max_binlog_cache_size =default; #@my_max_binlog_cache_size; +set global max_binlog_cache_size =@my_max_binlog_cache_size; set global max_binlog_size =@my_max_binlog_size; set global max_connect_errors =@my_max_connect_errors; set global max_connections =@my_max_connections; @@ -759,6 +760,7 @@ set global max_join_size =@my_max_join_size; set global max_user_connections =default; set global max_write_lock_count =default; set global myisam_data_pointer_size =@my_myisam_data_pointer_size; +set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size; set global net_buffer_length =@my_net_buffer_length; set global net_write_timeout =@my_net_write_timeout; set global net_read_timeout =@my_net_read_timeout; @@ -769,7 +771,7 @@ set global server_id =@my_server_id; set global slow_launch_time =@my_slow_launch_time; set global storage_engine =@my_storage_engine; set global thread_cache_size =@my_thread_cache_size; - +set global max_allowed_packet =@my_max_allowed_packet; # # Bug#28580 Repeatation of status variables # diff --git a/mysql-test/t/version_basic.test b/mysql-test/t/version_basic.test deleted file mode 100644 index 0a22713ca12..00000000000 --- a/mysql-test/t/version_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\version_basic.test ############################ -# # -# Variable Name: version # -# Scope: Global # -# Access Type: Static # -# Data Type: String # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable version # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_053_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.version); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_053_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.version=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.version); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_053_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.version = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.version); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_053_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@version = @@GLOBAL.version; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_053_05----------------------#' -################################################################################ -# Check if version can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@version); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.version); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.version); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.version); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT version = @@SESSION.version; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/version_comment_basic.test b/mysql-test/t/version_comment_basic.test deleted file mode 100644 index 3ae6daa192a..00000000000 --- a/mysql-test/t/version_comment_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\version_comment_basic.test #################### -# # -# Variable Name: version_comment # -# Scope: Global # -# Access Type: Static # -# Data Type: String # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable version_comment # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_054_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.version_comment); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_054_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.version_comment=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.version_comment); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_054_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.version_comment = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version_comment'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.version_comment); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version_comment'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_054_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@version_comment = @@GLOBAL.version_comment; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_054_05----------------------#' -################################################################################ -# Check if version_comment can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@version_comment); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.version_comment); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.version_comment); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.version_comment); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT version_comment = @@SESSION.version_comment; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/version_compile_machine_basic.test b/mysql-test/t/version_compile_machine_basic.test deleted file mode 100644 index 30742436068..00000000000 --- a/mysql-test/t/version_compile_machine_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\version_compile_machine_basic.test ############ -# # -# Variable Name: version_compile_machine # -# Scope: Global # -# Access Type: Static # -# Data Type: String # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable version_compile_machine # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_055_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.version_compile_machine); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_055_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.version_compile_machine=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.version_compile_machine); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_055_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.version_compile_machine = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version_compile_machine'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.version_compile_machine); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version_compile_machine'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_055_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@version_compile_machine = @@GLOBAL.version_compile_machine; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_055_05----------------------#' -################################################################################ -# Check if version_compile_machine can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@version_compile_machine); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.version_compile_machine); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.version_compile_machine); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.version_compile_machine); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT version_compile_machine = @@SESSION.version_compile_machine; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/version_compile_os_basic.test b/mysql-test/t/version_compile_os_basic.test deleted file mode 100644 index 8858f248249..00000000000 --- a/mysql-test/t/version_compile_os_basic.test +++ /dev/null @@ -1,100 +0,0 @@ - - -################## mysql-test\t\version_compile_os_basic.test ################# -# # -# Variable Name: version_compile_os # -# Scope: Global # -# Access Type: Static # -# Data Type: String # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable version_compile_os # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_056_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### -SELECT COUNT(@@GLOBAL.version_compile_os); ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_056_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.version_compile_os=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@GLOBAL.version_compile_os); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_056_03----------------------#' -################################################################# -# Check if the value in GLOBAL Table matches value in variable # -################################################################# - -SELECT @@GLOBAL.version_compile_os = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version_compile_os'; ---echo 1 Expected - -SELECT COUNT(@@GLOBAL.version_compile_os); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='version_compile_os'; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_056_04----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ -SELECT @@version_compile_os = @@GLOBAL.version_compile_os; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_056_05----------------------#' -################################################################################ -# Check if version_compile_os can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@version_compile_os); ---echo 1 Expected - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@local.version_compile_os); ---echo Expected error 'Variable is a GLOBAL variable' - ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@SESSION.version_compile_os); ---echo Expected error 'Variable is a GLOBAL variable' - -SELECT COUNT(@@GLOBAL.version_compile_os); ---echo 1 Expected - ---Error ER_BAD_FIELD_ERROR -SELECT version_compile_os = @@SESSION.version_compile_os; ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 1ea248f1fe9..9e22006ea67 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1228,11 +1228,11 @@ drop table t1; create table t1 (a int, b char(10)); create view v1 as select * from t1 where a != 0 with check option; -- error 1369 -load data infile '../std_data_ln/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines; +load data infile '../../std_data/loaddata3.dat' into table v1 fields terminated by '' enclosed by '' ignore 1 lines; select * from t1; select * from v1; delete from t1; -load data infile '../std_data_ln/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines; +load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines; select * from t1 order by a,b; select * from v1 order by a,b; drop view v1; @@ -1241,11 +1241,11 @@ drop table t1; create table t1 (a text, b text); create view v1 as select * from t1 where a <> 'Field A' with check option; -- error 1369 -load data infile '../std_data_ln/loaddata2.dat' into table v1 fields terminated by ',' enclosed by ''''; +load data infile '../../std_data/loaddata2.dat' into table v1 fields terminated by ',' enclosed by ''''; select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from v1; delete from t1; -load data infile '../std_data_ln/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by ''''; +load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by ''''; select concat('|',a,'|'), concat('|',b,'|') from t1; select concat('|',a,'|'), concat('|',b,'|') from v1; drop view v1; diff --git a/mysql-test/t/wait_timeout-master.opt b/mysql-test/t/wait_timeout-master.opt deleted file mode 100644 index 9e5c2289eb2..00000000000 --- a/mysql-test/t/wait_timeout-master.opt +++ /dev/null @@ -1 +0,0 @@ ---wait-timeout=1 diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test index 255947fa79f..63809252a01 100644 --- a/mysql-test/t/wait_timeout.test +++ b/mysql-test/t/wait_timeout.test @@ -1,40 +1,51 @@ -# This tests not performed with embedded server +# Last modification: +# 2009-01-19 H.Hunger Fix Bug#39108 main.wait_timeout fails sporadically +# - Increase wait timeout to 2 seconds +# - Eliminated the corresponding opt file, +# set global wait timeout within the test. +# - Replaced sleeps by wait condition +# - Minor improvements +############################################################################### +# These tests cannot run with the embedded server -- source include/not_embedded.inc -- source include/one_thread_per_connection.inc # -# Bug #8731: wait_timeout does not work on Mac OS X +# Bug#8731: wait_timeout does not work on Mac OS X # +let $start_value= `SELECT @@global.wait_timeout`; +SET @@global.wait_timeout= 2; +--echo disconnect default; +disconnect default; # Connect with another connection and reset counters --disable_query_log connect (wait_con,localhost,root,,test,,); +--echo connection wait_con; connection wait_con; -set session wait_timeout=100; +SET SESSION wait_timeout=100; let $retries=300; -set @aborted_clients= 0; +SET @aborted_clients= 0; --enable_query_log # Disable reconnect and do the query +connect (default,localhost,root,,test,,); +--echo connection default; connection default; -# If slow host (Valgrind...), we may have already timed out here. -# So force a reconnect if necessary, using a dummy query. And issue a -# 'flush status' to reset the 'aborted_clients' counter. ---enable_reconnect -select 0; -flush status; +--echo --disable_reconnect; --disable_reconnect -select 1; +SELECT 1; # Switch to wait_con and wait until server has aborted the connection --disable_query_log +--echo connection wait_con; connection wait_con; while (!`select @aborted_clients`) { - sleep 0.1; + real_sleep 0.1; let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`; - eval set @aborted_clients= SUBSTRING('$aborted_clients', 16)+0; + eval SET @aborted_clients= SUBSTRING('$aborted_clients', 16)+0; dec $retries; if (!$retries) @@ -45,44 +56,51 @@ while (!`select @aborted_clients`) --enable_query_log # The server has disconnected, add small sleep to make sure # the disconnect has reached client -sleep 1; - +let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist; +--source include/wait_condition.inc +--echo connection default; connection default; # When the connection is closed in this way, the error code should -# be consistent see bug#2845 for an explanation +# be consistent see Bug#2845 for an explanation # depending on platform/client, either errno 2006 or 2013 can occur below --error 2006,2013 -select 2; +SELECT 2; +--echo --enable_reconnect; --enable_reconnect -select 3; +SELECT 3; # Disconnect so that we will not be confused by a future abort from this # connection. +--echo disconnection default; disconnect default; # # Do the same test as above on a TCP connection -# (which we get by specifying a ip adress) +# (which we get by specifying an ip adress) # Connect with another connection and reset counters --disable_query_log +--echo connection wait_con; connection wait_con; -flush status; # Reset counters +FLUSH STATUS; # Reset counters let $retries=300; -set @aborted_clients= 0; +SET @aborted_clients= 0; --enable_query_log +--echo connection con1; connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,); +--echo --disable_reconnect; --disable_reconnect -select 1; +SELECT 1; # Switch to wait_con and wait until server has aborted the connection --disable_query_log +--echo connection wait_con; connection wait_con; while (!`select @aborted_clients`) { - sleep 0.1; + real_sleep 0.1; let $aborted_clients = `SHOW STATUS LIKE 'aborted_clients'`; - eval set @aborted_clients= SUBSTRING('$aborted_clients', 16)+0; + eval SET @aborted_clients= SUBSTRING('$aborted_clients', 16)+0; dec $retries; if (!$retries) @@ -93,14 +111,23 @@ while (!`select @aborted_clients`) --enable_query_log # The server has disconnected, add small sleep to make sure # the disconnect has reached client -sleep 1; +let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist; +--source include/wait_condition.inc +--echo connection con1; connection con1; # When the connection is closed in this way, the error code should -# be consistent see bug#2845 for an explanation +# be consistent see Bug#2845 for an explanation # depending on platform/client, either errno 2006 or 2013 can occur below --error 2006,2013 -select 2; +SELECT 2; +--echo --enable_reconnect; --enable_reconnect -select 3; +SELECT 3; +--replace_result $start_value <start_value> +eval SET @@global.wait_timeout= $start_value; +# ML: The start value might be changed in future ... +--echo disconnection con1; disconnect con1; + + diff --git a/mysql-test/t/wait_timeout_func.test b/mysql-test/t/wait_timeout_func.test deleted file mode 100644 index 6b7c8d016d2..00000000000 --- a/mysql-test/t/wait_timeout_func.test +++ /dev/null @@ -1,97 +0,0 @@ -############## mysql-test\t\wait_timeout_func.test ############################ -# # -# Variable Name: wait_timeout # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-03-07 # -# Author: Salman Rawala # -# # -# Modified: HHunger 2008-08-27 Simplified the test and replaced the sleeps. # -# # -# Description: Test Cases of Dynamic System Variable wait_timeout # -# that checks the functionality of this variable # -# # -# Reference: # -# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # -# # -############################################################################### - ---source include/not_embedded.inc - -SET @start_value= @@global.wait_timeout; - - ---echo '#--------------------FN_DYNVARS_186_01-------------------------#' -####################################################################### -# 1. test of scope session -####################################################################### - -SET @start_time= UNIX_TIMESTAMP(); ---echo connect (test_con1, localhost, root,,); -connect (test_con1, localhost, root,,); -connection test_con1; - -# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout. -SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1'; - -# Find a small value <> @@global.wait_timeout. -let $session_value = -`SELECT IF(@@global.wait_timeout <> 2 OR @@global.wait_timeout IS NULL, 2, 3)`; ---replace_result $session_value <session_value> -eval SET @@session.wait_timeout = $session_value; - ---echo connect (test_con2, localhost, root,,); -connect (test_con2, localhost, root,,); -connection test_con2; - ---replace_result $session_value <session_value> -eval SET @@session.wait_timeout = $session_value - 1; - ---echo connection default; -connection default; - ---echo wait until connections ready -let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist; ---source include/wait_condition.inc -SELECT info FROM information_schema.processlist; - ---echo '#--------------------FN_DYNVARS_186_03-------------------------#' -####################################################################### -# 2. test of scope global -####################################################################### - -# Find a small value <> @@global.wait_timeout. -let $global_value = $session_value + 1; ---replace_result $global_value <global_value> -eval SET @@global.wait_timeout= $global_value; - -# Changing the @@global.wait_timeout has no influence on the -# @@session.wait_timeout of already established sessions. -SELECT @@session.wait_timeout = @start_value AS 'Expect 1'; - ---echo connect (test_con3, localhost, root,,); -connect (test_con3, localhost, root,,); -connection test_con3; - -# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout. -SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1'; - ---echo connection default; -connection default; -# We can be sure that the connections test_con1 and test_con2 must be -# established because both have already executed a SET @@session.wait_timeout. -# This means they are or at least were visible within the processlist. -# Therefore we can now simply wait till both disappear from the processlist. -let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist; ---source include/wait_condition.inc -SELECT info FROM information_schema.processlist; - ---replace_result $global_value <global_value> $session_value <session_value>; -eval SELECT UNIX_TIMESTAMP() - @start_time >= $global_value + $session_value; -SET @@global.wait_timeout= @start_value; - diff --git a/mysql-test/t/warning_count_basic.test b/mysql-test/t/warning_count_basic.test deleted file mode 100644 index 64539e28d5b..00000000000 --- a/mysql-test/t/warning_count_basic.test +++ /dev/null @@ -1,97 +0,0 @@ - - -################## mysql-test\t\warning_count_basic.test ###################### -# # -# Variable Name: warning_count # -# Scope: Session # -# Access Type: Static # -# Data Type: numeric # -# # -# # -# Creation Date: 2008-02-07 # -# Author : Sharique Abdullah # -# # -# # -# Description:Test Cases of Dynamic System Variable warning_count # -# that checks the behavior of this variable in the following ways # -# * Value Check # -# * Scope Check # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---echo '#---------------------BS_STVARS_057_01----------------------#' -#################################################################### -# Displaying default value # -#################################################################### - -SELECT COUNT(@@SESSION.warning_count); ---echo 1 Expected - ---echo '#---------------------BS_STVARS_057_02----------------------#' -#################################################################### -# Check if Value can set # -#################################################################### - - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@SESSION.warning_count=1; ---echo Expected error 'Read only variable' - -SELECT COUNT(@@SESSION.warning_count); ---echo 1 Expected - - - - ---echo '#---------------------BS_STVARS_057_03----------------------#' -################################################################# -# Check if the value in SESSION Table matches value in variable # -################################################################# - -SELECT @@SESSION.warning_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='warning_count'; ---echo 1 Expected - -SELECT COUNT(@@SESSION.warning_count); ---echo 1 Expected - -SELECT COUNT(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='warning_count'; ---echo 1 Expected - - ---echo '#---------------------BS_STVARS_057_04----------------------#' -################################################################################ -# Check if accessing variable with and without SESSION point to same variable # -################################################################################ -SELECT @@warning_count = @@SESSION.warning_count; ---echo 1 Expected - - - ---echo '#---------------------BS_STVARS_057_05----------------------#' -################################################################################ -# Check if warning_count can be accessed with and without @@ sign # -################################################################################ - -SELECT COUNT(@@warning_count); ---echo 1 Expected -SELECT COUNT(@@local.warning_count); ---echo 1 Expected -SELECT COUNT(@@SESSION.warning_count); ---echo 1 Expected - ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT COUNT(@@GLOBAL.warning_count); ---echo Expected error 'Variable is a SESSION variable' - ---error ER_BAD_FIELD_ERROR -SELECT COUNT(warning_count = @@GLOBAL.warning_count); ---echo Expected error 'Readonly variable' - - diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 9e7e3e4f945..12421170eba 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -50,7 +50,7 @@ drop table t1; # create table t1(a tinyint, b int not null, c date, d char(5)); -load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ','; +load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; # PS doesn't work good with @@warning_count --disable_ps_protocol select @@warning_count; @@ -65,7 +65,6 @@ create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5)); insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test'); alter table t1 modify c char(4); alter table t1 add d char(2); ---error 1048 update t1 set a=NULL where a=10; update t1 set c='mysql ab' where c='test'; update t1 set d=c; diff --git a/mysql-test/t/warnings_engine_disabled.test b/mysql-test/t/warnings_engine_disabled.test index 0b09cff7b1e..b8751a062b7 100644 --- a/mysql-test/t/warnings_engine_disabled.test +++ b/mysql-test/t/warnings_engine_disabled.test @@ -4,7 +4,7 @@ # disable_query_log; --require r/true.require -select support = 'Disabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; +select support = 'NO' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; enable_query_log; @@ -16,4 +16,9 @@ create table t1 (id int) engine=NDB; alter table t1 engine=NDB; drop table t1; - +# +# Bug#29263 disabled storage engines omitted in SHOW ENGINES +# +SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster'; +SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE +PLUGIN_NAME='ndbcluster'; diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 5ca9c7afd76..74bce8dc962 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -551,4 +551,43 @@ INSERT INTO t1 VALUES (0), (0); SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1')); DROP TABLE t1; +# +# BUG#38227 EXTRACTVALUE doesn't work with DTD declarations +# +# Check that quoted strings work fine in DOCTYPE declaration. +# + +SET @xml= +'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <head> + <title> Title - document with document declaration</title> + </head> + <body> Hi, Im a webpage with document a declaration </body> +</html>'; + +SELECT ExtractValue(@xml, 'html/head/title'); +SELECT ExtractValue(@xml, 'html/body'); + +# These two documents will fail. +# Quoted strings are not allowed in regular tags +# +SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml'); +SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml'); + +# +# Bug#42495 updatexml: Assertion failed: xpath->context, file .\item_xmlfunc.cc, line 2507 +# +set @x=10; +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','$@x/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','round(123.4)/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','1/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','"b"/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','(1)/a'); + --echo End of 5.1 tests |