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:
12
sql/field.cc
12
sql/field.cc
@ -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, ¬_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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user