~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/nested_join.h

  • Committer: Monty Taylor
  • Date: 2008-10-09 22:38:27 UTC
  • mto: This revision was merged to the branch mainline in revision 497.
  • Revision ID: monty@inaugust.com-20081009223827-bc9gvpiplsmvpwyq
Moved test() to its own file.
Made a new function to possibly replace int10_to_str.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_NESTED_JOIN_H
21
21
#define DRIZZLED_NESTED_JOIN_H
22
22
 
23
 
#include <drizzled/sql_list.h>
24
 
#include <drizzled/sql_bitmap.h>
25
 
#include <drizzled/item.h>
26
 
#include <drizzled/table_list.h>
27
 
 
28
 
#include <bitset>
29
 
 
30
 
namespace drizzled
31
 
{
32
 
 
33
23
struct nested_join_st
34
24
{
35
 
  /* list of elements in the nested join */
36
 
  List<TableList> join_list;
37
 
 
38
 
  /* bitmap of tables in the nested join */
39
 
  table_map used_tables;
40
 
 
41
 
  /* tables that rejects nulls           */
42
 
  table_map not_null_tables;
43
 
 
44
 
  /* the first nested table in the plan  */
45
 
  JoinTable *first_nested;
46
 
 
47
 
  /*
 
25
  List<TableList>  join_list;       /* list of elements in the nested join */
 
26
  table_map         used_tables;     /* bitmap of tables in the nested join */
 
27
  table_map         not_null_tables; /* tables that rejects nulls           */
 
28
  struct st_join_table *first_nested;/* the first nested table in the plan  */
 
29
  /* 
48
30
    Used to count tables in the nested join in 2 isolated places:
49
 
    1. In make_outerjoin_info().
 
31
    1. In make_outerjoin_info(). 
50
32
    2. check_interleaving_with_nj/restore_prev_nj_state (these are called
51
 
    by the join optimizer.
 
33
       by the join optimizer. 
52
34
    Before each use the counters are zeroed by reset_nj_counters.
53
35
  */
54
 
  uint32_t counter_;
55
 
 
56
 
  /* Bit used to identify this nested join*/
57
 
  std::bitset<64> nj_map;
58
 
 
 
36
  uint32_t              counter_;
 
37
  nested_join_map   nj_map;          /* Bit used to identify this nested join*/
59
38
  /*
60
39
    (Valid only for semi-join nests) Bitmap of tables outside the semi-join
61
40
    that are used within the semi-join's ON condition.
62
41
  */
63
 
  table_map sj_depends_on;
 
42
  table_map         sj_depends_on;
64
43
  /* Outer non-trivially correlated tables */
65
 
  table_map sj_corr_tables;
66
 
 
67
 
  List<Item> sj_outer_expr_list;
68
 
 
69
 
  /**
70
 
     True if this join nest node is completely covered by the query execution
71
 
     plan. This means two things.
72
 
 
73
 
     1. All tables on its @c join_list are covered by the plan.
74
 
 
75
 
     2. All child join nest nodes are fully covered.
76
 
   */
77
 
  bool is_fully_covered() const { return join_list.elements == counter_; }
 
44
  table_map         sj_corr_tables;
 
45
  List<Item>        sj_outer_expr_list;
78
46
};
79
47
 
80
 
} /* namespace drizzled */
81
 
 
82
48
#endif /* DRIZZLED_NESTED_JOIN_H */