diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-05-15 16:23:59 +0200 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-05-15 16:23:59 +0200 |
commit | 37f940ce86615ed0ae16e210ebc4fa92e8dfb2a6 (patch) | |
tree | 4e66c3e11b66c426e36236eee86b8b5ee7ad2f54 /sql/ha_ndbcluster.cc | |
parent | ec83dd7c61f4e29122ecff278ca81b03bd51b271 (diff) | |
download | mariadb-git-37f940ce86615ed0ae16e210ebc4fa92e8dfb2a6.tar.gz |
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
- invalidate ndb dict cache on cluster disconnect (ClusterMgr.cpp)
- add check for correct frm on external lock when table cache is found invalid
ndb/include/ndbapi/ndb_cluster_connection.hpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
ndb/src/ndbapi/ClusterMgr.cpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
ndb/src/ndbapi/ClusterMgr.hpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
ndb/src/ndbapi/DictCache.cpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
ndb/src/ndbapi/DictCache.hpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
ndb/src/ndbapi/TransporterFacade.hpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
ndb/src/ndbapi/ndb_cluster_connection_impl.hpp:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
sql/ha_ndbcluster.cc:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
mysql-test/r/ndb_autodiscover3.result:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
mysql-test/t/ndb_autodiscover3.test:
Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 876d5d2f8fd..c0eae685a52 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3306,8 +3306,23 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) { m_table= (void *)tab; m_table_version = tab->getObjectVersion(); - if (!(my_errno= build_index_list(ndb, table, ILBP_OPEN))) + if ((my_errno= build_index_list(ndb, table, ILBP_OPEN))) DBUG_RETURN(my_errno); + + const void *data, *pack_data; + uint length, pack_length; + if (readfrm(table->path, &data, &length) || + packfrm(data, length, &pack_data, &pack_length) || + pack_length != tab->getFrmLength() || + memcmp(pack_data, tab->getFrmData(), pack_length)) + { + my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); + my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR)); + NdbError err= ndb->getNdbError(NDB_INVALID_SCHEMA_OBJECT); + DBUG_RETURN(ndb_to_mysql_error(&err)); + } + my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); + my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR)); } m_table_info= tab_info; } |