summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2021-03-22 22:04:54 -0700
committerIgor Babaev <igor@askmonty.org>2021-03-22 22:04:54 -0700
commit8f7a6cde580298116b50b144984f996dc6af60ae (patch)
tree4c72a5ad525c72dc9e2214110d26bdbff52d0038 /sql/sql_join_cache.cc
parent56274bd5e4115d86059936ddd3bf656dab1b4354 (diff)
downloadmariadb-git-8f7a6cde580298116b50b144984f996dc6af60ae.tar.gz
MDEV-24767 Wrong result when forced BNLH is used for join supported
by compound index This typo bug may lead to wrong result sets for equi-join queries where the join operation is supported by a compound index such that the order of its components differs from the order of the corresponding columns in the table the index belongs to. The bug manifests itself only when usage of the BNLH algorithm is forced. The fix for the bug was provided by Chu Huaxing.
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 594094afd74..4f9facc6d0c 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -1199,7 +1199,7 @@ bool JOIN_CACHE::check_emb_key_usage()
Item *item= ref->items[i]->real_item();
Field *fld= ((Item_field *) item)->field;
CACHE_FIELD *init_copy= field_descr+flag_fields+i;
- for (j= i, copy= init_copy; i < local_key_arg_fields; i++, copy++)
+ for (j= i, copy= init_copy; j < local_key_arg_fields; j++, copy++)
{
if (fld->eq(copy->field))
{