summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2005-10-25 19:28:27 +0400
committerunknown <sergefp@mysql.com>2005-10-25 19:28:27 +0400
commit2b7f5a45e96413f88ba93ebd85971a3b82cbeb7c (patch)
tree5de18844ff69573fffda746669424dbe86b91bf3 /sql/table.h
parent11541107b83d8e361722dff601192bd7d7f70ca9 (diff)
downloadmariadb-git-2b7f5a45e96413f88ba93ebd85971a3b82cbeb7c.tar.gz
BUG#13126: When choosing join order for join with nested joins, don't produce join
orders that cannot be handled by the executioner. mysql-test/r/bigint.result: Added mssing "drop table if exists" mysql-test/r/join_nested.result: Testcase for BUG#13126 mysql-test/t/bigint.test: Added mssing "drop table if exists" mysql-test/t/join_nested.test: Testcase for BUG#13126 sql/mysql_priv.h: BUG#13126: Added nested_join_map type. sql/sql_prepare.cc: BUG#13126: Don't set NESTED_JOIN::counter to 0 here as it is reset in other place now. sql/sql_select.cc: BUG#13126: When choosing join order for join with nested joins, don't produce join orders that the executioner cannot handle. The work is done by check_interleaving_with_nj() and restore_prev_nj_state() functions that are used from the join optimizer to avoid building invalid join orders. sql/sql_select.h: BUG#13126: Added JOIN_TAB::embedding_map and JOIN::cur_embedding_map. sql/table.h: BUG#13126: In NESTED_JOIN: added nj_map, added comment about where counter is used.
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/table.h b/sql/table.h
index e76d005f494..00259ec0c18 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -757,7 +757,15 @@ typedef struct st_nested_join
table_map used_tables; /* bitmap of tables in the nested join */
table_map not_null_tables; /* tables that rejects nulls */
struct st_join_table *first_nested;/* the first nested table in the plan */
- uint counter; /* to count tables in the nested join */
+ /*
+ Used to count tables in the nested join in 2 isolated places:
+ 1. In make_outerjoin_info().
+ 2. check_interleaving_with_nj/restore_prev_nj_state (these are called
+ by the join optimizer.
+ Before each use the counters are zeroed by reset_nj_counters.
+ */
+ uint counter;
+ nested_join_map nj_map; /* Bit used to identify this nested join*/
} NESTED_JOIN;