~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

  • Committer: Monty Taylor
  • Date: 2009-03-26 00:22:17 UTC
  • mto: (968.2.25 mordred)
  • mto: This revision was merged to the branch mainline in revision 971.
  • Revision ID: mordred@inaugust.com-20090326002217-6p53ncqutcwn0g2g
Removed extra space.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
      session->ha_data[xxx_engine.slot]
99
99
 
100
100
   slot number is initialized by MySQL after xxx_init() is called.
101
 
   */
102
 
   uint32_t slot;
103
 
   std::bitset<HTON_BIT_SIZE> flags; /* global handler flags */
104
 
   /*
105
 
     to store per-savepoint data storage engine is provided with an area
106
 
     of a requested size (0 is ok here).
107
 
     savepoint_offset must be initialized statically to the size of
108
 
     the needed memory to store per-savepoint information.
109
 
     After xxx_init it is changed to be an offset to savepoint storage
110
 
     area and need not be used by storage engine.
111
 
     see binlog_engine and binlog_savepoint_set/rollback for an example.
112
 
   */
113
 
   uint32_t savepoint_offset;
114
 
   uint32_t license; /* Flag for Engine License */
 
101
  */
 
102
  uint32_t slot;
 
103
  std::bitset<HTON_BIT_SIZE> flags; /* global handler flags */
 
104
  /*
 
105
    to store per-savepoint data storage engine is provided with an area
 
106
    of a requested size (0 is ok here).
 
107
    savepoint_offset must be initialized statically to the size of
 
108
    the needed memory to store per-savepoint information.
 
109
    After xxx_init it is changed to be an offset to savepoint storage
 
110
    area and need not be used by storage engine.
 
111
    see binlog_engine and binlog_savepoint_set/rollback for an example.
 
112
  */
 
113
  uint32_t savepoint_offset;
 
114
  uint32_t license; /* Flag for Engine License */
115
115
 
116
116
  StorageEngine(const std::string &name_arg, bool support_2pc= false)
117
117
    : name(name_arg), two_phase_commit(support_2pc), savepoint_offset(0)  {}
123
123
  }
124
124
 
125
125
 
126
 
 
127
 
   bool is_enabled() const
128
 
   {
129
 
     return (state == SHOW_OPTION_YES);
130
 
   }
131
 
 
132
 
   std::string get_name() { return name; }
133
 
 
134
 
   /*
135
 
     StorageEngine methods:
136
 
 
137
 
     close_connection is only called if
138
 
     session->ha_data[xxx_engine.slot] is non-zero, so even if you don't need
139
 
     this storage area - set it to something, so that MySQL would know
140
 
     this storage engine was accessed in this connection
141
 
   */
142
 
   virtual int close_connection(Session  *)
143
 
   {
144
 
     return 0;
145
 
   }
146
 
   /*
147
 
     The void * points to an uninitialized storage area of requested size
148
 
     (see savepoint_offset description)
149
 
   */
150
 
   virtual int savepoint_set(Session *, void *)
151
 
   {
152
 
     return 0;
153
 
   }
154
 
 
155
 
   /*
156
 
     The void * points to a storage area, that was earlier passed
157
 
     to the savepoint_set call
158
 
   */
159
 
   virtual int savepoint_rollback(Session *, void *)
160
 
   {
161
 
     return 0;
162
 
   }
163
 
 
164
 
   virtual int savepoint_release(Session *, void *)
165
 
   {
166
 
     return 0;
167
 
   }
168
 
 
169
 
   /*
170
 
     'all' is true if it's a real commit, that makes persistent changes
171
 
     'all' is false if it's not in fact a commit but an end of the
172
 
     statement that is part of the transaction.
173
 
     NOTE 'all' is also false in auto-commit mode where 'end of statement'
174
 
     and 'real commit' mean the same event.
175
 
   */
176
 
   virtual int  commit(Session *, bool)
177
 
   {
178
 
     return 0;
179
 
   }
180
 
 
181
 
   virtual int  rollback(Session *, bool)
182
 
   {
183
 
     return 0;
184
 
   }
185
 
 
186
 
   virtual int  prepare(Session *, bool) { return 0; }
