| 1 |
--source include/have_statement_timeout.inc |
| 2 |
|
| 3 |
--echo # Displaying default value |
| 4 |
|
| 5 |
SELECT COUNT(@@GLOBAL.have_statement_timeout); |
| 6 |
--echo 1 Expected |
| 7 |
|
| 8 |
--echo # Check if Value can set |
| 9 |
|
| 10 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 11 |
SET @@GLOBAL.have_statement_timeout=1; |
| 12 |
--echo Expected error 'Read only variable' |
| 13 |
|
| 14 |
SELECT COUNT(@@GLOBAL.have_statement_timeout); |
| 15 |
--echo 1 Expected |
| 16 |
|
| 17 |
--echo # Check if the value in GLOBAL Table matches value in variable |
| 18 |
|
| 19 |
--disable_warnings |
| 20 |
SELECT @@GLOBAL.have_statement_timeout = VARIABLE_VALUE |
| 21 |
FROM performance_schema.global_variables |
| 22 |
WHERE VARIABLE_NAME='have_statement_timeout'; |
| 23 |
--enable_warnings |
| 24 |
--echo 1 Expected |
| 25 |
|
| 26 |
SELECT COUNT(@@GLOBAL.have_statement_timeout); |
| 27 |
--echo 1 Expected |
| 28 |
|
| 29 |
--disable_warnings |
| 30 |
SELECT COUNT(VARIABLE_VALUE) |
| 31 |
FROM performance_schema.global_variables |
| 32 |
WHERE VARIABLE_NAME='have_statement_timeout'; |
| 33 |
--enable_warnings |
| 34 |
--echo 1 Expected |
| 35 |
|
| 36 |
--echo # Check if accessing variable with and without GLOBAL point to same variable |
| 37 |
|
| 38 |
SELECT @@have_statement_timeout = @@GLOBAL.have_statement_timeout; |
| 39 |
--echo 1 Expected |
| 40 |
|
| 41 |
--echo # Check if have_statement_timeout can be accessed with and without @@ sign |
| 42 |
|
| 43 |
SELECT COUNT(@@have_statement_timeout); |
| 44 |
--echo 1 Expected |
| 45 |
|
| 46 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 47 |
SELECT COUNT(@@local.have_statement_timeout); |
| 48 |
--echo Expected error 'Variable is a GLOBAL variable' |
| 49 |
|
| 50 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 51 |
SELECT COUNT(@@SESSION.have_statement_timeout); |
| 52 |
--echo Expected error 'Variable is a GLOBAL variable' |
| 53 |
|
| 54 |
SELECT COUNT(@@GLOBAL.have_statement_timeout); |
| 55 |
--echo 1 Expected |
| 56 |
|
| 57 |
--error ER_BAD_FIELD_ERROR |
| 58 |
SELECT have_statement_timeout; |
| 59 |
--echo Expected error 'Unknown column' |