1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

after merge fixes

strings/my_vsnprintf.c:
  %.#s support in my_vsnprintf
BitKeeper/etc/ignore:
  Added EXCEPTIONS-CLIENT to the ignore list
This commit is contained in:
unknown
2004-08-19 03:02:09 +02:00
parent 945625ebaa
commit ae2bf6275e
19 changed files with 98 additions and 88 deletions

View File

@ -4268,24 +4268,21 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
Store double value in Field_string or Field_varstring.
SYNOPSIS
store_double_in_string_field()
field field to store value in
field_length number of characters in the field
store(double nr)
nr number
DESCRIPTION
Pretty prints double number into field_length characters buffer.
*/
static int store_double_in_string_field(Field_str *field, uint32 field_length,
double nr)
int Field_str::store(double nr)
{
bool use_scientific_notation=TRUE;
char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
int length;
if (field_length < 32 && nr > 1)
if (field_length < 32 && nr > 1) // TODO: negative numbers
{
if (field->ceiling == 0)
if (ceiling == 0)
{
static double e[]= {1e1, 1e2, 1e4, 1e8, 1e16 };
double p= 1;
@ -4294,23 +4291,17 @@ static int store_double_in_string_field(Field_str *field, uint32 field_length,
if (field_length & j)
p*= e[i];
}
field->ceiling= p-1;
ceiling= p-1;
}
use_scientific_notation= (field->ceiling < nr);
use_scientific_notation= (ceiling < nr);
}
length= sprintf(buff, "%-.*g",
use_scientific_notation ? max(0,field_length-5) : field_length,
nr);
DBUG_ASSERT(length <= field_length);
return field->store(buff, (uint) length);
return store((const char *)buff, (uint) length, charset());
}
int Field_string::store(double nr)
{
return store_double_in_string_field(this, field_length, nr);
}
int Field_string::store(longlong nr)
{
char buff[64];
@ -4479,12 +4470,6 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
}
int Field_varstring::store(double nr)
{
return store_double_in_string_field(this, field_length, nr);
}
int Field_varstring::store(longlong nr)
{
char buff[64];