From 2fc1ec43560b453b4694adbc1aac11f3f23b1761 Mon Sep 17 00:00:00 2001 From: Seppo Jaakola Date: Fri, 13 Apr 2012 01:33:24 +0300 Subject: 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 --- sql/sql_truncate.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sql/sql_truncate.cc') diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 67ed608f114..a66b2377fcb 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -24,6 +24,9 @@ #include "sql_acl.h" // DROP_ACL #include "sql_parse.h" // check_one_table_access() #include "sql_truncate.h" +#ifdef WITH_WSREP +#include "wsrep_mysqld.h" +#endif /* WITH_WSREP */ /** @@ -515,9 +518,14 @@ bool Truncate_statement::execute(THD *thd) if (check_one_table_access(thd, DROP_ACL, first_table)) DBUG_RETURN(res); +#ifdef WITH_WSREP + if (WSREP(thd) && wsrep_to_isolation_begin(thd, + first_table->db, + first_table->table_name)) + DBUG_RETURN(TRUE); +#endif /* WITH_WSREP */ if (! (res= truncate_table(thd, first_table))) my_ok(thd); - DBUG_RETURN(res); } -- cgit v1.2.1