summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.h
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-04-19 05:37:16 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-04-19 05:37:16 +0400
commitb9bbe4a18ba8569cd1cedd391725e4ee214d9be7 (patch)
tree600fddc7dfc8927c8a3cbed5600db4da86e7e5fe /sql/opt_subselect.h
parent994c6db2d17eb035625387f4f5d4bdd8552fb767 (diff)
downloadmariadb-git-b9bbe4a18ba8569cd1cedd391725e4ee214d9be7.tar.gz
BUG#978479: Wrong result (extra rows) with derived_with_keys+loosescan+semijoin=ON, materialization=OFF
- Part#2: Don't try to construct a LooseScan access on indexes that do not guarantee index-ordered reads.
Diffstat (limited to 'sql/opt_subselect.h')
-rw-r--r--sql/opt_subselect.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h
index 07f1fc77a20..eca7b1acb3b 100644
--- a/sql/opt_subselect.h
+++ b/sql/opt_subselect.h
@@ -130,7 +130,9 @@ public:
void add_keyuse(table_map remaining_tables, KEYUSE *keyuse)
{
- if (try_loosescan && keyuse->sj_pred_no != UINT_MAX)
+ if (try_loosescan && keyuse->sj_pred_no != UINT_MAX &&
+ (keyuse->table->file->index_flags(keyuse->key, 0, 1 ) & HA_READ_ORDER))
+
{
if (!(remaining_tables & keyuse->used_tables))
{