summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-01-13 14:35:49 +0200
committerMichael Widenius <monty@askmonty.org>2012-01-13 14:35:49 +0200
commit5438d57315a3cb2b75f63f83de7e50d12645e421 (patch)
treea4c79aabda6f2dea97ae1d246ac4af79c4b4655a /sql/sql_class.h
parent296b450d3b58ded0fd4d4972161414c6cc7a80e5 (diff)
downloadmariadb-git-5438d57315a3cb2b75f63f83de7e50d12645e421.tar.gz
Added Handler_read_rnd_deleted, number of deleted rows found with ha_read_rnd_first.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index da82ed5beed..f7d44eeec52 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -571,6 +571,7 @@ typedef struct system_status_var
ulong ha_read_prev_count;
ulong ha_read_rnd_count;
ulong ha_read_rnd_next_count;
+ ulong ha_read_rnd_deleted_count;
/*
This number doesn't include calls to the default implementation and
calls made by range access. The intent is to count only calls made by
@@ -3747,10 +3748,17 @@ inline int handler::ha_ft_read(uchar *buf)
inline int handler::ha_rnd_next(uchar *buf)
{
- increment_statistics(&SSV::ha_read_rnd_next_count);
int error= rnd_next(buf);
if (!error)
+ {
update_rows_read();
+ increment_statistics(&SSV::ha_read_rnd_next_count);
+ }
+ else if (error == HA_ERR_RECORD_DELETED)
+ increment_statistics(&SSV::ha_read_rnd_deleted_count);
+ else
+ increment_statistics(&SSV::ha_read_rnd_next_count);
+
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}