diff --git a/CHANGES b/CHANGES index 985bac4cd..204f4b06b 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ Version 8.0.8 + - Fix for BUG#26750807, MASTER : NULL POINTER EXCEPTION IN SCHEMA.DROPVIEW(NULL). + - Fix for BUG#26750705, MASTER : ERROR - UNSUPPORTED CONVERSION FROM TIME TO JAVA.SQL.DATE. - WL#10620, DevAPI: SHA256 Authentication support. diff --git a/src/main/java/com/mysql/cj/xdevapi/SchemaImpl.java b/src/main/java/com/mysql/cj/xdevapi/SchemaImpl.java index 1911f2d8a..12d44ff2f 100644 --- a/src/main/java/com/mysql/cj/xdevapi/SchemaImpl.java +++ b/src/main/java/com/mysql/cj/xdevapi/SchemaImpl.java @@ -206,6 +206,9 @@ public void dropTable(String tableName) { @Override public void dropView(String viewName) { + if (viewName == null) { + throw new XDevAPIError(Messages.getString("CreateTableStatement.0", new String[] { "viewName" })); + } this.mysqlxSession.dropView(this.name, viewName, true); } } diff --git a/src/test/java/testsuite/x/devapi/SchemaTest.java b/src/test/java/testsuite/x/devapi/SchemaTest.java index a2eeeb789..4c2764ecf 100644 --- a/src/test/java/testsuite/x/devapi/SchemaTest.java +++ b/src/test/java/testsuite/x/devapi/SchemaTest.java @@ -668,6 +668,14 @@ public void testViewDDL() { // TODO could cause problems on different server versions assertEquals(ddlCheck, ddl); + // 7. Null view name should cause a XDevAPIError + assertThrows(XDevAPIError.class, "Parameter 'viewName' must not be null.", new Callable() { + public Void call() throws Exception { + SchemaTest.this.schema.dropView(null); + return null; + } + }); + } catch (Throwable t) { t.printStackTrace(); throw t;