~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Olaf van der Spek
  • Date: 2011-10-19 14:57:31 UTC
  • mto: This revision was merged to the branch mainline in revision 2445.
  • Revision ID: olafvdspek@gmail.com-20111019145731-y8ycpcinn2pkp3vg
Use str_ref

Show diffs side-by-side

added added

removed removed

Lines of Context:
462
462
      char buff[type::Time::MAX_STRING_LENGTH];
463
463
      String tmp(buff,sizeof(buff), &my_charset_bin);
464
464
      String *res= val_str(&tmp);
465
 
      if (not res || str_to_datetime_with_warn(&getSession(), res->ptr(), res->length(), &ltime, fuzzydate) <= type::DRIZZLE_TIMESTAMP_ERROR)
 
465
      if (not res || str_to_datetime_with_warn(getSession(), *res, ltime, fuzzydate) <= type::DRIZZLE_TIMESTAMP_ERROR)
466
466
      {
467
467
        break;
468
468
      }
478
478
      {
479
479
        char buff[DECIMAL_LONGLONG_DIGITS];
480
480
        char* end= internal::int64_t10_to_str(value, buff, -10);
481
 
        make_truncated_value_warning(&getSession(), DRIZZLE_ERROR::WARN_LEVEL_WARN, buff, (int) (end-buff), type::DRIZZLE_TIMESTAMP_NONE, NULL);
 
481
        make_truncated_value_warning(getSession(), DRIZZLE_ERROR::WARN_LEVEL_WARN, str_ref(buff, (int) (end-buff)), type::DRIZZLE_TIMESTAMP_NONE, NULL);
482
482
        break;
483
483
      }
484
484
    }
494
494
bool Item::get_time(type::Time &ltime)
495
495
{
496
496
  char buff[type::Time::MAX_STRING_LENGTH];
497
 
  String tmp(buff,sizeof(buff),&my_charset_bin),*res;
498
 
  if (!(res=val_str(&tmp)) or
499
 
      str_to_time_with_warn(&getSession(), res->ptr(), res->length(), &ltime))
 
497
  String tmp(buff,sizeof(buff),&my_charset_bin);
 
498
  String *res= val_str(&tmp);
 
499
  if (not res || str_to_time_with_warn(getSession(), *res, ltime))
500
500
  {
501
501
    ltime.reset();
502
 
 
503
502
    return true;
504
503
  }
505
504