Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Mohab-Sobhy
Copy link

Summary

This PR adds support for generating DELETE statements in MariaDB.

Changes

  • Added MariaDBDeleteGenerator for creating random DELETE queries.
  • Integrated the new DELETE action into MariaDBProvider.
  • Simplified imports in MariaDBProvider (import sqlancer.mariadb.gen.*).

@hawkingrei
Copy link
Collaborator

 Error:  Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.20.0:validate (eclipseformat) on project sqlancer: File '/home/runner/work/sqlancer/sqlancer/src/sqlancer/mariadb/gen/MariaDBDeleteGenerator.java' has not been previously formatted. Please format file (for example by invoking `mvn net.revelc.code.formatter:formatter-maven-plugin:2.20.0:format`) and commit before running validation! -> [Help 1]

Please run mvn formatter:format to fix the linter.

@mrigger
Copy link
Contributor

mrigger commented Nov 2, 2025

Thanks for the PR! Feel free to ping us for reviews (at least I don't get automatic notifications).

Based on the CI/CD checks, the change causes some tests to fail. Could you please take a look?

@Mohab-Sobhy
Copy link
Author

@mrigger Thanks for the feedback!

I’ve addressed the Checkstyle and MariaDB issues, and the corresponding General tests and DBMS Tests (MariaDB) should now be fixed.

Some of the required checks (e.g., Materialize, TiDB, YugabyteDB) don’t appear to be related to my changes. For instance, the Materialize job fails during setup with the following error:

ERROR: syntax error at or near "SETTING"
LINE 1: SET CLUSTER SETTING sql.stats.forecasts.enabled = false

This seems to be an environment or version issue in the CI setup rather than something caused by the changes in the MariaDB generator.
Could you please confirm if that’s expected or if I should investigate further?

Copy link
Contributor

@mrigger mrigger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it seems the current CI tests are not failing for MariaDB. I remember checking and seeing a DELETE statement fail for MariaDB, but perhaps that was for another PR or got resolved.

I noticed another minor issue. After fixing it, we can merge the PR. Thanks!

case CREATE_INDEX:
nrPerformed = globalState.getRandomly().getInteger(0, 2);
break;
case DELETE:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could also generate them with a low probability? This logic will include 10 DELETE statements into every test case, rather than probabilistically generate some for some test cases, so tables are likely to be empty for many test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants