From e976b27ea65c365953199ac6be9b80479d149525 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Wed, 11 Mar 2009 19:09:56 +0100 Subject: [PATCH] Bug#36751: Segmentation fault in ctype-bin.c:308; Linux 86_64, with-max-indexes=128 mysqld is optimized for the default case (up to 64-indices); for a greater number of indices it goes through a different code path. As that code-path is a compile-time option and can not easily be covered in standard tests, bitrot occurred. key-fields need an explicit initialization in the non- optimized case; this setup was presumably not added when a new key- vector was added. Changeset adds the necessary initialisations. No test case added due to dependence on compile-time option. sql/sql_select.cc: Init merge_keys as well. If we don't, things blow up badly outside of the optimized-for-64-keys case! sql/table.cc: Init merge_keys as well. If we don't, things blow up badly outside of the optimized-for-64-keys case! --- sql/sql_select.cc | 1 + sql/table.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bea748562eb..825d3c870d8 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9788,6 +9788,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, table->in_use= thd; table->quick_keys.init(); table->covering_keys.init(); + table->merge_keys.init(); table->keys_in_use_for_query.init(); table->s= share; diff --git a/sql/table.cc b/sql/table.cc index 17454ffb012..f67929ad96b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1652,6 +1652,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, goto err; outparam->quick_keys.init(); outparam->covering_keys.init(); + outparam->merge_keys.init(); outparam->keys_in_use_for_query.init(); /* Allocate handler */