1
0
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:
monty@mysql.com
2004-03-18 00:09:13 +02:00
parent f9ad650490
commit f34a642d6e
14 changed files with 289 additions and 315 deletions

View File

@@ -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;
}