You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2020/03/04 17:48:32 UTC

[GitHub] [phoenix] siddhimehta commented on a change in pull request #710: PHOENIX-5673 : The mutation state is silently getting cleared on the …

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:
users@infra.apache.org


With regards,
Apache Git Services