~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share.cc

  • Committer: Brian Aker
  • Date: 2010-06-11 17:26:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1610.
  • Revision ID: brian@gaz-20100611172639-e9q2sliqizeoz4yd
Update for having share declared type.

Show diffs side-by-side

added added

removed removed

Lines of Context:
245
245
    return foundTableShare(share);
246
246
  }
247
247
 
248
 
  if (not (share= new TableShare(key, key_length)))
 
248
  if (not (share= new TableShare(message::Table::STANDARD, key, key_length)))
249
249
  {
250
250
    return NULL;
251
251
  }
470
470
  return table_def_cache;
471
471
}
472
472
 
473
 
TableShare::TableShare() :
 
473
TableShare::TableShare(TableIdentifier::Type type_arg) :
474
474
  table_category(TABLE_UNKNOWN_CATEGORY),
475
475
  open_count(0),
476
476
  found_next_number_field(NULL),
486
486
  max_rows(0),
487
487
  table_proto(NULL),
488
488
  storage_engine(NULL),
489
 
  tmp_table(message::Table::STANDARD),
 
489
  tmp_table(type_arg),
490
490
  ref_count(0),
491
491
  null_bytes(0),
492
492
  last_null_bit_pos(0),
536
536
  init();
537
537
}
538
538
 
539
 
TableShare::TableShare(const char *key,
 
539
TableShare::TableShare(TableIdentifier::Type type_arg,
 
540
                       const char *key,
540
541
                       uint32_t key_length,
541
542
                       const char *new_table_name,
542
543
                       const char *new_path) :
555
556
  max_rows(0),
556
557
  table_proto(NULL),
557
558
  storage_engine(NULL),
558
 
  tmp_table(message::Table::STANDARD),
 
559
  tmp_table(type_arg),
559
560
  ref_count(0),
560
561
  null_bytes(0),
561
562
  last_null_bit_pos(0),
602
603
  memset(&path, 0, sizeof(LEX_STRING));
603
604
  memset(&normalized_path, 0, sizeof(LEX_STRING));
604
605
  init(key, key_length, new_table_name, new_path);
605
 
}
606
 
 
607
 
 
608
 
TableShare::TableShare(char *key,
 
606
  assert(type_arg == message::Table::INTERNAL);
 
607
}
 
608
 
 
609
 
 
610
TableShare::TableShare(TableIdentifier &identifier) :
 
611
  table_category(TABLE_UNKNOWN_CATEGORY),
 
612
  open_count(0),
 
613
  found_next_number_field(NULL),
 
614
  timestamp_field(NULL),
 
615
  key_info(NULL),
 
616
  blob_field(NULL),
 
617
  block_size(0),
 
618
  version(0),
 
619
  timestamp_offset(0),
 
620
  reclength(0),
 
621
  stored_rec_length(0),
 
622
  row_type(ROW_TYPE_DEFAULT),
 
623
  max_rows(0),
 
624
  table_proto(NULL),
 
625
  storage_engine(NULL),
 
626
  tmp_table(identifier.getType()),
 
627
  ref_count(0),
 
628
  null_bytes(0),
 
629
  last_null_bit_pos(0),
 
630
  fields(0),
 
631
  rec_buff_length(0),
 
632
  keys(0),
 
633
  key_parts(0),
 
634
  max_key_length(0),
 
635
  max_unique_length(0),
 
636
  total_key_length(0),
 
637
  uniques(0),
 
638
  null_fields(0),
 
639
  blob_fields(0),
 
640
  timestamp_field_offset(0),
 
641
  varchar_fields(0),
 
642
  db_create_options(0),
 
643
  db_options_in_use(0),
 
644
  db_record_offset(0),
 
645
  rowid_field_offset(0),
 
646
  primary_key(0),
 
647
  next_number_index(0),
 
648
  next_number_key_offset(0),
 
649
  next_number_keypart(0),
 
650
  error(0),
 
651
  open_errno(0),
 
652
  errarg(0),
 
653
  column_bitmap_size(0),
 
654
  blob_ptr_size(0),
 
655
  db_low_byte_first(false),
 
656
  name_lock(false),
 
657
  replace_with_name_lock(false),
 
658
  waiting_on_cond(false),
 
659
  keys_in_use(0),
 
660
  keys_for_keyread(0),
 
661
  event_observers(NULL),
 
662
  newed(true)
 
663
{
 
664
  memset(&name_hash, 0, sizeof(HASH));
 
665
 
 
666
  table_charset= 0;
 
667
  memset(&table_cache_key, 0, sizeof(LEX_STRING));
 
668
  memset(&db, 0, sizeof(LEX_STRING));
 
669
  memset(&table_name, 0, sizeof(LEX_STRING));
 
670
  memset(&path, 0, sizeof(LEX_STRING));
 
671
  memset(&normalized_path, 0, sizeof(LEX_STRING));
 
672
 
 
673
  {
 
674
    memory::init_sql_alloc(&mem_root, TABLE_ALLOC_BLOCK_SIZE, 0);
 
675
    table_category=         TABLE_CATEGORY_TEMPORARY;
 
676
    tmp_table=              message::Table::INTERNAL;
 
677
    db.str= const_cast<char *>(identifier.getSchemaName().c_str());
 
678
    db.length= identifier.getSchemaName().length();
 
679
    table_cache_key.str= const_cast<char *>(identifier.getSchemaName().c_str());
 
680
    table_cache_key.length= 0;
 
681
    table_name.str= const_cast<char *>(identifier.getTableName().c_str());
 
682
    table_name.length= identifier.getTableName().length();
 
683
    path.str= const_cast<char *>(identifier.getPath().c_str());
 
684
    normalized_path.str= const_cast<char *>(identifier.getPath().c_str());
 
685
    path.length= normalized_path.length= strlen(path.str);
 
686
  }
 
687
}
 
688
 
 
689
 
 
690
TableShare::TableShare(TableIdentifier::Type type_arg,
 
691
                       char *key,
609
692
                       uint32_t key_length,
610
693
                       char *path_arg,
611
694
                       uint32_t path_length_arg) :
624
707
  max_rows(0),
625
708
  table_proto(NULL),
626
709
  storage_engine(NULL),
627
 
  tmp_table(message::Table::STANDARD),
 
710
  tmp_table(type_arg),
628
711
  ref_count(0),
629
712
  null_bytes(0),
630
713
  last_null_bit_pos(0),