summaryrefslogtreecommitdiff
path: root/sql/sql_statistics.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-27 10:43:23 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-27 10:43:23 +0300
commitca9e0089d5d9c8777c58b1e44ff97e7bcb1bdddf (patch)
treeed50bb083a6ba280bcebb8b0fdb1ac3f73646e9a /sql/sql_statistics.cc
parent2d6719d7ee92843d5b0b9a27c7deaff5cacd4745 (diff)
downloadmariadb-git-ca9e0089d5d9c8777c58b1e44ff97e7bcb1bdddf.tar.gz
MDEV-19740: Fix GCC 9.2.1 -Wmaybe-uninitialized on AMD64
For CMAKE_BUILD_TYPE=Debug, the default MYSQL_MAINTAINER_MODE=AUTO implies -Werror along with other flags in cmake/maintainer.cmake, which would break the debug builds when CMAKE_CXX_FLAGS include -O2. This fix includes a backport of 6dd3f24090ce2d237037eb09cf7db083ebbc92f9 from MariaDB 10.3.
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r--sql/sql_statistics.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 7bf8fd676d4..55af2c34e6e 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -1814,16 +1814,13 @@ public:
bool is_partial_fields_present;
Index_prefix_calc(THD *thd, TABLE *table, KEY *key_info)
- : index_table(table), index_info(key_info)
+ : index_table(table), index_info(key_info), prefixes(0), empty(true),
+ calc_state(NULL), is_single_comp_pk(false), is_partial_fields_present(false)
{
uint i;
Prefix_calc_state *state;
uint key_parts= table->actual_n_key_parts(key_info);
- empty= TRUE;
- prefixes= 0;
- LINT_INIT_STRUCT(calc_state);
- is_partial_fields_present= is_single_comp_pk= FALSE;
uint pk= table->s->primary_key;
if ((uint) (table->key_info - key_info) == pk &&
table->key_info[pk].user_defined_key_parts == 1)