You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by elilevine <gi...@git.apache.org> on 2014/03/12 01:47:02 UTC

[GitHub] incubator-phoenix pull request: Unit test to repro PHOENIX-841

GitHub user elilevine opened a pull request:

    https://github.com/apache/incubator-phoenix/pull/16

    Unit test to repro PHOENIX-841

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/elilevine/incubator-phoenix 3.0

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-phoenix/pull/16.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16
    
----
commit df94f55f95536108570bedcc90214c0e39feb791
Author: Eli Levine <el...@salesforce.com>
Date:   2014-03-12T00:44:17Z

    Unit test to repro PHOENIX-841

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-phoenix pull request: Unit test to repro PHOENIX-841

Posted by JamesRTaylor <gi...@git.apache.org>.
Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/16#discussion_r10623128
  
    --- Diff: phoenix-core/src/test/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLTest.java ---
    @@ -384,4 +384,17 @@ public void testTenantTableCannotBeUsedInStatementsInNonMultitenantConnections()
                 conn.close();
             }
         }
    +    
    +	@Test
    +	public void testUpsertValuesUsingViewWithNoWhereClause() throws Exception {
    +		Connection conn = nextConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL);
    +		conn.setAutoCommit(true);
    +		conn.createStatement().executeUpdate("upsert into " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID + " (id) values (0)");
    +		
    +        ResultSet rs = conn.createStatement().executeQuery("select id from " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID);
    +        assertTrue(rs.next());
    --- End diff --
    
    Test passes with the above change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-phoenix pull request: Unit test to repro PHOENIX-841

Posted by JamesRTaylor <gi...@git.apache.org>.
Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/16#discussion_r10621681
  
    --- Diff: phoenix-core/src/test/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLTest.java ---
    @@ -384,4 +384,17 @@ public void testTenantTableCannotBeUsedInStatementsInNonMultitenantConnections()
                 conn.close();
             }
         }
    +    
    +	@Test
    +	public void testUpsertValuesUsingViewWithNoWhereClause() throws Exception {
    +		Connection conn = nextConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL);
    +		conn.setAutoCommit(true);
    +		conn.createStatement().executeUpdate("upsert into " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID + " (id) values (0)");
    +		
    +        ResultSet rs = conn.createStatement().executeQuery("select id from " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID);
    +        assertTrue(rs.next());
    --- End diff --
    
    You'd need to open another connection at a later timestamp, as with this test, you're manually managing the timestamps. I'll make this change and if it works, check it in and close the bug as fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-phoenix pull request: Unit test to repro PHOENIX-841

Posted by elilevine <gi...@git.apache.org>.
Github user elilevine commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/16#discussion_r10621363
  
    --- Diff: phoenix-core/src/test/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLTest.java ---
    @@ -384,4 +384,17 @@ public void testTenantTableCannotBeUsedInStatementsInNonMultitenantConnections()
                 conn.close();
             }
         }
    +    
    +	@Test
    +	public void testUpsertValuesUsingViewWithNoWhereClause() throws Exception {
    +		Connection conn = nextConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL);
    +		conn.setAutoCommit(true);
    +		conn.createStatement().executeUpdate("upsert into " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID + " (id) values (0)");
    +		
    +        ResultSet rs = conn.createStatement().executeQuery("select id from " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID);
    +        assertTrue(rs.next());
    --- End diff --
    
    @jtaylor-sfdc, with the null check in UpsertCompiler upsert no longer NPEs.  This test is now failing at this line, meaning this select does not return the expected single row.  Haven't had time to debug further.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-phoenix pull request: Unit test to repro PHOENIX-841

Posted by elilevine <gi...@git.apache.org>.
Github user elilevine commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/16#discussion_r10624236
  
    --- Diff: phoenix-core/src/test/java/org/apache/phoenix/end2end/TenantSpecificTablesDMLTest.java ---
    @@ -384,4 +384,17 @@ public void testTenantTableCannotBeUsedInStatementsInNonMultitenantConnections()
                 conn.close();
             }
         }
    +    
    +	@Test
    +	public void testUpsertValuesUsingViewWithNoWhereClause() throws Exception {
    +		Connection conn = nextConnection(PHOENIX_JDBC_TENANT_SPECIFIC_URL);
    +		conn.setAutoCommit(true);
    +		conn.createStatement().executeUpdate("upsert into " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID + " (id) values (0)");
    +		
    +        ResultSet rs = conn.createStatement().executeQuery("select id from " + TENANT_TABLE_NAME_NO_TENANT_TYPE_ID);
    +        assertTrue(rs.next());
    --- End diff --
    
    Nice!  Thanks, James.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---