~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.h

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include <bitset>
45
45
#include <algorithm>
46
46
 
 
47
namespace drizzled
 
48
{
 
49
 
47
50
#define HA_MAX_ALTER_FLAGS 40
48
51
 
49
52
 
80
83
typedef struct st_sort_field SORT_FIELD;
81
84
 
82
85
typedef List<Item> List_item;
83
 
 
84
 
typedef struct st_savepoint SAVEPOINT;
85
 
extern uint32_t savepoint_alloc_size;
86
86
extern KEY_CREATE_INFO default_key_create_info;
87
87
 
88
88
/* Forward declaration for condition pushdown to storage engine */
161
161
  must be set to 0.
162
162
*/
163
163
 
164
 
class Cursor :public drizzled::memory::SqlAlloc
 
164
class Cursor :public memory::SqlAlloc
165
165
{
166
166
protected:
167
167
  TableShare *table_share;   /* The table definition */
169
169
 
170
170
  ha_rows estimation_rows_to_insert;
171
171
public:
172
 
  drizzled::plugin::StorageEngine *engine;      /* storage engine of this Cursor */
173
 
  inline drizzled::plugin::StorageEngine *getEngine() const     /* table_type for handler */
 
172
  plugin::StorageEngine *engine;      /* storage engine of this Cursor */
 
173
  inline plugin::StorageEngine *getEngine() const       /* table_type for handler */
174
174
  {
175
175
    return engine;
176
176
  }
236
236
  */
237
237
  Discrete_interval auto_inc_interval_for_cur_row;
238
238
 
239
 
  Cursor(drizzled::plugin::StorageEngine &engine_arg, TableShare &share_arg);
 
239
  Cursor(plugin::StorageEngine &engine_arg, TableShare &share_arg);
240
240
  virtual ~Cursor(void);
241
 
  virtual Cursor *clone(drizzled::memory::Root *mem_root);
 
241
  virtual Cursor *clone(memory::Root *mem_root);
242
242
 
243
243
  /* ha_ methods: pubilc wrappers for private virtual API */
244
244
 
678
678
extern const char *binlog_format_names[];
679
679
extern uint32_t total_ha, total_ha_2pc;
680
680
 
681
 
       /* Wrapper functions */
682
 
#define ha_commit(session) (ha_commit_trans((session), true))
683
 
#define ha_rollback(session) (ha_rollback_trans((session), true))
684
 
 
685
681
/* basic stuff */
686
682
int ha_init_errors(void);
687
683
int ha_init(void);
688
684
int ha_end(void);
689
685
 
690
 
/* transactions: interface to plugin::StorageEngine functions */
691
 
int ha_commit_one_phase(Session *session, bool all);
692
 
int ha_rollback_trans(Session *session, bool all);
693
 
 
694
 
/* transactions: these functions never call plugin::StorageEngine functions directly */
695
 
int ha_commit_trans(Session *session, bool all);
696
 
int ha_autocommit_or_rollback(Session *session, int error);
697
 
int ha_enable_transaction(Session *session, bool on);
698
 
 
699
 
/* savepoints */
700
 
int ha_rollback_to_savepoint(Session *session, SAVEPOINT *sv);
701
 
int ha_savepoint(Session *session, SAVEPOINT *sv);
702
 
int ha_release_savepoint(Session *session, SAVEPOINT *sv);
703
 
 
704
 
/* these are called by storage engines */
705
 
void trans_register_ha(Session *session, bool all, drizzled::plugin::StorageEngine *engine);
706
 
 
707
686
uint32_t filename_to_tablename(const char *from, char *to, uint32_t to_length);
708
687
bool tablename_to_filename(const char *from, char *to, size_t to_length);
709
688
 
717
696
        !((all ? &session->transaction.all : &session->transaction.stmt)->no_2pc))
718
697
 
719
698
 
720
 
bool mysql_xa_recover(Session *session);
721
 
 
722
699
SORT_FIELD * make_unireg_sortorder(order_st *order, uint32_t *length,
723
700
                                   SORT_FIELD *sortorder);
724
701
int setup_order(Session *session, Item **ref_pointer_array, TableList *tables,
743
720
                         int *timestamps, int *timestamps_with_niladic);
744
721
 
745
722
bool mysql_create_table(Session *session,
746
 
                        drizzled::TableIdentifier &identifier,
 
723
                        TableIdentifier &identifier,
747
724
                        HA_CREATE_INFO *create_info,
748
 
                        drizzled::message::Table *table_proto,
 
725
                        message::Table *table_proto,
749
726
                        AlterInfo *alter_info,
750
727
                        bool tmp_table, uint32_t select_field_count,
751
728
                        bool is_if_not_exists);
752
729
 
753
730
bool mysql_create_table_no_lock(Session *session,
754
 
                                drizzled::TableIdentifier &identifier,
 
731
                                TableIdentifier &identifier,
755
732
                                HA_CREATE_INFO *create_info,
756
 
                                drizzled::message::Table *table_proto,
 
733
                                message::Table *table_proto,
757
734
                                AlterInfo *alter_info,
758
735
                                bool tmp_table,
759
736
                                uint32_t select_field_count,
760
737
                                bool is_if_not_exists);
761
738
 
762
739
bool mysql_create_like_table(Session* session, TableList* table, TableList* src_table,
763
 
                             drizzled::message::Table& create_table_proto,
764
 
                             drizzled::plugin::StorageEngine*,
 
740
                             message::Table& create_table_proto,
 
741
                             plugin::StorageEngine*,
765
742
                             bool is_if_not_exists,
766
743
                             bool is_engine_set);
767
744
 
768
 
bool mysql_rename_table(drizzled::plugin::StorageEngine *base, const char *old_db,
 
745
bool mysql_rename_table(plugin::StorageEngine *base, const char *old_db,
769
746
                        const char * old_name, const char *new_db,
770
747
                        const char * new_name, uint32_t flags);
771
748
 
831
808
Field *
832
809
find_field_in_table_sef(Table *table, const char *name);
833
810
 
 
811
} /* namespace drizzled */
834
812
 
835
813
#endif /* DRIZZLED_CURSOR_H */