stoneatom / stonedb

StoneDB is an Open-Source MySQL HTAP and MySQL-Native DataBase for OLTP, Real-Time Analytics, a counterpart of MySQLHeatWave. (https://stonedb.io)
https://stonedb.io/
GNU General Public License v2.0
857 stars 140 forks source link

crash: StoneDB crash when executing the command (SELECT, HAING, GROUP BY, IS NULL) #1941

Closed ZhengLin-Li closed 11 months ago

ZhengLin-Li commented 11 months ago

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

Describe the problem

SQLancer find that StoneDB will crash when executing the command:

SELECT *
FROM t0
GROUP BY t0.c0
HAVING (t0.c0 IS NULL)
UNION ALL
SELECT *
FROM t0
GROUP BY t0.c0
HAVING (NOT (t0.c0 IS NULL))
UNION ALL
SELECT *
FROM t0
GROUP BY t0.c0
HAVING (((t0.c0 IS NULL)) IS NULL);

image

Expected behavior

will not crash and return empty set

How To Reproduce

drop database db100;
create database db100;
use db100;
create table t0 (c0 int);

SELECT *
FROM t0
GROUP BY t0.c0
HAVING (t0.c0 IS NULL)
UNION ALL
SELECT *
FROM t0
GROUP BY t0.c0
HAVING (NOT (t0.c0 IS NULL))
UNION ALL
SELECT *
FROM t0
GROUP BY t0.c0
HAVING (((t0.c0 IS NULL)) IS NULL);

Environment

docker latest version

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

haitaoguan commented 11 months ago

image

./mysqld Ver 5.7.36-StoneDB-v1.0.4 for Linux on x86_64 (build-) build information as follow: Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev Branch name: stonedb-5.7-dev Last commit ID: 2bb2d48 Last commit time: Date: Thu Jul 13 10:04:56 2023 +0800 Build time: Date: Thu Jul 13 02:11:43 UTC 2023

ZhengLin-Li commented 11 months ago

@haitaoguan So, it means that this issue has been fixed? If so, maybe we can close this issue.