diff options
author | unknown <timour@askmonty.org> | 2011-07-13 17:09:09 +0300 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2011-07-13 17:09:09 +0300 |
commit | 990584d73a736c19439d249e0936a354deffb59b (patch) | |
tree | 906502523bb1d74f5f13d01d6f907492969b15c0 /sql/item_subselect.h | |
parent | d43063939cbcf2eba55f959f5a44321ef7c707f7 (diff) | |
download | mariadb-git-990584d73a736c19439d249e0936a354deffb59b.tar.gz |
Fixed bug lp:809245
In addition to the bug fix explained below, the patch performs
few renames, and adds some comments to avoid similar problems.
Analysis:
The failed assert was due to a bug in MWL#68, where it was
incorrectly assumed that the size of the bitmap
subselect_rowid_merge_engine::null_only_columns should be
the same as the size of the array of Ordered_keys.
The bitmap null_only_columns contains bits to mark columns
that contain only NULLs. Therefore the indexes of the bits
to be set in null_only_columns are different from the indexes
of the Ordered_keys. If there is a NULL-only column that appears
in a table after the last partial match column with Ordered_key,
this NULL-only column would require setting a bit with index
bigger than the size of the bitmap null_only_columns.
Accessing such a bit caused the failed assert.
Solution:
Upon analysis, it turns out that null_only_columns is not needed
at all, because we are looking for partial matches, and having
such columns guarantees that there is a partial match for any
corresponding outer value.
Therefore the patch removes
subselect_rowid_merge_engine::null_only_columns.
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r-- | sql/item_subselect.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 26a45a14dbe..42be1635b6f 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -1192,11 +1192,6 @@ protected: */ MY_BITMAP matching_outer_cols; /* - Columns that consist of only NULLs. Such columns match any value. - Computed once per query execution. - */ - MY_BITMAP null_only_columns; - /* Indexes of row numbers, sorted by <column_value, row_number>. If an index may contain NULLs, the NULLs are stored efficiently in a bitmap. @@ -1205,13 +1200,13 @@ protected: non-NULL columns, it is contained in keys[0]. */ Ordered_key **merge_keys; - /* The number of elements in keys. */ - uint keys_count; + /* The number of elements in merge_keys. */ + uint merge_keys_count; /* An index on all non-NULL columns of 'tmp_table'. The index has the logical form: <[v_i1 | ... | v_ik], rownum>. It allows to find the row number where the columns c_i1,...,c1_k contain the values v_i1,...,v_ik. - If such an index exists, it is always the first element of 'keys'. + If such an index exists, it is always the first element of 'merge_keys'. */ Ordered_key *non_null_key; /* @@ -1236,7 +1231,7 @@ protected: public: subselect_rowid_merge_engine(THD *thd_arg, subselect_uniquesubquery_engine *engine_arg, - TABLE *tmp_table_arg, uint keys_count_arg, + TABLE *tmp_table_arg, uint merge_keys_count_arg, uint covering_null_row_width_arg, Item_subselect *item_arg, select_result_interceptor *result_arg, @@ -1244,7 +1239,7 @@ public: :subselect_partial_match_engine(thd_arg, engine_arg, tmp_table_arg, item_arg, result_arg, equi_join_conds_arg, covering_null_row_width_arg), - keys_count(keys_count_arg), non_null_key(NULL) + merge_keys_count(merge_keys_count_arg), non_null_key(NULL) {} ~subselect_rowid_merge_engine(); bool init(MY_BITMAP *non_null_key_parts, MY_BITMAP *partial_match_key_parts); |