Skip to content
/ server Public

Conversation

@3titoo
Copy link

@3titoo 3titoo commented Feb 7, 2026

Normalize -0.0 to +0.0 in Item_func_neg::real_op() to match binary subtraction behavior. Add a test case in type_newdecimal.

@CLAassistant
Copy link

CLAassistant commented Feb 7, 2026

CLA assistant check
All committers have signed the CLA.

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Feb 9, 2026
Normalize -0.0 to +0.0 in Item_func_neg::real_op() to match
binary subtraction behavior. Add test case in type_newdecimal.

add result for tests

fix tests

Revert whitespace changes in type_newdecimal.result

Revert whitespace changes in type_newdecimal.test
Comment on lines +1830 to +1831
if (res == 0.0)
res= 0.0;
Copy link
Contributor

@ParadoxV5 ParadoxV5 Feb 12, 2026

Choose a reason for hiding this comment

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

To a human, this looks like something a compiler might consider no-op.

Copy link
Contributor

Choose a reason for hiding this comment

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

… but, checking on https://godbolt.org/, it’s not the case for either GCC -O3 or Clang -O3.

Copy link
Author

Choose a reason for hiding this comment

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

Really don't know why it works, but when I remove the condition, it prints -0 when run ( select -''; ), which is the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

4 participants