stonedb icon indicating copy to clipboard operation
stonedb copied to clipboard

bug: after altering operation, `NULL` values is evlauated to be `TRUE` in StoneDB

Open zhenglin-charlie-li opened this issue 2 years ago • 0 comments

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • [X] I confirm there is no existing issue for this

Describe the problem

SQLancer found that, after altering operation, NULL values is evlauated to be TRUE in StoneDB.

However, accroding to link: In MySQL, 0 or NULL means false and anything else means true. The default truth value from a boolean operation is 1.

Result in StoneDB:

image

Result in MySQL 5.7:

image

Expected behavior

No response

How To Reproduce

CREATE TABLE t0(c0 DATE);
INSERT INTO t0(c0) VALUES (DATE '1970-01-04'), (DEFAULT);
ALTER TABLE t0 CHANGE c0 c0 TEXT ;
SELECT * FROM t0 WHERE t0.c0 IS TRUE;
SELECT t0.c0 IS TRUE FROM t0;

Environment

Docker image v:1.0.4

Are you interested in submitting a PR to solve the problem?

  • [ ] Yes, I will!

zhenglin-charlie-li avatar Jul 18 '23 01:07 zhenglin-charlie-li