phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject git commit: Fix broken view unit test
Date Tue, 04 Mar 2014 19:47:53 GMT
Repository: incubator-phoenix
Updated Branches:
  refs/heads/master 025782d19 -> 646213744


Fix broken view unit test


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

Branch: refs/heads/master
Commit: 6462137444a68dfb5110a4b53ca2cee94e1cf9c7
Parents: 025782d
Author: James Taylor <jamestaylor@apache.org>
Authored: Tue Mar 4 11:47:46 2014 -0800
Committer: James Taylor <jamestaylor@apache.org>
Committed: Tue Mar 4 11:47:46 2014 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/schema/MetaDataClient.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/64621374/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 59fd613..49316ee 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
@@ -892,9 +892,10 @@ public class MetaDataClient {
             // Don't add link for mapped view, as it just points back to itself and causes
the drop to
             // fail because it looks like there's always a view associated with it.
             if (!physicalNames.isEmpty()) {
-                // Upsert physical name for mapped view if the parent name is different than
the name
+                // Upsert physical name for mapped view only if the full physical table name
is different than the full table name
+                // Otherwise, we end up with a self-referencing link and then cannot ever
drop the view.
                 if (viewType != ViewType.MAPPED
-                        || !physicalNames.get(0).getString().equals(PNameFactory.newName(SchemaUtil.getTableName(schemaName,
parentTableName)))) {
+                        || !physicalNames.get(0).getString().equals(SchemaUtil.getTableName(schemaName,
tableName))) {
                     // Add row linking from data table row to physical table row
                     PreparedStatement linkStatement = connection.prepareStatement(CREATE_LINK);
                     for (PName physicalName : physicalNames) {


Mime
View raw message