summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc81
1 files changed, 36 insertions, 45 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index cd37e830952..642199890e6 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -4430,29 +4430,24 @@ int ha_ndbcluster::create(const char *name,
Always create an event for the table, as other mysql servers
expect it to be there.
*/
- if (ndbcluster_create_event(ndb, t, event_name.c_ptr(), share) < 0)
+ if (!ndbcluster_create_event(ndb, t, event_name.c_ptr(), share,
+ share && do_event_op /* push warning */))
{
- /* this is only a serious error if the binlog is on */
- if (share && do_event_op)
- {
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
- "Creating event for logging table failed. "
- "See error log for details.");
- }
- break;
- }
- if (ndb_extra_logging)
- sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
- event_name.c_ptr());
-
- if (share && do_event_op &&
- ndbcluster_create_event_ops(share, t, event_name.c_ptr()) < 0)
- {
- sql_print_error("NDB Binlog: FAILED CREATE TABLE event operations."
- " Event: %s", name);
- /* a warning has been issued to the client */
+ if (ndb_extra_logging)
+ sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
+ event_name.c_ptr());
+ if (share && do_event_op &&
+ ndbcluster_create_event_ops(share, t, event_name.c_ptr()))
+ {
+ sql_print_error("NDB Binlog: FAILED CREATE TABLE event operations."
+ " Event: %s", name);
+ /* a warning has been issued to the client */
+ }
}
+ /*
+ warning has been issued if ndbcluster_create_event failed
+ and (share && do_event_op)
+ */
if (share && !do_event_op)
share->flags|= NSF_NO_BINLOG;
ndbcluster_log_schema_op(current_thd, share,
@@ -4793,31 +4788,24 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
ndb_rep_event_name(&event_name, to + sizeof(share_prefix) - 1, 0);
const NDBTAB *ndbtab= dict->getTable(new_tabname);
- if (ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share) >= 0)
+ if (!ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share,
+ share && ndb_binlog_running /* push warning */))
{
if (ndb_extra_logging)
sql_print_information("NDB Binlog: RENAME Event: %s",
event_name.c_ptr());
- if (share && ndb_binlog_running)
+ if (share && ndb_binlog_running &&
+ ndbcluster_create_event_ops(share, ndbtab, event_name.c_ptr()))
{
- if (ndbcluster_create_event_ops(share, ndbtab,
- event_name.c_ptr()) < 0)
- {
- sql_print_error("NDB Binlog: FAILED create event operations "
- "during RENAME. Event %s", event_name.c_ptr());
- /* a warning has been issued to the client */
- }
+ sql_print_error("NDB Binlog: FAILED create event operations "
+ "during RENAME. Event %s", event_name.c_ptr());
+ /* a warning has been issued to the client */
}
}
- else
- {
- sql_print_error("NDB Binlog: FAILED create event during RENAME. "
- "Event: %s", event_name.c_ptr());
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
- "Creating event for logging table failed. "
- "See error log for details.");
- }
+ /*
+ warning has been issued if ndbcluster_create_event failed
+ and (share && ndb_binlog_running)
+ */
if (!is_old_table_tmpfile)
ndbcluster_log_schema_op(current_thd, share,
current_thd->query, current_thd->query_length,
@@ -5524,14 +5512,17 @@ int ndbcluster_find_all_files(THD *thd)
for (uint i= 0 ; i < list.count ; i++)
{
NDBDICT::List::Element& elmt= list.elements[i];
- if (IS_TMP_PREFIX(elmt.name))
+ int do_handle_table= 0;
+ if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
{
DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
continue;
}
DBUG_PRINT("info", ("Found %s.%s in NDB", elmt.database, elmt.name));
- if (!(elmt.state == NDBOBJ::StateBuilding ||
- elmt.state == NDBOBJ::StateOnline))
+ if (elmt.state == NDBOBJ::StateOnline ||
+ elmt.state == NDBOBJ::StateBackup)
+ do_handle_table= 1;
+ else if (!(elmt.state == NDBOBJ::StateBuilding))
{
sql_print_information("NDB: skipping setup table %s.%s, in state %d",
elmt.database, elmt.name, elmt.state);
@@ -5543,7 +5534,7 @@ int ndbcluster_find_all_files(THD *thd)
if (!(ndbtab= dict->getTable(elmt.name)))
{
- if (elmt.state == NDBOBJ::StateOnline)
+ if (do_handle_table)
sql_print_error("NDB: failed to setup table %s.%s, error: %d, %s",
elmt.database, elmt.name,
dict->getNdbError().code,
@@ -5659,7 +5650,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
for (i= 0 ; i < list.count ; i++)
{
NDBDICT::List::Element& elmt= list.elements[i];
- if (IS_TMP_PREFIX(elmt.name))
+ if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
{
DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
continue;
@@ -5845,7 +5836,7 @@ static bool ndbcluster_init()
#ifdef HAVE_NDB_BINLOG
ndbcluster_binlog_init_handlerton();
#endif
- h.flags= HTON_NO_FLAGS;
+ h.flags= HTON_TEMPORARY_NOT_SUPPORTED;
}
// Set connectstring if specified