phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] dbwong commented on a change in pull request #450: PHOENIX-4345 Error message for incorrect index is not accurate
Date Fri, 05 Apr 2019 22:00:35 GMT
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_r272755729
 
 

 ##########
 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();
+        }
+    }
+
+    @Test
+    public void testIndexNotFoundForDropWongIndexName() throws Exception{
 
 Review comment:
   Same here 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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message