~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_proto.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-11 12:10:21 UTC
  • mto: This revision was merged to the branch mainline in revision 2397.
  • Revision ID: olafvdspek@gmail.com-20110811121021-cuio8i0qi202l6iu
Delete commented functions

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
    case message::Table::Field::DATE:
136
136
    case message::Table::Field::DATETIME:
137
137
    case message::Table::Field::UUID:
138
 
    case message::Table::Field::IPV6:
139
138
    case message::Table::Field::TIME:
140
139
    case message::Table::Field::BOOLEAN:
141
140
      break;
231
230
    constraints->set_is_nullable(field_arg->def->null_value);
232
231
#endif
233
232
 
234
 
    if (not field_arg->comment.empty())
 
233
    if (field_arg->comment.length)
235
234
    {
236
 
      uint32_t tmp_len= system_charset_info->cset->charpos(system_charset_info,
237
 
                                                  field_arg->comment.begin(),
238
 
                                                  field_arg->comment.end(),
 
235
      uint32_t tmp_len;
 
236
      tmp_len= system_charset_info->cset->charpos(system_charset_info,
 
237
                                                  field_arg->comment.str,
 
238
                                                  field_arg->comment.str +
 
239
                                                  field_arg->comment.length,
239
240
                                                  COLUMN_COMMENT_MAXLEN);
240
241
 
241
 
      if (tmp_len < field_arg->comment.size())
 
242
      if (tmp_len < field_arg->comment.length)
242
243
      {
243
 
        my_error(ER_WRONG_STRING_LENGTH, MYF(0), field_arg->comment.data(), "COLUMN COMMENT", (uint32_t) COLUMN_COMMENT_MAXLEN);
244
 
        return true;
 
244
        my_error(ER_WRONG_STRING_LENGTH, MYF(0),
 
245
                 field_arg->comment.str,"COLUMN COMMENT",
 
246
                 (uint32_t) COLUMN_COMMENT_MAXLEN);
 
247
        return true;
245
248
      }
246
249
 
247
 
      if (not use_existing_fields)
248
 
        attribute->set_comment(field_arg->comment.data());
 
250
      if (! use_existing_fields)
 
251
        attribute->set_comment(field_arg->comment.str);
249
252
 
250
 
      assert(strcmp(attribute->comment().c_str(), field_arg->comment.data())==0);
 
253
      assert(strcmp(attribute->comment().c_str(), field_arg->comment.str)==0);
251
254
    }
252
255
 
253
256
    if (field_arg->unireg_check == Field::NEXT_NUMBER)
402
405
 
403
406
  for (uint32_t i= 0; i < keys; i++)
404
407
  {
405
 
    message::Table::Index *idx= table_proto.add_indexes();
406
 
 
407
 
    assert(test(key_info[i].flags & HA_USES_COMMENT) == (key_info[i].comment.size() > 0));
 
408
    message::Table::Index *idx;
 
409
 
 
410
    idx= table_proto.add_indexes();
 
411
 
 
412
    assert(test(key_info[i].flags & HA_USES_COMMENT) ==
 
413
           (key_info[i].comment.length > 0));
408
414
 
409
415
    idx->set_name(key_info[i].name);
 
416
 
410
417
    idx->set_key_length(key_info[i].key_length);
411
 
    idx->set_is_primary(is_primary_key(key_info[i].name));
 
418
 
 
419
    if (is_primary_key_name(key_info[i].name))
 
420
      idx->set_is_primary(true);
 
421
    else
 
422
      idx->set_is_primary(false);
412
423
 
413
424
    switch(key_info[i].algorithm)
414
425
    {
459
470
    {
460
471
      uint32_t tmp_len;
461
472
      tmp_len= system_charset_info->cset->charpos(system_charset_info,
462
 
                                                  key_info[i].comment.begin(),
463
 
                                                  key_info[i].comment.end(),
 
473
                                                  key_info[i].comment.str,
 
474
                                                  key_info[i].comment.str +
 
475
                                                  key_info[i].comment.length,
464
476
                                                  TABLE_COMMENT_MAXLEN);
465
477
 
466
 
      if (tmp_len < key_info[i].comment.size())
 
478
      if (tmp_len < key_info[i].comment.length)
467
479
      {
468
480
        my_error(ER_WRONG_STRING_LENGTH, MYF(0),
469
 
                 key_info[i].comment.data(), "Index COMMENT",
 
481
                 key_info[i].comment.str,"Index COMMENT",
470
482
                 (uint32_t) TABLE_COMMENT_MAXLEN);
471
483
        return true;
472
484
      }
473
485
 
474
 
      idx->set_comment(key_info[i].comment.data());
 
486
      idx->set_comment(key_info[i].comment.str);
475
487
    }
476
488
    static const uint64_t unknown_index_flag= (HA_NOSAME | HA_PACK_KEY |
477
489
                                               HA_USES_BLOCK_SIZE |