summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-09-21 14:19:42 +0200
committerunknown <magnus@neptunus.(none)>2004-09-21 14:19:42 +0200
commit0609dba34abe2513afeca29462b48ad930bdbdb8 (patch)
treecdb1267f85de36a37332355688ccc3e89dfbbed2 /sql/ha_ndbcluster.cc
parent548ad8134cfc773b588a525f4853363ba7872f43 (diff)
parent65c617afc35931069fa32fbc47e7aeb9a8b38281 (diff)
downloadmariadb-git-0609dba34abe2513afeca29462b48ad930bdbdb8.tar.gz
Merge
sql/ha_ndbcluster.cc: SCCS merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc32
1 files changed, 28 insertions, 4 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index d7bd24fe681..5729b8a199c 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -186,7 +186,7 @@ void ha_ndbcluster::records_update()
DBUG_PRINT("info", ("id=%d, no_uncommitted_rows_count=%d",
((const NDBTAB *)m_table)->getTableId(),
info->no_uncommitted_rows_count));
- if (info->records == ~(ha_rows)0)
+ // if (info->records == ~(ha_rows)0)
{
Uint64 rows;
if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){
@@ -621,7 +621,7 @@ int ha_ndbcluster::get_metadata(const char *path)
DBUG_ENTER("get_metadata");
DBUG_PRINT("enter", ("m_tabname: %s, path: %s", m_tabname, path));
- if (!(tab= dict->getTable(m_tabname, &m_table_info)))
+ if (!(tab= dict->getTable(m_tabname)))
ERR_RETURN(dict->getNdbError());
DBUG_PRINT("info", ("Table schema version: %d", tab->getObjectVersion()));
@@ -670,7 +670,9 @@ int ha_ndbcluster::get_metadata(const char *path)
DBUG_RETURN(error);
// All checks OK, lets use the table
- m_table= (void*)tab;
+ // m_table= (void*)tab;
+ m_table= 0;
+ m_table_info= 0;
DBUG_RETURN(build_index_list(table, ILBP_OPEN));
}
@@ -2408,7 +2410,17 @@ void ha_ndbcluster::info(uint flag)
if (flag & HA_STATUS_VARIABLE)
{
DBUG_PRINT("info", ("HA_STATUS_VARIABLE"));
- records_update();
+ if (m_table_info)
+ {
+ records_update();
+ }
+ else
+ {
+ Uint64 rows;
+ if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){
+ records= rows;
+ }
+ }
}
if (flag & HA_STATUS_ERRKEY)
{
@@ -2795,6 +2807,16 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
// Start of transaction
retrieve_all_fields= FALSE;
ops_pending= 0;
+ {
+ NDBDICT *dict= m_ndb->getDictionary();
+ const NDBTAB *tab;
+ void *tab_info;
+ if (!(tab= dict->getTable(m_tabname, &tab_info)))
+ ERR_RETURN(dict->getNdbError());
+ DBUG_PRINT("info", ("Table schema version: %d", tab->getObjectVersion()));
+ m_table= (void *)tab;
+ m_table_info= tab_info;
+ }
no_uncommitted_rows_init(thd);
}
else
@@ -2817,6 +2839,8 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
thd->transaction.stmt.ndb_tid= 0;
}
}
+ m_table= (void *)0;
+ m_table_info= 0;
/*
This is the place to make sure this handler instance
no longer are connected to the active transaction.