summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-03-18 15:46:28 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-03-18 15:46:28 +0200
commitccfbeafc45f98bdf01513b00d9f0c82f029cdbf4 (patch)
tree88a88af3e2e08d5f19158998c9cc2575f09302bf /sql
parent7887d45352ca86b2328ceedc40f07e941c5cb10a (diff)
parent190a8312f598fc4892331225104297f6288f23ac (diff)
downloadmariadb-git-ccfbeafc45f98bdf01513b00d9f0c82f029cdbf4.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql')
-rw-r--r--sql/opt_range.cc6
-rw-r--r--sql/sql_parse.cc22
-rw-r--r--sql/wsrep_high_priority_service.cc11
3 files changed, 30 insertions, 9 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index a02b6171a20..f1657b51bf3 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -10642,9 +10642,15 @@ key_or(RANGE_OPT_PARAM *param, SEL_ARG *key1,SEL_ARG *key2)
*/
tmp->maybe_flag|= key2_cpy.maybe_flag;
key2_cpy.increment_use_count(key1->use_count+1);
+
+ uint old_weight= tmp->next_key_part? tmp->next_key_part->weight: 0;
+
tmp->next_key_part= key_or(param, tmp->next_key_part,
key2_cpy.next_key_part);
+ uint new_weight= tmp->next_key_part? tmp->next_key_part->weight: 0;
+ key1->weight += (new_weight - old_weight);
+
if (!cmp)
break; // case b: done with this key2 range
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a574cb927eb..d1b4c2881aa 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3633,6 +3633,11 @@ mysql_execute_command(THD *thd)
Json_writer_object trace_command(thd);
Json_writer_array trace_command_steps(thd, "steps");
+ /* store old value of binlog format */
+ enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format;
+
+ thd->get_binlog_format(&orig_binlog_format,
+ &orig_current_stmt_binlog_format);
#ifdef WITH_WSREP
if (WSREP(thd))
{
@@ -3684,12 +3689,6 @@ mysql_execute_command(THD *thd)
DBUG_ASSERT(thd->transaction->stmt.modified_non_trans_table == FALSE);
- /* store old value of binlog format */
- enum_binlog_format orig_binlog_format,orig_current_stmt_binlog_format;
-
- thd->get_binlog_format(&orig_binlog_format,
- &orig_current_stmt_binlog_format);
-
/*
Assign system variables with values specified by the clause
SET STATEMENT var1=value1 [, var2=value2, ...] FOR <statement>
@@ -7582,9 +7581,14 @@ void THD::reset_for_next_command(bool do_clear_error)
save_prep_leaf_list= false;
- DBUG_PRINT("debug",
- ("is_current_stmt_binlog_format_row(): %d",
- is_current_stmt_binlog_format_row()));
+#ifdef WITH_WSREP
+#if !defined(DBUG_OFF)
+ if (mysql_bin_log.is_open())
+#endif
+#endif
+ DBUG_PRINT("debug",
+ ("is_current_stmt_binlog_format_row(): %d",
+ is_current_stmt_binlog_format_row()));
DBUG_VOID_RETURN;
}
diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc
index 6136a459d16..a75882214cc 100644
--- a/sql/wsrep_high_priority_service.cc
+++ b/sql/wsrep_high_priority_service.cc
@@ -695,6 +695,17 @@ int Wsrep_replayer_service::apply_write_set(const wsrep::ws_meta& ws_meta,
DBUG_ASSERT(thd->wsrep_trx().active());
DBUG_ASSERT(thd->wsrep_trx().state() == wsrep::transaction::s_replaying);
+ /* Allow tests to block the replayer thread using the DBUG facilities */
+ DBUG_EXECUTE_IF("sync.wsrep_replay_cb",
+ {
+ const char act[]=
+ "now "
+ "SIGNAL sync.wsrep_replay_cb_reached "
+ "WAIT_FOR signal.wsrep_replay_cb";
+ DBUG_ASSERT(!debug_sync_set_action(thd,
+ STRING_WITH_LEN(act)));
+ };);
+
wsrep_setup_uk_and_fk_checks(thd);
int ret= 0;