From 7bd3c8a4b33da6c10c4833f4c2e6b18d82ec782e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 21 Apr 2020 17:37:29 +0300 Subject: [PATCH] MDEV-21941: Fix GCC 10 -Wmaybe-uninitialized commit 105b879d0f541f049a131a5c3b99d678fc7d3213 introduced this warning. The warning looks harmless, but GCC does not understand that the initialization and the use of the variables are guarded by the same predicate. --- sql/sql_table.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 474009c8a66..86eba4a521b 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -8146,8 +8146,8 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, Field **f_ptr,*field; MY_BITMAP *dropped_fields= NULL; // if it's NULL - no dropped fields bool drop_period= false; - LEX_CSTRING period_start_name; - LEX_CSTRING period_end_name; + LEX_CSTRING period_start_name= {nullptr, 0}; + LEX_CSTRING period_end_name= {nullptr, 0}; if (table->s->period.name) { period_start_name= table->s->period_start_field()->field_name;