mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.0
into gluh.mysql.r18.ru:/home/gluh/MySQL-BUGS/mysql-4.0.7498
This commit is contained in:
commit
b5528a8dc6
1 changed files with 7 additions and 6 deletions
|
@ -1465,7 +1465,8 @@ Item_func_format::Item_func_format(Item *org,int dec) :Item_str_func(org)
|
|||
String *Item_func_format::val_str(String *str)
|
||||
{
|
||||
double nr =args[0]->val();
|
||||
uint32 diff,length,str_length;
|
||||
uint32 length,str_length;
|
||||
int diff;
|
||||
uint dec;
|
||||
if ((null_value=args[0]->null_value))
|
||||
return 0; /* purecov: inspected */
|
||||
|
@ -1483,17 +1484,17 @@ String *Item_func_format::val_str(String *str)
|
|||
if (str_length >= dec+4)
|
||||
{
|
||||
char *tmp,*pos;
|
||||
length= str->length()+(diff=(str_length- dec-1)/3);
|
||||
length= str->length()+(diff= (int)(str_length- dec-1)/3);
|
||||
str= copy_if_not_alloced(&tmp_str,str,length);
|
||||
str->length(length);
|
||||
tmp= (char*) str->ptr()+length - dec-1;
|
||||
for (pos= (char*) str->ptr()+length-1; pos != tmp; pos--)
|
||||
pos[0]= pos[-(int) diff];
|
||||
pos[0]= pos[-diff];
|
||||
while (diff)
|
||||
{
|
||||
pos[0]=pos[-(int) diff]; pos--;
|
||||
pos[0]=pos[-(int) diff]; pos--;
|
||||
pos[0]=pos[-(int) diff]; pos--;
|
||||
pos[0]=pos[-diff]; pos--;
|
||||
pos[0]=pos[-diff]; pos--;
|
||||
pos[0]=pos[-diff]; pos--;
|
||||
pos[0]=',';
|
||||
pos--;
|
||||
diff--;
|
||||
|
|
Loading…
Add table
Reference in a new issue