Search in sources :

Example 6 with MySqlShowOpenTablesStatement

use of com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowOpenTablesStatement in project druid by alibaba.

the class DALParserTest method test_open_tables_3.

public void test_open_tables_3() throws Exception {
    String sql = "SHOW OPEN TABLES in mysql like '%'";
    MySqlStatementParser parser = new MySqlStatementParser(sql);
    MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
    parser.match(Token.EOF);
    String output = SQLUtils.toMySqlString(show);
    Assert.assertEquals("SHOW OPEN TABLES FROM mysql LIKE '%'", output);
}
Also used : MySqlShowOpenTablesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowOpenTablesStatement) MySqlStatementParser(com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)

Example 7 with MySqlShowOpenTablesStatement

use of com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowOpenTablesStatement in project druid by alibaba.

the class DALParserTest method test_open_tables_4.

public void test_open_tables_4() throws Exception {
    String sql = "SHOW OPEN TABLES in mysql where 1 = 1";
    MySqlStatementParser parser = new MySqlStatementParser(sql);
    MySqlShowOpenTablesStatement show = (MySqlShowOpenTablesStatement) parser.parseStatementList().get(0);
    parser.match(Token.EOF);
    String output = SQLUtils.toMySqlString(show);
    Assert.assertEquals("SHOW OPEN TABLES FROM mysql WHERE 1 = 1", output);
}
Also used : MySqlShowOpenTablesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowOpenTablesStatement) MySqlStatementParser(com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)

Aggregations

MySqlShowOpenTablesStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowOpenTablesStatement)7 MySqlStatementParser (com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)5 CobarShowStatus (com.alibaba.druid.sql.dialect.mysql.ast.statement.CobarShowStatus)2 MySqlShowAuthorsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowAuthorsStatement)2 MySqlShowBinLogEventsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinLogEventsStatement)2 MySqlShowBinaryLogsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinaryLogsStatement)2 MySqlShowCharacterSetStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCharacterSetStatement)2 MySqlShowCollationStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCollationStatement)2 MySqlShowColumnsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowColumnsStatement)2 MySqlShowContributorsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowContributorsStatement)2 MySqlShowCreateDatabaseStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateDatabaseStatement)2 MySqlShowCreateEventStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateEventStatement)2 MySqlShowCreateFunctionStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateFunctionStatement)2 MySqlShowCreateProcedureStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateProcedureStatement)2 MySqlShowCreateTableStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTableStatement)2 MySqlShowCreateTriggerStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTriggerStatement)2 MySqlShowCreateViewStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateViewStatement)2 MySqlShowDatabasesStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowDatabasesStatement)2 MySqlShowEngineStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement)2 MySqlShowEnginesStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement)2