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

MySQL Join implementation #921

Merged
merged 1 commit into from
Mar 18, 2024
Merged

MySQL Join implementation #921

merged 1 commit into from
Mar 18, 2024

Conversation

bajinsheng
Copy link
Collaborator

Part of #918

@bajinsheng bajinsheng requested a review from mrigger March 18, 2024 00:40
@@ -148,7 +140,7 @@ private static int mapActions(MySQLGlobalState globalState, Action a) {

@Override
public void generateDatabase(MySQLGlobalState globalState) throws Exception {
while (globalState.getSchema().getDatabaseTables().size() < Randomly.smallNumber() + 1) {
while (globalState.getSchema().getDatabaseTables().size() < Randomly.getNotCachedInteger(1, 6)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

6 tables seem like a lot here and might have a detrimental effect on performance. Could we perhaps set the limit depending on the test oracle here?

@@ -148,7 +140,7 @@ private static int mapActions(MySQLGlobalState globalState, Action a) {

@Override
public void generateDatabase(MySQLGlobalState globalState) throws Exception {
while (globalState.getSchema().getDatabaseTables().size() < Randomly.smallNumber() + 1) {
while (globalState.getSchema().getDatabaseTables().size() < Randomly.getNotCachedInteger(1, 2)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could just leave Randomly.smallNumber() + 1, which might sometimes generate more tables than 2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. Small number returns (-1, 1) with a Gaussian distribution, which means in most situations, there is only one table.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification!

@mrigger mrigger merged commit 9362681 into sqlancer:main Mar 18, 2024
11 of 21 checks passed
albertZhangTJ pushed a commit to albertZhangTJ/sqlancer-lancerfuzz that referenced this pull request Mar 20, 2024
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.

None yet

2 participants