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

feat(fuzz): add fuzz test with delete rows #3867

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hanxuanliang
Copy link

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

Closes #3761

What's changed and what's your intention?

This PR implements fuzz test:

  • generate delete SQL expression
  • add delete rows fuzz test

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label May 6, 2024
@hanxuanliang
Copy link
Author

Currently, I am testing the deletion of a row and have encountered a peculiar issue:

  • fuzz test case:
CREATE TABLE `esT`(
  `eT` TIMESTAMP(3) TIME INDEX,
  `eAque` BOOLEAN,
  `DoLOruM` INT,
  `repudiAndae` FLOAT,
  `ULLaM` BOOLEAN,
  `COnSECTeTuR` SMALLINT DEFAULT -31852,
  `DOLOrIBUS` FLOAT NOT NULL,
  `QUiS` SMALLINT NULL,
  `consEquatuR` BOOLEAN NOT NULL,
  `vERO` BOOLEAN,
  PRIMARY KEY(`repudiAndae`, `ULLaM`, `DoLOruM`)
) ENGINE = mito;
  • DDL rows:
INSERT INTO
  `esT` (
    `consEquatuR`,
    `eAque`,
    `eT`,
    `repudiAndae`,
    `DOLOrIBUS`
  )
VALUES
  (
    false,
    false,
    '+234049-06-04 01:11:41.163+0000',
    0.2339946,
    0.97377783
  ),
  (
    false,
    true,
    '-19578-12-20 11:45:59.875+0000',
    NULL,
    0.3535998
  );
  
  DELETE FROM
  `esT`
WHERE
  `DOLOrIBUS` = 0.73806196
  AND `consEquatuR` = false;
  • error:
Failed to execute query: DELETE FROM `esT` WHERE `DOLOrIBUS` = 0.73806196 AND `consEquatuR` = false err=0: Table operation error, at src/frontend/src/instance.rs:302:14
1: Failed to execute logical plan, at /Users/hanfox/Desktop/code/contribute/greptimedb/src/operator/src/statement.rs:269:14
2: Failed to create RecordBatch, at src/query/src/datafusion.rs:134:31
3: , at src/common/recordbatch/src/adapter.rs:254:55
4: External(0: , at src/common/recordbatch/src/adapter.rs:254:55
1: External(0: , at src/common/recordbatch/src/adapter.rs:254:55
1: External(External(0: Fail to create datafusion record batch, at /Users/hanfox/Desktop/code/contribute/greptimedb/src/common/recordbatch/src/recordbatch.rs:51:14
1: InvalidArgumentError("column types must match schema types, expected Float32 but found Int32 at column index 3")))))

At the same time, after I connect to port 4002 using mycli: select * from est;. The same error may also occur.

I don't understand why there would be a type exception issue in repudiAndae? From the insert sql, this input also appears to be correct.

@WenyXu

@WenyXu
Copy link
Member

WenyXu commented May 7, 2024

Thank! @hanxuanliang, I reproduced this problem. We'll fix it as soon as possible.

@killme2008
Copy link
Contributor

Thank you for conducting these important tests. Your great job helped us uncover some previously unknown bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fuzz test for deleting rows from tables
3 participants