Github user yaise commented on a diff in the pull request:

    https://github.com/apache/incubator-phoenix/pull/15#discussion_r10463742
  
    --- Diff: 
phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixDriverTest.java ---
    @@ -0,0 +1,48 @@
    +package org.apache.phoenix.jdbc;
    +
    +import org.apache.phoenix.util.PhoenixRuntime;
    +import org.junit.*;
    +
    +import java.sql.Connection;
    +import java.sql.Driver;
    +import java.sql.DriverManager;
    +import java.sql.SQLException;
    +import java.util.Properties;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +public class PhoenixDriverTest {
    +
    +    @Before
    +    public void registerTestDriver() throws Exception {
    +        DriverManager.registerDriver(new PhoenixTestDriver());
    +    }
    +
    +    @After
    +    public void deRegisterTestDriver() throws Exception {
    +        DriverManager.deregisterDriver(new PhoenixTestDriver());
    +    }
    +
    +    @Test
    +    public void testFirstConnectionWhenPropsHasTenantId() throws Exception 
{
    +        final String url = "jdbc:phoenix:localhost";
    +        verifyConnectionValid(url);
    +    }
    +
    +    @Test
    +    public void testFirstConnectionlessConnectionWhenPropsHasTenantId() 
throws Exception {
    +        final String url = "jdbc:phoenix:none;test=true";
    +        verifyConnectionValid(url);
    +    }
    +
    +    private void verifyConnectionValid(String url) throws SQLException {
    +        Driver driver = DriverManager.getDriver(url);
    +
    +        Properties props = new Properties();
    +        final String tenantId = "00Dxx0000001234";
    +        props.put(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId);
    +
    +        Connection connection = driver.connect(url, props);
    --- End diff --
    
    This guy internally creates a *separate* metaConnection to do system table 
creation if it isn't already present. See Connection and 
ConnectionLessQueryImpl . 
    
    The connection that you are requesting should still contain tenantId though 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to