diff options
author | Guilhem Bichot <guilhem@mysql.com> | 2009-02-12 15:08:56 +0100 |
---|---|---|
committer | Guilhem Bichot <guilhem@mysql.com> | 2009-02-12 15:08:56 +0100 |
commit | 704b4845aa9ce51a6c5a9f5f42265e376db0dfb3 (patch) | |
tree | 73476f970c229f75846855edeeddfbc6fd87ed4b /mysql-test/suite/sys_vars/t/identity_basic.test | |
parent | 2637dda66845868fe996e60e54996acf03f6c537 (diff) | |
parent | a5e5b0180a6b86cce258eef232ef59d6e7c40bb0 (diff) | |
download | mariadb-git-704b4845aa9ce51a6c5a9f5f42265e376db0dfb3.tar.gz |
merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.
There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.
mysys/thr_mutex.c:
adding DBUG_PRINT here, so that we can locate where the warning is issued.
Diffstat (limited to 'mysql-test/suite/sys_vars/t/identity_basic.test')
-rw-r--r-- | mysql-test/suite/sys_vars/t/identity_basic.test | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/mysql-test/suite/sys_vars/t/identity_basic.test b/mysql-test/suite/sys_vars/t/identity_basic.test new file mode 100644 index 00000000000..fa5fc807414 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/identity_basic.test @@ -0,0 +1,189 @@ +############## 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 # +######################################################################## |