~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share.h

  • Committer: Monty Taylor
  • Date: 2010-03-11 18:27:20 UTC
  • mfrom: (1333 staging)
  • mto: This revision was merged to the branch mainline in revision 1348.
  • Revision ID: mordred@inaugust.com-20100311182720-hd1h87y6cb1b1mp0
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    max_rows(0),
59
59
    table_proto(NULL),
60
60
    storage_engine(NULL),
61
 
    tmp_table(NO_TMP_TABLE),
 
61
    tmp_table(STANDARD_TABLE),
62
62
    ref_count(0),
63
63
    null_bytes(0),
64
64
    last_null_bit_pos(0),
119
119
    max_rows(0),
120
120
    table_proto(NULL),
121
121
    storage_engine(NULL),
122
 
    tmp_table(NO_TMP_TABLE),
 
122
    tmp_table(STANDARD_TABLE),
123
123
    ref_count(0),
124
124
    null_bytes(0),
125
125
    last_null_bit_pos(0),
199
199
  LEX_STRING path;      /* Path to table (from datadir) */
200
200
  LEX_STRING normalized_path;           /* unpack_filename(path) */
201
201
 
 
202
  const char *getTableName() const
 
203
  {
 
204
    return table_name.str;
 
205
  }
 
206
 
 
207
  const char *getSchemaName() const
 
208
  {
 
209
    return db.str;
 
210
  }
 
211
 
202
212
  uint32_t   block_size;                   /* create information */
203
213
  uint64_t   version;
204
214
  uint32_t   timestamp_offset;          /* Set to offset+1 of record */
206
216
  uint32_t   stored_rec_length;         /* Stored record length*/
207
217
  enum row_type row_type;               /* How rows are stored */
208
218
 
 
219
  uint32_t getRecordLength()
 
220
  {
 
221
    return reclength;
 
222
  }
 
223
 
209
224
private:
210
225
  /* Max rows is a hint to HEAP during a create tmp table */
211
226
  uint64_t max_rows;
213
228
  message::Table *table_proto;
214
229
public:
215
230
 
 
231
  const char * getTableTypeAsString() const
 
232
  {
 
233
    switch (table_proto->type())
 
234
    {
 
235
    default:
 
236
    case message::Table::STANDARD:
 
237
      return "STANDARD";
 
238
    case message::Table::TEMPORARY:
 
239
      return "TEMPORARY";
 
240
    case message::Table::INTERNAL:
 
241
      return "INTERNAL";
 
242
    case message::Table::FUNCTION:
 
243
      return "FUNCTION";
 
244
    }
 
245
  }
 
246
 
216
247
  /* This is only used in one location currently */
 
248
  inline message::Table *getTableProto() const
 
249
  {
 
250
    return table_proto;
 
251
  }
 
252
 
217
253
  inline void setTableProto(message::Table *arg)
218
254
  {
219
255
    assert(table_proto == NULL);
255
291
    max_rows= arg;
256
292
  }
257
293
 
 
294
  /**
 
295
   * Returns true if the supplied Field object
 
296
   * is part of the table's primary key.
 
297
   */
 
298
  bool fieldInPrimaryKey(Field *field) const;
 
299
 
258
300
  plugin::StorageEngine *storage_engine;                        /* storage engine plugin */
259
301
  inline plugin::StorageEngine *db_type() const /* table_type for handler */
260
302
  {
444
486
      If someone is waiting for this to be deleted, inform it about this.
445
487
      Don't do a delete until we know that no one is refering to this anymore.
446
488
    */
447
 
    if (tmp_table == NO_TMP_TABLE)
 
489
    if (tmp_table == STANDARD_TABLE)
448
490
    {
449
491
      /* share->mutex is locked in release_table_share() */
450
492
      while (waiting_on_cond)