1# Variable Name: stored_program_cache 2# Scope: GLOBAL 3# Access Type: Dynamic 4# Data Type: numeric 5# Default Value: 256 6# Range: 256-524288 7 8--source include/load_sysvars.inc 9 10--echo # Saving initial value of stored_program_cache in a temporary variable 11SET @start_value = @@global.stored_program_cache; 12SELECT @start_value; 13 14--echo # Display the DEFAULT value of stored_program_cache 15SET @@global.stored_program_cache = DEFAULT; 16SELECT @@global.stored_program_cache; 17 18--echo # Verify default value of variable 19SELECT @@global.stored_program_cache = 256; 20 21--echo # Change the value of stored_program_cache to a valid value 22SET @@global.stored_program_cache = 512; 23SELECT @@global.stored_program_cache; 24 25--echo # Change the value of stored_program_cache to invalid value 26SET @@global.stored_program_cache = -1; 27SELECT @@global.stored_program_cache; 28 29SET @@global.stored_program_cache =100000000000; 30SELECT @@global.stored_program_cache; 31 32SET @@global.stored_program_cache = 0; 33SELECT @@global.stored_program_cache; 34 35--Error ER_WRONG_TYPE_FOR_VAR 36SET @@global.stored_program_cache = 10000.01; 37 38--Error ER_WRONG_TYPE_FOR_VAR 39SET @@global.stored_program_cache = ON; 40--Error ER_WRONG_TYPE_FOR_VAR 41SET @@global.stored_program_cache= 'test'; 42 43--Error ER_WRONG_TYPE_FOR_VAR 44SET @@global.stored_program_cache = ''; 45 46--echo # Test if accessing session stored_program_cache gives error 47 48--Error ER_GLOBAL_VARIABLE 49SET @@session.stored_program_cache = 0; 50 51--echo # Check if accessing variable without SCOPE points to same global variable 52 53SET @@global.stored_program_cache = 512; 54SELECT @@stored_program_cache = @@global.stored_program_cache; 55 56--echo # Restore initial value 57 58SET @@global.stored_program_cache = @start_value; 59SELECT @@global.stored_program_cache; 60