~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/table.cc

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
 
193
193
    share->version=       refresh_version;
194
194
 
195
 
    share->tablespace=    NULL;
196
 
 
197
195
    /*
198
196
      This constant is used to mark that no table map version has been
199
197
      assigned.  No arithmetic is done on the value: it will be
261
259
  share->normalized_path.str=    (char*) path;
262
260
  share->path.length= share->normalized_path.length= strlen(path);
263
261
  share->frm_version=            FRM_VER_TRUE_VARCHAR;
264
 
  share->tablespace=             NULL;
265
262
  /*
266
263
    Temporary tables are not replicated, but we set up these fields
267
264
    anyway to be able to catch errors.
763
760
      {
764
761
        const uint format_section_header_size= 8;
765
762
        uint format_section_len= uint2korr(next_chunk+0);
766
 
        uint flags=              uint4korr(next_chunk+2);
767
 
 
768
 
        share->default_storage_media= (enum ha_storage_media) (flags & 0x7);
769
 
 
770
 
        const char *tablespace= (const char*)next_chunk + format_section_header_size;
771
 
        uint tablespace_len= strlen(tablespace);
772
 
        if (tablespace_len != 0) 
773
 
        {
774
 
          share->tablespace= (char *) alloc_root(&share->mem_root,
775
 
                                                 tablespace_len+1);
776
 
          strxmov(share->tablespace, tablespace, NullS);
777
 
        }
778
 
        else
779
 
          share->tablespace= NULL;
780
 
 
781
 
        field_extra_info= next_chunk + format_section_header_size + tablespace_len + 1;
 
763
 
 
764
        field_extra_info= next_chunk + format_section_header_size + 1;
782
765
        next_chunk+= format_section_len;
783
766
      }
784
767
    }
891
874
    */
892
875
    share->null_bytes= (share->null_fields + null_bit_pos + 7) / 8;
893
876
  }
894
 
#ifndef WE_WANT_TO_SUPPORT_VERY_OLD_FRM_FILES
895
 
  else
896
 
  {
897
 
    share->null_bytes= (share->null_fields+7)/8;
898
 
    null_flags= null_pos= (uchar*) (record + 1 +share->reclength -
899
 
                                    share->null_bytes);
900
 
    null_bit_pos= 0;
901
 
  }
902
 
#endif
903
877
 
904
878
  use_hash= share->fields >= MAX_FIELDS_BEFORE_HASH;
905
879
  if (use_hash)
912
886
  {
913
887
    uint pack_flag, interval_nr, unireg_type, recpos, field_length;
914
888
    enum_field_types field_type;
915
 
    enum ha_storage_media storage_type= HA_SM_DEFAULT;
916
889
    enum column_format_type column_format= COLUMN_FORMAT_TYPE_DEFAULT;
917
890
    CHARSET_INFO *charset=NULL;
918
891
    LEX_STRING comment;
920
893
    if (field_extra_info)
921
894
    {
922
895
      char tmp= field_extra_info[i];
923
 
      storage_type= (enum ha_storage_media)(tmp & STORAGE_TYPE_MASK);
924
896
      column_format= (enum column_format_type)
925
897
                    ((tmp >> COLUMN_FORMAT_SHIFT) & COLUMN_FORMAT_MASK);
926
898
    }
1043
1015
      goto err;                 /* purecov: inspected */
1044
1016
    }
1045
1017
 
1046
 
    reg_field->flags|= ((uint)storage_type << FIELD_STORAGE_FLAGS);
1047
1018
    reg_field->flags|= ((uint)column_format << COLUMN_FORMAT_FLAGS);
1048
1019
    reg_field->field_index= i;
1049
1020
    reg_field->comment=comment;
2174
2145
  create_info->table_options= share->db_create_options;
2175
2146
  create_info->avg_row_length= share->avg_row_length;
2176
2147
  create_info->row_type= share->row_type;
2177
 
  create_info->default_storage_media= share->default_storage_media;
2178
 
  create_info->tablespace= share->tablespace;
2179
2148
  create_info->default_table_charset= share->table_charset;
2180
2149
  create_info->table_charset= 0;
2181
2150
  create_info->comment= share->comment;