Commit 42b69efd authored by Seppo Jaakola's avatar Seppo Jaakola

References lp:1051808 - merged with lp:codership-mysql 5.5.27 based trunk

    patched with: bzr diff lp:codership-mysql/5.5 -r3790..3793
parent 076f2f32
......@@ -91,7 +91,7 @@ wsrep_log()
# echo everything to stderr so that it gets into common error log
# deliberately made to look different from the rest of the log
local readonly tst="$(date +%Y%m%d\ %H:%M:%S.%N | cut -b -21)"
echo "WSREP_SST: $* ($tst)" >/dev/stderr
echo "WSREP_SST: $* ($tst)" >>/dev/stderr
}
wsrep_log_error()
......
......@@ -5078,9 +5078,6 @@ bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags,
}
}
#ifdef WITH_WSREP
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto err;
if ((thd->lex->sql_command== SQLCOM_INSERT ||
thd->lex->sql_command== SQLCOM_INSERT_SELECT ||
thd->lex->sql_command== SQLCOM_REPLACE ||
......@@ -5094,6 +5091,7 @@ bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags,
{
WSREP_TO_ISOLATION_BEGIN(NULL, NULL, (*start));
}
error:
#endif
err:
......
......@@ -4090,7 +4090,7 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open())
#else
if (mysql_bin_log.is_open())
#endif
#endif /* WITH_WSREP */
{
int errcode= query_error_code(thd, thd->killed == NOT_KILLED);
result= thd->binlog_query(THD::STMT_QUERY_TYPE,
......@@ -4100,7 +4100,23 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
/* suppress_use */ FALSE,
errcode);
}
#ifdef WITH_WSREP
const CSET_STRING query_save = thd->query_string;
thd->set_query_inner((char*)query.ptr(), query.length(), system_charset_info);
WSREP_TO_ISOLATION_BEGIN((*tables)->s->db.str, (*tables)->s->table_name.str, NULL);
WSREP_TO_ISOLATION_END;
thd_binlog_trx_reset(thd);
thd->query_string = query_save;
thd->wsrep_exec_mode = LOCAL_STATE;
#endif /* WITH_WSREP */
return result;
#ifdef WITH_WSREP
error:
WSREP_WARN("TO isolation failed: %s", thd->query());
return 0;
#endif
}
void select_create::store_values(List<Item> &values)
......
This diff is collapsed.
......@@ -202,6 +202,21 @@ inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
return test(cs->mbminlen == 1);
}
#ifdef WITH_WSREP
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
#define WSREP_TO_ISOLATION_END \
if (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER)) \
wsrep_to_isolation_end(thd);
#else
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
#endif /* WITH_WSREP */
#endif /* SQL_PARSE_INCLUDED */
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