summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@macbook.gmz>2006-08-03 19:20:30 +0300
committerunknown <gkodinov/kgeorge@macbook.gmz>2006-08-03 19:20:30 +0300
commit8462d3a46a262b0974f9bcf2bb2fc766df2ae631 (patch)
tree4ccbef8986f35888340564df13147cdf4e7441e4 /sql/opt_range.cc
parent84ece59cefafc7a223c65aa7c763f5e72afaa1fc (diff)
downloadmariadb-git-8462d3a46a262b0974f9bcf2bb2fc766df2ae631.tar.gz
Bug #21180: Subselect with index for both WHERE and ORDER BY produces empty result
Reseting subqueries with "quick" access methods was incomplete. Partially backported the correct reseting of QUICK_SELECTs from 5.x. mysql-test/r/subselect.result: Bug #21180: Subselect with index for both WHERE and ORDER BY produces empty result - test case mysql-test/t/subselect.test: Bug #21180: Subselect with index for both WHERE and ORDER BY produces empty result - test case sql/opt_range.cc: Bug #21180: Subselect with index for both WHERE and ORDER BY produces empty result - partially backported the correct reseting of QUICK_SELECTs from 5.x. sql/opt_range.h: Bug #21180: Subselect with index for both WHERE and ORDER BY produces empty result - partially backported the correct reseting of QUICK_SELECTs from 5.x.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 57903ffe7b9..85125a4521a 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2980,6 +2980,14 @@ int QUICK_SELECT::get_next()
}
}
+void QUICK_SELECT::reset(void)
+{
+ next= 0;
+ it.rewind();
+ range= 0;
+ if (file->inited == handler::NONE)
+ file->ha_index_init(index);
+}
/* Get next for geometrical indexes */
@@ -3201,7 +3209,11 @@ bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg,
return 0;
}
#endif
-
+void QUICK_SELECT_DESC::reset(void)
+{
+ rev_it.rewind();
+ QUICK_SELECT::reset();
+}
/*****************************************************************************
** Print a quick range for debugging