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

Fix for bug #12173 (show create table crash)

mysql-test/r/type_newdecimal.result:
  test result fixed
mysql-test/t/type_newdecimal.test:
  testcase
strings/decimal.c:
  we always add one int-part digit even if decimal(10,10) (no int part declared)
This commit is contained in:
unknown
2005-07-29 14:39:11 +05:00
parent 90b2daa713
commit 68cd99bd99
3 changed files with 20 additions and 1 deletions

View File

@ -351,7 +351,8 @@ int decimal2string(decimal_t *from, char *to, int *to_len,
buf0=&tmp;
}
intg_len= fixed_precision ? fixed_intg : (intg ? intg : 1);
if (!(intg_len= fixed_precision ? fixed_intg : intg))
intg_len= 1;
frac_len= fixed_precision ? fixed_decimals : frac;
len= from->sign + intg_len + test(frac) + frac_len;
if (fixed_precision)