Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash: StoneDB crash: SUM #1953

Open
2 of 3 tasks
ZhengLin-Li opened this issue Jul 19, 2023 · 1 comment
Open
2 of 3 tasks

crash: StoneDB crash: SUM #1953

ZhengLin-Li opened this issue Jul 19, 2023 · 1 comment
Labels
A-bug Something isn't working

Comments

@ZhengLin-Li
Copy link

ZhengLin-Li commented Jul 19, 2023

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

StoneDB V1.0.4 crash when running the following commands:

EXAMPLE 1:

image

EXAMPLE 2:

image

EXAMPLE 3:

image

(Have tried to reduce the statements as fewer as possible)

Expected behavior

EXAMPLE 1:

Return NULL as MySQL 5.7 does:
image

EXAMPLE 2:

Return NULL as MySQL 5.7 does:
image

EXAMPLE 3:

Return NULL as MySQL 5.7 does:
image

How To Reproduce

EXAMPLE 1:

CREATE TABLE t0(c0 INT);
INSERT INTO t0(c0) VALUES (1);
ALTER TABLE t0 CHANGE COLUMN c0 c1 INT;
CREATE TABLE t1(c0 INT);

SELECT SUM(count1) FROM (SELECT CAST(t0.c1 AS UNSIGNED)  as count1 FROM t0, t1) as res;

EXAMPLE 2:

CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 INT) ;
INSERT INTO t1(c0) VALUES (111);

SELECT SUM(count1) FROM (SELECT CAST(t1.c0 AS UNSIGNED)  as count1 FROM t1, t0) as res;

EXAMPLE 3:

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

SELECT SUM(count1) FROM (SELECT CAST(t0.c1 AS UNSIGNED)  as count1 FROM t0, t1) as res;

Environment

Docker image V1.0.4

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

  • Yes, I will!
@ZhengLin-Li ZhengLin-Li added the A-bug Something isn't working label Jul 19, 2023
@ZhengLin-Li ZhengLin-Li changed the title crash: StoneDB crash: INSERT, CHANGE COLUMN, CAST, SUM crash: StoneDB crash: INSERT, CAST, SUM Jul 19, 2023
@ZhengLin-Li ZhengLin-Li changed the title crash: StoneDB crash: INSERT, CAST, SUM crash: StoneDB crash: SUM Jul 29, 2023
@ZhengLin-Li
Copy link
Author

ZhengLin-Li commented Jul 29, 2023

UPDATE:
it seams that the CAST operation is not essential to reproduce this crash, but the SUM operation is essential.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant