summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-08-30 12:29:17 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-08-30 12:29:47 +0300
commit4c91fd4cd62e3cfa8949d4f6265c79943390b2d2 (patch)
treecdbe677f837384fb7772fda3fb290db65d5874da
parent01209de7637a7206c18788e08919b5ccf0b3d700 (diff)
downloadmariadb-git-4c91fd4cd62e3cfa8949d4f6265c79943390b2d2.tar.gz
Galera after-merge fixes
wsrep_drop_table_query(): Remove the definition of this ununsed function. row_upd_sec_index_entry(), row_upd_clust_rec_by_insert(): Evaluate the simplest conditions first. The merge could have slightly hurt performance by causing extra calls to wsrep_on().
-rw-r--r--sql/wsrep_mysqld.cc58
-rw-r--r--storage/innobase/row/row0upd.cc6
-rw-r--r--storage/xtradb/row/row0upd.cc6
3 files changed, 6 insertions, 64 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 67b64301ff9..33689a91661 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1363,64 +1363,6 @@ static int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len);
static int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len);
/*
- Rewrite DROP TABLE for TOI. Temporary tables are eliminated from
- the query as they are visible only to client connection.
-
- TODO: See comments for sql_base.cc:drop_temporary_table() and refine
- the function to deal with transactional locked tables.
- */
-static int wsrep_drop_table_query(THD* thd, uchar** buf, size_t* buf_len)
-{
-
- LEX* lex= thd->lex;
- SELECT_LEX* select_lex= &lex->select_lex;
- TABLE_LIST* first_table= select_lex->table_list.first;
- String buff;
-
- bool found_temp_table= false;
- for (TABLE_LIST* table= first_table; table; table= table->next_global)
- {
- if (find_temporary_table(thd, table->db, table->table_name))
- {
- found_temp_table= true;
- break;
- }
- }
-
- if (found_temp_table)
- {
- buff.append("DROP TABLE ");
- if (lex->check_exists)
- buff.append("IF EXISTS ");
-
- for (TABLE_LIST* table= first_table; table; table= table->next_global)
- {
- if (!find_temporary_table(thd, table->db, table->table_name))
- {
- append_identifier(thd, &buff, table->db, strlen(table->db));
- buff.append(".");
- append_identifier(thd, &buff, table->table_name,
- strlen(table->table_name));
- buff.append(",");
- }
- }
-
- /* Chop the last comma */
- buff.chop();
- buff.append(" /* generated by wsrep */");
-
- WSREP_DEBUG("Rewrote '%s' as '%s'", thd->query(), buff.ptr());
-
- return wsrep_to_buf_helper(thd, buff.ptr(), buff.length(), buf, buf_len);
- }
- else
- {
- return wsrep_to_buf_helper(thd, thd->query(), thd->query_length(),
- buf, buf_len);
- }
-}
-
-/*
Decide if statement should run in TOI.
Look if table or table_list contain temporary tables. If the
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index d8d7002aad7..85a4b0bdf19 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -1982,9 +1982,9 @@ row_upd_sec_index_entry(
index, offsets, thr, &mtr);
}
#ifdef WITH_WSREP
- if (wsrep_on(trx->mysql_thd) &&
+ if (err == DB_SUCCESS && !referenced &&
+ wsrep_on(trx->mysql_thd) &&
!wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
- err == DB_SUCCESS && !referenced &&
!(parent && que_node_get_type(parent) ==
QUE_NODE_UPDATE &&
((upd_node_t*)parent)->cascade_node == node) &&
@@ -2270,7 +2270,7 @@ err_exit:
}
}
#ifdef WITH_WSREP
- if (wsrep_on(trx->mysql_thd) && !referenced &&
+ if (!referenced && wsrep_on(trx->mysql_thd) &&
!(parent && que_node_get_type(parent) == QUE_NODE_UPDATE &&
((upd_node_t*)parent)->cascade_node == node) &&
foreign
diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc
index 2679e9a1c8a..91dbc5252bc 100644
--- a/storage/xtradb/row/row0upd.cc
+++ b/storage/xtradb/row/row0upd.cc
@@ -1988,9 +1988,9 @@ row_upd_sec_index_entry(
index, offsets, thr, &mtr);
}
#ifdef WITH_WSREP
- if (wsrep_on(trx->mysql_thd) &&
+ if (err == DB_SUCCESS && !referenced &&
+ wsrep_on(trx->mysql_thd) &&
!wsrep_thd_is_BF(trx->mysql_thd, FALSE) &&
- err == DB_SUCCESS && !referenced &&
!(parent && que_node_get_type(parent) ==
QUE_NODE_UPDATE &&
((upd_node_t*)parent)->cascade_node == node) &&
@@ -2279,7 +2279,7 @@ err_exit:
}
}
#ifdef WITH_WSREP
- if (wsrep_on(trx->mysql_thd) && !referenced &&
+ if (!referenced && wsrep_on(trx->mysql_thd) &&
!(parent && que_node_get_type(parent) == QUE_NODE_UPDATE &&
((upd_node_t*)parent)->cascade_node == node) &&
foreign