Repository: phoenix Updated Branches: refs/heads/4.9-HBase-0.98 918dabf26 -> aee05ae7c
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/aee05ae7 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/aee05ae7 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/aee05ae7 Branch: refs/heads/4.9-HBase-0.98 Commit: aee05ae7c91af185252b2135defc41ef06faa8a1 Parents: 918dabf Author: Samarth <samarth.j...@salesforce.com> Authored: Thu Jan 26 15:50:42 2017 -0800 Committer: Samarth <samarth.j...@salesforce.com> Committed: Thu Jan 26 15:50:42 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/aee05ae7/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 83128f1..56444ba 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());