Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 bfd511827 -> 198ad6fcb


PHOENIX-3614 Use unique name for index in TransactionIT#testNonTxToTxTable


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/198ad6fc
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/198ad6fc
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/198ad6fc

Branch: refs/heads/4.x-HBase-0.98
Commit: 198ad6fcb9d7d7b49eb3314d5ecc76c1b0fbc146
Parents: bfd5118
Author: Samarth <samarth.j...@salesforce.com>
Authored: Thu Jan 26 15:49:11 2017 -0800
Committer: Samarth <samarth.j...@salesforce.com>
Committed: Thu Jan 26 15:49:11 2017 -0800

----------------------------------------------------------------------
 .../src/it/java/org/apache/phoenix/tx/TransactionIT.java      | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/198ad6fc/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
index bde5cc8..1399f6c 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/tx/TransactionIT.java
@@ -255,6 +255,7 @@ public class TransactionIT extends ParallelStatsDisabledIT {
     @Test
     public void testNonTxToTxTable() throws Exception {
         String nonTxTableName = generateUniqueName();
+        String indexName = generateUniqueName() + "_IDX";
 
         Connection conn = DriverManager.getConnection(getUrl());
         conn.createStatement().execute("CREATE TABLE " + nonTxTableName + "(k 
INTEGER PRIMARY KEY, v VARCHAR)");
@@ -263,7 +264,7 @@ public class TransactionIT extends ParallelStatsDisabledIT {
         conn.createStatement().execute("UPSERT INTO " + nonTxTableName + " 
VALUES (3, 'b')");
         conn.commit();
         
-        conn.createStatement().execute("CREATE INDEX IDX ON " + nonTxTableName 
+ "(v)");
+        conn.createStatement().execute("CREATE INDEX " + indexName + " ON " + 
nonTxTableName + "(v)");
         // Reset empty column value to an empty value like it is 
pre-transactions
         HTableInterface htable = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(Bytes.toBytes( 
nonTxTableName));
         List<Put>puts = Lists.newArrayList(new 
Put(PInteger.INSTANCE.toBytes(1)), new Put(PInteger.INSTANCE.toBytes(2)), new 
Put(PInteger.INSTANCE.toBytes(3)));
@@ -276,7 +277,7 @@ public class TransactionIT extends ParallelStatsDisabledIT {
         
         htable = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(Bytes.toBytes( 
nonTxTableName));
         
assertTrue(htable.getTableDescriptor().getCoprocessors().contains(PhoenixTransactionalProcessor.class.getName()));
-        htable = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(Bytes.toBytes("IDX"));
+        htable = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getTable(Bytes.toBytes(indexName));
         
assertTrue(htable.getTableDescriptor().getCoprocessors().contains(PhoenixTransactionalProcessor.class.getName()));
 
         conn.createStatement().execute("UPSERT INTO " + nonTxTableName + " 
VALUES (4, 'c')");
@@ -289,7 +290,7 @@ public class TransactionIT extends ParallelStatsDisabledIT {
         
         conn.createStatement().execute("UPSERT INTO " + nonTxTableName + " 
VALUES (5, 'd')");
         rs = conn.createStatement().executeQuery("SELECT k FROM " + 
nonTxTableName);
-        assertTrue(conn.unwrap(PhoenixConnection.class).getTable(new 
PTableKey(null, "IDX")).isTransactional());
+        assertTrue(conn.unwrap(PhoenixConnection.class).getTable(new 
PTableKey(null, indexName)).isTransactional());
         assertTrue(rs.next());
         assertEquals(1,rs.getInt(1));
         assertTrue(rs.next());

Reply via email to