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