stonedb icon indicating copy to clipboard operation
stonedb copied to clipboard

bug: INSERT INTO t1 SELECT * FROM t2 WHERE x IS NULL; condition is null, the StonedB engine reported an error

Open shangyanwen opened this issue 3 years ago • 0 comments

Describe the problem

CREATE TABLE t1 (
  ID_with_null int NULL,
  ID_better int NOT NULL,
  INDEX idx1 (ID_with_null),
  INDEX idx2 (ID_better)
)engine=stonedb;
INSERT INTO t2 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3);

INSERT INTO t1 SELECT * FROM t2 WHERE ID_with_null IS NULL;
##The error results are as follows
ERROR 1030 (HY000): Got error 124 from storage engine

Expected behavior

##Insert the success
INSERT INTO t1 SELECT * FROM t2 WHERE ID_with_null IS NULL;

##note:
1、The problem is that the where condition is null, so we need to analyze NULL;
2、The test was successful on InnoDB

How To Reproduce

CREATE TABLE t1 ( ID_with_null int NULL, ID_better int NOT NULL, INDEX idx1 (ID_with_null), INDEX idx2 (ID_better) )engine=stonedb; INSERT INTO t2 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3);

INSERT INTO t1 SELECT * FROM t2 WHERE ID_with_null IS NULL;

Environment

  1. StoneDB for mysql5.7 (release)
  2. Ubuntu 20.04.4

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

  • [ ] Yes, I will!

shangyanwen avatar Jul 21 '22 09:07 shangyanwen