Skip to content

Unexpected result when using trigonomeric functions #3981

@suyZhong

Description

@suyZhong

Consider the following test cases. It is unexpected that the second query return TRUE and the third query return an empty result. If it is expected that the second query return TRUE, then the third query should return the row in the table.

DROP TABLE t1;

CREATE TABLE t1(c0 INT, PRIMARY KEY(c0));
INSERT INTO t1 (c0) VALUES (1);

SELECT * FROM t1; -- 1
SELECT ASIN(2) > t1.c0 FROM t1; -- TRUE (somewhat unexpected)
SELECT * FROM t1 WHERE (ASIN(2))>(t1.c0);
-- Actual:  Empty set (0 rows, 0 ms)

I originally find this by building the latest source version cd09d93. I could also reproduce this in 2.2.224.

Here's how I start H2 Shell:

java -cp target/h2-2.2.229-SNAPSHOT.jar org.h2.tools.Shell -url jdbc:h2:./test -user sa -password 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions