~drizzle-trunk/drizzle/development

1089.1.8 by Brian Aker
Shuffled around a few structures.
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
1089.1.8 by Brian Aker
Shuffled around a few structures.
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; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
21
/**
22
 * @file
23
 *
24
 * Defines the JoinTable class which is the primary class
25
 * used in the nested loops join implementation.
26
 */
27
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
28
#pragma once
1089.1.8 by Brian Aker
Shuffled around a few structures.
29
1089.1.13 by Brian Aker
Sorting methods into class files.
30
#include <drizzled/base.h>
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
31
#include <drizzled/definitions.h>
1089.1.13 by Brian Aker
Sorting methods into class files.
32
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
33
namespace drizzled
34
{
35
1089.1.8 by Brian Aker
Shuffled around a few structures.
36
class StoredKey;
1089.1.13 by Brian Aker
Sorting methods into class files.
37
class Item;
1089.1.8 by Brian Aker
Shuffled around a few structures.
38
1089.1.14 by Brian Aker
Fix TABLE_REF structure
39
struct table_reference_st
1089.1.8 by Brian Aker
Shuffled around a few structures.
40
{
2047.1.1 by Andrew Hutchings
Refix using placement new for join code, vector for join cache buffer.
41
  table_reference_st() :
42
    key_err(false),
43
    key_parts(0),
44
    key_length(0),
45
    key(0),
46
    key_buff(NULL),
47
    key_buff2(NULL),
48
    key_copy(NULL),
49
    items(NULL),
50
    cond_guards(NULL),
51
    null_ref_key(NULL),
52
    disable_cache(false)
53
  { }
54
1089.1.8 by Brian Aker
Shuffled around a few structures.
55
  bool key_err;
56
  uint32_t key_parts; /**< num of key parts */
57
  uint32_t key_length; /**< length of key_buff */
58
  int32_t key; /**< key no (index) */
59
  unsigned char *key_buff; /**< value to look for with key */
60
  unsigned char *key_buff2; /**< key_buff+key_length */
61
  StoredKey **key_copy; /**< No idea what this does... */
62
  Item **items; /**< val()'s for each keypart */
63
  /**
64
    Array of pointers to trigger variables. Some/all of the pointers may be
65
    NULL.  The ref access can be used iff
66
67
      for each used key part i, (!cond_guards[i] || *cond_guards[i])
68
69
    This array is used by subquery code. The subquery code may inject
70
    triggered conditions, i.e. conditions that can be 'switched off'. A ref
71
    access created from such condition is not valid when at least one of the
72
    underlying conditions is switched off (see subquery code for more details)
73
  */
74
  bool **cond_guards;
75
  /**
76
    (null_rejecting & (1<<i)) means the condition is '=' and no matching
77
    rows will be produced if items[i] IS NULL (see add_not_null_conds())
78
  */
79
  key_part_map  null_rejecting;
80
  table_map	depend_map; /**< Table depends on these tables. */
81
  /** null byte position in the key_buf. Used for REF_OR_NULL optimization */
82
  unsigned char *null_ref_key;
83
  /**
84
    true <=> disable the "cache" as doing lookup with the same key value may
85
    produce different results (because of Index Condition Pushdown)
86
  */
87
  bool disable_cache;
1089.1.14 by Brian Aker
Fix TABLE_REF structure
88
};
1089.1.8 by Brian Aker
Shuffled around a few structures.
89
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
90
} /* namespace drizzled */
91