summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/eagle.(none)>2007-10-29 15:39:56 +0400
committerunknown <gluh@mysql.com/eagle.(none)>2007-10-29 15:39:56 +0400
commit9e6bb07d3845566ffa7274bb14df544c8147f594 (patch)
tree79c7e5d0acbd96a8ca7b79b89a4ccf282bb9834c /sql-common
parentd5b1d6205b126be933a833f497a8de8854c0666d (diff)
downloadmariadb-git-9e6bb07d3845566ffa7274bb14df544c8147f594.tar.gz
Bug#30889: filesort and order by with float/numeric crashes server
There are two problems with ROUND(X, D) on an exact numeric (DECIMAL, NUMERIC type) field of a table: 1) The implementation of the ROUND function would change the number of decimal places regardless of the value decided upon in fix_length_and_dec. When the number of decimal places is not constant, this would cause an inconsistent state where the number of digits was less than the number of decimal places, which crashes filesort. Fixed by not allowing the ROUND operation to add any more decimal places than was decided in fix_length_and_dec. 2) fix_length_and_dec would allow the number of decimals to be greater than the maximium configured value for constant values of D. This led to the same crash as in (1). Fixed by not allowing the above in fix_length_and_dec. mysql-test/r/type_decimal.result: Bug#30889: Test result mysql-test/t/type_decimal.test: Bug#30889: Test case sql/item_func.cc: Bug#30889: - Avoid setting number of digits after decimal point (scale) higher than its maximum value. - Avoid increasing the number of decimal places in ::decimal_op sql/item_func.h: Bug#30889: Added comments to the declarations of Item_func_numhybrid::<type>_op family of methods.
Diffstat (limited to 'sql-common')
0 files changed, 0 insertions, 0 deletions