From 5b7acdf276685f38ea4d94ea884e99dedea168c1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Sep 2006 23:41:37 +1000 Subject: BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables post-review fixes as indicated by Serg. manual testing of error cases done in 5.0 due to support for DBUG_EXECUTE_IF to insert errors. Unable to write test case for mysql-test until 5.1 due to support for setting debug options at runtime. sql/ha_blackhole.cc: update for handler::info() now returning int sql/ha_blackhole.h: update for handler::info() now returning int sql/ha_isam.cc: update for handler::info() now returning int sql/ha_isam.h: update for handler::info() now returning int sql/ha_isammrg.cc: update for handler::info() now returning int sql/ha_isammrg.h: update for handler::info() now returning int sql/item_sum.cc: update for handler::info() now returning int. return error to user if info call fails sql/sql_delete.cc: update for handler::info() now returning int. return error to user if info call fails sql/sql_select.cc: update for handler::info() now returning int. return error to user if info call fails sql/sql_union.cc: update for handler::info() now returning int. return error to user if info call fails --- sql/item_sum.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sql/item_sum.cc') diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 0b9b10d05d4..1cd5f81afcd 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1410,12 +1410,20 @@ bool Item_sum_count_distinct::add() longlong Item_sum_count_distinct::val_int() { + int error; DBUG_ASSERT(fixed == 1); if (!table) // Empty query return LL(0); if (use_tree) return tree->elements_in_tree; - table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); + + error= table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); + + if(error) + { + table->file->print_error(error, MYF(0)); + } + return table->file->records; } -- cgit v1.2.1