EXPLAIN FORMAT=JSON: Do set usable_key_parts for key in the temp. table

If we didn't do it, SJ-Materialization table would appear to
EXPLAIN JSON code as having different keyparts than it actually
has. This caused unpredictable content in "used_key_parts"
This commit is contained in:
Sergei Petrunia 2014-12-02 01:22:16 +03:00
parent 5c5a8b1cc8
commit a35b05399e

View file

@ -16391,6 +16391,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
((field_count-param->hidden_field_count)+
(share->uniques ? MY_TEST(null_pack_length) : 0));
keyinfo->ext_key_parts= keyinfo->user_defined_key_parts;
keyinfo->usable_key_parts= keyinfo->user_defined_key_parts;
table->distinct= 1;
share->keys= 1;
if (!(key_part_info= (KEY_PART_INFO*)