~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
2252.1.18 by Olaf van der Spek
Common fwd
33
namespace drizzled {
1089.1.8 by Brian Aker
Shuffled around a few structures.
34
1089.1.14 by Brian Aker
Fix TABLE_REF structure
35
struct table_reference_st
1089.1.8 by Brian Aker
Shuffled around a few structures.
36
{
2047.1.1 by Andrew Hutchings
Refix using placement new for join code, vector for join cache buffer.
37
  table_reference_st() :
38
    key_err(false),
39
    key_parts(0),
40
    key_length(0),
41
    key(0),
42
    key_buff(NULL),
43
    key_buff2(NULL),
44
    key_copy(NULL),
45
    items(NULL),
46
    cond_guards(NULL),
47
    null_ref_key(NULL),
48
    disable_cache(false)
49
  { }
50
1089.1.8 by Brian Aker
Shuffled around a few structures.
51
  bool key_err;
52
  uint32_t key_parts; /**< num of key parts */
53
  uint32_t key_length; /**< length of key_buff */
54
  int32_t key; /**< key no (index) */
55
  unsigned char *key_buff; /**< value to look for with key */
56
  unsigned char *key_buff2; /**< key_buff+key_length */
57
  StoredKey **key_copy; /**< No idea what this does... */
58
  Item **items; /**< val()'s for each keypart */
59
  /**
60
    Array of pointers to trigger variables. Some/all of the pointers may be
61
    NULL.  The ref access can be used iff
62
63
      for each used key part i, (!cond_guards[i] || *cond_guards[i])
64
65
    This array is used by subquery code. The subquery code may inject
66
    triggered conditions, i.e. conditions that can be 'switched off'. A ref
67
    access created from such condition is not valid when at least one of the
68
    underlying conditions is switched off (see subquery code for more details)
69
  */
70
  bool **cond_guards;
71
  /**
72
    (null_rejecting & (1<<i)) means the condition is '=' and no matching
73
    rows will be produced if items[i] IS NULL (see add_not_null_conds())
74
  */
75
  key_part_map  null_rejecting;
76
  table_map	depend_map; /**< Table depends on these tables. */
77
  /** null byte position in the key_buf. Used for REF_OR_NULL optimization */
78
  unsigned char *null_ref_key;
79
  /**
80
    true <=> disable the "cache" as doing lookup with the same key value may
81
    produce different results (because of Index Condition Pushdown)
82
  */
83
  bool disable_cache;
1089.1.14 by Brian Aker
Fix TABLE_REF structure
84
};
1089.1.8 by Brian Aker
Shuffled around a few structures.
85
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
86
} /* namespace drizzled */
87