~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

  • Committer: Monty Taylor
  • Date: 2009-05-24 23:54:21 UTC
  • mfrom: (1014.2.12 kill-malloc)
  • mto: This revision was merged to the branch mainline in revision 1039.
  • Revision ID: mordred@inaugust.com-20090524235421-x5vfss90auzbn896
Merged Monty from lp:~mordred/drizzle/kill-malloc

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
  LEX_STRING cset;
64
64
} TABLE_FIELD_W_TYPE;
65
65
 
 
66
 
66
67
bool create_myisam_from_heap(Session *session, Table *table,
67
68
                             MI_COLUMNDEF *start_recinfo,
68
69
                             MI_COLUMNDEF **recinfo,
70
71
 
71
72
class Table {
72
73
public:
73
 
  Table() {}                               /* Remove gcc warning */
74
74
 
75
75
  TableShare    *s;
76
76
  Field **field;                        /* Pointer to fields */
210
210
  timestamp_auto_set_type timestamp_field_type;
211
211
  table_map     map;                    /* ID bit of table (1,2,4,8,16...) */
212
212
 
213
 
  REGINFO reginfo;                      /* field connections */
 
213
  RegInfo reginfo;                      /* field connections */
214
214
 
215
215
  /*
216
216
    Map of keys that can be used to retrieve all data from this table
255
255
  filesort_info_st sort;
256
256
 
257
257
 
 
258
  Table()
 
259
    : s(NULL), field(NULL), 
 
260
      file(NULL), next(NULL), prev(NULL),
 
261
      read_set(NULL), write_set(NULL),
 
262
      tablenr(0), db_stat(0),
 
263
      bitmap_init_value(NULL),
 
264
/* TODO: ensure that MY_BITMAP has a constructor for def_read_set, def_write_set and tmp_set */
 
265
      in_use(NULL),
 
266
      write_row_record(NULL), insert_values(NULL), key_info(NULL),
 
267
      next_number_field(NULL), found_next_number_field(NULL),
 
268
      timestamp_field(NULL),
 
269
      pos_in_table_list(NULL), group(NULL), alias(NULL), null_flags(NULL),
 
270
      lock_position(0), lock_data_start(0), lock_count(0),
 
271
      used_fields(0), temp_pool_slot(0),
 
272
      status(0), derived_select_number(0), current_lock(F_UNLCK),
 
273
      copy_blobs(false), maybe_null(false), null_row(false),
 
274
      force_index(false), distinct(false), const_table(false),
 
275
      no_rows(false), key_read(false), no_keyread(false),
 
276
      open_placeholder(false), locked_by_name(false), no_cache(false),
 
277
      auto_increment_field_not_null(false), insert_or_update(false),
 
278
      alias_name_used(false), get_fields_in_item_tree(false),
 
279
      query_id(0), quick_condition_rows(0),
 
280
      timestamp_field_type(TIMESTAMP_NO_AUTO_SET), map(0)
 
281
{
 
282
    memset(record, 0, sizeof(unsigned char *) * 2);
 
283
 
 
284
    covering_keys.reset();
 
285
 
 
286
    quick_keys.reset();
 
287
    merge_keys.reset();
 
288
 
 
289
    keys_in_use_for_query.reset();
 
290
    keys_in_use_for_group_by.reset();
 
291
    keys_in_use_for_order_by.reset();
 
292
 
 
293
    memset(quick_rows, 0, sizeof(query_id_t) * MAX_KEY);
 
294
    memset(const_key_parts, 0, sizeof(ha_rows) * MAX_KEY);
 
295
 
 
296
    memset(quick_key_parts, 0, sizeof(unsigned int) * MAX_KEY);
 
297
    memset(quick_n_ranges, 0, sizeof(unsigned int) * MAX_KEY);
 
298
 
 
299
    init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
 
300
    memset(&sort, 0, sizeof(filesort_info_st));
 
301
  }
 
302
 
 
303
  void reset(Session *session, TableShare *share, uint32_t db_stat_arg)
 
304
  {
 
305
 
 
306
    s= share;
 
307
    field= NULL;
 
308
 
 
309
    file= NULL;
 
310
    next= NULL;
 
311
    prev= NULL;
 
312
 
 
313
    read_set= NULL;
 
314
    write_set= NULL;
 
315
 
 
316
    tablenr= 0;
 
317
    db_stat= db_stat_arg;
 
318
 
 
319
    bitmap_init_value= NULL;
 
320
 
 
321
    in_use= session;
 
322
    memset(record, 0, sizeof(unsigned char *) * 2);
 
323
 
 
324
    write_row_record= NULL;
 
325
    insert_values= NULL;
 
326
    key_info= NULL;
 
327
    next_number_field= NULL;
 
328
    found_next_number_field= NULL;
 
329
    timestamp_field= NULL;
 
330
 
 
331
    pos_in_table_list= NULL;
 
332
    group= NULL;
 
333
    alias= NULL;
 
334
    null_flags= NULL;
 
335
     
 
336
    lock_position= 0;
 
337
    lock_data_start= 0;
 
338
    lock_count= 0;
 
339
    used_fields= 0;
 
340
    temp_pool_slot= 0;
 
341
    status= 0;
 
342
    derived_select_number= 0;
 
343
    current_lock= F_UNLCK;
 
344
    copy_blobs= false;
 
345
 
 
346
    maybe_null= false;
 
347
 
 
348
    null_row= false;
 
349
 
 
350
    force_index= false;
 
351
    distinct= false;
 
352
    const_table= false;
 
353
    no_rows= false;
 
354
    key_read= false;
 
355
    no_keyread= false;
 
356
 
 
357
    open_placeholder= false;
 
358
    locked_by_name= false;
 
359
    no_cache= false;
 
360
 
 
361
    auto_increment_field_not_null= false;
 
362
    insert_or_update= false;
 
363
    alias_name_used= false;
 
364
    get_fields_in_item_tree= false;
 
365
    
 
366
    query_id= 0;
 
367
    quick_condition_rows= 0;
 
368
     
 
369
    timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
 
370
    map= 0;
 
371
 
 
372
    reginfo.reset();
 
373
 
 
374
    covering_keys.reset();
 
375
 
 
376
    quick_keys.reset();
 
377
    merge_keys.reset();
 
378
 
 
379
    keys_in_use_for_query.reset();
 
380
    keys_in_use_for_group_by.reset();
 
381
    keys_in_use_for_order_by.reset();
 
382
 
 
383
    memset(quick_rows, 0, sizeof(query_id_t) * MAX_KEY);
 
384
    memset(const_key_parts, 0, sizeof(ha_rows) * MAX_KEY);
 
385
 
 
386
    memset(quick_key_parts, 0, sizeof(unsigned int) * MAX_KEY);
 
387
    memset(quick_n_ranges, 0, sizeof(unsigned int) * MAX_KEY);
 
388
 
 
389
    init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
 
390
    memset(&sort, 0, sizeof(filesort_info_st));
 
391
 
 
392
 
 
393
  }
258
394
 
259
395
  /* SHARE methods */
260
396
  inline TableShare *getShare() { return s; } /* Get rid of this long term */