mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-3953 Add columns for ROWS_EXAMINED, ROWS_SENT, and ROWS_READ to I_S and processlist
MDEV-32441 SENT_ROWS shows random wrong values when stored function is selected. MDEV-32281 EXAMINED_ROWS is not populated in information_schema.processlist upon SELECT. Added ROWS_SENT to information_schema.processlist This is to have the same information as Percona server (SENT_ROWS) To ensure that information_schema.processlist has correct values for sent_rows and examined_rows I introduced two new variables to hold the total counts so far. This was needed as stored functions and stored procedures will reset the normal counters to be able to count rows for each statement individually for slow query log. Other things: - Selects with functions shows in processlist the total examined_rows and sent_rows by the main statement and all functions. - Stored procedures shows in processlist examined_rows and sent_rows per stored procedure statement. - Fixed some double accounting for sent_rows and examined_rows. - HANDLER operations now also supports send_rows and examined_rows. - Display sizes for MEMORY_USED, MAX_MEMORY_USED, EXAMINED_ROWS and QUERY_ID in information_schema.processlist changed to 10 characters. - EXAMINED_ROWS and SENT_ROWS changed to bigint. - INSERT RETURNING and DELETE RETURNING now updates SENT_ROWS. - As thd is always up to date with examined_rows, we do not need to handle examined row counting for unions or filesort. - I renamed SORT_INFO::examined_rows to m_examined_rows to ensure that we don't get bugs in merges that tries to use examined_rows. - Removed calls of type "thd->set_examined_row_count(0)" as they are not needed anymore. - Removed JOIN::join_examined_rows - Removed not used functions: THD::set_examined_row_count() - Made inline some functions that where called for each row.
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
--source include/have_sequence.inc
|
||||
|
||||
--echo # Test for INSERT...RETURNING
|
||||
|
||||
CREATE TABLE t1(id1 INT PRIMARY KEY AUTO_INCREMENT, val1 VARCHAR(1));
|
||||
@ -396,3 +398,15 @@ CREATE TABLE t (a INT);
|
||||
INSERT t WITH cte AS (SELECT 1) SELECT * FROM cte RETURNING *;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-3953 Add columns for ROWS_EXAMINED, ROWS_SENT, and ROWS_READ to I_S and
|
||||
--echo # processlist
|
||||
--echo #
|
||||
|
||||
create table t1 (a int primary key, b int);
|
||||
flush status;
|
||||
insert into t1 values (1,2),(2,4) returning a,b;
|
||||
insert into t1 select seq,seq from seq_10_to_13 returning a,b;
|
||||
show status like "Rows_sent";
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user