~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_conv.cc

  • Committer: Brian Aker
  • Date: 2010-12-07 09:12:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1985.
  • Revision ID: brian@tangent.org-20101207091212-1m0w20tck6z7632m
This is a fix for bug lp:686197

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
 
249
249
static void do_copy_not_null(CopyField *copy)
250
250
{
251
 
  if (*copy->from_null_ptr & copy->from_bit)
 
251
  std::cerr << "hasDefault() " << drizzled::message::type(copy->to_field->hasDefault()) << "\n";
 
252
  if (copy->to_field->hasDefault() and *copy->from_null_ptr & copy->from_bit)
 
253
  {
 
254
    copy->to_field->set_default();
 
255
  }
 
256
  else if (*copy->from_null_ptr & copy->from_bit)
252
257
  {
253
258
    copy->to_field->set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,
254
259
                                ER_WARN_DATA_TRUNCATED, 1);
255
260
    copy->to_field->reset();
256
261
  }
257
262
  else
 
263
  {
258
264
    (copy->do_copy2)(copy);
 
265
  }
259
266
}
260
267
 
261
268
 
594
601
      to_null_ptr= to->null_ptr;
595
602
      to_bit= to->null_bit;
596
603
      if (from_null_ptr)
 
604
      {
597
605
        do_copy= do_copy_null;
 
606
      }
598
607
      else
599
608
      {
600
609
        null_row= &from->getTable()->null_row;
604
613
    else
605
614
    {
606
615
      if (to_field->type() == DRIZZLE_TYPE_TIMESTAMP)
 
616
      {
607
617
        do_copy= do_copy_timestamp;               // Automatic timestamp
 
618
      }
608
619
      else if (to_field == to_field->getTable()->next_number_field)
 
620
      {
609
621
        do_copy= do_copy_next_number;
 
622
      }
610
623
      else
 
624
      {
611
625
        do_copy= do_copy_not_null;
 
626
      }
612
627
    }
613
628
  }
614
629
  else if (to_field->real_maybe_null())