Skip to content

Commit

Permalink
Add a workaround for issue 799 (sqlancer#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrigger authored Jun 7, 2023
1 parent e418489 commit d013225
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/sqlancer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,32 @@
import com.beust.jcommander.JCommander;
import com.beust.jcommander.JCommander.Builder;

import sqlancer.arangodb.ArangoDBProvider;
import sqlancer.citus.CitusProvider;
import sqlancer.clickhouse.ClickHouseProvider;
import sqlancer.cnosdb.CnosDBProvider;
import sqlancer.cockroachdb.CockroachDBProvider;
import sqlancer.common.log.Loggable;
import sqlancer.common.query.Query;
import sqlancer.common.query.SQLancerResultSet;
import sqlancer.cosmos.CosmosProvider;
import sqlancer.databend.DatabendProvider;
import sqlancer.doris.DorisProvider;
import sqlancer.duckdb.DuckDBProvider;
import sqlancer.h2.H2Provider;
import sqlancer.hsqldb.HSQLDBProvider;
import sqlancer.mariadb.MariaDBProvider;
import sqlancer.materialize.MaterializeProvider;
import sqlancer.mongodb.MongoDBProvider;
import sqlancer.mysql.MySQLProvider;
import sqlancer.oceanbase.OceanBaseProvider;
import sqlancer.postgres.PostgresProvider;
import sqlancer.questdb.QuestDBProvider;
import sqlancer.sqlite3.SQLite3Provider;
import sqlancer.tidb.TiDBProvider;
import sqlancer.timescaledb.TimescaleDBProvider;
import sqlancer.yugabyte.ycql.YCQLProvider;
import sqlancer.yugabyte.ysql.YSQLProvider;

public final class Main {

Expand Down Expand Up @@ -609,9 +632,41 @@ private boolean run(MainOptions options, ExecutorService execService,
for (DatabaseProvider<?, ?, ?> provider : loader) {
providers.add(provider);
}
checkForIssue799(providers);
return providers;
}

// see https://github.com/sqlancer/sqlancer/issues/799
private static void checkForIssue799(List<DatabaseProvider<?, ?, ?>> providers) {
if (providers.isEmpty()) {
System.err.println(
"No DBMS implementations (i.e., instantiations of the DatabaseProvider class) were found. You likely ran into an issue described in https://github.com/sqlancer/sqlancer/issues/799. As a workaround, I now statically load all supported providers as of June 7, 2023.");
providers.add(new ArangoDBProvider());
providers.add(new CitusProvider());
providers.add(new ClickHouseProvider());
providers.add(new CnosDBProvider());
providers.add(new CockroachDBProvider());
providers.add(new CosmosProvider());
providers.add(new DatabendProvider());
providers.add(new DorisProvider());
providers.add(new DuckDBProvider());
providers.add(new H2Provider());
providers.add(new HSQLDBProvider());
providers.add(new MariaDBProvider());
providers.add(new MaterializeProvider());
providers.add(new MongoDBProvider());
providers.add(new MySQLProvider());
providers.add(new OceanBaseProvider());
providers.add(new PostgresProvider());
providers.add(new QuestDBProvider());
providers.add(new SQLite3Provider());
providers.add(new TiDBProvider());
providers.add(new TimescaleDBProvider());
providers.add(new YCQLProvider());
providers.add(new YSQLProvider());
}
}

private static synchronized void startProgressMonitor() {
if (progressMonitorStarted) {
/*
Expand Down

0 comments on commit d013225

Please sign in to comment.