| 1 |
|
| 2 |
# Test requires: sp-protocol/ps-protocol/view-protocol/cursor-protocol disabled |
| 3 |
--source include/no_protocol.inc |
| 4 |
--source include/not_valgrind.inc |
| 5 |
|
| 6 |
# |
| 7 |
# BUG#33236909 Lock_time computed differently by slow log and performance_schema |
| 8 |
# |
| 9 |
|
| 10 |
CREATE TABLE t1(id INT PRIMARY KEY,val INT); |
| 11 |
INSERT INTO t1 VALUES (1,1); |
| 12 |
|
| 13 |
--connect (c1, localhost, root,,) |
| 14 |
BEGIN; |
| 15 |
SELECT * FROM t1 WHERE id=1 FOR SHARE; |
| 16 |
|
| 17 |
--connect (c2, localhost, root,,) |
| 18 |
BEGIN; |
| 19 |
--send SELECT * FROM t1 FOR UPDATE |
| 20 |
|
| 21 |
--sleep 5 |
| 22 |
--connection c1 |
| 23 |
COMMIT; |
| 24 |
--disconnect c1 |
| 25 |
|
| 26 |
--connection c2 |
| 27 |
--reap |
| 28 |
--connection default |
| 29 |
SELECT SQL_TEXT, (LOCK_TIME >= 4900000000000) as locked_5_sec |
| 30 |
FROM performance_schema.events_statements_current; |
| 31 |
--connection c2 |
| 32 |
COMMIT; |
| 33 |
|
| 34 |
--connection default |
| 35 |
--disconnect c2 |
| 36 |
|
| 37 |
## MANUAL INSPECTION ONLY |
| 38 |
# --let $read_from_file=`select @@slow_query_log_file` |
| 39 |
# --source include/read_file_to_var.inc |
| 40 |
# --echo $result |
| 41 |
|
| 42 |
SELECT query_sample_text, (SUM_LOCK_TIME >= 4900000000000) as locked_5_sec |
| 43 |
FROM performance_schema.events_statements_summary_by_digest |
| 44 |
WHERE query_sample_text LIKE 'SELECT * FROM t1 %'; |
| 45 |
|
| 46 |
DROP TABLE t1; |
| 47 |
|
| 48 |
|