phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xcangCRM <...@git.apache.org>
Subject [GitHub] phoenix pull request #409: PHOENIX-5034 Log all critical statements in SYSTE...
Date Tue, 04 Dec 2018 19:44:20 GMT
Github user xcangCRM commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/409#discussion_r238810960
  
    --- Diff: phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryLoggerIT.java ---
    @@ -250,7 +250,44 @@ public void testWithLoggingOFF() throws Exception{
             assertFalse(foundQueryLog);
             conn.close();
         }
    -    
    +
    +    @Test
    +    //DROP Table statement should be always logged.
    +    public void testDropTableStatement() throws Exception{
    +        String tableName = generateUniqueName();
    +        createTableAndInsertValues(tableName, true);
    +        Properties props= new Properties();
    +        props.setProperty(QueryServices.LOG_LEVEL, LogLevel.INFO.name());
    +        Connection conn = DriverManager.getConnection(getUrl(),props);
    +        assertEquals(conn.unwrap(PhoenixConnection.class).getLogLevel(),LogLevel.INFO);
    +
    +        String query = "SELECT * FROM " + tableName;
    +        ResultSet rs = conn.createStatement().executeQuery(query);
    +
    +        String query2 = "DROP TABLE " + tableName;
    +        conn.createStatement().execute(query2);
    +        while (rs.next()) {
    +            rs.getString(1);
    +            rs.getString(2);
    +        }
    +        String logQuery = "SELECT * FROM " + SYSTEM_CATALOG_SCHEMA + ".\"" + SYSTEM_LOG_TABLE
    +            + "\"";
    +        int delay = 5000;
    +
    +        // sleep for sometime to let query log committed
    +        Thread.sleep(delay);
    --- End diff --
    
    Changed.


---

Mime
View raw message