126
int Field_date::store_time(type::Time *ltime,
126
int Field_date::store_time(type::Time <ime,
127
127
type::timestamp_t time_type)
131
131
if (time_type == type::DRIZZLE_TIMESTAMP_DATE || time_type == type::DRIZZLE_TIMESTAMP_DATETIME)
133
tmp= ltime->year*10000 + ltime->month*100 + ltime->day;
133
tmp= ltime.year*10000 + ltime.month*100 + ltime.day;
135
135
type::cut_t cut_error= type::VALID;
136
if (ltime->check(tmp != 0,
136
if (ltime.check(tmp != 0,
137
137
(TIME_FUZZY_DATE |
138
138
(current_session->variables.sql_mode &
139
139
(MODE_NO_ZERO_DATE | MODE_INVALID_DATES))), cut_error))
141
141
char buff[type::Time::MAX_STRING_LENGTH];
142
142
String str(buff, sizeof(buff), &my_charset_utf8_general_ci);
143
ltime->convert(str, type::DRIZZLE_TIMESTAMP_DATE);
143
ltime.convert(str, type::DRIZZLE_TIMESTAMP_DATE);
144
144
set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED,
145
145
str.ptr(), str.length(), type::DRIZZLE_TIMESTAMP_DATE, 1);
148
148
error= static_cast<int>(cut_error);
150
if (not error && ltime->time_type != type::DRIZZLE_TIMESTAMP_DATE &&
151
(ltime->hour || ltime->minute || ltime->second || ltime->second_part))
150
if (not error && ltime.time_type != type::DRIZZLE_TIMESTAMP_DATE &&
151
(ltime.hour || ltime.minute || ltime.second || ltime.second_part))
153
153
char buff[type::Time::MAX_STRING_LENGTH];
154
154
String str(buff, sizeof(buff), &my_charset_utf8_general_ci);
156
156
set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_NOTE,
157
157
ER_WARN_DATA_TRUNCATED,
158
158
str.ptr(), str.length(), type::DRIZZLE_TIMESTAMP_DATE, 1);