| 1 |
** Setup ** |
| 2 |
|
| 3 |
SET @global_max_prepared_stmt_count = @@global.max_prepared_stmt_count; |
| 4 |
'#---------------------FN_DYNVARS_031_01----------------------#' |
| 5 |
SET GLOBAL max_prepared_stmt_count=2; |
| 6 |
** Prepare statements ** |
| 7 |
PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 8 |
PREPARE stmt1 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 9 |
PREPARE stmt2 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 10 |
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 2) |
| 11 |
Expected error "Max prepared statements count reached" |
| 12 |
SHOW STATUS like 'Prepared_stmt_count'; |
| 13 |
Variable_name Value |
| 14 |
Prepared_stmt_count 2 |
| 15 |
2 Expected |
| 16 |
'#---------------------FN_DYNVARS_031_02----------------------#' |
| 17 |
SET GLOBAL max_prepared_stmt_count=0; |
| 18 |
PREPARE stmt3 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 19 |
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 0) |
| 20 |
Expected error "Max prepared statements count reached" |
| 21 |
SHOW STATUS like 'Prepared_stmt_count'; |
| 22 |
Variable_name Value |
| 23 |
Prepared_stmt_count 2 |
| 24 |
2 Expected |
| 25 |
PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 26 |
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 0) |
| 27 |
Expected error "Max prepared statements count reached" |
| 28 |
SHOW STATUS like 'Prepared_stmt_count'; |
| 29 |
Variable_name Value |
| 30 |
Prepared_stmt_count 1 |
| 31 |
2 Expected |
| 32 |
'Bug#35389 A pre existing valid prepared statement DROPS if a PREPARE' |
| 33 |
'STATEMENT command is issued with the same name that' |
| 34 |
'causes ER_MAX_PREPARED_STMT_COUNT_REACHED error' |
| 35 |
'#---------------------FN_DYNVARS_031_03----------------------#' |
| 36 |
SHOW STATUS like 'Prepared_stmt_count'; |
| 37 |
Variable_name Value |
| 38 |
Prepared_stmt_count 1 |
| 39 |
SET GLOBAL max_prepared_stmt_count=4; |
| 40 |
PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 41 |
PREPARE stmt1 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 42 |
PREPARE stmt2 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 43 |
PREPARE stmt3 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 44 |
** Value of prepared stmt' |
| 45 |
SHOW STATUS LIKE 'Prepared_stmt_count'; |
| 46 |
Variable_name Value |
| 47 |
Prepared_stmt_count 4 |
| 48 |
4 Expected |
| 49 |
'#---------------------FN_DYNVARS_031_04----------------------#' |
| 50 |
** preparing stmts ** |
| 51 |
PREPARE stmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 52 |
PREPARE stmt1 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 53 |
PREPARE stmt2 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 54 |
** setting value ** |
| 55 |
SET GLOBAL max_prepared_stmt_count=3; |
| 56 |
** Check wether any more statements can be prepared ** |
| 57 |
PREPARE stmt5 from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 58 |
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 3) |
| 59 |
Expected error "Max prepared statements count reached" |
| 60 |
SHOW STATUS LIKE 'Prepared_stmt_count'; |
| 61 |
Variable_name Value |
| 62 |
Prepared_stmt_count 4 |
| 63 |
4 Expected |
| 64 |
'#---------------------FN_DYNVARS_031_05----------------------#' |
| 65 |
SET GLOBAL max_prepared_stmt_count=3; |
| 66 |
** Creating procedure ** |
| 67 |
DROP PROCEDURE IF EXISTS sp_checkstmts; |
| 68 |
Warnings: |
| 69 |
Note 1305 PROCEDURE test.sp_checkstmts does not exist |
| 70 |
CREATE PROCEDURE sp_checkstmts () |
| 71 |
BEGIN |
| 72 |
PREPARE newstmt from "SELECT * FROM information_schema.CHARACTER_SETS C"; |
| 73 |
END // |
| 74 |
CALL sp_checkstmts(); |
| 75 |
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 3) |
| 76 |
Expected error "Max prepared statements count reached" |
| 77 |
DROP PREPARE stmt; |
| 78 |
DROP PREPARE stmt1; |
| 79 |
DROP PREPARE stmt2; |
| 80 |
DROP PREPARE stmt3; |
| 81 |
DROP PROCEDURE sp_checkstmts; |
| 82 |
SET @@global.max_prepared_stmt_count = @global_max_prepared_stmt_count; |