>>>>> "Timothy" == Timothy P Clark <Timothy> writes:
Timothy> Does the following comment from ha_example.cc :: info() still hold in 5.1?
Timothy> You will probably want to have the following in your code:
Timothy> if (records < 2)
Timothy> records = 2;
Timothy> I ask because "DELETE FROM [TABLE];" appears to rely on the stats.records
Timothy> to report how many rows were deleted from a call to
Timothy> handler::delete_all_rows(). If my storage engine always sets stats.records
Timothy> to be >= 2, DELETE FROM will always report that at least two rows were
Timothy> deleted, even if the table was empty. Furthermore, I don't see MyISAM or
Timothy> InnoDB implementing this logic.
We need the above, because the SELECT optimizer trusts that the handler gives
a correct row count if the info method returns 0 or 1.
(It's used to optimize the two common case where the table is empty or
has 1 row)