Skip to content

Commit

Permalink
Fix for BUG#26750807, MASTER : NULL POINTER EXCEPTION IN
Browse files Browse the repository at this point in the history
SCHEMA.DROPVIEW(NULL).
  • Loading branch information
soklakov committed Sep 12, 2017
1 parent 7a9c0bd commit f443c3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/mysql/cj/xdevapi/SchemaImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
8 changes: 8 additions & 0 deletions src/test/java/testsuite/x/devapi/SchemaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Void>() {
public Void call() throws Exception {
SchemaTest.this.schema.dropView(null);
return null;
}
});

} catch (Throwable t) {
t.printStackTrace();
throw t;
Expand Down

0 comments on commit f443c3a

Please sign in to comment.