You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2016/12/06 23:23:58 UTC

[jira] [Created] (PHOENIX-3522) Altering the mutability of a parent table does not propagate to the child views

Thomas D'Silva created PHOENIX-3522:
---------------------------------------

             Summary: Altering the mutability of a parent table does not propagate to the child views
                 Key: PHOENIX-3522
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3522
             Project: Phoenix
          Issue Type: Bug
            Reporter: Thomas D'Silva
            Assignee: Thomas D'Silva
             Fix For: 4.9.1


The following test fails

{code}
@Test
    public void testAlterMutabilityOfParentTable() throws Exception {
        try (Connection conn = DriverManager.getConnection(getUrl());
                Connection viewConn = isMultiTenant ? DriverManager.getConnection(TENANT_SPECIFIC_URL1) : conn ) {       
            String tableName = generateUniqueName();
            String viewOfTable = tableName + "_VIEW";
            String ddlFormat = "CREATE TABLE IF NOT EXISTS " + tableName + " ("
                            + " %s ID char(1) NOT NULL,"
                            + " COL1 integer NOT NULL,"
                            + " COL2 bigint NOT NULL,"
                            + " CONSTRAINT NAME_PK PRIMARY KEY (%s ID, COL1, COL2)"
                            + " ) %s";
            conn.createStatement().execute(generateDDL(ddlFormat));
            
            viewConn.createStatement().execute("CREATE VIEW " + viewOfTable + " ( VIEW_COL1 DECIMAL(10,2), VIEW_COL2 VARCHAR ) AS SELECT * FROM " + tableName);
            
            conn.createStatement().execute("ALTER TABLE " + tableName + " SET IMMUTABLE_ROWS=true");
            PhoenixConnection phoenixConn = conn.unwrap(PhoenixConnection.class);
            PTable table = phoenixConn.getTable(new PTableKey(null, tableName));
            assertTrue(table.isImmutableRows());
            PTable view = phoenixConn.getTable(new PTableKey(null, viewOfTable));
            assertTrue(view.isImmutableRows());
        } 
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)