You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ma...@apache.org on 2017/01/27 01:19:09 UTC

[25/26] phoenix git commit: PHOENIX-3614 Use unique name for index in TransactionIT#testNonTxToTxTable

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/069c371a
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/069c371a
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/069c371a

Branch: refs/heads/calcite
Commit: 069c371aec23a6b87519615eda7eafb895cb1af0
Parents: a44d317
Author: Samarth <sa...@salesforce.com>
Authored: Thu Jan 26 15:49:33 2017 -0800
Committer: Samarth <sa...@salesforce.com>
Committed: Thu Jan 26 15:49:33 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/069c371a/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());