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';
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';
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';
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';
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';
49
'#---------------------FN_DYNVARS_031_04----------------------#'
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";
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';
64
'#---------------------FN_DYNVARS_031_05----------------------#'
65
SET GLOBAL max_prepared_stmt_count=3;
66
** Creating procedure **
67
DROP PROCEDURE IF EXISTS sp_checkstmts;
69
Note 1305 PROCEDURE sp_checkstmts does not exist
70
CREATE PROCEDURE sp_checkstmts ()
72
PREPARE newstmt from "SELECT * FROM information_schema.CHARACTER_SETS C";
75
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 3)
76
Expected error "Max prepared statements count reached"
81
DROP PROCEDURE sp_checkstmts;
82
SET @@global.max_prepared_stmt_count = @global_max_prepared_stmt_count;