Skip to content

Commit

Permalink
HIVE-20355: Clean up parameter of HiveConnection.setSchema (Daniel Da…
Browse files Browse the repository at this point in the history
…i, reviewed by Sankar Hariappan)
  • Loading branch information
daijy committed Sep 15, 2018
1 parent 01083a6 commit 2c8e679
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,9 @@ public void setSchema(String schema) throws SQLException {
if (schema == null || schema.isEmpty()) {
throw new SQLException("Schema name is null or empty");
}
if (schema.contains(";")) {
throw new SQLException("invalid schema name");
}
Statement stmt = createStatement();
stmt.execute("use " + schema);
stmt.close();
Expand Down

0 comments on commit 2c8e679

Please sign in to comment.