Skip to content

Unexpected Results about Floating-point Type Casting #7018

Description

@suyZhong

Considering the test case below:

CREATE TABLE t1(c1 INT);
INSERT INTO t1(c1) VALUES (1);

SELECT * FROM t1 WHERE (1 AND true); -- 1
SELECT * FROM t1 WHERE (1/1 AND true);
-- Expected: 1
-- Actual: empty

The second SELECT returns an empty result, which is surprising: since the only difference between two queries is the integer 1 and float 1/1. I suppose there's some type coercion issue in floating-point, as mentioned in issue #7006

This test case works well in MySQL 8.0.33, however not in dolt.

I originally find this by building dolt from source version (76c2f46). It could also be reproduced in 1.26.1

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions