Spracherkennung für: .test vermutete Sprache: Postscript {Postscript[54] Python[54] R[54]} [Methode: maximale Elemente, drei Dimensionen]
############## mysql-test\t\max_open_cursors_basic.test ###############
# #
# Variable Name: max_open_cursors #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 16777216 #
# Range: 0-65535 #
# #
# #
# Creation Date: 2025-02-10 #
# Author: Salman #
# #
# Description: Test Cases of Dynamic System Variable max_open_cursors #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
###############################################################################
--source include/load_sysvars.inc
###############################################################
# START OF max_open_cursors TESTS #
###############################################################
#############################################################
# Save initial value #
#############################################################
SET @start_global_value = @@global.max_open_cursors;
SET @start_session_value = @@session.max_open_cursors;
SELECT @start_session_value = @start_global_value;
--echo '#--------------------FN_DYNVARS_077_01-------------------------#'
###############################################################
# Display the DEFAULT value of max_open_cursors #
###############################################################
SET @@global.max_open_cursors = 1677721610;
SET @@global.max_open_cursors = DEFAULT;
SELECT @@global.max_open_cursors > 0;
SET @@session.max_open_cursors = 1677721610;
SET @@session.max_open_cursors = DEFAULT;
SELECT @@session.max_open_cursors > 0;
--echo '#--------------------FN_DYNVARS_077_03-------------------------#'
############################################################################
# Change the value of max_open_cursors to a valid value for GLOBAL Scope #
############################################################################
SET @@global.max_open_cursors = 16384;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = 16385;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = 65535;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = 4294967294;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = 4294967295;
SELECT @@global.max_open_cursors;
--echo '#--------------------FN_DYNVARS_077_04-------------------------#'
#############################################################################
# Change the value of max_open_cursors to a valid value for SESSION Scope #
#############################################################################
SET @@session.max_open_cursors = 16384;
SELECT @@session.max_open_cursors;
SET @@session.max_open_cursors = 16385;
SELECT @@session.max_open_cursors;
SET @@session.max_open_cursors = 65535;
SELECT @@session.max_open_cursors;
SET @@session.max_open_cursors = 4294967294;
SELECT @@session.max_open_cursors;
SET @@session.max_open_cursors = 4294967295;
SELECT @@session.max_open_cursors;
--echo '#------------------FN_DYNVARS_077_05-----------------------#'
##############################################################
# Change the value of max_open_cursors to an invalid value #
##############################################################
SET @@global.max_open_cursors = -1;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = -1024;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = 1024;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = 16383;
SELECT @@global.max_open_cursors;
--disable_warnings
SET @@global.max_open_cursors = 4294967296;
--enable_warnings
--replace_result 4294966272 4294967296
SELECT @@global.max_open_cursors;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_open_cursors = 65530.34;
--replace_result 4294966272 4294967296
SELECT @@global.max_open_cursors;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.max_open_cursors = test;
--replace_result 4294966272 4294967296
SELECT @@global.max_open_cursors;
SET @@session.max_open_cursors = -1;
SELECT @@session.max_open_cursors;
SET @@session.max_open_cursors = 16383;
SELECT @@session.max_open_cursors;
--disable_warnings
SET @@session.max_open_cursors = 4294967296;
--enable_warnings
--replace_result 4294966272 4294967296
SELECT @@session.max_open_cursors;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_open_cursors = 65530.34;
SET @@session.max_open_cursors = 10737418241;
--replace_result 4294966272 10737418240
SELECT @@session.max_open_cursors;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.max_open_cursors = test;
--replace_result 4294966272 10737418240
SELECT @@session.max_open_cursors;
--echo '#------------------FN_DYNVARS_077_06-----------------------#'
####################################################################
# Check if the value in GLOBAL Table matches value in variable #
####################################################################
SELECT @@global.max_open_cursors = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_open_cursors';
--echo '#------------------FN_DYNVARS_077_07-----------------------#'
####################################################################
# Check if the value in SESSION Table matches value in variable #
####################################################################
SELECT @@session.max_open_cursors = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_open_cursors';
--echo '#------------------FN_DYNVARS_077_08-----------------------#'
####################################################################
# Check if TRUE and FALSE values can be used on variable #
####################################################################
SET @@global.max_open_cursors = TRUE;
SELECT @@global.max_open_cursors;
SET @@global.max_open_cursors = FALSE;
SELECT @@global.max_open_cursors;
--echo '#---------------------FN_DYNVARS_077_09----------------------#'
#################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
#################################################################################
SET @@global.max_open_cursors = 163845;
SELECT @@max_open_cursors = @@global.max_open_cursors;
--echo '#---------------------FN_DYNVARS_077_10----------------------#'
########################################################################################################
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
########################################################################################################
SET @@max_open_cursors = 16777216;
SELECT @@max_open_cursors = @@local.max_open_cursors;
SELECT @@local.max_open_cursors = @@session.max_open_cursors;
--echo '#---------------------FN_DYNVARS_077_11----------------------#'
#############################################################################
# Check if max_open_cursors can be accessed with and without @@ sign #
#############################################################################
SET max_open_cursors = 316777216;
SELECT @@max_open_cursors;
--Error ER_UNKNOWN_TABLE
SELECT local.max_open_cursors;
--Error ER_UNKNOWN_TABLE
SELECT session.max_open_cursors;
--Error ER_BAD_FIELD_ERROR
SELECT max_open_cursors = @@session.max_open_cursors;
####################################
# Restore initial value #
####################################
SET @@global.max_open_cursors = @start_global_value;
#######################################################
# END OF max_open_cursors TESTS #
#######################################################
[Dauer der Verarbeitung: 0.18 Sekunden]