Server IP : 104.21.38.3 / Your IP : 162.158.190.7 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/sys_vars/t/ |
Upload File : |
############## 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; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.identity = " "; SELECT @@session.identity; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.identity = ' '; SELECT @@session.identity; --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'; --disable_warnings SELECT @@session.identity = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='identity'; --enable_warnings --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 # ########################################################################