Commit 1d633f64 authored by unknown's avatar unknown

A fix. "(int) var" type cast doesn't work correctly for uint32 var

on some 64-bit platforms (e.g. IRIX, non-debug build).

parent de109e46
...@@ -1645,7 +1645,8 @@ String *Item_func_format::val_str(String *str) ...@@ -1645,7 +1645,8 @@ String *Item_func_format::val_str(String *str)
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
double nr =args[0]->val(); double nr =args[0]->val();
uint32 diff,length,str_length; int diff;
uint32 length, str_length;
uint dec; uint dec;
if ((null_value=args[0]->null_value)) if ((null_value=args[0]->null_value))
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
...@@ -1670,9 +1671,12 @@ String *Item_func_format::val_str(String *str) ...@@ -1670,9 +1671,12 @@ String *Item_func_format::val_str(String *str)
pos[0]= pos[-(int) diff]; pos[0]= pos[-(int) diff];
while (diff) while (diff)
{ {
pos[0]=pos[-(int) diff]; pos--; *pos= *(pos - diff);
pos[0]=pos[-(int) diff]; pos--; pos--;
pos[0]=pos[-(int) diff]; pos--; *pos= *(pos - diff);
pos--;
*pos= *(pos - diff);
pos--;
pos[0]=','; pos[0]=',';
pos--; pos--;
diff--; diff--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment