Skip to content

[Bug]: POW with negative base and fractional exponent returns NaN instead of MySQL error #25308

Closed

Description

@Ariznawlll

Bug Report

MatrixOne Version

Latest origin/main verified locally at 200bfa7e0efb.

Reproduce Steps

set session sql_mode = '';

select pow(-2, 0.5) as pow_domain;

Expected Behavior

MySQL rejects the out-of-domain result:

ERROR 1690 (22003): DOUBLE value is out of range in 'pow(-(2),0.5)'

Actual Behavior

MatrixOne returns NaN:

pow_domain
NaN

Notes

Found during MySQL compatibility Module 6 exploration for numeric functions. Other domain checks such as sqrt(-1), log(-2), and log(1, 100) matched MySQL by returning NULL; this issue is specific to POW/POWER domain handling.

Activity

  1. added
    kind/bug
    severity/s1
    on Jul 1, 2026
  2. added
    severity/s0
    and removed
    severity/s1
    on Jul 2, 2026
  3. added this to the MO-202607 milestone on Jul 2, 2026
  4. added theissue type on Jul 2, 2026
  5. added and removed
    severity/s0
    on Jul 2, 2026
  6. added
    severity/s0
    ai-easy
    and removed on Jul 3, 2026
  7. added a commit that references this issue on Jul 6, 2026
    a5cb217
  8. Ariznawlll commented on Jul 7, 2026

    @Ariznawlll
    CollaboratorAuthor

    Verified on latest main a03bfc1b6 (FIX: FileService implements new DISK-V2 backend to replace DISK (#25272)).

    Validation:

    set session sql_mode = '';
    select pow(-2, 0.5) as pow_domain;

    MO now matches MySQL 8.0.45 by returning an out-of-range error instead of NaN:

    ERROR 1690: data out of range: data type float64, DOUBLE value is out of range in 'pow(-2,0.5)'
    

    Additional checks:

    • pow(4, 0.5) / power(9, 0.5): normal positive-base control case works.
    • power(-2, 0.5): returns ERROR 1690.
    • pow(-8, 1.0 / 3.0): returns ERROR 1690.

    Regression added to motr PR: matrixorigin/motr#39

    MOTR validation:

    14_issue_regression.issue_25308_pow_negative_fraction | success | stmts=5 ok=5 fail=0
    
  9. added 3 commits that reference this issue on Sep 17, 2026
    8896c0f
    b17a4e4
    7a38928
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easykind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions