Commit e34496e5 authored by unknown's avatar unknown
Browse files

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/ha_berkeley.cc:
  update handler::info interface to return int
sql/ha_berkeley.h:
  update handler::info interface to return int
sql/ha_heap.cc:
  update handler::info interface to return int
sql/ha_heap.h:
  update handler::info interface to return int
sql/ha_innodb.cc:
  update handler::info interface to return int
sql/ha_innodb.h:
  update handler::info interface to return int
sql/ha_myisam.cc:
  update handler::info interface to return int
sql/examples/ha_archive.cc:
  update handler::info interface to return int
sql/examples/ha_archive.h:
  update handler::info interface to return int
sql/examples/ha_example.cc:
  update handler::info interface to return int
sql/examples/ha_example.h:
  update handler::info interface to return int
sql/examples/ha_tina.cc:
  update handler::info interface to return int
sql/examples/ha_tina.h:
  update handler::info interface to return int
sql/ha_myisam.h:
  update handler::info interface to return int
sql/ha_myisammrg.cc:
  update handler::info interface to return int
sql/ha_myisammrg.h:
  update handler::info interface to return int
sql/ha_ndbcluster.cc:
  update handler::info interface to return int
sql/ha_ndbcluster.h:
  update handler::info interface to return int
sql/handler.h:
  update handler::info interface to return int
sql/opt_sum.cc:
  If we get an error when using handler::info to get count(*),
  print and return the error.
sql/sql_select.cc:
  if error, set fatal error.
parent bfdbb780
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ class ha_archive: public handler
  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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
}


+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ class ha_example: public handler
  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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
}

/*
Loading