diff options
author | Igor Babaev <igor@askmonty.org> | 2012-03-22 19:56:17 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-03-22 19:56:17 -0700 |
commit | da9aabbbb653274de997763b7f833ac6822f81bf (patch) | |
tree | 5b9acd524d68fb1b8f2b2d6dd8a2eb2cf619c2db /sql | |
parent | 65528b783fad655bb16316eca69cd848763fe361 (diff) | |
download | mariadb-git-da9aabbbb653274de997763b7f833ac6822f81bf.tar.gz |
Fixed LP bug #954900.
If the first component of a ref key happened to be a constant appeared
after constant row substitution then no store_key element should be
created for such a component. Yet create_ref_for_key() erroneously could
create such an element that caused construction of invalid ref keys and
wrong results for some joins.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_select.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index b7c0156f65b..a526de5a256 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7498,7 +7498,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, if (keyuse->null_rejecting) j->ref.null_rejecting |= 1 << i; keyuse_uses_no_tables= keyuse_uses_no_tables && !keyuse->used_tables; - if (!keyuse->used_tables && !thd->lex->describe) + if (!keyuse->val->used_tables() && !thd->lex->describe) { // Compare against constant store_key_item tmp(thd, keyinfo->key_part[i].field, |