Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CBRD-23600] Unexpected rounding up a numeric value when the case expressions are used recursively #2180

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

hgryoo
Copy link
Member

@hgryoo hgryoo commented Jan 15, 2020

http://jira.cubrid.org/browse/CBRD-23600

When the CASE expressions are used recursively and values specified in the THEN clause are numeric and integer types order repeatedly, one of the numeric values is rounded up unexpectedly.

this bug causes because the arg1 pointer variable for PT_NODE is incorrectly re-used at the part of checking the next case clause. please see the changes in this PR. To make a common data type of expression, pt_upd_domain_info () is invoked with the possibly wrong assigned arg1. As a consequence, the data type is going to be updated incorrect precision and scale.

It fixes to keep the arg1 from being re-used incorrectly.

@hgryoo hgryoo self-assigned this Jan 15, 2020
@hgryoo hgryoo added the bug label Jan 15, 2020
Copy link
Contributor

@beyondykk9 beyondykk9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you found a good debugging point. This error is commonly found when the function routine is too long.

Copy link
Contributor

@shparkcubrid shparkcubrid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if there was an explanation of why the reuse of arg1 was not the intended reuse.

@hgryoo hgryoo merged commit 781302c into CUBRID:develop Jan 31, 2020
@hgryoo hgryoo added this to the damson milestone Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants