This is an automated email from the ASF dual-hosted git repository. larsh pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push: new e91b614 PHOENIX-5610 Dropping a view or column with a 4.14 client raises an ArrayIndexOutOfBoundsException on 4.15 server. e91b614 is described below commit e91b614d7e6f2867f3ac9930aff66311f779dded Author: Lars Hofhansl <la...@apache.org> AuthorDate: Thu Dec 12 09:10:19 2019 -0800 PHOENIX-5610 Dropping a view or column with a 4.14 client raises an ArrayIndexOutOfBoundsException on 4.15 server. --- .../apache/phoenix/coprocessor/MetaDataEndpointImpl.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java index 86afe8d..fb626c4 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java @@ -2490,6 +2490,14 @@ public class MetaDataEndpointImpl extends MetaDataProtocol implements RegionCopr } } + if (clientVersion < MIN_SPLITTABLE_SYSTEM_CATALOG && tableType == PTableType.VIEW) { + try (PhoenixConnection connection = QueryUtil.getConnectionOnServer(env.getConfiguration()).unwrap(PhoenixConnection.class)) { + PTable pTable = PhoenixRuntime.getTableNoCache(connection, table.getParentName().getString()); + table = ViewUtil.addDerivedColumnsAndIndexesFromParent(connection, table, pTable); + } catch (ClassNotFoundException e) { + throw new IOException(e); + } + } return new MetaDataMutationResult(MutationCode.TABLE_ALREADY_EXISTS, EnvironmentEdgeManager.currentTimeMillis(), table, tableNamesToDelete, sharedTablesToDelete); } @@ -2731,6 +2739,14 @@ public class MetaDataEndpointImpl extends MetaDataProtocol implements RegionCopr return result; } else { table = buildTable(key, cacheKey, region, HConstants.LATEST_TIMESTAMP, clientVersion); + if (clientVersion < MIN_SPLITTABLE_SYSTEM_CATALOG && type == PTableType.VIEW) { + try (PhoenixConnection connection = QueryUtil.getConnectionOnServer(env.getConfiguration()).unwrap(PhoenixConnection.class)) { + PTable pTable = PhoenixRuntime.getTableNoCache(connection, table.getParentName().getString()); + table = ViewUtil.addDerivedColumnsAndIndexesFromParent(connection, table, pTable); + } catch (ClassNotFoundException e) { + throw new IOException(e); + } + } return new MetaDataMutationResult(MutationCode.TABLE_ALREADY_EXISTS, currentTime, table, tableNamesToDelete, sharedTablesToDelete); }