~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_reference.h

  • Committer: Brian Aker
  • Date: 2009-07-11 05:59:19 UTC
  • mfrom: (1089.1.9 merge)
  • Revision ID: brian@gaz-20090711055919-m4px3crrdgta5lie
Collection of patches from new-cleanup (includes asserts for field in debug)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
31
class StoredKey;
 
32
 
 
33
typedef struct st_table_ref
 
34
{
 
35
  bool key_err;
 
36
  uint32_t key_parts; /**< num of key parts */
 
37
  uint32_t key_length; /**< length of key_buff */
 
38
  int32_t key; /**< key no (index) */
 
39
  unsigned char *key_buff; /**< value to look for with key */
 
40
  unsigned char *key_buff2; /**< key_buff+key_length */
 
41
  StoredKey **key_copy; /**< No idea what this does... */
 
42
  Item **items; /**< val()'s for each keypart */
 
43
  /**
 
44
    Array of pointers to trigger variables. Some/all of the pointers may be
 
45
    NULL.  The ref access can be used iff
 
46
 
 
47
      for each used key part i, (!cond_guards[i] || *cond_guards[i])
 
48
 
 
49
    This array is used by subquery code. The subquery code may inject
 
50
    triggered conditions, i.e. conditions that can be 'switched off'. A ref
 
51
    access created from such condition is not valid when at least one of the
 
52
    underlying conditions is switched off (see subquery code for more details)
 
53
  */
 
54
  bool **cond_guards;
 
55
  /**
 
56
    (null_rejecting & (1<<i)) means the condition is '=' and no matching
 
57
    rows will be produced if items[i] IS NULL (see add_not_null_conds())
 
58
  */
 
59
  key_part_map  null_rejecting;
 
60
  table_map     depend_map; /**< Table depends on these tables. */
 
61
  /** null byte position in the key_buf. Used for REF_OR_NULL optimization */
 
62
  unsigned char *null_ref_key;
 
63
  /**
 
64
    true <=> disable the "cache" as doing lookup with the same key value may
 
65
    produce different results (because of Index Condition Pushdown)
 
66
  */
 
67
  bool disable_cache;
 
68
} TABLE_REF;
 
69
 
 
70
#endif /* DRIZZLED_TABLE_REFERENCE_H */