~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/instance/base.cc

  • Committer: Mark Atwood
  • Date: 2011-11-08 19:06:32 UTC
  • mfrom: (2445.1.22 rf)
  • Revision ID: me@mark.atwood.name-20111108190632-7pfvz4ggbolmlnnu
mergeĀ lp:~olafvdspek/drizzle/refactor10

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
  key_info(NULL),
231
231
  mem_root(TABLE_ALLOC_BLOCK_SIZE),
232
232
  all_set(),
233
 
  db(null_lex_string()),
234
 
  table_name(null_lex_string()),
235
 
  path(null_lex_string()),
236
 
  normalized_path(null_lex_string()),
237
233
  block_size(0),
238
234
  version(0),
239
235
  timestamp_offset(0),
293
289
  mem_root(TABLE_ALLOC_BLOCK_SIZE),
294
290
  table_charset(0),
295
291
  all_set(),
296
 
  db(null_lex_string()),
297
 
  table_name(null_lex_string()),
298
 
  path(null_lex_string()),
299
 
  normalized_path(null_lex_string()),
300
292
  block_size(0),
301
293
  version(0),
302
294
  timestamp_offset(0),
363
355
  mem_root(TABLE_ALLOC_BLOCK_SIZE),
364
356
  table_charset(0),
365
357
  all_set(),
366
 
  db(null_lex_string()),
367
 
  table_name(null_lex_string()),
368
 
  path(null_lex_string()),
369
 
  normalized_path(null_lex_string()),
370
358
  block_size(0),
371
359
  version(0),
372
360
  timestamp_offset(0),
436
424
  mem_root(TABLE_ALLOC_BLOCK_SIZE),
437
425
  table_charset(0),
438
426
  all_set(),
439
 
  db(null_lex_string()),
440
 
  table_name(null_lex_string()),
441
 
  path(null_lex_string()),
442
 
  normalized_path(null_lex_string()),
443
427
  block_size(0),
444
428
  version(0),
445
429
  timestamp_offset(0),
715
699
      key_part->key_type= 0;
716
700
    }
717
701
 
718
 
    if (! indx.has_comment())
 
702
    if (not indx.has_comment())
719
703
    {
720
 
      keyinfo->comment.assign(NULL, 0);
 
704
      keyinfo->comment.clear();
721
705
    }
722
706
    else
723
707
    {
948
932
      unireg_type= Field::TIMESTAMP_UN_FIELD;
949
933
    }
950
934
 
951
 
    lex_string_t comment;
952
 
    if (!pfield.has_comment())
953
 
    {
954
 
      comment.assign("", 0);
955
 
    }
956
 
    else
 
935
    str_ref comment;
 
936
    if (pfield.has_comment())
957
937
    {
958
938
      comment.assign(mem().strdup(pfield.comment()), pfield.comment().size());
959
939
    }
964
944
 
965
945
    const charset_info_st *charset= &my_charset_bin;
966
946
 
967
 
    if (field_type == DRIZZLE_TYPE_BLOB ||
968
 
        field_type == DRIZZLE_TYPE_VARCHAR)
 
947
    if (field_type == DRIZZLE_TYPE_BLOB || field_type == DRIZZLE_TYPE_VARCHAR)
969
948
    {
970
949
      message::Table::Field::StringFieldOptions field_options= pfield.string_options();
971
950
 
972
 
      charset= get_charset(field_options.has_collation_id() ?
973
 
                           field_options.collation_id() : 0);
 
951
      charset= get_charset(field_options.has_collation_id() ? field_options.collation_id() : 0);
974
952
 
975
 
      if (! charset)
 
953
      if (not charset)
976
954
        charset= default_charset_info;
977
955
    }
978
956
 
980
958
    {
981
959
      message::Table::Field::EnumerationValues field_options= pfield.enumeration_values();
982
960
 
983
 
      charset= get_charset(field_options.has_collation_id()?
984
 
                           field_options.collation_id() : 0);
 
961
      charset= get_charset(field_options.has_collation_id() ? field_options.collation_id() : 0);
985
962
 
986
 
      if (! charset)
 
963
      if (not charset)
987
964
        charset= default_charset_info;
988
965
    }
989
966
 
990
967
    uint8_t decimals= 0;
991
 
    if (field_type == DRIZZLE_TYPE_DECIMAL
992
 
        || field_type == DRIZZLE_TYPE_DOUBLE)
 
968
    if (field_type == DRIZZLE_TYPE_DECIMAL || field_type == DRIZZLE_TYPE_DOUBLE)
993
969
    {
994
970
      message::Table::Field::NumericFieldOptions fo= pfield.numeric_options();
995
971
 
996
 
      if (! pfield.has_numeric_options() || ! fo.has_scale())
 
972
      if (not pfield.has_numeric_options() || ! fo.has_scale())
997
973
      {
998
974
        /*
999
975
          We don't write the default to table proto so