mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
after merge fixes
This commit is contained in:
36
sql/field.cc
36
sql/field.cc
@@ -2264,25 +2264,23 @@ void Field_longlong::sql_type(String &res) const
|
||||
add_zerofill_and_unsigned(res);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** single precision float
|
||||
single precision float
|
||||
****************************************************************************/
|
||||
|
||||
int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
{
|
||||
int err;
|
||||
int error;
|
||||
char *end;
|
||||
double nr= my_strntod(cs,(char*) from,len,&end,&err);
|
||||
if (!err && (!current_thd->count_cuted_fields || end-from==len))
|
||||
{
|
||||
return Field_float::store(nr);
|
||||
}
|
||||
else
|
||||
double nr= my_strntod(cs,(char*) from,len,&end,&error);
|
||||
if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields))
|
||||
{
|
||||
error= 1;
|
||||
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
|
||||
Field_float::store(nr);
|
||||
return 1;
|
||||
}
|
||||
Field_float::store(nr);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -2562,25 +2560,23 @@ void Field_float::sql_type(String &res) const
|
||||
add_zerofill_and_unsigned(res);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** double precision floating point numbers
|
||||
double precision floating point numbers
|
||||
****************************************************************************/
|
||||
|
||||
int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
{
|
||||
int err;
|
||||
int error;
|
||||
char *end;
|
||||
double nr= my_strntod(cs,(char*) from,len,&end,&err);
|
||||
if (!err && (!current_thd->count_cuted_fields || end-from==len))
|
||||
{
|
||||
return Field_double::store(nr);
|
||||
}
|
||||
else
|
||||
double nr= my_strntod(cs,(char*) from, len, &end, &error);
|
||||
if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields))
|
||||
{
|
||||
error= 1;
|
||||
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
|
||||
Field_double::store(nr);
|
||||
return 1;
|
||||
}
|
||||
Field_double::store(nr);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user