diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-11-23 10:41:56 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-11-23 10:41:56 -0500 |
commit | 9f0ad12aa508bc67dbf51c203cfc64c4d7dc0d5b (patch) | |
tree | b8c7dfcedcf5ac15c210f40cb29b29d4bcb016b8 | |
parent | afca8ff8bedd1e178c0a90742eef2108844b2862 (diff) | |
download | mariadb-git-bb-10.1-wsrep-ctas.tar.gz |
Refs: MW-317: Post-fixbb-10.1-wsrep-ctas
-rw-r--r-- | sql/sql_insert.cc | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 11d000a4f68..75a0fd45b84 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -4368,29 +4368,32 @@ bool select_create::send_eof() if (!table->s->tmp_table) { #ifdef WITH_WSREP - /* - Append table level exclusive key for CTAS. - */ - wsrep_key_arr_t key_arr= {0, 0}; - wsrep_prepare_keys_for_isolation(thd, - create_table->db, - create_table->table_name, - table_list, - &key_arr); - int rcode = wsrep->append_key( - wsrep, - &thd->wsrep_ws_handle, - key_arr.keys, //&wkey, - key_arr.keys_len, - WSREP_KEY_EXCLUSIVE, - false); - wsrep_keys_free(&key_arr); - if (rcode) { - DBUG_PRINT("wsrep", ("row key failed: %d", rcode)); - WSREP_ERROR("Appending table key for CTAS failed: %s, %d", - thd->query() ? thd->query() : "void", rcode); - abort_result_set(); - DBUG_RETURN(true); + if (WSREP_ON) + { + /* + Append table level exclusive key for CTAS. + */ + wsrep_key_arr_t key_arr= {0, 0}; + wsrep_prepare_keys_for_isolation(thd, + create_table->db, + create_table->table_name, + table_list, + &key_arr); + int rcode= wsrep->append_key(wsrep, + &thd->wsrep_ws_handle, + key_arr.keys, //&wkey, + key_arr.keys_len, + WSREP_KEY_EXCLUSIVE, + false); + wsrep_keys_free(&key_arr); + if (rcode) + { + DBUG_PRINT("wsrep", ("row key failed: %d", rcode)); + WSREP_ERROR("Appending table key for CTAS failed: %s, %d", + thd->query() ? thd->query() : "void", rcode); + abort_result_set(); + DBUG_RETURN(true); + } } #endif /* WITH_WSREP */ trans_commit_stmt(thd); |