| 1 |
|
| 2 |
================================================================================ |
| 3 |
SETUP |
| 4 |
================================================================================ |
| 5 |
CREATE TABLE test.t1 (c1 INT); |
| 6 |
PREPARE stmt1 FROM "SELECT c1 FROM test.t1"; |
| 7 |
EXECUTE stmt1; |
| 8 |
c1 |
| 9 |
SHOW SESSION STATUS LIKE "%com_stmt_%prepare%"; |
| 10 |
Variable_name Value |
| 11 |
Com_stmt_prepare 1 |
| 12 |
Com_stmt_reprepare 0 |
| 13 |
SELECT * FROM performance_schema.session_status WHERE VARIABLE_NAME LIKE "%com_stmt%"; |
| 14 |
VARIABLE_NAME VARIABLE_VALUE |
| 15 |
Com_stmt_reprepare 0 |
| 16 |
SELECT VARIABLE_VALUE FROM performance_schema.global_status |
| 17 |
WHERE VARIABLE_NAME LIKE "Com_stmt_reprepare" |
| 18 |
INTO @count_global_reprepare_before; |
| 19 |
ALTER TABLE test.t1 ADD COLUMN c2 INTEGER; |
| 20 |
EXECUTE stmt1; |
| 21 |
c1 |
| 22 |
SHOW SESSION STATUS LIKE "%com_stmt_%prepare%"; |
| 23 |
Variable_name Value |
| 24 |
Com_stmt_prepare 2 |
| 25 |
Com_stmt_reprepare 1 |
| 26 |
SELECT * FROM performance_schema.session_status WHERE VARIABLE_NAME LIKE "%com_stmt%"; |
| 27 |
VARIABLE_NAME VARIABLE_VALUE |
| 28 |
Com_stmt_reprepare 1 |
| 29 |
SELECT VARIABLE_VALUE FROM performance_schema.global_status |
| 30 |
WHERE VARIABLE_NAME LIKE "Com_stmt_reprepare" |
| 31 |
INTO @count_global_reprepare_after; |
| 32 |
SELECT @count_global_reprepare_after - @count_global_reprepare_before; |
| 33 |
@count_global_reprepare_after - @count_global_reprepare_before |
| 34 |
1 |
| 35 |
|
| 36 |
================================================================================ |
| 37 |
CLEANUP |
| 38 |
================================================================================ |
| 39 |
DROP TABLE test.t1; |