summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <stewart@willster.(none)>2006-06-28 22:47:25 +1000
committerunknown <stewart@willster.(none)>2006-06-28 22:47:25 +1000
commit9607b202c756bbd305515c1c422fd9e1ad73b4f6 (patch)
tree250f4261bfa0ad0c2e3541d8d8ab0c0538591678
parent842ae81df080d09fc6a0fd17f2291e868521eb34 (diff)
parentda81451d518fc1db35e16ff62d701f87c2461242 (diff)
downloadmariadb-git-9607b202c756bbd305515c1c422fd9e1ad73b4f6.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into mysql.com:/home/stewart/Documents/MySQL/5.1/bug20725 sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged
-rw-r--r--sql/ha_ndbcluster.cc34
-rw-r--r--sql/ha_ndbcluster.h1
2 files changed, 34 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 54fea1e728a..b1ca0182984 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -414,6 +414,37 @@ void ha_ndbcluster::set_rec_per_key()
DBUG_VOID_RETURN;
}
+ha_rows ha_ndbcluster::records()
+{
+ ha_rows retval;
+ DBUG_ENTER("ha_ndbcluster::records");
+ struct Ndb_local_table_statistics *info= m_table_info;
+ DBUG_PRINT("info", ("id=%d, no_uncommitted_rows_count=%d",
+ ((const NDBTAB *)m_table)->getTableId(),
+ info->no_uncommitted_rows_count));
+
+ Ndb *ndb= get_ndb();
+ ndb->setDatabaseName(m_dbname);
+ struct Ndb_statistics stat;
+ if (ndb_get_table_statistics(ndb, m_table, &stat) == 0)
+ {
+ retval= stat.row_count;
+ }
+ else
+ {
+ /**
+ * Be consistent with BUG#19914 until we fix it properly
+ */
+ DBUG_RETURN(-1);
+ }
+
+ THD *thd= current_thd;
+ if (get_thd_ndb(thd)->error)
+ info->no_uncommitted_rows_count= 0;
+
+ DBUG_RETURN(retval + info->no_uncommitted_rows_count);
+}
+
void ha_ndbcluster::records_update()
{
if (m_ha_not_exact_count)
@@ -5455,7 +5486,8 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | \
HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | \
HA_PARTIAL_COLUMN_READ | \
- HA_HAS_OWN_BINLOGGING
+ HA_HAS_OWN_BINLOGGING | \
+ HA_HAS_RECORDS
ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
handler(&ndbcluster_hton, table_arg),
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 9dc9ee79755..5e13a6664f0 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -622,6 +622,7 @@ class ha_ndbcluster: public handler
int read_multi_range_next(KEY_MULTI_RANGE **found_range_p);
bool get_error_message(int error, String *buf);
+ ha_rows records();
void info(uint);
void get_dynamic_partition_info(PARTITION_INFO *stat_info, uint part_id);
int extra(enum ha_extra_function operation);