~drizzle-trunk/drizzle/development

575.4.7 by Monty Taylor
More header cleanup.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
575.4.7 by Monty Taylor
More header cleanup.
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
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
20
21
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
22
#pragma once
575.4.7 by Monty Taylor
More header cleanup.
23
798.2.22 by Brian Aker
Removing include structures to old replication
24
#include <drizzled/table.h>
2151.2.10 by Olaf van der Spek
Const fixes
25
#include <drizzled/table_list.h>
1859.2.6 by Brian Aker
Merge in a bit more strictness around table type.
26
#include <drizzled/table/concurrent.h>
575.4.7 by Monty Taylor
More header cleanup.
27
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
28
#include <drizzled/visibility.h>
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
29
2252.1.17 by Olaf van der Spek
Common fwd
30
namespace drizzled {
575.4.7 by Monty Taylor
More header cleanup.
31
2318.2.16 by Olaf van der Spek
Refactor
32
void table_cache_free();
1669 by Brian Aker
This patch turns the table_cache into boost::unordered_multimap.
33
1877.2.4 by Brian Aker
Shift over to cache definition in table/cache
34
table::Cache &get_open_cache();
575.4.7 by Monty Taylor
More header cleanup.
35
2318.2.16 by Olaf van der Spek
Refactor
36
DRIZZLED_API void kill_drizzle();
575.4.7 by Monty Taylor
More header cleanup.
37
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
38
/* sql_base.cc */
39
void set_item_name(Item *item,char *pos,uint32_t length);
2445.1.11 by Olaf van der Spek
Use str_ref
40
bool add_field_to_list(Session *session, str_ref field_name, enum enum_field_types type,
2318.8.6 by Olaf van der Spek
Add const
41
                       const char *length, const char *decimal,
1109.1.5 by Brian Aker
More extraction from sql_base
42
                       uint32_t type_modifier,
43
                       enum column_format_type column_format,
44
                       Item *default_value, Item *on_update_value,
2440.2.9 by Olaf van der Spek
Refactor
45
                       str_ref comment,
2318.8.6 by Olaf van der Spek
Add const
46
                       const char *change, List<String> *interval_list,
2254 by Brian Aker
Shift CHARSET_INFO to charset_info_st
47
                       const charset_info_st * const cs);
2318.8.6 by Olaf van der Spek
Add const
48
CreateField * new_create_field(Session *session, const char *field_name, enum_field_types type,
49
                               const char *length, const char *decimals,
1109.1.5 by Brian Aker
More extraction from sql_base
50
                               uint32_t type_modifier,
51
                               Item *default_value, Item *on_update_value,
2445.1.11 by Olaf van der Spek
Use str_ref
52
                               str_ref comment, const char *change,
2254 by Brian Aker
Shift CHARSET_INFO to charset_info_st
53
                               List<String> *interval_list, charset_info_st *cs);
2241.2.13 by Olaf van der Spek
Refactor
54
void push_new_name_resolution_context(Session&, TableList& left_op, TableList& right_op);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
55
void add_join_on(TableList *b,Item *expr);
56
void add_join_natural(TableList *a,TableList *b,List<String> *using_fields,
846 by Brian Aker
Removing on typedeffed class.
57
                      Select_Lex *lex);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
58
extern Item **not_found_item;
59
1055.2.13 by Jay Pipes
Documentation and style fixes in Session class. Doxygen should finally pick up the Statement and Session classes now. Removes the silly Query_arena class, as it's not needed anymore.
60
/**
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
61
  A set of constants used for checking non aggregated fields and sum
62
  functions mixture in the ONLY_FULL_GROUP_BY_MODE.
63
*/
1089.6.3 by Padraig O'Sullivan
Replaced an instance where a uint8_t type was being used to hold a
64
enum enum_group_by_mode_type
65
{
66
  NON_AGG_FIELD_USED= 0,
67
  SUM_FUNC_USED
68
};
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
69
1055.2.13 by Jay Pipes
Documentation and style fixes in Session class. Doxygen should finally pick up the Statement and Session classes now. Removes the silly Query_arena class, as it's not needed anymore.
70
/**
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
71
  This enumeration type is used only by the function find_item_in_list
72
  to return the info on how an item has been resolved against a list
73
  of possibly aliased items.
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
74
  The item can be resolved:
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
75
   - against an alias name of the list's element (RESOLVED_AGAINST_ALIAS)
76
   - against non-aliased field name of the list  (RESOLVED_WITH_NO_ALIAS)
77
   - against an aliased field name of the list   (RESOLVED_BEHIND_ALIAS)
78
   - ignoring the alias name in cases when SQL requires to ignore aliases
79
     (e.g. when the resolved field reference contains a table name or
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
80
     when the resolved item is an expression)   (RESOLVED_IGNORING_ALIAS)
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
81
*/
82
enum enum_resolution_type {
83
  NOT_RESOLVED=0,
84
  RESOLVED_IGNORING_ALIAS,
85
  RESOLVED_BEHIND_ALIAS,
86
  RESOLVED_WITH_NO_ALIAS,
87
  RESOLVED_AGAINST_ALIAS
88
};
1578.6.3 by Brian Aker
More current_session removal.
89
Item ** find_item_in_list(Session *session,
90
                          Item *item, List<Item> &items, uint32_t *counter,
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
91
                          find_item_error_report_type report_error,
92
                          enum_resolution_type *resolution);
93
bool insert_fields(Session *session, Name_resolution_context *context,
1109.1.5 by Brian Aker
More extraction from sql_base
94
                   const char *db_name, const char *table_name,
2179.1.2 by Olaf van der Spek
x
95
                   List<Item>::iterator *it, bool any_privileges);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
96
bool setup_tables(Session *session, Name_resolution_context *context,
97
                  List<TableList> *from_clause, TableList *tables,
98
                  TableList **leaves, bool select_insert);
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
99
bool setup_tables_and_check_access(Session *session,
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
100
                                   Name_resolution_context *context,
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
101
                                   List<TableList> *from_clause,
102
                                   TableList *tables,
103
                                   TableList **leaves,
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
104
                                   bool select_insert);
1034.1.7 by Brian Aker
Remove dead bits to the end of functions.
105
int setup_wild(Session *session, List<Item> &fields,
106
               List<Item> *sum_func_list,
107
               uint32_t wild_num);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
108
bool setup_fields(Session *session, Item** ref_pointer_array,
109
                  List<Item> &item, enum_mark_columns mark_used_columns,
110
                  List<Item> *sum_func_list, bool allow_sum_func);
111
inline bool setup_fields_with_no_wrap(Session *session, Item **ref_pointer_array,
112
                                      List<Item> &item,
113
                                      enum_mark_columns mark_used_columns,
114
                                      List<Item> *sum_func_list,
115
                                      bool allow_sum_func)
116
{
117
  bool res;
118
  res= setup_fields(session, ref_pointer_array, item, mark_used_columns, sum_func_list,
119
                    allow_sum_func);
120
  return res;
121
}
1034.1.7 by Brian Aker
Remove dead bits to the end of functions.
122
int setup_conds(Session *session, TableList *leaves, COND **conds);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
123
/* open_and_lock_tables with optional derived handling */
124
TableList *find_table_in_list(TableList *table,
125
                               TableList *TableList::*link,
126
                               const char *db_name,
127
                               const char *table_name);
1220.1.13 by Brian Aker
Remove mysql_lock_have_duplicate() (we don't have merge, and our partition
128
TableList *unique_table(TableList *table, TableList *table_list,
129
                        bool check_alias= false);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
130
2275.3.1 by Olaf van der Spek
Remove table::Cache::singleton()
131
/* bits for last argument to table::Cache::removeTable() */
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
132
#define RTFC_NO_FLAG                0x0000
133
#define RTFC_OWNED_BY_Session_FLAG      0x0001
134
#define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002
135
#define RTFC_CHECK_KILLED_FLAG      0x0004
136
137
void mem_alloc_error(size_t size);
138
1235.1.11 by Brian Aker
Small cleanups, did in MERGE table only engine flag.
139
bool fill_record(Session* session, List<Item> &fields, List<Item> &values, bool ignore_errors= false);
140
bool fill_record(Session *session, Field **field, List<Item> &values, bool ignore_errors= false);
584.1.15 by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes.
141
inline TableList *find_table_in_global_list(TableList *table,
142
                                             const char *db_name,
143
                                             const char *table_name)
144
{
145
  return find_table_in_list(table, &TableList::next_global,
146
                            db_name, table_name);
147
}
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
148
2302.1.3 by Olaf van der Spek
New / make_shared doesn't return NULL
149
void drizzle_rm_tmp_tables();
2190.1.6 by Brian Aker
Remove duplicate symbols.
150
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
151
} /* namespace drizzled */
152