diff options
author | unknown <hf@deer.(none)> | 2003-07-03 10:42:13 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2003-07-03 10:42:13 +0500 |
commit | d433fe5580dafbc1fba0ebe9dc76217d1b0e5144 (patch) | |
tree | 80f8f2e51425e1bc7891c055c599729152b21a2e /sql/sql_select.cc | |
parent | adcd7be93515460327127e189a7b5ca5b63f232e (diff) | |
download | mariadb-git-d433fe5580dafbc1fba0ebe9dc76217d1b0e5144.tar.gz |
Proposed bugfix for #717
Current table is placed into read_tables set of the current join_tab->select
so get_mm_parts function thinks that current table's record is read and
tries to calculate WHERE condition with the fields of the record.
Result of these calculations is unpredictable.
Looks funny - outcome of the SELECT depends on the queries executed before.
Anyway i think we should have testcase on this part of the code.
mysql-test/r/sel000001.result:
appropriate result added
mysql-test/t/sel000001.test:
testcase added
sql/sql_select.cc:
I think we should count current table out of read_tables set
Diffstat (limited to 'sql/sql_select.cc')
-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 5b5972be384..bde5392d299 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2683,7 +2683,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (select->quick && (select->quick->records >= 100L)))) ? 2 : 1; - sel->read_tables= used_tables; + sel->read_tables= used_tables & ~current_map; } if (i != join->const_tables && tab->use_quick != 2) { /* Read with cache */ |