Commit 4c91fd4c authored by Marko Mäkelä's avatar Marko Mäkelä

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().
parent 01209de7
......@@ -1362,64 +1362,6 @@ create_view_query(THD *thd, uchar** buf, size_t* buf_len)
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.
......
......@@ -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 @@ row_upd_clust_rec_by_insert(
}
}
#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
......
......@@ -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 @@ row_upd_clust_rec_by_insert(
}
}
#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
......
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