diff options
author | unknown <msvensson@pilot.mysql.com> | 2008-01-09 12:59:20 +0100 |
---|---|---|
committer | unknown <msvensson@pilot.mysql.com> | 2008-01-09 12:59:20 +0100 |
commit | 47926cd0efceb335388b870f6381dd2b9345c9c1 (patch) | |
tree | c9e6137778d2d12fb92e157467f6499b872128e0 /sql/ha_ndbcluster.cc | |
parent | 003c55d95edb20f1ef9b49f3872d5cb496262214 (diff) | |
download | mariadb-git-47926cd0efceb335388b870f6381dd2b9345c9c1.tar.gz |
Bug#33763 Mysqld leaves readonly mode for cluster tables too early - part2
- Open tables readonly while not properly initialized
- Close cached tables when coming out of readonly mode
- Apply basically same patch as for 32275
mysql-test/include/ndb_not_readonly.inc:
Fix syntax of "die" call
Remove the maskin of ER_GET_ERRMSG, should never happen
sql/ha_ndbcluster.cc:
- Open tables readonly until binlog tables have been
initialized
sql/ha_ndbcluster_binlog.cc:
- Reset "ndb_binlog_tables_inited" when something has happened to schema table,
apply status table or when connection to cluster is lost.
- Close cached tabled after setting ndb_binlog_is_ready to cleanout any
tables opened as readonly.
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index bf2b19bfc9c..1b0b5c53250 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -5138,6 +5138,7 @@ int ha_ndbcluster::create(const char *name, strcmp(m_tabname, NDB_SCHEMA_TABLE) == 0)) { DBUG_PRINT("info", ("Schema distribution table not setup")); + DBUG_ASSERT(ndb_schema_share); DBUG_RETURN(HA_ERR_NO_CONNECTION); } single_user_mode = NdbDictionary::Table::SingleUserModeReadWrite; @@ -5963,6 +5964,7 @@ ha_ndbcluster::delete_table(ha_ndbcluster *h, Ndb *ndb, if (!ndb_schema_share) { DBUG_PRINT("info", ("Schema distribution table not setup")); + DBUG_ASSERT(ndb_schema_share); DBUG_RETURN(HA_ERR_NO_CONNECTION); } /* ndb_share reference temporary */ @@ -6144,6 +6146,7 @@ int ha_ndbcluster::delete_table(const char *name) if (!ndb_schema_share) { DBUG_PRINT("info", ("Schema distribution table not setup")); + DBUG_ASSERT(ndb_schema_share); DBUG_RETURN(HA_ERR_NO_CONNECTION); } #endif @@ -6424,8 +6427,11 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked) DBUG_RETURN(res); } #ifdef HAVE_NDB_BINLOG - if (!ndb_binlog_tables_inited && ndb_binlog_running) + if (!ndb_binlog_tables_inited) + { table->db_stat|= HA_READ_ONLY; + sql_print_information("table '%s' opened read only", name); + } #endif DBUG_RETURN(0); } @@ -6784,8 +6790,8 @@ static void ndbcluster_drop_database(handlerton *hton, char *path) if (!ndb_schema_share) { DBUG_PRINT("info", ("Schema distribution table not setup")); + DBUG_ASSERT(ndb_schema_share); DBUG_VOID_RETURN; - //DBUG_RETURN(HA_ERR_NO_CONNECTION); } #endif ndbcluster_drop_database_impl(path); |