~drizzle-trunk/drizzle/development

390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 Sun Microsystems
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; version 2 of the License.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 */
19
327.2.4 by Brian Aker
Refactoring table.h
20
#ifndef DRIZZLED_NESTED_JOIN_H
21
#define DRIZZLED_NESTED_JOIN_H
22
553.1.2 by Monty Taylor
Moved some bitmap defines into bitmap.
23
#include <drizzled/sql_list.h>
24
#include <drizzled/sql_bitmap.h>
553.1.3 by Monty Taylor
Split out nested_join.h.
25
#include <drizzled/item.h>
26
#include <drizzled/table_list.h>
553.1.2 by Monty Taylor
Moved some bitmap defines into bitmap.
27
1100.4.2 by Padraig O'Sullivan
Removed the typedef for nested_join_map and instead just declare these
28
#include <bitset>
29
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
30
namespace drizzled
31
{
32
327.2.4 by Brian Aker
Refactoring table.h
33
struct nested_join_st
34
{
553.1.3 by Monty Taylor
Split out nested_join.h.
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  */
1089.1.1 by Brian Aker
Remove of JOIN_TAB to JoinTable
45
  JoinTable *first_nested;
553.1.3 by Monty Taylor
Split out nested_join.h.
46
47
  /*
327.2.4 by Brian Aker
Refactoring table.h
48
    Used to count tables in the nested join in 2 isolated places:
553.1.3 by Monty Taylor
Split out nested_join.h.
49
    1. In make_outerjoin_info().
327.2.4 by Brian Aker
Refactoring table.h
50
    2. check_interleaving_with_nj/restore_prev_nj_state (these are called
553.1.3 by Monty Taylor
Split out nested_join.h.
51
    by the join optimizer.
327.2.4 by Brian Aker
Refactoring table.h
52
    Before each use the counters are zeroed by reset_nj_counters.
53
  */
553.1.3 by Monty Taylor
Split out nested_join.h.
54
  uint32_t counter_;
55
56
  /* Bit used to identify this nested join*/
1100.4.2 by Padraig O'Sullivan
Removed the typedef for nested_join_map and instead just declare these
57
  std::bitset<64> nj_map;
553.1.3 by Monty Taylor
Split out nested_join.h.
58
327.2.4 by Brian Aker
Refactoring table.h
59
  /*
60
    (Valid only for semi-join nests) Bitmap of tables outside the semi-join
61
    that are used within the semi-join's ON condition.
62
  */
553.1.3 by Monty Taylor
Split out nested_join.h.
63
  table_map sj_depends_on;
327.2.4 by Brian Aker
Refactoring table.h
64
  /* Outer non-trivially correlated tables */
553.1.3 by Monty Taylor
Split out nested_join.h.
65
  table_map sj_corr_tables;
66
67
  List<Item> sj_outer_expr_list;
327.2.4 by Brian Aker
Refactoring table.h
68
};
69
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
70
} /* namespace drizzled */
71
327.2.4 by Brian Aker
Refactoring table.h
72
#endif /* DRIZZLED_NESTED_JOIN_H */