~drizzle-trunk/drizzle/development

1237.13.5 by Padraig O'Sullivan
Split some classes from the range optimizer out in to their own header and implementation files.
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; 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_OPTIMIZER_QUICK_RANGE_H
21
#define DRIZZLED_OPTIMIZER_QUICK_RANGE_H
22
23
namespace drizzled
24
{
25
26
namespace optimizer
27
{
28
1240.3.1 by Brian Aker
Merge Padraig.
29
class QuickRange : public Sql_alloc
1237.13.5 by Padraig O'Sullivan
Split some classes from the range optimizer out in to their own header and implementation files.
30
{
31
public:
32
  unsigned char *min_key;
33
  unsigned char *max_key;
34
  uint16_t min_length;
35
  uint16_t max_length;
36
  uint16_t flag;
37
  key_part_map min_keypart_map; /**< bitmap of used keyparts in min_key */
38
  key_part_map max_keypart_map; /**< bitmap of used keyparts in max_key */
39
40
  QuickRange(); /**< Constructor for a "full range" */
41
  QuickRange(const unsigned char *min_key_arg,
42
              uint32_t min_length_arg,
43
              key_part_map min_keypart_map_arg,
1240.3.1 by Brian Aker
Merge Padraig.
44
	            const unsigned char *max_key_arg,
1237.13.5 by Padraig O'Sullivan
Split some classes from the range optimizer out in to their own header and implementation files.
45
              uint32_t max_length_arg,
46
              key_part_map max_keypart_map_arg,
47
	            uint32_t flag_arg)
1240.3.1 by Brian Aker
Merge Padraig.
48
    :
1237.13.5 by Padraig O'Sullivan
Split some classes from the range optimizer out in to their own header and implementation files.
49
      min_key((unsigned char*) sql_memdup(min_key_arg,min_length_arg+1)),
50
      max_key((unsigned char*) sql_memdup(max_key_arg,max_length_arg+1)),
51
      min_length((uint16_t) min_length_arg),
52
      max_length((uint16_t) max_length_arg),
53
      flag((uint16_t) flag_arg),
54
      min_keypart_map(min_keypart_map_arg),
55
      max_keypart_map(max_keypart_map_arg)
56
    {}
57
};
58
59
} /* namespace optimizer */
60
61
} /* namespace drizzled */
62
63
#endif /* DRIZZLED_OPTIMIZER_QUICK_RANGE_H */