Skip to content

Commit 1e66da1

Browse files
author
Tor Didriksen
committed
Bug#19143857 GET RID OF DYNAMIC_ARRAY IN RPL_FILTER
Post-push fix gcc 4.4.6 with -Werror -O3 said: prealloced_array.h:226: error: 'job_worker.st_slave_job_group::ts' may be used uninitialized in this function when we did push_back on an uninitialized object. Fix: use value-initialization on the job_worker object. Also fix some warnings from gcc 4.7.2 in optimized mode.
1 parent 98a0207 commit 1e66da1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

sql/rpl_mts_submode.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ Mts_submode_logical_clock::get_least_occupied_worker(Relay_log_info *rli,
553553
{
554554
Slave_committed_queue *gaq= rli->gaq;
555555
Slave_worker *worker= NULL;
556-
Slave_job_group* ptr_group;
556+
Slave_job_group* ptr_group __attribute__((unused));
557557
PSI_stage_info *old_stage= 0;
558558
THD* thd= rli->info_thd;
559559
DBUG_ENTER("Mts_submode_logical_clock::get_least_occupied_worker");

sql/rpl_slave.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -4843,7 +4843,10 @@ int mts_recovery_groups(Relay_log_info *rli)
48434843
bool flag_group_seen_begin= FALSE;
48444844
uint recovery_group_cnt= 0;
48454845
bool not_reached_commit= true;
4846-
Slave_job_group job_worker;
4846+
4847+
// Value-initialization, to avoid compiler warnings on push_back.
4848+
Slave_job_group job_worker= Slave_job_group();
4849+
48474850
IO_CACHE log;
48484851
File file;
48494852
LOG_INFO linfo;

sql/sql_plugin.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ static void intern_plugin_unlock(LEX *lex, plugin_ref plugin)
10631063
could be unlocked faster - optimizing for LIFO semantics.
10641064
*/
10651065
plugin_ref *iter= lex->plugins.end() - 1;
1066-
bool found_it= false;
1066+
bool found_it __attribute__((unused)) = false;
10671067
for (; iter >= lex->plugins.begin() - 1; --iter)
10681068
{
10691069
if (plugin == *iter)

0 commit comments

Comments
 (0)