Skip to content

MDEV-39351: too narrow decimal precision for expression cache#4997

Open
DaveGosselin-MariaDB wants to merge 1 commit into10.11from
12.3-MDEV-39351-round-avg-error
Open

MDEV-39351: too narrow decimal precision for expression cache#4997
DaveGosselin-MariaDB wants to merge 1 commit into10.11from
12.3-MDEV-39351-round-avg-error

Conversation

@DaveGosselin-MariaDB
Copy link
Copy Markdown
Member

The expression cache had a narrower precision than the decimal value that it cached, leading to a wrong result as truncation errors compounded over the query's lifetime. Fix this by taking the actual precision of the decimal value before initializing the expression cache (rather than the default value found in the Type_numeric_attributes parent class) and using it to initialize the expression cache's temporary table result field.

The expression cache had a narrower precision than the decimal value
that it cached, leading to a wrong result as truncation errors
compounded over the query's lifetime.  Fix this by taking the actual
precision of the decimal value before initializing the expression
cache (rather than the default value found in the Type_numeric_attributes
parent class) and using it to initialize the expression cache's
temporary table result field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant