Drizzled Public API Documentation

tmp_table_param.h
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, Inc.
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 
21 #pragma once
22 
23 #include <plugin/myisam/myisam.h>
24 
25 namespace drizzled {
26 
27 /*
28  Param to create temporary tables when doing SELECT:s
29  NOTE
30  This structure is copied using memcpy as a part of JOIN.
31 */
32 
33 class Tmp_Table_Param : public memory::SqlAlloc, boost::noncopyable
34 {
35 public:
36  KeyInfo *keyinfo;
37  List<Item> copy_funcs;
38  List<Item> save_copy_funcs;
39  CopyField *copy_field, *copy_field_end;
40  CopyField *save_copy_field, *save_copy_field_end;
41  unsigned char *group_buff;
42  Item **items_to_copy; /* Fields in tmp table */
43  MI_COLUMNDEF *recinfo,*start_recinfo;
44  ha_rows end_write_records;
45  uint32_t field_count;
46  uint32_t sum_func_count;
47  uint32_t func_count;
48  uint32_t hidden_field_count;
49  uint32_t group_parts,group_length,group_null_parts;
50  uint32_t quick_group;
51  bool using_indirect_summary_function;
52  bool schema_table;
53 
54  /*
55  True if GROUP BY and its aggregate functions are already computed
56  by a table access method (e.g. by loose index scan). In this case
57  query execution should not perform aggregation and should treat
58  aggregate functions as normal functions.
59  */
60  bool precomputed_group_by;
61 
62  bool force_copy_fields;
63 
64  /* If >0 convert all blob fields to varchar(convert_blob_length) */
65  uint32_t convert_blob_length;
66 
67  const charset_info_st *table_charset;
68 
69  Tmp_Table_Param() :
70  keyinfo(0),
71  copy_funcs(),
72  save_copy_funcs(),
73  copy_field(0),
74  copy_field_end(0),
75  save_copy_field(0),
76  save_copy_field_end(0),
77  group_buff(0),
78  items_to_copy(0),
79  recinfo(0),
80  start_recinfo(0),
81  end_write_records(0),
82  field_count(0),
83  sum_func_count(0),
84  func_count(0),
85  hidden_field_count(0),
86  group_parts(0),
87  group_length(0),
88  group_null_parts(0),
89  quick_group(0),
90  using_indirect_summary_function(false),
91  schema_table(false),
92  precomputed_group_by(false),
93  force_copy_fields(false),
94  convert_blob_length(0),
95  table_charset(0)
96  {}
97 
99  {
100  cleanup();
101  }
102  void init(void);
103  void cleanup(void);
104 };
105 
106 } /* namespace drizzled */
107 
TODO: Rename this file - func.h is stupid.