mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02:00
Don't increment 'Empty_queries' for queries with errors.
This commit is contained in:
parent
7ca60dd842
commit
6c1c27ea11
3 changed files with 18 additions and 1 deletions
|
|
@ -7,4 +7,12 @@ select * from t1;
|
|||
nr b str
|
||||
select * from t1 limit 0;
|
||||
nr b str
|
||||
show status like "Empty_queries";
|
||||
Variable_name Value
|
||||
Empty_queries 2
|
||||
drop table t1;
|
||||
select * from t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
show status like "Empty_queries";
|
||||
Variable_name Value
|
||||
Empty_queries 2
|
||||
|
|
|
|||
|
|
@ -10,6 +10,15 @@ create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary
|
|||
select count(*) from t1;
|
||||
select * from t1;
|
||||
select * from t1 limit 0;
|
||||
show status like "Empty_queries";
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Accessing a non existing table should not increase Empty_queries
|
||||
#
|
||||
|
||||
--error 1146
|
||||
select * from t2;
|
||||
show status like "Empty_queries";
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
|
|||
|
|
@ -6359,7 +6359,7 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
|
|||
}
|
||||
}
|
||||
/* Count number of empty select queries */
|
||||
if (!thd->get_sent_row_count())
|
||||
if (!thd->get_sent_row_count() && !res)
|
||||
status_var_increment(thd->status_var.empty_queries);
|
||||
else
|
||||
status_var_add(thd->status_var.rows_sent, thd->get_sent_row_count());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue