summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorSeppo Jaakola <seppo.jaakola@codership.com>2012-04-13 01:33:24 +0300
committerSeppo Jaakola <seppo.jaakola@codership.com>2012-04-13 01:33:24 +0300
commit2fc1ec43560b453b4694adbc1aac11f3f23b1761 (patch)
tree880c3875dae28574a90bf891ef901027723d21f6 /sql/sql_alter.cc
parent51c77ec5d406843bb8c8131f0687f4f75839d045 (diff)
downloadmariadb-git-2fc1ec43560b453b4694adbc1aac11f3f23b1761.tar.gz
Initial push of codership-wsrep API implementation for MariaDB.
Merge of: lp:maria/5.5, #3334: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/3334 lp:codership-mysql/5.5, #3725: http://bazaar.launchpad.net/~codership/codership-mysql/wsrep-5.5/revision/3725
Diffstat (limited to 'sql/sql_alter.cc')
-rw-r--r--sql/sql_alter.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index c6c02773286..c4468ee8793 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -17,7 +17,9 @@
#include "sql_table.h" // mysql_alter_table,
// mysql_exchange_partition
#include "sql_alter.h"
-
+#ifdef WITH_WSREP
+#include "wsrep_mysqld.h"
+#endif /* WITH_WSREP */
bool Alter_table_statement::execute(THD *thd)
{
LEX *lex= thd->lex;
@@ -97,6 +99,17 @@ bool Alter_table_statement::execute(THD *thd)
thd->enable_slow_log= opt_log_slow_admin_statements;
+#ifdef WITH_WSREP
+TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl);
+
+ if ((!thd->is_current_stmt_binlog_format_row() ||
+ !find_temporary_table(thd, first_table)) &&
+ wsrep_to_isolation_begin(thd, first_table->db, first_table->table_name))
+ {
+ WSREP_WARN("ALTER TABLE isolation failure");
+ DBUG_RETURN(TRUE);
+ }
+#endif /* WITH_WSREP */
result= mysql_alter_table(thd, select_lex->db, lex->name.str,
&create_info,
first_table,
@@ -105,5 +118,7 @@ bool Alter_table_statement::execute(THD *thd)
select_lex->order_list.first,
lex->ignore, lex->online);
+#ifdef WITH_WSREP
+#endif /* WITH_WSREP */
DBUG_RETURN(result);
}