summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-03-07 14:28:10 +0100
committerunknown <serg@serg.mylan>2005-03-07 14:28:10 +0100
commit9fa4492a382a40b0ecc88c7625ce92b7f424a03f (patch)
tree0072100da3fe6dc2613c800806b2f47b21ce87c5 /sql
parentba05aef9306f3cac9a7280c8197b7eda5fda29c6 (diff)
parent39fb340d4bb45a04538cb89c96f5751e63aac3cd (diff)
downloadmariadb-git-9fa4492a382a40b0ecc88c7625ce92b7f424a03f.tar.gz
Merge serg@bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_ndbcluster.cc37
-rw-r--r--sql/ha_ndbcluster.h1
-rw-r--r--sql/net_serv.cc2
3 files changed, 33 insertions, 7 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 3e2fc5b2855..f0988affc2e 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -328,6 +328,35 @@ void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd)
# The mapped error code
*/
+void ha_ndbcluster::invalidateDictionaryCache()
+{
+ NDBDICT *dict= get_ndb()->getDictionary();
+ DBUG_PRINT("info", ("invalidating %s", m_tabname));
+ dict->invalidateTable(m_tabname);
+ table->version=0L; /* Free when thread is ready */
+ /* Invalidate indexes */
+ for (uint i= 0; i < table->keys; i++)
+ {
+ NDBINDEX *index = (NDBINDEX *) m_index[i].index;
+ NDBINDEX *unique_index = (NDBINDEX *) m_index[i].unique_index;
+ NDB_INDEX_TYPE idx_type= m_index[i].type;
+
+ switch(idx_type) {
+ case(PRIMARY_KEY_ORDERED_INDEX):
+ case(ORDERED_INDEX):
+ dict->invalidateIndex(index->getName(), m_tabname);
+ break;
+ case(UNIQUE_ORDERED_INDEX):
+ dict->invalidateIndex(index->getName(), m_tabname);
+ case(UNIQUE_INDEX):
+ dict->invalidateIndex(unique_index->getName(), m_tabname);
+ break;
+ case(PRIMARY_KEY_INDEX):
+ case(UNDEFINED_INDEX):
+ break;
+ }
+ }
+}
int ha_ndbcluster::ndb_err(NdbConnection *trans)
{
@@ -339,11 +368,7 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans)
switch (err.classification) {
case NdbError::SchemaError:
{
- Ndb *ndb= get_ndb();
- NDBDICT *dict= ndb->getDictionary();
- DBUG_PRINT("info", ("invalidateTable %s", m_tabname));
- dict->invalidateTable(m_tabname);
- table->version=0L; /* Free when thread is ready */
+ invalidateDictionaryCache();
break;
}
default:
@@ -733,7 +758,7 @@ int ha_ndbcluster::get_metadata(const char *path)
if (!invalidating_ndb_table)
{
DBUG_PRINT("info", ("Invalidating table"));
- dict->invalidateTable(m_tabname);
+ invalidateDictionaryCache();
invalidating_ndb_table= TRUE;
}
else
diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
index 07b305bad3e..2261b56b071 100644
--- a/sql/ha_ndbcluster.h
+++ b/sql/ha_ndbcluster.h
@@ -201,6 +201,7 @@ class ha_ndbcluster: public handler
void print_results();
longlong get_auto_increment();
+ void invalidateDictionaryCache();
int ndb_err(NdbConnection*);
bool uses_blob_value(bool all_fields);
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 5699b5a2f55..c8b2e28ec52 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -251,7 +251,7 @@ my_bool
my_net_write(NET *net,const char *packet,ulong len)
{
uchar buff[NET_HEADER_SIZE];
- if (unlikely(!net->vio)) /* nowhere to write */
+ if (unlikely(!net->vio)) /* nowhere to write */
return 0;
/*
Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH