siddhimehta commented on a change in pull request #710: PHOENIX-5673 : The 
mutation state is silently getting cleared on the …
URL: https://github.com/apache/phoenix/pull/710#discussion_r387830943
 
 

 ##########
 File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/MutationStateIT.java
 ##########
 @@ -499,4 +499,27 @@ public void testSplitMutationsIntoSameGroupForSingleRow() 
throws Exception {
         }
     }
 
+    @Test(expected = SQLException.class)
+    public void testDDLwithPendingMutations() throws Exception {
+        String tableName = generateUniqueName();
+        ensureTableCreated(getUrl(), tableName, TestUtil.PTSDB_NAME, null, 
null, null);
+        Properties props = new Properties();
+        props.setProperty(QueryServices.PENDING_MUTATIONS_DDL_THROW_ATTRIB, 
Boolean.toString(true));
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+
+        // setting auto commit to false
+        conn.setAutoCommit(false);
+
+        // Run upsert queries but donot commit
+        PreparedStatement stmt =
+                conn.prepareStatement("UPSERT INTO " + tableName
+                        + " (inst,host,\"DATE\") 
VALUES(?,'b',CURRENT_DATE())");
+        stmt.setString(1, "a");
+        stmt.execute();
+
+        // Create a ddl statement
+        String tableName2 = generateUniqueName();
+        String ddl = "CREATE TABLE " + tableName2 + " (V BIGINT PRIMARY KEY, K 
BIGINT)";
+        conn.createStatement().execute(ddl);
 
 Review comment:
   Done. Used ExpectedException which asserts exception & message and fails if 
no exceptions

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

Reply via email to