pvary commented on a change in pull request #2547:
URL: https://github.com/apache/hive/pull/2547#discussion_r707189777



##########
File path: ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java
##########
@@ -3243,4 +3251,42 @@ public void testFullTableReadLock() throws Exception {
     checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "tab_acid", 
null, locks);
     checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", 
"tab_not_acid", null, locks);
   }
+
+  @Test
+  public void testInsertSnapshotIsolation() throws Exception {
+    driver.run("create table if not exists acid_insert_snapshot_isolation (a 
int, b int) " +
+        "stored as orc TBLPROPERTIES ('transactional'='true')");
+    driver.compileAndRespond("insert into acid_insert_snapshot_isolation 
values(1,2)");
+    DbTxnManager txnMgr2 = (DbTxnManager) 
TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf);
+    swapTxnManager(txnMgr2);
+    driver2.compileAndRespond("select * from acid_insert_snapshot_isolation");
+    swapTxnManager(txnMgr);
+    driver.run();
+    txnHandler.cleanTxnToWriteIdTable();
+    swapTxnManager(txnMgr2);
+    driver2.run();
+    List res = new ArrayList();
+    driver2.getFetchTask().fetch(res);
+    Assert.assertEquals(0, res.size());
+  }
+
+  @Test
+  public void testUpdateSnapshotIsolation() throws Exception {
+    driver.run("create table if not exists acid_update_snapshot_isolation (a 
int, b int) " +
+        "stored as orc TBLPROPERTIES ('transactional'='true')");
+        driver.run("insert into acid_update_snapshot_isolation values(1,2)");

Review comment:
       nit: formatting




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to