~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
 *
4
 *  Copyright (C) 2008-2009 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; 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
28
#ifndef DRIZZLED_TABLE_REFERENCE_H
29
#define DRIZZLED_TABLE_REFERENCE_H
30
1089.1.13 by Brian Aker
Sorting methods into class files.
31
#include <drizzled/base.h>
1802.16.11 by Padraig O'Sullivan
Remove cpp and header file with MyBitmap class and associated functions. No longer needed.
32
#include "drizzled/definitions.h"
1089.1.13 by Brian Aker
Sorting methods into class files.
33
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
34
namespace drizzled
35
{
36
1089.1.8 by Brian Aker
Shuffled around a few structures.
37
class StoredKey;
1089.1.13 by Brian Aker
Sorting methods into class files.
38
class Item;
1089.1.8 by Brian Aker
Shuffled around a few structures.
39
1089.1.14 by Brian Aker
Fix TABLE_REF structure
40
struct table_reference_st
1089.1.8 by Brian Aker
Shuffled around a few structures.
41
{
42
  bool key_err;
43
  uint32_t key_parts; /**< num of key parts */
44
  uint32_t key_length; /**< length of key_buff */
45
  int32_t key; /**< key no (index) */
46
  unsigned char *key_buff; /**< value to look for with key */
47
  unsigned char *key_buff2; /**< key_buff+key_length */
48
  StoredKey **key_copy; /**< No idea what this does... */
49
  Item **items; /**< val()'s for each keypart */
50
  /**
51
    Array of pointers to trigger variables. Some/all of the pointers may be
52
    NULL.  The ref access can be used iff
53
54
      for each used key part i, (!cond_guards[i] || *cond_guards[i])
55
56
    This array is used by subquery code. The subquery code may inject
57
    triggered conditions, i.e. conditions that can be 'switched off'. A ref
58
    access created from such condition is not valid when at least one of the
59
    underlying conditions is switched off (see subquery code for more details)
60
  */
61
  bool **cond_guards;
62
  /**
63
    (null_rejecting & (1<<i)) means the condition is '=' and no matching
64
    rows will be produced if items[i] IS NULL (see add_not_null_conds())
65
  */
66
  key_part_map  null_rejecting;
67
  table_map	depend_map; /**< Table depends on these tables. */
68
  /** null byte position in the key_buf. Used for REF_OR_NULL optimization */
69
  unsigned char *null_ref_key;
70
  /**
71
    true <=> disable the "cache" as doing lookup with the same key value may
72
    produce different results (because of Index Condition Pushdown)
73
  */
74
  bool disable_cache;
1089.1.14 by Brian Aker
Fix TABLE_REF structure
75
};
1089.1.8 by Brian Aker
Shuffled around a few structures.
76
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
77
} /* namespace drizzled */
78
1089.1.8 by Brian Aker
Shuffled around a few structures.
79
#endif /* DRIZZLED_TABLE_REFERENCE_H */