diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index a3bd9aa..e5f0a5a 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2607,6 +2607,7 @@ public HiveConf(HiveConf other) { auxJars = other.auxJars; origProp = (Properties)other.origProp.clone(); restrictList.addAll(other.restrictList); + modWhiteListPattern = other.modWhiteListPattern; } public Properties getAllProperties() { diff --git a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java index 6f1a8b2..bd0ba0e 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcWithSQLAuthorization.java @@ -175,4 +175,29 @@ private void checkAssertContains(String expectedSubString, String message) { fail("Message [" + message + "] does not contain substring [" + expectedSubString + "]"); } + @Test + public void testConfigWhiteList() throws Exception { + + // create tables as user1 + Connection hs2Conn = getConnection("user1"); + + Statement stmt = hs2Conn.createStatement(); + try { + stmt.execute("set hive.metastore.uris=x"); + fail("exception expected"); + } catch (SQLException e) { + String msg = "Cannot modify hive.metastore.uris at runtime. " + + "It is not in list of params that are allowed to be modified at runtime"; + assertTrue(e.getMessage().contains(msg)); + } + + stmt.execute("set hive.exec.reducers.bytes.per.reducer=10000"); + //no exception should be thrown + + stmt.close(); + hs2Conn.close(); + } + + + }