Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 6e56eddc9 -> a9e040184


PHOENIX-2066 Existing client fails initialization due to upgrade atttempting to 
create column with no name (Lukas Lalinsky)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: a9e040184d2af3c72e125115cf6d755d52ad67ff
Parents: 6e56edd
Author: James Taylor <[email protected]>
Authored: Wed Jun 24 08:11:12 2015 -0700
Committer: James Taylor <[email protected]>
Committed: Wed Jun 24 08:17:16 2015 -0700

----------------------------------------------------------------------
 .../phoenix/query/ConnectionQueryServicesImpl.java    | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/a9e04018/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 f3be8f2..28b47aa 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
@@ -1941,11 +1941,15 @@ public class ConnectionQueryServicesImpl extends 
DelegateQueryServices implement
                                     columnsToAdd += ", " + 
PhoenixDatabaseMetaData.INDEX_TYPE + " " + 
PUnsignedTinyint.INSTANCE.getSqlTypeName()
                                             + ", " + 
PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP + " " + 
PLong.INSTANCE.getSqlTypeName();
                                 }
-                                // Ugh..need to assign to another local 
variable to keep eclipse happy.
-                                PhoenixConnection newMetaConnection = 
addColumnsIfNotExists(metaConnection,
-                                        PhoenixDatabaseMetaData.SYSTEM_CATALOG,
-                                        
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP, columnsToAdd);
-                                metaConnection = newMetaConnection;
+
+                                // If we have some new columns from 4.1-4.3 to 
add, add them now.
+                                if (!columnsToAdd.isEmpty()) {
+                                    // Ugh..need to assign to another local 
variable to keep eclipse happy.
+                                    PhoenixConnection newMetaConnection = 
addColumnsIfNotExists(metaConnection,
+                                            
PhoenixDatabaseMetaData.SYSTEM_CATALOG,
+                                            
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP, columnsToAdd);
+                                    metaConnection = newMetaConnection;
+                                }
                                 
                                 if (currentServerSideTableTimeStamp < 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_5_0) {
                                     columnsToAdd = 
PhoenixDatabaseMetaData.BASE_COLUMN_COUNT + " "

Reply via email to