package sqlancer.dbms;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

import org.junit.jupiter.api.Test;

import sqlancer.Main;

public class TestMySQL {

    String mysqlAvailable = System.getenv("MYSQL_AVAILABLE");
    boolean mysqlIsAvailable = mysqlAvailable != null && mysqlAvailable.equalsIgnoreCase("true");

    @Test
    public void testMySQL() {
        assumeTrue(mysqlIsAvailable);
        assertEquals(0,
                Main.executeMain(new String[] { "--random-seed", "0", "--timeout-seconds", TestConfig.SECONDS,
                        "--max-expression-depth", "1", "--num-threads", "4", "--num-queries", TestConfig.NUM_QUERIES,
                        "mysql" }));
    }

    @Test
    public void testPQS() {
        assumeTrue(mysqlIsAvailable);
        assertEquals(0,
                Main.executeMain(new String[] { "--random-seed", "0", "--timeout-seconds", TestConfig.SECONDS,
                        "--num-threads", "4", "--random-string-generation", "ALPHANUMERIC", "--database-prefix",
                        "pqsdb" /* Workaround for connections not being closed */, "--num-queries", "100000", "mysql",
                        "--oracle", "PQS" }));
    }

}

@@ -415,21 +415,19 @@
 oid test
-MySQL
+PQS
 () %7B%0A   
@@ -627,129 +627,267 @@
  %22--
-max-expression-depth%22, %221%22, %22--num-threads%22, %224%22, %22--num-queries%22, TestConfig.NUM_QUERIES,%0A                        %22mysql
+num-threads%22, %224%22, %22--random-string-generation%22, %22ALPHANUMERIC%22, %22--database-prefix%22,%0A                        %22pqsdb%22 /* Workaround for connections not being closed */, %22--num-queries%22,%0A                        TestConfig.NUM_QUERIES, %22mysql%22, %22--oracle%22, %22PQS
 %22 %7D)
@@ -918,35 +918,37 @@
 public void test
-PQS
+MySQL
 () %7B%0A        ass
@@ -1140,211 +1140,97 @@
  %22--
-num-threads%22, %224%22, %22--random-string-generation%22, %22ALPHANUMERIC%22, %22--database-prefix%22,%0A                        %22pqsdb%22 /* Workaround for connections not being closed */, %22--num-queries%22, %22100000%22, %22mysql%22
+max-expression-depth%22, %221%22, %22--num-threads%22, %224%22, %22--num-queries%22, TestConfig.NUM_QUERIES
 ,%0A  
@@ -1252,31 +1252,21 @@
        %22
---oracle%22, %22PQS
+mysql
 %22 %7D));%0A 

Use the default number of queries