From 9d2e6b8d23eb5e18a75a2fcb42a63abc97461c38 Mon Sep 17 00:00:00 2001 From: "stewart@willster.(none)" <> Date: Thu, 10 Aug 2006 22:55:20 +0800 Subject: [PATCH 1/3] BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables allow handler::info to return an error code (that will be returned to the user) --- sql/examples/ha_archive.cc | 4 ++-- sql/examples/ha_archive.h | 2 +- sql/examples/ha_example.cc | 4 ++-- sql/examples/ha_example.h | 2 +- sql/examples/ha_tina.cc | 4 ++-- sql/examples/ha_tina.h | 2 +- sql/ha_berkeley.cc | 4 ++-- sql/ha_berkeley.h | 2 +- sql/ha_heap.cc | 3 ++- sql/ha_heap.h | 2 +- sql/ha_innodb.cc | 6 +++--- sql/ha_innodb.h | 2 +- sql/ha_myisam.cc | 4 +++- sql/ha_myisam.h | 2 +- sql/ha_myisammrg.cc | 3 ++- sql/ha_myisammrg.h | 2 +- sql/ha_ndbcluster.cc | 25 ++++++++++++++++--------- sql/ha_ndbcluster.h | 4 ++-- sql/handler.h | 2 +- sql/opt_sum.cc | 7 ++++++- sql/sql_select.cc | 2 ++ 21 files changed, 53 insertions(+), 35 deletions(-) diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 55fc359348f..16ba7605415 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -972,7 +972,7 @@ int ha_archive::index_last(byte * buf) } -void ha_archive::info(uint flag) +int ha_archive::info(uint flag) { DBUG_ENTER("ha_archive::info"); @@ -980,7 +980,7 @@ void ha_archive::info(uint flag) records= share->rows_recorded; deleted= 0; - DBUG_VOID_RETURN; + DBUG_RETURN(0); } int ha_archive::extra(enum ha_extra_function operation) diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h index 6ceb660e951..3c5dccfdb6f 100644 --- a/sql/examples/ha_archive.h +++ b/sql/examples/ha_archive.h @@ -116,7 +116,7 @@ public: int read_data_header(gzFile file_to_read); int write_data_header(gzFile file_to_write); void position(const byte *record); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int reset(void); int external_lock(THD *thd, int lock_type); diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index b3edce5ba4a..924ced816aa 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -486,10 +486,10 @@ int ha_example::rnd_pos(byte * buf, byte *pos) sql_update.cc */ -void ha_example::info(uint flag) +int ha_example::info(uint flag) { DBUG_ENTER("ha_example::info"); - DBUG_VOID_RETURN; + DBUG_RETURN(0); } diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h index ae72e5bb275..cb8a8465737 100644 --- a/sql/examples/ha_example.h +++ b/sql/examples/ha_example.h @@ -138,7 +138,7 @@ public: int rnd_next(byte *buf); //required int rnd_pos(byte * buf, byte *pos); //required void position(const byte *record); //required - void info(uint); //required + int info(uint); //required int extra(enum ha_extra_function operation); int reset(void); diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 91e42bfea31..0091e1f40a0 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -683,13 +683,13 @@ int ha_tina::rnd_pos(byte * buf, byte *pos) Currently this table handler doesn't implement most of the fields really needed. SHOW also makes use of this data */ -void ha_tina::info(uint flag) +int ha_tina::info(uint flag) { DBUG_ENTER("ha_tina::info"); /* This is a lie, but you don't want the optimizer to see zero or 1 */ if (records < 2) records= 2; - DBUG_VOID_RETURN; + DBUG_RETURN(0); } /* diff --git a/sql/examples/ha_tina.h b/sql/examples/ha_tina.h index 22193c01013..d8cd0fa9cfe 100644 --- a/sql/examples/ha_tina.h +++ b/sql/examples/ha_tina.h @@ -115,7 +115,7 @@ class ha_tina: public handler int rnd_pos(byte * buf, byte *pos); int rnd_end(); void position(const byte *record); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int reset(void); int external_lock(THD *thd, int lock_type); diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 33f7b6238b0..e8dbf7ab12d 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1715,7 +1715,7 @@ void ha_berkeley::position(const byte *record) } -void ha_berkeley::info(uint flag) +int ha_berkeley::info(uint flag) { DBUG_ENTER("ha_berkeley::info"); if (flag & HA_STATUS_VARIABLE) @@ -1735,7 +1735,7 @@ void ha_berkeley::info(uint flag) /* Don't return key if we got an error for the internal primary key */ if (flag & HA_STATUS_ERRKEY && last_dup_key < table->keys) errkey= last_dup_key; - DBUG_VOID_RETURN; + DBUG_RETURN(0); } diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 1d4823bbdc0..50d5d537663 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -127,7 +127,7 @@ class ha_berkeley: public handler int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int reset(void); int external_lock(THD *thd, int lock_type); diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 9c680daaf91..3e981087df7 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -282,7 +282,7 @@ void ha_heap::position(const byte *record) *(HEAP_PTR*) ref= heap_position(file); // Ref is aligned } -void ha_heap::info(uint flag) +int ha_heap::info(uint flag) { HEAPINFO info; (void) heap_info(file,&info,flag); @@ -304,6 +304,7 @@ void ha_heap::info(uint flag) */ if (key_stat_version != file->s->key_stat_version) update_key_stats(); + return 0; } int ha_heap::extra(enum ha_extra_function operation) diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 0a087fde1b0..3598a270efd 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -80,7 +80,7 @@ public: int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 6c93ac293d0..3d1724efb91 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4570,7 +4570,7 @@ ha_innobase::read_time( Returns statistics information of the table to the MySQL interpreter, in various fields of the handle object. */ -void +int ha_innobase::info( /*==============*/ uint flag) /* in: what information MySQL requests */ @@ -4593,7 +4593,7 @@ ha_innobase::info( if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { - DBUG_VOID_RETURN; + DBUG_RETURN(HA_ERR_CRASHED); } /* We do not know if MySQL can call this function before calling @@ -4758,7 +4758,7 @@ ha_innobase::info( prebuilt->trx->op_info = (char*)""; - DBUG_VOID_RETURN; + DBUG_RETURN(0); } /************************************************************************** diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index d336811a1eb..bbe226fcb19 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -142,7 +142,7 @@ class ha_innobase: public handler int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - void info(uint); + int info(uint); int analyze(THD* thd,HA_CHECK_OPT* check_opt); int optimize(THD* thd,HA_CHECK_OPT* check_opt); int discard_or_import_tablespace(my_bool discard); diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 9b84e48e970..2e29d929352 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1214,7 +1214,7 @@ void ha_myisam::position(const byte* record) ha_store_ptr(ref, ref_length, position); } -void ha_myisam::info(uint flag) +int ha_myisam::info(uint flag) { MI_ISAMINFO info; char name_buff[FN_REFLEN]; @@ -1273,6 +1273,8 @@ void ha_myisam::info(uint flag) update_time = info.update_time; if (flag & HA_STATUS_AUTO) auto_increment_value= info.auto_increment; + + return 0; } diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index b256d4777f9..5bd1d263ad8 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -100,7 +100,7 @@ class ha_myisam: public handler int rnd_pos(byte * buf, byte *pos); int restart_rnd_next(byte *buf, byte *pos); void position(const byte *record); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); int external_lock(THD *thd, int lock_type); diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index edb3521470f..62516d3dd41 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -218,7 +218,7 @@ ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key, } -void ha_myisammrg::info(uint flag) +int ha_myisammrg::info(uint flag) { MYMERGE_INFO info; (void) myrg_status(file,&info,flag); @@ -253,6 +253,7 @@ void ha_myisammrg::info(uint flag) (char*) info.rec_per_key, sizeof(table->key_info[0].rec_per_key)*table->key_parts); } + return 0; } diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h index 7348096b695..84eaae04590 100644 --- a/sql/ha_myisammrg.h +++ b/sql/ha_myisammrg.h @@ -71,7 +71,7 @@ class ha_myisammrg: public handler int rnd_pos(byte * buf, byte *pos); void position(const byte *record); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); int external_lock(THD *thd, int lock_type); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 10240e597bf..0df680b7aa3 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -256,11 +256,13 @@ void ha_ndbcluster::set_rec_per_key() DBUG_VOID_RETURN; } -void ha_ndbcluster::records_update() +int ha_ndbcluster::records_update() { if (m_ha_not_exact_count) - return; + return 0; DBUG_ENTER("ha_ndbcluster::records_update"); + int result= 0; + struct Ndb_local_table_statistics *info= (struct Ndb_local_table_statistics *)m_table_info; DBUG_PRINT("info", ("id=%d, no_uncommitted_rows_count=%d", @@ -271,7 +273,7 @@ void ha_ndbcluster::records_update() Ndb *ndb= get_ndb(); Uint64 rows; ndb->setDatabaseName(m_dbname); - if(ndb_get_table_statistics(ndb, m_tabname, &rows, 0) == 0){ + if((result= ndb_get_table_statistics(ndb, m_tabname, &rows, 0)) == 0){ info->records= rows; } } @@ -281,7 +283,7 @@ void ha_ndbcluster::records_update() info->no_uncommitted_rows_count= 0; } records= info->records+ info->no_uncommitted_rows_count; - DBUG_VOID_RETURN; + DBUG_RETURN(result); } void ha_ndbcluster::no_uncommitted_rows_execute_failure() @@ -2858,8 +2860,9 @@ void ha_ndbcluster::position(const byte *record) } -void ha_ndbcluster::info(uint flag) +int ha_ndbcluster::info(uint flag) { + int result= 0; DBUG_ENTER("info"); DBUG_PRINT("enter", ("flag: %d", flag)); @@ -2877,17 +2880,17 @@ void ha_ndbcluster::info(uint flag) if (m_ha_not_exact_count) records= 100; else - records_update(); + result= records_update(); } else { if ((my_errno= check_ndb_connection())) - DBUG_VOID_RETURN; + DBUG_RETURN(my_errno); Ndb *ndb= get_ndb(); Uint64 rows= 100; ndb->setDatabaseName(m_dbname); if (current_thd->variables.ndb_use_exact_count) - ndb_get_table_statistics(ndb, m_tabname, &rows, 0); + result= ndb_get_table_statistics(ndb, m_tabname, &rows, 0); records= rows; } } @@ -2912,7 +2915,11 @@ void ha_ndbcluster::info(uint flag) ndb->readAutoIncrementValue((const NDBTAB *) m_table); } } - DBUG_VOID_RETURN; + + if(result == -1) + result= HA_ERR_NO_CONNECTION; + + DBUG_RETURN(result); } diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 313e497f9b5..5e3811a5e8e 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -115,7 +115,7 @@ class ha_ndbcluster: public handler int read_range_next(); bool get_error_message(int error, String *buf); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); int reset(); @@ -256,7 +256,7 @@ class ha_ndbcluster: public handler Ndb *get_ndb(); void set_rec_per_key(); - void records_update(); + int records_update(); void no_uncommitted_rows_execute_failure(); void no_uncommitted_rows_update(int); void no_uncommitted_rows_init(THD *); diff --git a/sql/handler.h b/sql/handler.h index e361dfd4559..75ff3c2764e 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -394,7 +394,7 @@ public: key_range *max_key) { return (ha_rows) 10; } virtual void position(const byte *record)=0; - virtual void info(uint)=0; + virtual int info(uint)=0; virtual int extra(enum ha_extra_function operation) { return 0; } virtual int extra_opt(enum ha_extra_function operation, ulong cache_size) diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index b53fbfd3f80..64b01ce002a 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -125,7 +125,12 @@ int opt_sum_query(TABLE_LIST *tables, List &all_fields,COND *conds) } else { - tl->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); + error= tl->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); + if(error) + { + tl->table->file->print_error(error, MYF(0)); + return error; + } count*= tl->table->file->records; } } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 605ef49bb07..03ce04a81a7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -537,6 +537,8 @@ JOIN::optimize() { if (res > 1) { + thd->fatal_error(); + error= res; DBUG_RETURN(1); } if (res < 0) From 57a97f53bc13488d702ee3478aba83ffa4de5f7a Mon Sep 17 00:00:00 2001 From: "stewart@willster.(none)" <> Date: Thu, 28 Sep 2006 23:41:37 +1000 Subject: [PATCH 2/3] 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 | 4 ++-- sql/ha_blackhole.h | 2 +- sql/ha_isam.cc | 3 ++- sql/ha_isam.h | 2 +- sql/ha_isammrg.cc | 3 ++- sql/ha_isammrg.h | 2 +- sql/item_sum.cc | 10 +++++++++- sql/sql_delete.cc | 7 ++++++- sql/sql_select.cc | 7 ++++++- sql/sql_union.cc | 7 ++++++- 10 files changed, 36 insertions(+), 11 deletions(-) diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index 9ac4ba2da15..8c76b860e50 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -100,7 +100,7 @@ void ha_blackhole::position(const byte *record) } -void ha_blackhole::info(uint flag) +int ha_blackhole::info(uint flag) { DBUG_ENTER("ha_blackhole::info"); @@ -114,7 +114,7 @@ void ha_blackhole::info(uint flag) delete_length= 0; if (flag & HA_STATUS_AUTO) auto_increment_value= 1; - DBUG_VOID_RETURN; + DBUG_RETURN(0); } int ha_blackhole::external_lock(THD *thd, int lock_type) diff --git a/sql/ha_blackhole.h b/sql/ha_blackhole.h index 88715c62408..177b59fa970 100644 --- a/sql/ha_blackhole.h +++ b/sql/ha_blackhole.h @@ -78,7 +78,7 @@ public: int index_first(byte * buf); int index_last(byte * buf); void position(const byte *record); - void info(uint flag); + int info(uint flag); int external_lock(THD *thd, int lock_type); uint lock_count(void) const; int create(const char *name, TABLE *table_arg, diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc index afa7dffa5f4..34d5440a0f8 100644 --- a/sql/ha_isam.cc +++ b/sql/ha_isam.cc @@ -178,7 +178,7 @@ void ha_isam::position(const byte *record) ha_store_ptr(ref, ref_length, position); } -void ha_isam::info(uint flag) +int ha_isam::info(uint flag) { N_ISAMINFO info; (void) nisam_info(file,&info,flag); @@ -224,6 +224,7 @@ void ha_isam::info(uint flag) } if (flag & HA_STATUS_TIME) update_time = info.update_time; + return 0; } diff --git a/sql/ha_isam.h b/sql/ha_isam.h index 1f9b8eb28fe..b94377c8e3d 100644 --- a/sql/ha_isam.h +++ b/sql/ha_isam.h @@ -67,7 +67,7 @@ class ha_isam: public handler int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc index c0e6f665f08..8a03e09bcec 100644 --- a/sql/ha_isammrg.cc +++ b/sql/ha_isammrg.cc @@ -149,7 +149,7 @@ void ha_isammrg::position(const byte *record) } -void ha_isammrg::info(uint flag) +int ha_isammrg::info(uint flag) { MERGE_INFO info; (void) mrg_info(file,&info,flag); @@ -163,6 +163,7 @@ void ha_isammrg::info(uint flag) block_size=0; update_time=0; ref_length=4; // Should be big enough + return 0; } diff --git a/sql/ha_isammrg.h b/sql/ha_isammrg.h index 82a2e312ca3..a0fcee8f5a6 100644 --- a/sql/ha_isammrg.h +++ b/sql/ha_isammrg.h @@ -58,7 +58,7 @@ class ha_isammrg: public handler int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - void info(uint); + int info(uint); int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); uint lock_count(void) const; 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; } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index b085d37be78..017e9596b14 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -43,7 +43,12 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, if ((open_and_lock_tables(thd, table_list))) DBUG_RETURN(-1); table= table_list->table; - 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)); + DBUG_RETURN(error); + } thd->proc_info="init"; table->map=1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 36959ee1d0f..d36a6252adc 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1786,7 +1786,12 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, s->checked_keys.init(); s->needed_reg.init(); table_vector[i]=s->table=table=tables->table; - table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);// record count + error= table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); + if(error) + { + table->file->print_error(error, MYF(0)); + DBUG_RETURN(1); + } table->quick_keys.clear_all(); table->reginfo.join_tab=s; table->reginfo.not_exists_optimize=0; diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 0948602bbb4..f3f814831f5 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -492,7 +492,12 @@ int st_select_lex_unit::exec() DBUG_RETURN(res); } /* Needed for the following test and for records_at_start in next loop */ - table->file->info(HA_STATUS_VARIABLE); + int error= table->file->info(HA_STATUS_VARIABLE); + if(error) + { + table->file->print_error(error, MYF(0)); + DBUG_RETURN(1); + } if (found_rows_for_union && !sl->braces && select_limit_cnt != HA_POS_ERROR) { From fff4559edd704dd68b79e045f03f0308f640e20a Mon Sep 17 00:00:00 2001 From: "stewart@willster.(none)" <> Date: Mon, 16 Oct 2006 17:41:29 +1000 Subject: [PATCH 3/3] BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables update federated for fix --- sql/ha_federated.cc | 6 +++--- sql/ha_federated.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 7919519cdce..8be1e40f42d 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -2385,7 +2385,7 @@ int ha_federated::rnd_pos(byte *buf, byte *pos) */ -void ha_federated::info(uint flag) +int ha_federated::info(uint flag) { char error_buffer[FEDERATED_QUERY_BUFFER_SIZE]; char status_buf[FEDERATED_QUERY_BUFFER_SIZE]; @@ -2463,7 +2463,7 @@ void ha_federated::info(uint flag) if (result) mysql_free_result(result); - DBUG_VOID_RETURN; + DBUG_RETURN(0); error: if (result) @@ -2472,7 +2472,7 @@ error: my_sprintf(error_buffer, (error_buffer, ": %d : %s", mysql_errno(mysql), mysql_error(mysql))); my_error(error_code, MYF(0), error_buffer); - DBUG_VOID_RETURN; + DBUG_RETURN(error_code); } diff --git a/sql/ha_federated.h b/sql/ha_federated.h index 61f5af686a3..11e5a4f634f 100644 --- a/sql/ha_federated.h +++ b/sql/ha_federated.h @@ -285,7 +285,7 @@ public: int rnd_next(byte *buf); //required int rnd_pos(byte *buf, byte *pos); //required void position(const byte *record); //required - void info(uint); //required + int info(uint); //required void update_auto_increment(void); int repair(THD* thd, HA_CHECK_OPT* check_opt);