~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.h

  • Committer: Joseph Daly
  • Date: 2010-09-16 17:47:44 UTC
  • mto: (1774.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1775.
  • Revision ID: jdaly@rx7-20100916174744-9myzc6sigk4zrmtn
fix copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <drizzled/xid.h>
24
24
#include <drizzled/discrete_interval.h>
25
25
#include <drizzled/identifier.h>
26
 
#include <drizzled/definitions.h>
27
 
#include <drizzled/key_map.h>
28
26
 
29
27
/* Definitions for parameters to do with Cursor-routines */
30
28
 
38
36
 
39
37
#include <drizzled/message/table.pb.h>
40
38
 
 
39
/* Bits to show what an alter table will do */
 
40
#include <drizzled/sql_bitmap.h>
 
41
 
41
42
#include <bitset>
42
43
#include <algorithm>
43
44
 
55
56
class TableShare;
56
57
class Select_Lex_Unit;
57
58
class ForeignKeyInfo;
58
 
struct Order;
 
59
struct order_st;
59
60
 
60
61
class Item;
61
62
 
145
146
*/
146
147
class Cursor
147
148
{
148
 
  Table &table;               /* The current open table */
149
 
  plugin::StorageEngine &engine;      /* storage engine of this Cursor */
 
149
protected:
 
150
  TableShare *table_share;   /* The table definition */
 
151
  Table *table;               /* The current open table */
150
152
 
151
 
protected:
152
153
  ha_rows estimation_rows_to_insert;
153
 
 
 
154
  plugin::StorageEngine *engine;      /* storage engine of this Cursor */
154
155
public:
155
156
  inline plugin::StorageEngine *getEngine() const       /* table_type for handler */
156
157
  {
157
 
    return &engine;
 
158
    return engine;
158
159
  }
159
160
  unsigned char *ref;                           /* Pointer to current row */
160
161
  unsigned char *dup_ref;                       /* Pointer to duplicate row */
161
162
 
162
 
  TableShare *getShare();
163
 
 
164
 
  Table *getTable() const
 
163
  TableShare *getShare() const
165
164
  {
166
 
    return &table;
 
165
    return table_share;
167
166
  }
168
167
 
169
168
  ha_statistics stats;
224
223
  */
225
224
  Discrete_interval auto_inc_interval_for_cur_row;
226
225
 
227
 
  Cursor(plugin::StorageEngine &engine_arg, Table &share_arg);
 
226
  Cursor(plugin::StorageEngine &engine_arg, TableShare &share_arg);
228
227
  virtual ~Cursor(void);
229
228
  virtual Cursor *clone(memory::Root *mem_root);
230
229
 
231
230
  /* ha_ methods: pubilc wrappers for private virtual API */
232
231
 
233
 
  int ha_open(const TableIdentifier &identifier, int mode, int test_if_locked);
 
232
  int ha_open(const TableIdentifier &identifier, Table *table, int mode, int test_if_locked);
234
233
  int startIndexScan(uint32_t idx, bool sorted);
235
234
  int endIndexScan();
236
235
  int startTableScan(bool scan);
268
267
 
269
268
  void adjust_next_insert_id_after_explicit_value(uint64_t nr);
270
269
  int update_auto_increment();
 
270
  virtual void change_table_ptr(Table *table_arg, TableShare *share);
271
271
 
272
272
  /* Estimates calculation */
273
273
  virtual double scan_time(void)
475
475
    or partitioned.
476
476
 
477
477
    @note that one can NOT rely on table->in_use in store_lock().  It may
478
 
    refer to a different thread if called from abortLockForThread().
 
478
    refer to a different thread if called from mysql_lock_abort_for_thread().
479
479
 
480
480
    @note If the table is MERGE, store_lock() can return less locks
481
481
    than lock_count() claimed. This can happen when the MERGE children
522
522
    the corresponding 'ha_*' method above.
523
523
  */
524
524
 
525
 
  virtual int open(const char *, int , uint32_t ) { assert(0); return -1; }
 
525
  virtual int open(const char *, int , uint32_t ) { assert(0); return -1; };
526
526
  virtual int doOpen(const TableIdentifier &identifier, int mode, uint32_t test_if_locked);
527
527
  virtual int doStartIndexScan(uint32_t idx, bool)
528
528
  { active_index= idx; return 0; }
583
583
  {
584
584
    return 0;
585
585
  }
586
 
  virtual void release_auto_increment(void) { return; }
 
586
  virtual void release_auto_increment(void) { return; };
587
587
  /** admin commands - called from mysql_admin_table */
588
588
  virtual int check(Session *)
589
589
  { return HA_ADMIN_NOT_IMPLEMENTED; }
640
640
void ha_init_errors(void);
641
641
 
642
642
class SortField;
643
 
SortField *make_unireg_sortorder(Order *order, uint32_t *length,
 
643
SortField *make_unireg_sortorder(order_st *order, uint32_t *length,
644
644
                                 SortField *sortorder);
645
645
int setup_order(Session *session, Item **ref_pointer_array, TableList *tables,
646
 
                List<Item> &fields, List <Item> &all_fields, Order *order);
 
646
                List<Item> &fields, List <Item> &all_fields, order_st *order);
647
647
int setup_group(Session *session, Item **ref_pointer_array, TableList *tables,
648
 
                List<Item> &fields, List<Item> &all_fields, Order *order,
 
648
                List<Item> &fields, List<Item> &all_fields, order_st *order,
649
649
                bool *hidden_group_fields);
650
650
bool fix_inner_refs(Session *session, List<Item> &all_fields, Select_Lex *select,
651
651
                    Item **ref_pointer_array);
692
692
                        TableIdentifier &new_identifier);
693
693
 
694
694
bool mysql_prepare_update(Session *session, TableList *table_list,
695
 
                          Item **conds, uint32_t order_num, Order *order);
 
695
                          Item **conds, uint32_t order_num, order_st *order);
696
696
int mysql_update(Session *session,TableList *tables,List<Item> &fields,
697
697
                 List<Item> &values,COND *conds,
698
 
                 uint32_t order_num, Order *order, ha_rows limit,
 
698
                 uint32_t order_num, order_st *order, ha_rows limit,
699
699
                 enum enum_duplicates handle_duplicates, bool ignore);
700
700
bool mysql_prepare_insert(Session *session, TableList *table_list, Table *table,
701
701
                          List<Item> &fields, List_item *values,