17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_CURSOR_H
21
#define DRIZZLED_CURSOR_H
23
#include <drizzled/xid.h>
22
#include <drizzled/atomics.h>
23
#include <drizzled/definitions.h>
24
24
#include <drizzled/discrete_interval.h>
25
#include <drizzled/error_t.h>
26
#include <drizzled/ha_statistics.h>
27
#include <drizzled/handler_structs.h>
25
28
#include <drizzled/identifier.h>
26
#include <drizzled/definitions.h>
27
29
#include <drizzled/key_map.h>
28
#include <drizzled/error_t.h>
30
/* Definitions for parameters to do with Cursor-routines */
30
#include <drizzled/message/table.h>
31
#include <drizzled/sql_list.h>
32
32
#include <drizzled/thr_lock.h>
33
#include <drizzled/sql_list.h>
34
#include <drizzled/handler_structs.h>
35
#include <drizzled/ha_statistics.h>
36
#include <drizzled/atomics.h>
38
#include <drizzled/message/table.h>
41
35
#include <algorithm>
43
#include "drizzled/visibility.h"
37
#include <drizzled/visibility.h>
48
41
#define HA_MAX_ALTER_FLAGS 40
50
43
typedef std::bitset<HA_MAX_ALTER_FLAGS> HA_ALTER_FLAGS;
59
class Select_Lex_Unit;
68
45
typedef List<Item> List_item;
69
46
extern KEY_CREATE_INFO default_key_create_info;
71
/* Forward declaration for condition pushdown to storage engine */
72
typedef class Item COND;
74
typedef struct system_status_var system_status_var;
76
namespace optimizer { class CostVector; }
77
namespace plugin { class StorageEngine; }
80
49
bitmap with first N+1 bits set
81
50
(keypart_map for a key prefix of [0..N] keyparts)
84
inline key_part_map make_keypart_map(T a)
52
inline key_part_map make_keypart_map(int a)
86
54
return (((key_part_map)2 << a) - 1);
90
58
bitmap with first N bits set
91
59
(keypart_map for a key prefix of [0..N-1] keyparts)
94
inline key_part_map make_prev_keypart_map(T a)
61
inline key_part_map make_prev_keypart_map(int a)
96
63
return (((key_part_map)1 << a) - 1);
258
225
void ha_release_auto_increment();
260
227
/** to be actually called to get 'check()' functionality*/
261
int ha_check(Session *session, HA_CHECK_OPT *check_opt);
228
int ha_check(Session*);
263
230
void ha_start_bulk_insert(ha_rows rows);
264
231
int ha_end_bulk_insert();
265
232
int ha_delete_all_rows();
266
233
int ha_reset_auto_increment(uint64_t value);
267
int ha_analyze(Session* session, HA_CHECK_OPT* check_opt);
234
int ha_analyze(Session*);
269
236
int ha_disable_indexes(uint32_t mode);
270
237
int ha_enable_indexes(uint32_t mode);
277
244
/* Estimates calculation */
278
245
virtual double scan_time(void)
279
{ return uint64_t2double(stats.data_file_length) / IO_SIZE + 2; }
246
{ return static_cast<double>(stats.data_file_length) / IO_SIZE + 2; }
280
247
virtual double read_time(uint32_t, uint32_t ranges, ha_rows rows)
281
{ return rows2double(ranges+rows); }
248
{ return ranges + rows; }
283
250
virtual double index_only_read_time(uint32_t keynr, double records);
644
611
/* basic stuff */
645
612
void ha_init_errors(void);
648
614
SortField *make_unireg_sortorder(Order *order, uint32_t *length,
649
615
SortField *sortorder);
650
616
int setup_order(Session *session, Item **ref_pointer_array, TableList *tables,
685
651
bool is_if_not_exists);
687
653
bool create_like_table(Session* session,
688
identifier::Table::const_reference destination_identifier,
689
identifier::Table::const_reference source_identifier,
654
const identifier::Table& destination_identifier,
655
const identifier::Table& source_identifier,
690
656
message::Table &create_table_proto,
691
657
bool is_if_not_exists,
692
658
bool is_engine_set);