~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/semi_join_table.h

Extracted the LOAD command into its own class and implementation files.
Removed the corresponding case label from the switch statement.

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 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
 
 
20
#ifndef DRIZZLED_SEMI_JOIN_TABLE_H
 
21
#define DRIZZLED_SEMI_JOIN_TABLE_H
 
22
 
 
23
#include <drizzled/server_includes.h>
 
24
#include <drizzled/table.h>
 
25
 
 
26
/*
 
27
  Describes use of one temporary table to weed out join duplicates.
 
28
  The temporar
 
29
 
 
30
  Used to
 
31
    - create a temp table
 
32
    - when we reach the weed-out tab, walk through rowid-ed tabs and
 
33
      and copy rowids.
 
34
      For each table we need
 
35
       - rowid offset
 
36
       - null bit address.
 
37
*/
 
38
 
 
39
class SemiJoinTable : public Sql_alloc
 
40
{
 
41
public:
 
42
  /* Array of pointers to tables that should be "used" */
 
43
  class TAB
 
44
  {
 
45
  public:
 
46
    JoinTable *join_tab;
 
47
    uint32_t rowid_offset;
 
48
    uint16_t null_byte;
 
49
    unsigned char null_bit;
 
50
  };
 
51
  TAB *tabs;
 
52
  TAB *tabs_end;
 
53
 
 
54
  uint32_t null_bits;
 
55
  uint32_t null_bytes;
 
56
  uint32_t rowid_len;
 
57
 
 
58
  Table *tmp_table;
 
59
 
 
60
  MI_COLUMNDEF *start_recinfo;
 
61
  MI_COLUMNDEF *recinfo;
 
62
 
 
63
  /* Pointer to next table (next->start_idx > this->end_idx) */
 
64
  SemiJoinTable *next;
 
65
 
 
66
  Table *createTable(Session *session,
 
67
                     uint32_t uniq_tuple_length_arg);
 
68
  int reset();
 
69
};
 
70
 
 
71
#endif /* DRIZZLED_SEMI_JOIN_TABLE_H */