ChinmaySKulkarni commented on a change in pull request #886:
URL: https://github.com/apache/phoenix/pull/886#discussion_r490446630



##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
##########
@@ -984,46 +1063,116 @@ public Thread newThread(Runnable r) {
             tableDdl = "ALTER TABLE " + fullTableName + " ADD v3 INTEGER";
             try {
                 // add the same column to the base table with a different type
-                conn.createStatement().execute(tableDdl);
-                fail("Creating a view while concurrently dropping the base 
table should fail");
-            } catch (ConcurrentTableMutationException e) {
+                stmt.execute(tableDdl);
+                fail("Adding a column of a to a base table should fail when 
the same column of a "
+                        + "different type is being added to a child view");
+            } catch (ConcurrentTableMutationException ignored) {
             }
             latch2.countDown();
 
             Exception e = future.get();
             assertNull(e);
 
-            // add a the same column to the another view  to ensure that the 
cell used
+            // add the same column to the another view  to ensure that the 
cell used
             // to prevent concurrent modifications was removed
             ddl = "CREATE VIEW " + fullViewName2 + " (v2 VARCHAR) AS SELECT * 
FROM " 
                     + fullTableName + " WHERE k = 6";
-            conn.createStatement().execute(ddl);
+            stmt.execute(ddl);
             tableDdl = "ALTER VIEW " + fullViewName2 + " ADD v3 INTEGER";
-            conn.createStatement().execute(tableDdl);
+            stmt.execute(tableDdl);
+        }
+    }
+
+    // Test that we do a checkAndPut even in case of tenant-specific 
connections (see PHOENIX-6075)
+    @Test
+    public void testConcurrentAddSameColumnDifferentTypeTenantView() throws 
Exception {

Review comment:
       This is the new test. 




----------------------------------------------------------------
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]


Reply via email to