187
 
   virtual int  recover(XID *, uint32_t) { return 0; }
188
 
   virtual int  commit_by_xid(XID *) { return 0; }
189
 
   virtual int  rollback_by_xid(XID *) { return 0; }
190
 
   virtual handler *create(TABLE_SHARE *, MEM_ROOT *)= 0;
191
 
   /* args: path */
192
 
   virtual void drop_database(char*) { }
193
 
   virtual int start_consistent_snapshot(Session *) { return 0; }
194
 
   virtual bool flush_logs() { return false; }
195
 
   virtual bool show_status(Session *, stat_print_fn *, enum ha_stat_type)
196
 
   {
197
 
     return false;
198
 
   }
199
 
 
200
 
   /* args: current_session, tables, cond */
201
 
   virtual int fill_files_table(Session *, TableList *,
202
 
                                Item *) { return 0; }
203
 
   virtual int release_temporary_latches(Session *) { return false; }
204
 
 
205
 
   /* args: current_session, db, name */
206
 
   virtual int table_exists_in_engine(Session*, const char *, const char *);
 
126
  bool is_enabled() const
 
127
  {
 
128
    return (state == SHOW_OPTION_YES);
 
129
  }
 
130
 
 
131
  std::string get_name() { return name; }
 
132
 
 
133
  /*
 
134
    StorageEngine methods:
 
135
 
 
136
    close_connection is only called if
 
137
    session->ha_data[xxx_engine.slot] is non-zero, so even if you don't need
 
138
    this storage area - set it to something, so that MySQL would know
 
139
    this storage engine was accessed in this connection
 
140
  */
 
141
  virtual int close_connection(Session  *)
 
142
  {
 
143
    return 0;
 
144
  }
 
145
  /*
 
146
    The void * points to an uninitialized storage area of requested size
 
147
    (see savepoint_offset description)
 
148
  */
 
149
  virtual int savepoint_set(Session *, void *)
 
150
  {
 
151
    return 0;
 
152
  }
 
153
 
 
154
  /*
 
155
    The void * points to a storage area, that was earlier passed
 
156
    to the savepoint_set call
 
157
  */
 
158
  virtual int savepoint_rollback(Session *, void *)
 
159
  {
 
160
    return 0;
 
161
  }
 
162
 
 
163
  virtual int savepoint_release(Session *, void *)
 
164
  {
 
165
    return 0;
 
166
  }
 
167
 
 
168
  /*
 
169
    'all' is true if it's a real commit, that makes persistent changes
 
170
    'all' is false if it's not in fact a commit but an end of the
 
171
    statement that is part of the transaction.
 
172
    NOTE 'all' is also false in auto-commit mode where 'end of statement'
 
173
    and 'real commit' mean the same event.
 
174
  */
 
175
  virtual int  commit(Session *, bool)
 
176
  {
 
177
    return 0;
 
178
  }
 
179
 
 
180
  virtual int  rollback(Session *, bool)
 
181
  {
 
182
    return 0;
 
183
  }
 
184
 
 
185
  virtual int  prepare(Session *, bool) { return 0; }
 
186
  virtual int  recover(XID *, uint32_t) { return 0; }
 
187
  virtual int  commit_by_xid(XID *) { return 0; }
 
188
  virtual int  rollback_by_xid(XID *) { return 0; }
 
189
  virtual handler *create(TABLE_SHARE *, MEM_ROOT *)= 0;
 
190
  /* args: path */
 
191
  virtual void drop_database(char*) { }
 
192
  virtual int start_consistent_snapshot(Session *) { return 0; }
 
193
  virtual bool flush_logs() { return false; }
 
194
  virtual bool show_status(Session *, stat_print_fn *, enum ha_stat_type)
 
195
  {
 
196
    return false;
 
197
  }
 
198
 
 
199
  /* args: current_session, tables, cond */
 
200
  virtual int fill_files_table(Session *, TableList *,
 
201
                               Item *) { return 0; }
 
202
  virtual int release_temporary_latches(Session *) { return false; }
 
203
 
 
204
  /* args: current_session, db, name */
 
205
  virtual int table_exists_in_engine(Session*, const char *, const char *);
207
206
};
208
207
 
209
208