| 1 |
# Saving initial value of stored_program_cache in a temporary variable |
| 2 |
SET @start_value = @@global.stored_program_cache; |
| 3 |
SELECT @start_value; |
| 4 |
@start_value |
| 5 |
256 |
| 6 |
# Display the DEFAULT value of stored_program_cache |
| 7 |
SET @@global.stored_program_cache = DEFAULT; |
| 8 |
SELECT @@global.stored_program_cache; |
| 9 |
@@global.stored_program_cache |
| 10 |
256 |
| 11 |
# Verify default value of variable |
| 12 |
SELECT @@global.stored_program_cache = 256; |
| 13 |
@@global.stored_program_cache = 256 |
| 14 |
1 |
| 15 |
# Change the value of stored_program_cache to a valid value |
| 16 |
SET @@global.stored_program_cache = 512; |
| 17 |
SELECT @@global.stored_program_cache; |
| 18 |
@@global.stored_program_cache |
| 19 |
512 |
| 20 |
# Change the value of stored_program_cache to invalid value |
| 21 |
SET @@global.stored_program_cache = -1; |
| 22 |
Warnings: |
| 23 |
Warning 1292 Truncated incorrect stored_program_cache value: '-1' |
| 24 |
SELECT @@global.stored_program_cache; |
| 25 |
@@global.stored_program_cache |
| 26 |
16 |
| 27 |
SET @@global.stored_program_cache =100000000000; |
| 28 |
Warnings: |
| 29 |
Warning 1292 Truncated incorrect stored_program_cache value: '100000000000' |
| 30 |
SELECT @@global.stored_program_cache; |
| 31 |
@@global.stored_program_cache |
| 32 |
524288 |
| 33 |
SET @@global.stored_program_cache = 0; |
| 34 |
Warnings: |
| 35 |
Warning 1292 Truncated incorrect stored_program_cache value: '0' |
| 36 |
SELECT @@global.stored_program_cache; |
| 37 |
@@global.stored_program_cache |
| 38 |
16 |
| 39 |
SET @@global.stored_program_cache = 10000.01; |
| 40 |
ERROR 42000: Incorrect argument type to variable 'stored_program_cache' |
| 41 |
SET @@global.stored_program_cache = ON; |
| 42 |
ERROR 42000: Incorrect argument type to variable 'stored_program_cache' |
| 43 |
SET @@global.stored_program_cache= 'test'; |
| 44 |
ERROR 42000: Incorrect argument type to variable 'stored_program_cache' |
| 45 |
SET @@global.stored_program_cache = ''; |
| 46 |
ERROR 42000: Incorrect argument type to variable 'stored_program_cache' |
| 47 |
# Test if accessing session stored_program_cache gives error |
| 48 |
SET @@session.stored_program_cache = 0; |
| 49 |
ERROR HY000: Variable 'stored_program_cache' is a GLOBAL variable and should be set with SET GLOBAL |
| 50 |
# Check if accessing variable without SCOPE points to same global variable |
| 51 |
SET @@global.stored_program_cache = 512; |
| 52 |
SELECT @@stored_program_cache = @@global.stored_program_cache; |
| 53 |
@@stored_program_cache = @@global.stored_program_cache |
| 54 |
1 |
| 55 |
# Restore initial value |
| 56 |
SET @@global.stored_program_cache = @start_value; |
| 57 |
SELECT @@global.stored_program_cache; |
| 58 |
@@global.stored_program_cache |
| 59 |
256 |