dbwong commented on a change in pull request #450: PHOENIX-4345 Error message
for incorrect index is not accurate
URL: https://github.com/apache/phoenix/pull/450#discussion_r272755633
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexUsageIT.java
##########
@@ -772,4 +773,43 @@ public void helpTestIndexExpressionWithJoin(boolean
mutable,
}
}
+ @Test
+ public void testIndexNotFoundForWrongIndexNameRebuild() throws Exception{
+ Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+ Connection conn = DriverManager.getConnection(getUrl(), props);
+ String dataTableName = generateUniqueName();
+ String wrongIndexName = generateUniqueName();
+
+ try {
+ conn.createStatement().execute("CREATE TABLE " + dataTableName +
+ " (k VARCHAR NOT NULL PRIMARY KEY, v VARCHAR)");
+
+ conn.createStatement().execute(
+ "ALTER INDEX " + wrongIndexName + " ON " + dataTableName +
" rebuild");
+
+ }catch (SQLException e) {
+ assertEquals(e.getErrorCode(),
SQLExceptionCode.INDEX_UNDEFINED.getErrorCode());
+ } finally {
+ conn.close();
+ }
+ }
Review comment:
This test will pass if the exception isn't thrown.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services