mirror of
https://github.com/MariaDB/server.git
synced 2026-04-29 11:45:32 +02:00
Bug #49756 Rows_examined is always 0 in the slow query log for
update statements
Only SELECT statements report any examined rows in the slow
log. Slow UPDATE, DELETE and INSERT statements report 0 rows
examined, unless the statement has a condition including a
SELECT substatement.
This patch adds counting of examined rows for the UPDATE and
DELETE statements. An INSERT ... VALUES statement will still
not report any rows as examined.
sql/sql_class.h:
Added more docs for THD::examined_row_count.
sql/sql_delete.cc:
Add incrementing thd->examined_row_count.
sql/sql_update.cc:
Add incrementing thd->examined_row_count.
This commit is contained in:
parent
29c8c152b2
commit
330864fcda
5 changed files with 85 additions and 2 deletions
|
|
@ -425,6 +425,7 @@ int mysql_update(THD *thd,
|
|||
{
|
||||
goto err;
|
||||
}
|
||||
thd->examined_row_count+= examined_rows;
|
||||
/*
|
||||
Filesort has already found and selected the rows we want to update,
|
||||
so we don't need the where clause
|
||||
|
|
@ -471,6 +472,7 @@ int mysql_update(THD *thd,
|
|||
|
||||
while (!(error=info.read_record(&info)) && !thd->killed)
|
||||
{
|
||||
thd->examined_row_count++;
|
||||
if (!(select && select->skip_record()))
|
||||
{
|
||||
if (table->file->was_semi_consistent_read())
|
||||
|
|
@ -577,6 +579,7 @@ int mysql_update(THD *thd,
|
|||
|
||||
while (!(error=info.read_record(&info)) && !thd->killed)
|
||||
{
|
||||
thd->examined_row_count++;
|
||||
if (!(select && select->skip_record()))
|
||||
{
|
||||
if (table->file->was_semi_consistent_read())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue