Commit 329058be authored by Sergei Golubchik's avatar Sergei Golubchik

wsrep: create a macro for the error: label

that is used by WSREP_TO_ISOLATION_BEGIN and other galera macros,
to avoid the need for wrapping this label in #ifdef WITH_WSREP/#endif
parent 0140bfac
......@@ -25,12 +25,12 @@
#define WSREP_MYSQL_DB (char *)"mysql"
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
goto error;
goto wsrep_error_label;
#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_) \
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, \
table_list_, alter_info_)) \
goto error;
goto wsrep_error_label;
#define WSREP_TO_ISOLATION_END \
if (WSREP_ON && (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER))) \
......@@ -42,7 +42,7 @@
*/
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto wsrep_error_label;
#define WSREP_DEBUG(...) \
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
......@@ -52,8 +52,8 @@
#define WSREP_SYNC_WAIT(thd_, before_) \
{ if (WSREP_CLIENT(thd_) && \
wsrep_sync_wait(thd_, before_)) goto error; }
wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; }
#define WSREP_ERROR_LABEL wsrep_error_label
#else
#define IF_WSREP(A,B) B
#define DBUG_ASSERT_IF_WSREP(A)
......@@ -65,6 +65,7 @@
#define WSREP_TO_ISOLATION_END
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#define WSREP_SYNC_WAIT(thd_, before_)
#define WSREP_ERROR_LABEL goto wsrep_error_label; wsrep_error_label
#endif /* WITH_WSREP */
......
......@@ -418,10 +418,10 @@ Events::create_event(THD *thd, Event_parse_data *parse_data)
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(ret);
#ifdef WITH_WSREP
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(TRUE);
#endif /* WITH_WSREP */
}
......@@ -549,10 +549,9 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(ret);
#ifdef WITH_WSREP
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(TRUE);
#endif /* WITH_WSREP */
}
......@@ -616,10 +615,9 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(ret);
#ifdef WITH_WSREP
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(TRUE);
#endif /* WITH_WSREP */
}
......
......@@ -2861,7 +2861,7 @@ bool change_password(THD *thd, LEX_USER *user)
close_mysql_tables(thd);
#ifdef WITH_WSREP
error: // this label is used in WSREP_TO_ISOLATION_BEGIN
WSREP_ERROR_LABEL:
if (WSREP(thd) && !thd->wsrep_applier)
{
WSREP_TO_ISOLATION_END;
......@@ -3014,7 +3014,7 @@ int acl_set_default_role(THD *thd, const char *host, const char *user,
close_mysql_tables(thd);
#ifdef WITH_WSREP
error: // this label is used in WSREP_TO_ISOLATION_END
WSREP_ERROR_LABEL:
if (WSREP(thd) && !thd->wsrep_applier)
{
WSREP_TO_ISOLATION_END;
......
......@@ -1262,6 +1262,7 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
m_lex->query_tables= first_table;
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(res);
}
......@@ -1320,6 +1321,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd)
m_lex->query_tables= first_table;
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(res);
}
......@@ -1354,5 +1356,6 @@ bool Sql_cmd_repair_table::execute(THD *thd)
m_lex->query_tables= first_table;
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(res);
}
......@@ -330,13 +330,10 @@ bool Sql_cmd_alter_table::execute(THD *thd)
lex->ignore);
DBUG_RETURN(result);
#ifdef WITH_WSREP
error:
{
WSREP_WARN("ALTER TABLE isolation failure");
DBUG_RETURN(TRUE);
}
#endif /* WITH_WSREP */
WSREP_ERROR_LABEL:
WSREP_WARN("ALTER TABLE isolation failure");
DBUG_RETURN(TRUE);
}
bool Sql_cmd_discard_import_tablespace::execute(THD *thd)
......
......@@ -4813,6 +4813,7 @@ bool open_tables(THD *thd, const DDL_options_st &options,
}
error:
WSREP_ERROR_LABEL:
THD_STAGE_INFO(thd, stage_after_opening_tables);
thd_proc_info(thd, 0);
......
......@@ -5712,6 +5712,7 @@ mysql_execute_command(THD *thd)
goto finish;
error:
WSREP_ERROR_LABEL:
res= TRUE;
finish:
......
......@@ -2185,10 +2185,9 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
if (argv)
free_defaults(argv);
DBUG_RETURN(error);
#ifdef WITH_WSREP
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(TRUE);
#endif /* WITH_WSREP */
}
......@@ -2330,10 +2329,9 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
mysql_mutex_unlock(&LOCK_plugin);
DBUG_RETURN(error);
#ifdef WITH_WSREP
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(TRUE);
#endif /* WITH_WSREP */
}
......
......@@ -612,10 +612,9 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
my_ok(thd);
DBUG_RETURN(result);
#ifdef WITH_WSREP
error:
WSREP_ERROR_LABEL:
DBUG_RETURN(true);
#endif /* WITH_WSREP */
}
......
......@@ -691,10 +691,10 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
lex->link_first_table_back(view, link_to_local);
DBUG_RETURN(0);
#ifdef WITH_WSREP
error:
WSREP_ERROR_LABEL:
res= TRUE;
#endif /* WITH_WSREP */
err:
THD_STAGE_INFO(thd, stage_end);
lex->link_first_table_back(view, link_to_local);
......
......@@ -2715,7 +2715,7 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
return(false);
error:
WSREP_ERROR_LABEL:
thd->wsrep_TOI_pre_query= NULL;
return (true);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment