1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge mysql.com:/home/jimw/my/mysql-4.1-6067

into mysql.com:/home/jimw/my/mysql-4.1-clean
This commit is contained in:
jimw@mysql.com
2005-02-04 10:39:13 -08:00
3 changed files with 25 additions and 2 deletions

View File

@ -3512,9 +3512,17 @@ void Field_time::sql_type(String &res) const
int Field_year::store(const char *from, uint len,CHARSET_INFO *cs)
{
int not_used; // We can ignore result from str2int
int err;
char *end;
long nr= my_strntol(cs, from, len, 10, &end, &not_used);
long nr= my_strntol(cs, from, len, 10, &end, &err);
if (err)
{
if (table->in_use->count_cuted_fields)
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
*ptr= 0;
return 0;
}
if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155)
{