You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by td...@apache.org on 2015/04/16 22:08:57 UTC

phoenix git commit: Do not set QueryServices.DROP_METADATA_ATTRIB in TransactionIT

Repository: phoenix
Updated Branches:
  refs/heads/txn 20cf437fd -> f0c4d0661


Do not set QueryServices.DROP_METADATA_ATTRIB in TransactionIT


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

Branch: refs/heads/txn
Commit: f0c4d06615bc23fb946ff5b7f34eb271673bf0b9
Parents: 20cf437
Author: Thomas <td...@salesforce.com>
Authored: Thu Apr 16 13:08:45 2015 -0700
Committer: Thomas <td...@salesforce.com>
Committed: Thu Apr 16 13:08:45 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/phoenix/end2end/AlterTableIT.java   |  2 +-
 .../org/apache/phoenix/transactions/TransactionIT.java  | 12 ------------
 .../phoenix/query/ConnectionQueryServicesImpl.java      |  3 ---
 .../java/org/apache/phoenix/schema/MetaDataClient.java  |  2 +-
 .../java/org/apache/phoenix/util/TransactionUtil.java   |  2 +-
 5 files changed, 3 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f0c4d066/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
index 9e7a4a9..46f51cf 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java
@@ -2005,7 +2005,7 @@ public class AlterTableIT extends BaseOwnClusterHBaseManagedTimeIT {
             conn.createStatement().execute(ddl);
             fail();
         } catch (SQLException e) {
-            assertEquals(SQLExceptionCode.SET_UNSUPPORTED_PROP_ON_ALTER_TABLE.getErrorCode(),e.getErrorCode());
+            assertEquals(SQLExceptionCode.CANNOT_ALTER_PROPERTY.getErrorCode(),e.getErrorCode());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f0c4d066/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java
index 08f972d..35f88e4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/transactions/TransactionIT.java
@@ -35,7 +35,6 @@ import org.apache.phoenix.end2end.Shadower;
 import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.query.QueryConstants;
-import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.DateUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.TestUtil;
@@ -60,7 +59,6 @@ public class TransactionIT extends BaseHBaseManagedTimeIT {
     @Shadower(classBeingShadowed = BaseHBaseManagedTimeIT.class)
     public static void doSetup() throws Exception {
         Map<String,String> props = Maps.newHashMapWithExpectedSize(3);
-        props.put(QueryServices.DROP_METADATA_ATTRIB, Boolean.toString(true));
         props.put(TxConstants.ALLOW_EMPTY_VALUES_KEY, Boolean.toString(true));
         setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
     }
@@ -107,18 +105,8 @@ public class TransactionIT extends BaseHBaseManagedTimeIT {
 	        // verify no rows returned 
 			rs = conn.createStatement().executeQuery(selectSql);
 	     	assertFalse(rs.next());
-	     	
 	        conn.commit();
 	        
-	        Scan scan = new Scan();
-	        PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
-	        HTableInterface table = pconn.getQueryServices().getTable(Bytes.toBytes(FULL_TABLE_NAME));
-	        ResultScanner results = table.getScanner(scan);
-	        for (Result res : results) {
-	        	System.err.println(res.toString());
-	        }
-	        results.close();
-	        
 	        // verify row exists
 	        rs = conn.createStatement().executeQuery(selectSql);
 	        validateRowKeyColumns(rs, 1);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f0c4d066/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
index 20ab602..37a28fb 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
@@ -2071,9 +2071,6 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement
     @Override
     public MutationState updateData(MutationPlan plan) throws SQLException {
         TableRef currentTable = plan.getContext().getCurrentTable();
-		if (currentTable!=null && currentTable.getTable().isTransactional()) {
-            return new MutationState(1, plan.getConnection());
-        }
         return plan.execute();
     }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f0c4d066/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
index 7c78089..7e332f9 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
@@ -592,7 +592,7 @@ public class MetaDataClient {
 
     public MutationState createTable(CreateTableStatement statement, byte[][] splits, PTable parent, String viewStatement, ViewType viewType, byte[][] viewColumnConstants, BitSet isViewColumnReferenced) throws SQLException {
         PTable table = createTableInternal(statement, splits, parent, viewStatement, viewType, viewColumnConstants, isViewColumnReferenced, null, null);
-        if (table == null || table.getType() == PTableType.VIEW) {
+        if (table == null || table.getType() == PTableType.VIEW || table.isTransactional()) {
             return new MutationState(0,connection);
         }
         // Hack to get around the case when an SCN is specified on the connection.

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f0c4d066/phoenix-core/src/main/java/org/apache/phoenix/util/TransactionUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/TransactionUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/TransactionUtil.java
index 33079d8..061a98b 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/TransactionUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/TransactionUtil.java
@@ -50,7 +50,7 @@ public class TransactionUtil {
     }
     
     public static Transaction decodeTxnState(byte[] txnBytes) throws IOException {
-        return txnBytes == null ? null : codec.decode(txnBytes);
+    	return (txnBytes == null || txnBytes.length==0) ? null : codec.decode(txnBytes);
     }
 
     public static SQLException getSQLException(TransactionFailureException e) {