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

Fixes during review of new code

- Mostly indentation fixes
- Added missing test
- Ensure that Item_func_case() checks for stack overruns
- Use real_item() instead of (Item_ref*) item
- Fixed wrong error handling


myisam/mi_unique.c:
  Improved comments
myisam/myisampack.c:
  Updated version number
mysql-test/r/group_by.result:
  Added test that was lost during earlier merge
mysql-test/r/information_schema.result:
  Safety fix: Drop procedures before used
mysql-test/t/group_by.test:
  Added test that was lost during earlier merge
mysql-test/t/information_schema.test:
  Safety fix: Drop procedures before used
mysys/hash.c:
  Updated comment
sql/field.cc:
  false -> FALSE
sql/ha_ndbcluster.cc:
  Fix some style issues
  - No () around argument to 'case'
  - Space before ( in switch and if
  - Removed 'goto'
  - Added {}
  - Added () to make expressions easier to read
  - my_snprintf -> strmov
sql/handler.cc:
  if( -> if (
sql/item.cc:
  Indentation changes
sql/item.h:
  false -> FALSE
sql/item_cmpfunc.cc:
  Ensure that Item_func_case() check for stack overrun properly
sql/item_cmpfunc.h:
  Ensure that Item_func_case() check for stack overrun properly
sql/item_func.cc:
  Indentation fixes
  Fixed wrong goto label
sql/mysqld.cc:
  Remove test for opt_disable_networking as this flag can never be set here
sql/opt_range.cc:
  Simplify code
sql/sql_class.h:
  Move define out from middle of class definition
sql/sql_parse.cc:
  Remove extra empty lines
sql/sql_select.cc:
  use real_item() instead of (Item_ref*) item
  Modifed function comment to be align with others
  Simple optimization
sql/sql_union.cc:
  Portability fix:
  Don't use 'bool_variable|=...'
sql/sql_view.cc:
  Move List_iterator_fast out from loops (rewind is faster than creating a new itearator)
strings/ctype-utf8.c:
  if( -> if (
strings/ctype.c:
  Remove disabled code
strings/decimal.c:
  Indentation fixes
strings/xml.c:
  Indentation fixes
This commit is contained in:
unknown
2005-07-04 03:42:33 +03:00
parent 1aa6343fe8
commit 306ebf7b1c
26 changed files with 443 additions and 313 deletions

View File

@ -1492,17 +1492,18 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
{
int do_inc= FALSE;
DBUG_ASSERT(frac0+intg0 >= 0);
switch (round_digit)
{
switch (round_digit) {
case 0:
{
dec1 *p0= buf0 + (frac1-frac0);
for (; p0 > buf0; p0--)
{
if (*p0)
{
do_inc= TRUE;
break;
};
}
}
break;
}
case 5:
@ -1511,9 +1512,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
do_inc= (x>5) || ((x == 5) &&
(mode == HALF_UP || (frac0+intg0 > 0 && *buf0 & 1)));
break;
};
default:;
};
}
default:
break;
}
if (do_inc)
{
if (frac0+intg0>0)
@ -1567,9 +1569,9 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
*buf1=1;
to->intg++;
}
/* Here we check 999.9 -> 1000 case when we need to increase intg */
else
{
/* Here we check 999.9 -> 1000 case when we need to increase intg */
int first_dig= to->intg % DIG_PER_DEC1;
/* first_dig==0 should be handled above in the 'if' */
if (first_dig && (*buf1 >= powers10[first_dig]))