~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/optimizer/quick_range.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

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; 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
#include "drizzled/memory/sql_alloc.h"
 
24
#include "drizzled/base.h"
 
25
 
 
26
namespace drizzled
 
27
{
 
28
 
 
29
namespace optimizer
 
30
{
 
31
 
 
32
class QuickRange : public memory::SqlAlloc
 
33
{
 
34
public:
 
35
  unsigned char *min_key;
 
36
  unsigned char *max_key;
 
37
  uint16_t min_length;
 
38
  uint16_t max_length;
 
39
  uint16_t flag;
 
40
  key_part_map min_keypart_map; /**< bitmap of used keyparts in min_key */
 
41
  key_part_map max_keypart_map; /**< bitmap of used keyparts in max_key */
 
42
 
 
43
  QuickRange(); /**< Constructor for a "full range" */
 
44
  QuickRange(const unsigned char *min_key_arg,
 
45
              uint32_t min_length_arg,
 
46
              key_part_map min_keypart_map_arg,
 
47
                    const unsigned char *max_key_arg,
 
48
              uint32_t max_length_arg,
 
49
              key_part_map max_keypart_map_arg,
 
50
                    uint32_t flag_arg)
 
51
    :
 
52
      min_key((unsigned char*) memory::sql_memdup(min_key_arg,min_length_arg+1)),
 
53
      max_key((unsigned char*) memory::sql_memdup(max_key_arg,max_length_arg+1)),
 
54
      min_length((uint16_t) min_length_arg),
 
55
      max_length((uint16_t) max_length_arg),
 
56
      flag((uint16_t) flag_arg),
 
57
      min_keypart_map(min_keypart_map_arg),
 
58
      max_keypart_map(max_keypart_map_arg)
 
59
    {}
 
60
};
 
61
 
 
62
} /* namespace optimizer */
 
63
 
 
64
} /* namespace drizzled */
 
65
 
 
66
#endif /* DRIZZLED_OPTIMIZER_QUICK_RANGE_H */