~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.h

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_CURSOR_H
21
 
#define DRIZZLED_CURSOR_H
 
20
#pragma once
22
21
 
23
22
#include <drizzled/atomics.h>
24
23
#include <drizzled/definitions.h>
31
30
#include <drizzled/message/table.h>
32
31
#include <drizzled/sql_list.h>
33
32
#include <drizzled/thr_lock.h>
34
 
#include <drizzled/xid.h>
35
33
 
36
34
#include <bitset>
37
35
#include <algorithm>
38
36
 
39
37
#include <drizzled/visibility.h>
40
38
 
41
 
namespace drizzled
42
 
{
 
39
namespace drizzled {
43
40
 
44
41
#define HA_MAX_ALTER_FLAGS 40
45
42
 
46
43
typedef std::bitset<HA_MAX_ALTER_FLAGS> HA_ALTER_FLAGS;
47
44
 
48
 
class AlterInfo;
49
 
class CreateField;
50
 
class ForeignKeyInfo;
51
 
class Item;
52
 
class Item_ident;
53
 
class LEX;
54
 
class Select_Lex;
55
 
class Select_Lex_Unit;
56
 
class String;
57
 
class Table;
58
 
class TableList;
59
 
class TableShare;
60
 
class select_result;
61
 
class sys_var_str;
62
 
struct Order;
63
 
 
64
45
typedef List<Item> List_item;
65
46
extern KEY_CREATE_INFO default_key_create_info;
66
47
 
67
 
/* Forward declaration for condition pushdown to storage engine */
68
 
typedef class Item COND;
69
 
 
70
 
typedef struct system_status_var system_status_var;
71
 
 
72
 
namespace optimizer { class CostVector; }
73
 
namespace plugin { class StorageEngine; }
74
 
 
75
48
/*
76
49
  bitmap with first N+1 bits set
77
50
  (keypart_map for a key prefix of [0..N] keyparts)
78
51
*/
79
 
template<class T>
80
 
inline key_part_map make_keypart_map(T a)
 
52
inline key_part_map make_keypart_map(int a)
81
53
{
82
54
  return (((key_part_map)2 << a) - 1);
83
55
}
86
58
  bitmap with first N bits set
87
59
  (keypart_map for a key prefix of [0..N-1] keyparts)
88
60
*/
89
 
template<class T>
90
 
inline key_part_map make_prev_keypart_map(T a)
 
61
inline key_part_map make_prev_keypart_map(int a)
91
62
{
92
63
  return (((key_part_map)1 << a) - 1);
93
64
}
199
170
    get_auto_increment().
200
171
  */
201
172
  uint64_t next_insert_id;
202
 
  uint64_t getNextInsertId()
 
173
  uint64_t getNextInsertId() const
203
174
  {
204
175
    return next_insert_id;
205
176
  }
207
178
  /**
208
179
    Used by SHOW TABLE STATUS to get the current auto_inc from the engine
209
180
  */
210
 
  uint64_t getAutoIncrement()
 
181
  uint64_t getAutoIncrement() const
211
182
  {
212
183
    return stats.auto_increment_value;
213
184
  }
252
223
  int updateRecord(const unsigned char * old_data, unsigned char * new_data) __attribute__ ((warn_unused_result));
253
224
  int deleteRecord(const unsigned char * buf) __attribute__ ((warn_unused_result));
254
225
  void ha_release_auto_increment();
255
 
 
256
 
  /** to be actually called to get 'check()' functionality*/
257
 
  int ha_check(Session *session, HA_CHECK_OPT *check_opt);
258
 
 
 
226
  int ha_check(Session*);
259
227
  void ha_start_bulk_insert(ha_rows rows);
260
228
  int ha_end_bulk_insert();
261
229
  int ha_delete_all_rows();
262
230
  int ha_reset_auto_increment(uint64_t value);
263
 
  int ha_analyze(Session* session, HA_CHECK_OPT* check_opt);
 
231
  int ha_analyze(Session*);
264
232
 
265
233
  int ha_disable_indexes(uint32_t mode);
266
234
  int ha_enable_indexes(uint32_t mode);
267
235
  int ha_discard_or_import_tablespace(bool discard);
268
 
  void closeMarkForDelete(const char *name);
 
236
  void closeMarkForDelete();
269
237
 
270
238
  void adjust_next_insert_id_after_explicit_value(uint64_t nr);
271
239
  int update_auto_increment();
632
600
    no new engine should ever use it). Right
633
601
    now HEAP does rely on it, so we cannot remove it.
634
602
  */
635
 
  virtual void drop_table(const char *name);
 
603
  virtual void drop_table();
636
604
};
637
605
 
638
606
extern const char *ha_row_type[];
640
608
/* basic stuff */
641
609
void ha_init_errors(void);
642
610
 
643
 
class SortField;
644
611
SortField *make_unireg_sortorder(Order *order, uint32_t *length,
645
612
                                 SortField *sortorder);
646
613
int setup_order(Session *session, Item **ref_pointer_array, TableList *tables,
681
648
                          bool is_if_not_exists);
682
649
 
683
650
bool create_like_table(Session* session,
684
 
                       identifier::Table::const_reference destination_identifier,
685
 
                       identifier::Table::const_reference source_identifier,
 
651
                       const identifier::Table& destination_identifier,
 
652
                       const identifier::Table& source_identifier,
686
653
                       message::Table &create_table_proto,
687
654
                       bool is_if_not_exists,
688
655
                       bool is_engine_set);
747
714
 
748
715
} /* namespace drizzled */
749
716
 
750
 
#endif /* DRIZZLED_CURSOR_H */