Skip to content

Commit a3859a9

Browse files
committed
New validation on wildcard was added to AbstractJdbcSource.java,as a sample solution to polypheny#447
1 parent 2dbce56 commit a3859a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/jdbc-adapter-framework/src/main/java/org/polypheny/db/adapter/jdbc/sources/AbstractJdbcSource.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ public Map<String, List<ExportedColumn>> getExportedColumns() {
205205
Connection connection = statement.getConnection();
206206
DatabaseMetaData dbmd = connection.getMetaData();
207207

208-
String[] tables = settings.get( "tables" ).split( "," );
208+
String tablesString = settings.get("tables");
209+
if ("*".equals(tablesString)) {
210+
throw new GenericRuntimeException("Wildcard '*' is not allowed for table names.");
211+
}
212+
String[] tables = tablesString.split(",");
209213
for ( String str : tables ) {
210214
String[] names = str.split( "\\." );
211215
if ( names.length == 0 || names.length > 2 || (requiresSchema() && names.length == 1) ) {

0 commit comments

Comments
 (0)