~posulliv/drizzle/memcached_applier

« back to all changes in this revision

Viewing changes to drizzled/handler.h

  • Committer: Jay Pipes
  • Date: 2009-08-03 14:23:22 UTC
  • mfrom: (1039.2.68 staging)
  • mto: This revision was merged to the branch mainline in revision 1078.
  • Revision ID: jpipes@serialcoder-20090803142322-1g67h7su9mocg9ig
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
 
90
90
class COST_VECT;
91
91
 
92
 
uint16_t &mrr_persistent_flag_storage(range_seq_t seq, uint32_t idx);
93
 
char* &mrr_get_ptr_by_idx(range_seq_t seq, uint32_t idx);
94
 
 
95
92
uint32_t calculate_key_len(Table *, uint, const unsigned char *, key_part_map);
96
93
/*
97
94
  bitmap with first N+1 bits set
845
842
  virtual void drop_table(const char *name);
846
843
};
847
844
 
848
 
 
849
 
 
850
 
/**
851
 
  A Disk-Sweep MRR interface implementation
852
 
 
853
 
  This implementation makes range (and, in the future, 'ref') scans to read
854
 
  table rows in disk sweeps.
855
 
 
856
 
  Currently it is used by MyISAM and InnoDB. Potentially it can be used with
857
 
  any table handler that has non-clustered indexes and on-disk rows.
858
 
*/
859
 
 
860
 
class DsMrr_impl
861
 
{
862
 
public:
863
 
  typedef void (handler::*range_check_toggle_func_t)(bool on);
864
 
 
865
 
  DsMrr_impl()
866
 
    : h2(NULL) {};
867
 
 
868
 
  handler *h; /* The "owner" handler object. It is used for scanning the index */
869
 
  Table *table; /* Always equal to h->table */
870
 
private:
871
 
  /*
872
 
    Secondary handler object. It is used to retrieve full table rows by
873
 
    calling rnd_pos().
874
 
  */
875
 
  handler *h2;
876
 
 
877
 
  /* Buffer to store rowids, or (rowid, range_id) pairs */
878
 
  unsigned char *rowids_buf;
879
 
  unsigned char *rowids_buf_cur;   /* Current position when reading/writing */
880
 
  unsigned char *rowids_buf_last;  /* When reading: end of used buffer space */
881
 
  unsigned char *rowids_buf_end;   /* End of the buffer */
882
 
 
883
 
  bool dsmrr_eof; /* true <=> We have reached EOF when reading index tuples */
884
 
 
885
 
  /* true <=> need range association, buffer holds {rowid, range_id} pairs */
886
 
  bool is_mrr_assoc;
887
 
 
888
 
  bool use_default_impl; /* true <=> shortcut all calls to default MRR impl */
889
 
public:
890
 
  void init(handler *h_arg, Table *table_arg)
891
 
  {
892
 
    h= h_arg;
893
 
    table= table_arg;
894
 
  }
895
 
  int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
896
 
                 void *seq_init_param, uint32_t n_ranges, uint32_t mode,
897
 
                 HANDLER_BUFFER *buf);
898
 
  void dsmrr_close();
899
 
  int dsmrr_fill_buffer(handler *h);
900
 
  int dsmrr_next(handler *h, char **range_info);
901
 
 
902
 
  int dsmrr_info(uint32_t keyno, uint32_t n_ranges, uint32_t keys, uint32_t *bufsz,
903
 
                 uint32_t *flags, COST_VECT *cost);
904
 
 
905
 
  ha_rows dsmrr_info_const(uint32_t keyno, RANGE_SEQ_IF *seq,
906
 
                            void *seq_init_param, uint32_t n_ranges, uint32_t *bufsz,
907
 
                            uint32_t *flags, COST_VECT *cost);
908
 
private:
909
 
  bool key_uses_partial_cols(uint32_t keyno);
910
 
  bool choose_mrr_impl(uint32_t keyno, ha_rows rows, uint32_t *flags, uint32_t *bufsz,
911
 
                       COST_VECT *cost);
912
 
  bool get_disk_sweep_mrr_cost(uint32_t keynr, ha_rows rows, uint32_t flags,
913
 
                               uint32_t *buffer_size, COST_VECT *cost);
914
 
};
915
 
 
916
845
extern const char *ha_row_type[];
917
846
extern const char *tx_isolation_names[];
918
847
extern const char *binlog_format_names[];
938
867
int ha_create_table(Session *session, const char *path,
939
868
                    const char *db, const char *table_name,
940
869
                    HA_CREATE_INFO *create_info,
941
 
                    bool update_create_info);
 
870
                    bool update_create_info,
 
871
                    drizzled::message::Table *table_proto);
942
872
int ha_delete_table(Session *session, const char *path,
943
873
                    const char *db, const char *alias, bool generate_warning);
944
874
 
947
877
 
948
878
int ha_find_files(Session *session,const char *db,const char *path,
949
879
                  const char *wild, bool dir, List<LEX_STRING>* files);
950
 
int ha_table_exists_in_engine(Session* session, const char* db, const char* name, StorageEngine **engine= NULL);
951
880
 
952
881
/* key cache */
953
882
extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);