Commit bb06ec21 authored by unknown's avatar unknown
Browse files

Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb

into  mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb


sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
parents 0fa984e4 81b19542
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -469,11 +469,13 @@ ha_rows ha_ndbcluster::records()
  DBUG_RETURN(retval + info->no_uncommitted_rows_count);
}

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= m_table_info;
  DBUG_PRINT("info", ("id=%d, no_uncommitted_rows_count=%d",
                      ((const NDBTAB *)m_table)->getTableId(),
@@ -483,7 +485,7 @@ void ha_ndbcluster::records_update()
    Ndb *ndb= get_ndb();
    struct Ndb_statistics stat;
    ndb->setDatabaseName(m_dbname);
    if (ndb_get_table_statistics(ndb, m_table, &stat) == 0)
    if ((result= ndb_get_table_statistics(ndb, m_table, &stat)) == 0)
    {
      stats.mean_rec_length= stat.row_size;
      stats.data_file_length= stat.fragment_memory;
@@ -496,7 +498,7 @@ void ha_ndbcluster::records_update()
      info->no_uncommitted_rows_count= 0;
  }
  stats.records= info->records+ info->no_uncommitted_rows_count;
  DBUG_VOID_RETURN;
  DBUG_RETURN(result);
}

void ha_ndbcluster::no_uncommitted_rows_execute_failure()
@@ -3649,8 +3651,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));
  
@@ -3668,18 +3671,18 @@ void ha_ndbcluster::info(uint flag)
      if (m_ha_not_exact_count)
        stats.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();
      ndb->setDatabaseName(m_dbname);
      struct Ndb_statistics stat;
      ndb->setDatabaseName(m_dbname);
      if (current_thd->variables.ndb_use_exact_count &&
          ndb_get_table_statistics(ndb, m_table, &stat) == 0)
          (result= ndb_get_table_statistics(ndb, m_table, &stat)) == 0)
      {
        stats.mean_rec_length= stat.row_size;
        stats.data_file_length= stat.fragment_memory;
@@ -3723,7 +3726,11 @@ void ha_ndbcluster::info(uint flag)
        stats.auto_increment_value= (ulonglong)auto_increment_value64;
    }
  }
  DBUG_VOID_RETURN;

  if(result == -1)
    result= HA_ERR_NO_CONNECTION;

  DBUG_RETURN(result);
}


+2 −2
Original line number Diff line number Diff line
@@ -673,7 +673,7 @@ class ha_ndbcluster: public handler

  bool get_error_message(int error, String *buf);
  ha_rows records();
  void info(uint);
  int info(uint);
  void get_dynamic_partition_info(PARTITION_INFO *stat_info, uint part_id);
  int extra(enum ha_extra_function operation);
  int extra_opt(enum ha_extra_function operation, ulong cache_size);
@@ -878,7 +878,7 @@ static void set_tabname(const char *pathname, char *tabname);
  int check_ndb_connection(THD* thd= current_thd);

  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_reset(THD *);
+2 −2
Original line number Diff line number Diff line
@@ -4241,7 +4241,7 @@ void ha_partition::include_partition_fields_in_used_fields()
      retrieving statistics data.
*/

void ha_partition::info(uint flag)
int ha_partition::info(uint flag)
{
  handler *file, **file_array;
  DBUG_ENTER("ha_partition:info");
@@ -4405,7 +4405,7 @@ void ha_partition::info(uint flag)
	stats.update_time= file->stats.update_time;
    } while (*(++file_array));
  }
  DBUG_VOID_RETURN;
  DBUG_RETURN(0);
}


+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ class ha_partition :public handler
    purposes.
    -------------------------------------------------------------------------
  */
  virtual void info(uint);
  virtual int info(uint);
  void get_dynamic_partition_info(PARTITION_INFO *stat_info,
                                  uint part_id);
  virtual int extra(enum ha_extra_function operation);
+1 −1
Original line number Diff line number Diff line
@@ -1243,7 +1243,7 @@ class handler :public Sql_alloc
                                   key_range *max_key)
    { return (ha_rows) 10; }
  virtual void position(const byte *record)=0;
  virtual void info(uint)=0; // see my_base.h for full description
  virtual int info(uint)=0; // see my_base.h for full description
  virtual void get_dynamic_partition_info(PARTITION_INFO *stat_info,
                                          uint part_id);
  virtual int extra(enum ha_extra_function operation)
Loading