~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/date.cc

  • Committer: Brian Aker
  • Date: 2011-01-26 21:05:29 UTC
  • mto: (2122.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2123.
  • Revision ID: brian@tangent.org-20110126210529-2y7gt9xg9fz1b29c
Fix error message on date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
  DateTime temporal;
75
75
  if (! temporal.from_string(from, (size_t) len))
76
76
  {
77
 
    my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), from);
 
77
    my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), from);
78
78
    return 2;
79
79
  }
80
80
  /* Create the stored integer format. @TODO This should go away. Should be up to engine... */
94
94
    ss.precision(18); /* 18 places should be fine for error display of double input. */
95
95
    ss << from; ss >> tmp;
96
96
 
97
 
    my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str());
 
97
    my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), tmp.c_str());
98
98
    return 2;
99
99
  }
100
100
  return Field_date::store((int64_t) rint(from), false);
113
113
    /* Convert the integer to a string using boost::lexical_cast */
114
114
    std::string tmp(boost::lexical_cast<std::string>(from)); 
115
115
 
116
 
    my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str());
 
116
    my_error(ER_INVALID_DATE_VALUE, MYF(ME_FATALERROR), tmp.c_str());
117
117
    return 2;
118
118
  }
119
119
 
120
120
  /* Create the stored integer format. @TODO This should go away. Should be up to engine... */
121
121
  uint32_t int_value= (temporal.years() * 10000) + (temporal.months() * 100) + temporal.days();
122
122
  int4store(ptr, int_value);
 
123
 
123
124
  return 0;
124
125
}
125
126