Sometimes server assigns DOUBLE type for arithmetic operations over DECIMAL arguments. In this rare case width of result was incorrectly adjusted and it triggered an assertion. Now width of result gets adjusted only if result type is also DECIMAL.