Commit 6c1c27ea authored by Monty's avatar Monty

Don't increment 'Empty_queries' for queries with errors.

parent 7ca60dd8
......@@ -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());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment