summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-03-29 15:16:42 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2023-03-29 15:16:42 +0300
commitdd2fe81122224c07a65e89b409dc28d70802fe99 (patch)
treeb3737b6d5a89e34fa30aea32843a8a78704e4b23 /sql
parente4b83f0febbd24b04687d4814871c758cbede111 (diff)
parent0760ad3336521b85454b522390eb972a606def23 (diff)
downloadmariadb-git-dd2fe81122224c07a65e89b409dc28d70802fe99.tar.gz
Merge 10.6 into 10.8
Diffstat (limited to 'sql')
-rw-r--r--sql/log_event_client.cc4
-rw-r--r--sql/rpl_parallel.cc4
-rw-r--r--sql/rpl_parallel.h3
-rw-r--r--sql/rpl_reporting.h14
-rw-r--r--sql/slave.cc6
-rw-r--r--sql/sql_test.cc4
6 files changed, 20 insertions, 15 deletions
diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
index 92adb98d8c7..03e319076c7 100644
--- a/sql/log_event_client.cc
+++ b/sql/log_event_client.cc
@@ -1967,11 +1967,11 @@ bool Query_log_event::print_query_header(IO_CACHE* file,
goto err;
}
if (my_b_printf(file,"SET "
- "@@session.character_set_client=%d,"
+ "@@session.character_set_client=%s,"
"@@session.collation_connection=%d,"
"@@session.collation_server=%d"
"%s\n",
- uint2korr(charset),
+ cs_info->cs_name.str,
uint2korr(charset+2),
uint2korr(charset+4),
print_event_info->delimiter))
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 24367897c89..b3917942874 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -1815,6 +1815,7 @@ rpl_parallel_activate_pool(rpl_parallel_thread_pool *pool)
}
else
bkp->init(pool->count);
+ bkp->is_valid= false; // Mark backup as stale during pool init
}
}
@@ -2100,7 +2101,7 @@ rpl_parallel_thread::rpl_parallel_thread()
rpl_parallel_thread_pool::rpl_parallel_thread_pool()
: threads(0), free_list(0), count(0), inited(false),current_start_alters(0), busy(false),
- pfs_bkp{0, false, NULL}
+ pfs_bkp{0, false, false, NULL}
{
}
@@ -2229,6 +2230,7 @@ rpl_parallel_thread_pool::copy_pool_for_pfs(Relay_log_info *rli)
pfs_rpt->worker_idle_time= rpt->get_worker_idle_time();
pfs_rpt->last_trans_retry_count= rpt->last_trans_retry_count;
}
+ pfs_bkp.is_valid= true;
}
}
diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h
index 66c7fc9f316..9a8dfc7e386 100644
--- a/sql/rpl_parallel.h
+++ b/sql/rpl_parallel.h
@@ -272,7 +272,7 @@ struct rpl_parallel_thread {
struct pool_bkp_for_pfs{
uint32 count;
- bool inited;
+ bool inited, is_valid;
struct rpl_parallel_thread **rpl_thread_arr;
void init(uint32 thd_count)
{
@@ -299,6 +299,7 @@ struct pool_bkp_for_pfs{
my_free(rpl_thread_arr);
rpl_thread_arr= NULL;
}
+ inited= false;
}
};
diff --git a/sql/rpl_reporting.h b/sql/rpl_reporting.h
index 46a71ff5ad6..8c10f3f04c1 100644
--- a/sql/rpl_reporting.h
+++ b/sql/rpl_reporting.h
@@ -93,13 +93,13 @@ public:
localtime_r(&skr, &tm_tmp);
start=&tm_tmp;
- sprintf(timestamp, "%02d%02d%02d %02d:%02d:%02d",
- start->tm_year % 100,
- start->tm_mon+1,
- start->tm_mday,
- start->tm_hour,
- start->tm_min,
- start->tm_sec);
+ snprintf(timestamp, sizeof(timestamp), "%02d%02d%02d %02d:%02d:%02d",
+ start->tm_year % 100,
+ start->tm_mon+1,
+ start->tm_mday,
+ start->tm_hour,
+ start->tm_min,
+ start->tm_sec);
timestamp[15]= '\0';
}
diff --git a/sql/slave.cc b/sql/slave.cc
index 37a34224fa1..24d9700af74 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -5144,8 +5144,7 @@ err_during_init:
DBUG_LEAVE; // Must match DBUG_ENTER()
my_thread_end();
ERR_remove_state(0);
- pthread_exit(0);
- return 0; // Avoid compiler warnings
+ return nullptr;
}
/*
@@ -5853,8 +5852,7 @@ err_during_init:
DBUG_LEAVE; // Must match DBUG_ENTER()
my_thread_end();
ERR_remove_state(0);
- pthread_exit(0);
- return 0; // Avoid compiler warnings
+ return nullptr;
}
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 0d1a8313564..479d4289406 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -628,6 +628,10 @@ Next alarm time: %lu\n",
#elif defined(HAVE_MALLINFO)
struct mallinfo info= mallinfo();
#endif
+#if __has_feature(memory_sanitizer)
+ /* Work around missing MSAN instrumentation */
+ MEM_MAKE_DEFINED(&info, sizeof info);
+#endif
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2)
char llbuff[10][22];
printf("\nMemory status:\n\