1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Manual merge.

This commit is contained in:
Alexey Kopytov
2009-07-03 14:36:04 +04:00
9 changed files with 204 additions and 51 deletions

View File

@ -9392,13 +9392,17 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
+1: for decimal point
*/
overflow= my_decimal_precision_to_length(intg + dec, dec,
item->unsigned_flag) - len;
const int required_length=
my_decimal_precision_to_length(intg + dec, dec,
item->unsigned_flag);
overflow= required_length - len;
if (overflow > 0)
dec= max(0, dec - overflow); // too long, discard fract
else
len -= item->decimals - dec; // corrected value fits
/* Corrected value fits. */
len= required_length;
}
new_field= new Field_new_decimal(len, maybe_null, item->name,