Bug #111935 | The procedure contains an alter table and the slow log output is inaccurate | ||
---|---|---|---|
Submitted: | 1 Aug 2023 7:50 | Modified: | 1 Aug 2023 14:29 |
Reporter: | xiang wang | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Logging | Severity: | S4 (Feature request) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[1 Aug 2023 7:50]
xiang wang
[1 Aug 2023 12:31]
MySQL Verification Team
Hi Mr. wang, Thank you for your bug report. However, the release that you are using is ancient. We have tested your test case with 8.0.34 and we get syntax errors in your definition of the stored procedure. Unsupported.
[1 Aug 2023 13:19]
xiang wang
Testing on MySQL 8.0.33: #my.cnf configuration: [mysqld] log_slow_admin_statements=on long_query_time=1 #Execute the following statement: create database test; use test; create table t(id int primary key,var char(20)); insert into t values(1,'aa'),(2,'bb'); DELIMITER $$ create procedure test() BEGIN update t set var='bb' where id=sleep(2); alter table t add age int; select now(); END $$ DELIMITER ; call test(); #slow log oputout,Among them, select now() did not execute for 4 seconds: # Time: 2023-08-01T21:09:10.185192+08:00 # User@Host: root[root] @ localhost [] Id: 169 # Query_time: 4.011447 Lock_time: 0.000026 Rows_sent: 1 Rows_examined: 3 use test; SET timestamp=1690895350; select now(); # Time: 2023-08-01T21:09:10.185675+08:00 # User@Host: root[root] @ localhost [] Id: 169 # Query_time: 4.011930 Lock_time: 0.000004 Rows_sent: 1 Rows_examined: 3 SET timestamp=1690895350; call test();
[1 Aug 2023 14:29]
MySQL Verification Team
Hi, This time, we were able to repeat the test case, we got this in the slow query log: Time Id Command Argument # Time: 2023-08-01T14:15:41.426023Z # User@Host: admin[admin] @ localhost [] Id: 8 # Query_time: 4.020971 Lock_time: 0.000018 Rows_sent: 1 Rows_examined: 3 use test; SET timestamp=1690899341; select now(); # Time: 2023-08-01T14:15:41.426363Z # User@Host: sinisa[sinisa] @ localhost [] Id: 8 # Query_time: 4.021311 Lock_time: 0.000002 Rows_sent: 1 Rows_examined: 3 SET timestamp=1690899341; call test(); ----------------------------- This is expected behaviour. However, we suppose you wished to see the following command in it: update t set var='bb' where id=sleep(2); This is truly a bug, but very low priority bug. Actually, this is a feature request. Verified.
[1 Aug 2023 14:29]
MySQL Verification Team
HI, It affects both 8.0.34 and 8.1.0.