Skip to content

Commit 6f255a5

Browse files
committed
feat: throw an exception if someone attempts to pass creds to DuckDB
1 parent 8a16b51 commit 6f255a5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/sqlancer/duckdb/DuckDBProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sqlancer.AbstractAction;
1212
import sqlancer.DatabaseProvider;
1313
import sqlancer.IgnoreMeException;
14+
import sqlancer.MainOptions;
1415
import sqlancer.Randomly;
1516
import sqlancer.SQLConnection;
1617
import sqlancer.SQLGlobalState;
@@ -143,6 +144,11 @@ public SQLConnection createDatabase(DuckDBGlobalState globalState) throws SQLExc
143144
String url = "jdbc:duckdb:" + databaseFile;
144145
tryDeleteDatabase(databaseFile);
145146

147+
MainOptions options = globalState.getOptions();
148+
if (!(options.isDefaultUsername() && options.isDefaultPassword())) {
149+
throw new AssertionError("DuckDB doesn't support credentials (username/password)");
150+
}
151+
146152
Connection conn = DriverManager.getConnection(url);
147153
Statement stmt = conn.createStatement();
148154
stmt.execute("PRAGMA checkpoint_threshold='1 byte';");

0 commit comments

Comments
 (0)