Search in sources :

Example 1 with MySqlShowCreateTriggerStatement

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

the class DALParserTest method test_show_create_trigger.

public void test_show_create_trigger() throws Exception {
    String sql = "SHOW CREATE trigger x";
    MySqlStatementParser parser = new MySqlStatementParser(sql);
    MySqlShowCreateTriggerStatement show = (MySqlShowCreateTriggerStatement) parser.parseStatementList().get(0);
    parser.match(Token.EOF);
    String output = SQLUtils.toMySqlString(show);
    Assert.assertEquals("SHOW CREATE TRIGGER x", output);
}
Also used : MySqlShowCreateTriggerStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTriggerStatement) MySqlStatementParser(com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)

Example 2 with MySqlShowCreateTriggerStatement

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

the class MySqlStatementParser method parseShow.

public SQLStatement parseShow() {
    accept(Token.SHOW);
    if (lexer.token() == Token.COMMENT) {
        lexer.nextToken();
    }
    boolean full = false;
    if (lexer.token() == Token.FULL) {
        lexer.nextToken();
        full = true;
    }
    if (identifierEquals("PROCESSLIST")) {
        lexer.nextToken();
        MySqlShowProcessListStatement stmt = new MySqlShowProcessListStatement();
        stmt.setFull(full);
        return stmt;
    }
    if (identifierEquals("COLUMNS") || identifierEquals("FIELDS")) {
        lexer.nextToken();
        MySqlShowColumnsStatement stmt = parseShowColumns();
        stmt.setFull(full);
        return stmt;
    }
    if (identifierEquals("COLUMNS")) {
        lexer.nextToken();
        MySqlShowColumnsStatement stmt = parseShowColumns();
        return stmt;
    }
    if (identifierEquals(TABLES)) {
        lexer.nextToken();
        SQLShowTablesStatement stmt = parseShowTabless();
        stmt.setFull(full);
        return stmt;
    }
    if (identifierEquals("DATABASES")) {
        lexer.nextToken();
        MySqlShowDatabasesStatement stmt = parseShowDatabases();
        return stmt;
    }
    if (identifierEquals("WARNINGS")) {
        lexer.nextToken();
        MySqlShowWarningsStatement stmt = parseShowWarnings();
        return stmt;
    }
    if (identifierEquals("COUNT")) {
        lexer.nextToken();
        accept(Token.LPAREN);
        accept(Token.STAR);
        accept(Token.RPAREN);
        if (identifierEquals(ERRORS)) {
            lexer.nextToken();
            MySqlShowErrorsStatement stmt = new MySqlShowErrorsStatement();
            stmt.setCount(true);
            return stmt;
        } else {
            acceptIdentifier("WARNINGS");
            MySqlShowWarningsStatement stmt = new MySqlShowWarningsStatement();
            stmt.setCount(true);
            return stmt;
        }
    }
    if (identifierEquals(ERRORS)) {
        lexer.nextToken();
        MySqlShowErrorsStatement stmt = new MySqlShowErrorsStatement();
        stmt.setLimit(this.exprParser.parseLimit());
        return stmt;
    }
    if (identifierEquals(STATUS)) {
        lexer.nextToken();
        MySqlShowStatusStatement stmt = parseShowStatus();
        return stmt;
    }
    if (identifierEquals(VARIABLES)) {
        lexer.nextToken();
        MySqlShowVariantsStatement stmt = parseShowVariants();
        return stmt;
    }
    if (identifierEquals(GLOBAL)) {
        lexer.nextToken();
        if (identifierEquals(STATUS)) {
            lexer.nextToken();
            MySqlShowStatusStatement stmt = parseShowStatus();
            stmt.setGlobal(true);
            return stmt;
        }
        if (identifierEquals(VARIABLES)) {
            lexer.nextToken();
            MySqlShowVariantsStatement stmt = parseShowVariants();
            stmt.setGlobal(true);
            return stmt;
        }
    }
    if (identifierEquals(SESSION)) {
        lexer.nextToken();
        if (identifierEquals(STATUS)) {
            lexer.nextToken();
            MySqlShowStatusStatement stmt = parseShowStatus();
            stmt.setSession(true);
            return stmt;
        }
        if (identifierEquals(VARIABLES)) {
            lexer.nextToken();
            MySqlShowVariantsStatement stmt = parseShowVariants();
            stmt.setSession(true);
            return stmt;
        }
    }
    if (identifierEquals("COBAR_STATUS")) {
        lexer.nextToken();
        return new CobarShowStatus();
    }
    if (identifierEquals("AUTHORS")) {
        lexer.nextToken();
        return new MySqlShowAuthorsStatement();
    }
    if (lexer.token() == Token.BINARY) {
        lexer.nextToken();
        acceptIdentifier("LOGS");
        return new MySqlShowBinaryLogsStatement();
    }
    if (identifierEquals("MASTER")) {
        lexer.nextToken();
        if (identifierEquals("LOGS")) {
            lexer.nextToken();
            return new MySqlShowMasterLogsStatement();
        }
        acceptIdentifier(STATUS);
        return new MySqlShowMasterStatusStatement();
    }
    if (identifierEquals(CHARACTER)) {
        lexer.nextToken();
        accept(Token.SET);
        MySqlShowCharacterSetStatement stmt = new MySqlShowCharacterSetStatement();
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            stmt.setPattern(this.exprParser.expr());
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            stmt.setWhere(this.exprParser.expr());
        }
        return stmt;
    }
    if (identifierEquals("COLLATION")) {
        lexer.nextToken();
        MySqlShowCollationStatement stmt = new MySqlShowCollationStatement();
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            stmt.setPattern(this.exprParser.expr());
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            stmt.setWhere(this.exprParser.expr());
        }
        return stmt;
    }
    if (identifierEquals(BINLOG)) {
        lexer.nextToken();
        acceptIdentifier(EVENTS);
        MySqlShowBinLogEventsStatement stmt = new MySqlShowBinLogEventsStatement();
        if (lexer.token() == Token.IN) {
            lexer.nextToken();
            stmt.setIn(this.exprParser.expr());
        }
        if (lexer.token() == Token.FROM) {
            lexer.nextToken();
            stmt.setFrom(this.exprParser.expr());
        }
        stmt.setLimit(this.exprParser.parseLimit());
        return stmt;
    }
    if (identifierEquals("CONTRIBUTORS")) {
        lexer.nextToken();
        return new MySqlShowContributorsStatement();
    }
    if (lexer.token() == Token.CREATE) {
        lexer.nextToken();
        if (lexer.token() == Token.DATABASE) {
            lexer.nextToken();
            MySqlShowCreateDatabaseStatement stmt = new MySqlShowCreateDatabaseStatement();
            stmt.setDatabase(this.exprParser.name());
            return stmt;
        }
        if (identifierEquals("EVENT")) {
            lexer.nextToken();
            MySqlShowCreateEventStatement stmt = new MySqlShowCreateEventStatement();
            stmt.setEventName(this.exprParser.name());
            return stmt;
        }
        if (lexer.token() == Token.FUNCTION) {
            lexer.nextToken();
            MySqlShowCreateFunctionStatement stmt = new MySqlShowCreateFunctionStatement();
            stmt.setName(this.exprParser.name());
            return stmt;
        }
        if (lexer.token() == Token.PROCEDURE) {
            lexer.nextToken();
            MySqlShowCreateProcedureStatement stmt = new MySqlShowCreateProcedureStatement();
            stmt.setName(this.exprParser.name());
            return stmt;
        }
        if (lexer.token() == Token.TABLE) {
            lexer.nextToken();
            MySqlShowCreateTableStatement stmt = new MySqlShowCreateTableStatement();
            stmt.setName(this.exprParser.name());
            return stmt;
        }
        if (lexer.token() == Token.VIEW) {
            lexer.nextToken();
            MySqlShowCreateViewStatement stmt = new MySqlShowCreateViewStatement();
            stmt.setName(this.exprParser.name());
            return stmt;
        }
        if (lexer.token() == Token.TRIGGER) {
            lexer.nextToken();
            MySqlShowCreateTriggerStatement stmt = new MySqlShowCreateTriggerStatement();
            stmt.setName(this.exprParser.name());
            return stmt;
        }
        throw new ParserException("TODO " + lexer.stringVal());
    }
    if (identifierEquals(ENGINE)) {
        lexer.nextToken();
        MySqlShowEngineStatement stmt = new MySqlShowEngineStatement();
        stmt.setName(this.exprParser.name());
        stmt.setOption(MySqlShowEngineStatement.Option.valueOf(lexer.stringVal().toUpperCase()));
        lexer.nextToken();
        return stmt;
    }
    if (identifierEquals("STORAGE")) {
        lexer.nextToken();
        acceptIdentifier(ENGINES);
        MySqlShowEnginesStatement stmt = new MySqlShowEnginesStatement();
        stmt.setStorage(true);
        return stmt;
    }
    if (identifierEquals(ENGINES)) {
        lexer.nextToken();
        MySqlShowEnginesStatement stmt = new MySqlShowEnginesStatement();
        return stmt;
    }
    if (identifierEquals(EVENTS)) {
        lexer.nextToken();
        MySqlShowEventsStatement stmt = new MySqlShowEventsStatement();
        if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
            lexer.nextToken();
            stmt.setSchema(this.exprParser.name());
        }
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            stmt.setLike(this.exprParser.expr());
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            stmt.setWhere(this.exprParser.expr());
        }
        return stmt;
    }
    if (lexer.token() == Token.FUNCTION) {
        lexer.nextToken();
        if (identifierEquals("CODE")) {
            lexer.nextToken();
            MySqlShowFunctionCodeStatement stmt = new MySqlShowFunctionCodeStatement();
            stmt.setName(this.exprParser.name());
            return stmt;
        }
        acceptIdentifier(STATUS);
        MySqlShowFunctionStatusStatement stmt = new MySqlShowFunctionStatusStatement();
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            stmt.setLike(this.exprParser.expr());
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            stmt.setWhere(this.exprParser.expr());
        }
        return stmt;
    }
    if (identifierEquals(ENGINE)) {
        lexer.nextToken();
        MySqlShowEngineStatement stmt = new MySqlShowEngineStatement();
        stmt.setName(this.exprParser.name());
        stmt.setOption(MySqlShowEngineStatement.Option.valueOf(lexer.stringVal().toUpperCase()));
        lexer.nextToken();
        return stmt;
    }
    if (identifierEquals("STORAGE")) {
        lexer.nextToken();
        accept(Token.EQ);
        accept(Token.DEFAULT);
        MySqlShowEnginesStatement stmt = new MySqlShowEnginesStatement();
        stmt.setStorage(true);
        return stmt;
    }
    if (identifierEquals(ENGINES)) {
        lexer.nextToken();
        MySqlShowEnginesStatement stmt = new MySqlShowEnginesStatement();
        return stmt;
    }
    if (identifierEquals("GRANTS")) {
        lexer.nextToken();
        MySqlShowGrantsStatement stmt = new MySqlShowGrantsStatement();
        if (lexer.token() == Token.FOR) {
            lexer.nextToken();
            stmt.setUser(this.exprParser.expr());
        }
        return stmt;
    }
    if (lexer.token() == Token.INDEX || identifierEquals("INDEXES")) {
        lexer.nextToken();
        MySqlShowIndexesStatement stmt = new MySqlShowIndexesStatement();
        if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
            lexer.nextToken();
            SQLName table = exprParser.name();
            stmt.setTable(table);
            if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
                lexer.nextToken();
                SQLName database = exprParser.name();
                stmt.setDatabase(database);
            }
        }
        if (lexer.token() == Token.HINT) {
            stmt.setHints(this.exprParser.parseHints());
        }
        return stmt;
    }
    if (identifierEquals("KEYS")) {
        lexer.nextToken();
        MySqlShowKeysStatement stmt = new MySqlShowKeysStatement();
        if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
            lexer.nextToken();
            SQLName table = exprParser.name();
            stmt.setTable(table);
            if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
                lexer.nextToken();
                SQLName database = exprParser.name();
                stmt.setDatabase(database);
            }
        }
        return stmt;
    }
    if (lexer.token() == Token.OPEN || identifierEquals("OPEN")) {
        lexer.nextToken();
        acceptIdentifier(TABLES);
        MySqlShowOpenTablesStatement stmt = new MySqlShowOpenTablesStatement();
        if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
            lexer.nextToken();
            stmt.setDatabase(this.exprParser.name());
        }
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            stmt.setLike(this.exprParser.expr());
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            stmt.setWhere(this.exprParser.expr());
        }
        return stmt;
    }
    if (identifierEquals("PLUGINS")) {
        lexer.nextToken();
        MySqlShowPluginsStatement stmt = new MySqlShowPluginsStatement();
        return stmt;
    }
    if (identifierEquals("PRIVILEGES")) {
        lexer.nextToken();
        MySqlShowPrivilegesStatement stmt = new MySqlShowPrivilegesStatement();
        return stmt;
    }
    if (lexer.token() == Token.PROCEDURE) {
        lexer.nextToken();
        if (identifierEquals("CODE")) {
            lexer.nextToken();
            MySqlShowProcedureCodeStatement stmt = new MySqlShowProcedureCodeStatement();
            stmt.setName(this.exprParser.name());
            return stmt;
        }
        acceptIdentifier(STATUS);
        MySqlShowProcedureStatusStatement stmt = new MySqlShowProcedureStatusStatement();
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            stmt.setLike(this.exprParser.expr());
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            stmt.setWhere(this.exprParser.expr());
        }
        return stmt;
    }
    if (identifierEquals("PROCESSLIST")) {
        lexer.nextToken();
        MySqlShowProcessListStatement stmt = new MySqlShowProcessListStatement();
        return stmt;
    }
    if (identifierEquals("PROFILES")) {
        lexer.nextToken();
        MySqlShowProfilesStatement stmt = new MySqlShowProfilesStatement();
        return stmt;
    }
    if (identifierEquals("PROFILE")) {
        lexer.nextToken();
        MySqlShowProfileStatement stmt = new MySqlShowProfileStatement();
        for (; ; ) {
            if (lexer.token() == Token.ALL) {
                stmt.getTypes().add(MySqlShowProfileStatement.Type.ALL);
                lexer.nextToken();
            } else if (identifierEquals("BLOCK")) {
                lexer.nextToken();
                acceptIdentifier("IO");
                stmt.getTypes().add(MySqlShowProfileStatement.Type.BLOCK_IO);
            } else if (identifierEquals("CONTEXT")) {
                lexer.nextToken();
                acceptIdentifier("SWITCHES");
                stmt.getTypes().add(MySqlShowProfileStatement.Type.CONTEXT_SWITCHES);
            } else if (identifierEquals("CPU")) {
                lexer.nextToken();
                stmt.getTypes().add(MySqlShowProfileStatement.Type.CPU);
            } else if (identifierEquals("IPC")) {
                lexer.nextToken();
                stmt.getTypes().add(MySqlShowProfileStatement.Type.IPC);
            } else if (identifierEquals("MEMORY")) {
                lexer.nextToken();
                stmt.getTypes().add(MySqlShowProfileStatement.Type.MEMORY);
            } else if (identifierEquals("PAGE")) {
                lexer.nextToken();
                acceptIdentifier("FAULTS");
                stmt.getTypes().add(MySqlShowProfileStatement.Type.PAGE_FAULTS);
            } else if (identifierEquals("SOURCE")) {
                lexer.nextToken();
                stmt.getTypes().add(MySqlShowProfileStatement.Type.SOURCE);
            } else if (identifierEquals("SWAPS")) {
                lexer.nextToken();
                stmt.getTypes().add(MySqlShowProfileStatement.Type.SWAPS);
            } else {
                break;
            }
            if (lexer.token() == Token.COMMA) {
                lexer.nextToken();
                continue;
            }
            break;
        }
        if (lexer.token() == Token.FOR) {
            lexer.nextToken();
            acceptIdentifier("QUERY");
            stmt.setForQuery(this.exprParser.primary());
        }
        stmt.setLimit(this.exprParser.parseLimit());
        return stmt;
    }
    if (identifierEquals("RELAYLOG")) {
        lexer.nextToken();
        acceptIdentifier(EVENTS);
        MySqlShowRelayLogEventsStatement stmt = new MySqlShowRelayLogEventsStatement();
        if (lexer.token() == Token.IN) {
            lexer.nextToken();
            stmt.setLogName(this.exprParser.primary());
        }
        if (lexer.token() == Token.FROM) {
            lexer.nextToken();
            stmt.setFrom(this.exprParser.primary());
        }
        stmt.setLimit(this.exprParser.parseLimit());
        return stmt;
    }
    if (identifierEquals("RELAYLOG")) {
        lexer.nextToken();
        acceptIdentifier(EVENTS);
        MySqlShowRelayLogEventsStatement stmt = new MySqlShowRelayLogEventsStatement();
        if (lexer.token() == Token.IN) {
            lexer.nextToken();
            stmt.setLogName(this.exprParser.primary());
        }
        if (lexer.token() == Token.FROM) {
            lexer.nextToken();
            stmt.setFrom(this.exprParser.primary());
        }
        stmt.setLimit(this.exprParser.parseLimit());
        return stmt;
    }
    if (identifierEquals("SLAVE")) {
        lexer.nextToken();
        if (identifierEquals(STATUS)) {
            lexer.nextToken();
            return new MySqlShowSlaveStatusStatement();
        } else {
            acceptIdentifier("HOSTS");
            MySqlShowSlaveHostsStatement stmt = new MySqlShowSlaveHostsStatement();
            return stmt;
        }
    }
    if (lexer.token() == Token.TABLE) {
        lexer.nextToken();
        acceptIdentifier(STATUS);
        MySqlShowTableStatusStatement stmt = new MySqlShowTableStatusStatement();
        if (lexer.token() == Token.FROM || lexer.token() == Token.IN) {
            lexer.nextToken();
            stmt.setDatabase(this.exprParser.name());
        }
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            stmt.setLike(this.exprParser.expr());
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            stmt.setWhere(this.exprParser.expr());
        }
        return stmt;
    }
    if (identifierEquals("TRIGGERS")) {
        lexer.nextToken();
        MySqlShowTriggersStatement stmt = new MySqlShowTriggersStatement();
        if (lexer.token() == Token.FROM) {
            lexer.nextToken();
            SQLName database = exprParser.name();
            stmt.setDatabase(database);
        }
        if (lexer.token() == Token.LIKE) {
            lexer.nextToken();
            SQLExpr like = exprParser.expr();
            stmt.setLike(like);
        }
        if (lexer.token() == Token.WHERE) {
            lexer.nextToken();
            SQLExpr where = exprParser.expr();
            stmt.setWhere(where);
        }
        return stmt;
    }
    // MySqlShowSlaveHostsStatement
    throw new ParserException("TODO " + lexer.stringVal());
}
Also used : MySqlShowProcedureStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProcedureStatusStatement) MySqlShowProfilesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProfilesStatement) MySqlShowIndexesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowIndexesStatement) MySqlShowDatabasesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowDatabasesStatement) MySqlShowCreateDatabaseStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateDatabaseStatement) MySqlShowErrorsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement) MySqlShowEnginesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement) MySqlShowVariantsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowVariantsStatement) MySqlShowColumnsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowColumnsStatement) MySqlShowWarningsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowWarningsStatement) MySqlShowMasterLogsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement) MySqlShowCollationStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCollationStatement) MySqlShowOpenTablesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowOpenTablesStatement) MySqlShowSlaveHostsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveHostsStatement) MySqlShowProcedureCodeStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProcedureCodeStatement) MySqlShowProfileStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProfileStatement) MySqlShowMasterStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterStatusStatement) MySqlShowProcessListStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProcessListStatement) MySqlShowCreateTriggerStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTriggerStatement) MySqlShowTableStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTableStatusStatement) MySqlShowKeysStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowKeysStatement) MySqlShowPluginsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowPluginsStatement) MySqlShowFunctionCodeStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement) MySqlShowCreateEventStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateEventStatement) ParserException(com.alibaba.druid.sql.parser.ParserException) MySqlShowPrivilegesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowPrivilegesStatement) MySqlShowFunctionStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement) MySqlShowStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement) MySqlShowEventsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement) MySqlShowBinLogEventsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinLogEventsStatement) CobarShowStatus(com.alibaba.druid.sql.dialect.mysql.ast.statement.CobarShowStatus) SQLName(com.alibaba.druid.sql.ast.SQLName) MySqlShowCreateViewStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateViewStatement) MySqlShowCreateFunctionStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateFunctionStatement) SQLExpr(com.alibaba.druid.sql.ast.SQLExpr) MySqlShowSlaveStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveStatusStatement) MySqlShowRelayLogEventsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowRelayLogEventsStatement) MySqlShowCharacterSetStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCharacterSetStatement) MySqlShowTriggersStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTriggersStatement) MySqlShowAuthorsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowAuthorsStatement) MySqlShowContributorsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowContributorsStatement) MySqlShowCreateProcedureStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateProcedureStatement) MySqlShowBinaryLogsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinaryLogsStatement) MySqlShowEngineStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement) MySqlShowGrantsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowGrantsStatement) MySqlShowCreateTableStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTableStatement)

Example 3 with MySqlShowCreateTriggerStatement

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

the class MySqlASTVisitorAdapterTest method test_adapter.

public void test_adapter() throws Exception {
    MySqlASTVisitorAdapter adapter = new MySqlASTVisitorAdapter();
    new SQLBooleanExpr().accept(adapter);
    new SQLLimit().accept(adapter);
    new MySqlTableIndex().accept(adapter);
    new MySqlKey().accept(adapter);
    new MySqlPrimaryKey().accept(adapter);
    new MySqlIntervalExpr().accept(adapter);
    new SQLBinaryExpr().accept(adapter);
    new MySqlPrepareStatement().accept(adapter);
    new MySqlExecuteStatement().accept(adapter);
    new MysqlDeallocatePrepareStatement().accept(adapter);
    new MySqlDeleteStatement().accept(adapter);
    new MySqlInsertStatement().accept(adapter);
    new MySqlLoadXmlStatement().accept(adapter);
    new MySqlReplaceStatement().accept(adapter);
    new SQLStartTransactionStatement().accept(adapter);
    new MySqlRollbackStatement().accept(adapter);
    new MySqlShowColumnsStatement().accept(adapter);
    new MySqlShowDatabasesStatement().accept(adapter);
    new MySqlShowWarningsStatement().accept(adapter);
    new MySqlShowStatusStatement().accept(adapter);
    new CobarShowStatus().accept(adapter);
    new MySqlKillStatement().accept(adapter);
    new MySqlBinlogStatement().accept(adapter);
    new MySqlResetStatement().accept(adapter);
    new UserSpecification().accept(adapter);
    new MySqlPartitionByKey().accept(adapter);
    new MySqlOutFileExpr().accept(adapter);
    new MySqlUpdateStatement().accept(adapter);
    new MySqlSetTransactionStatement().accept(adapter);
    new MySqlSetNamesStatement().accept(adapter);
    new MySqlShowMasterLogsStatement().accept(adapter);
    new MySqlSetCharSetStatement().accept(adapter);
    new MySqlShowAuthorsStatement().accept(adapter);
    new MySqlShowCollationStatement().accept(adapter);
    new MySqlShowBinLogEventsStatement().accept(adapter);
    new MySqlShowCharacterSetStatement().accept(adapter);
    new MySqlShowContributorsStatement().accept(adapter);
    new MySqlShowCreateDatabaseStatement().accept(adapter);
    new MySqlShowCreateEventStatement().accept(adapter);
    new MySqlShowCreateFunctionStatement().accept(adapter);
    new MySqlShowCreateProcedureStatement().accept(adapter);
    new MySqlShowCreateTableStatement().accept(adapter);
    new MySqlShowCreateTriggerStatement().accept(adapter);
    new MySqlShowCreateViewStatement().accept(adapter);
    new MySqlShowEngineStatement().accept(adapter);
    new MySqlShowEnginesStatement().accept(adapter);
    new MySqlShowErrorsStatement().accept(adapter);
    new MySqlShowEventsStatement().accept(adapter);
    new MySqlShowFunctionCodeStatement().accept(adapter);
    new MySqlShowFunctionStatusStatement().accept(adapter);
    new MySqlShowGrantsStatement().accept(adapter);
    new MySqlUserName().accept(adapter);
    new MySqlShowIndexesStatement().accept(adapter);
    new MySqlShowKeysStatement().accept(adapter);
    new MySqlShowMasterStatusStatement().accept(adapter);
    new MySqlShowOpenTablesStatement().accept(adapter);
    new MySqlShowBinaryLogsStatement().accept(adapter);
    new MySqlShowPluginsStatement().accept(adapter);
    new MySqlShowPrivilegesStatement().accept(adapter);
    new MySqlShowProcedureCodeStatement().accept(adapter);
    new MySqlShowProcedureStatusStatement().accept(adapter);
    new MySqlShowProcessListStatement().accept(adapter);
    new MySqlShowProfileStatement().accept(adapter);
    new MySqlShowSlaveHostsStatement().accept(adapter);
    new MySqlShowRelayLogEventsStatement().accept(adapter);
    new MySqlShowSlaveStatusStatement().accept(adapter);
    new MySqlShowTableStatusStatement().accept(adapter);
    new MySqlShowTriggersStatement().accept(adapter);
    new MySqlRenameTableStatement().accept(adapter);
    new MySqlUnionQuery().accept(adapter);
    new MySqlUseIndexHint().accept(adapter);
    new MySqlIgnoreIndexHint().accept(adapter);
    new MySqlLockTableStatement().accept(adapter);
    new MySqlUnlockTablesStatement().accept(adapter);
    new MySqlForceIndexHint().accept(adapter);
    new MySqlAlterTableChangeColumn().accept(adapter);
    new MySqlAlterTableCharacter().accept(adapter);
    new MySqlAlterTableOption().accept(adapter);
    new MySqlCreateTableStatement().accept(adapter);
    new MySqlCharExpr().accept(adapter);
    new MySqlUnique().accept(adapter);
    new MySqlAlterTableModifyColumn().accept(adapter);
    new MySqlAlterTableDiscardTablespace().accept(adapter);
    new MySqlAlterTableImportTablespace().accept(adapter);
    new TableSpaceOption().accept(adapter);
}
Also used : MySqlASTVisitorAdapter(com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitorAdapter) MySqlShowProcedureStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProcedureStatusStatement) MySqlAlterTableModifyColumn(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlAlterTableModifyColumn) SQLBinaryExpr(com.alibaba.druid.sql.ast.expr.SQLBinaryExpr) MySqlKey(com.alibaba.druid.sql.dialect.mysql.ast.MySqlKey) MySqlShowDatabasesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowDatabasesStatement) MySqlTableIndex(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlTableIndex) MySqlShowErrorsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement) MySqlShowEnginesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement) MySqlPartitionByKey(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlPartitionByKey) MySqlResetStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlResetStatement) MySqlShowColumnsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowColumnsStatement) MySqlShowCollationStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCollationStatement) UserSpecification(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateUserStatement.UserSpecification) MySqlShowProcedureCodeStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProcedureCodeStatement) MySqlShowProfileStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProfileStatement) MysqlDeallocatePrepareStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MysqlDeallocatePrepareStatement) SQLStartTransactionStatement(com.alibaba.druid.sql.ast.statement.SQLStartTransactionStatement) MySqlShowKeysStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowKeysStatement) MySqlRenameTableStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlRenameTableStatement) MySqlShowPluginsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowPluginsStatement) MySqlShowFunctionCodeStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement) MySqlCreateTableStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement) MySqlPrepareStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlPrepareStatement) TableSpaceOption(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement.TableSpaceOption) MySqlShowFunctionStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement) MySqlShowBinLogEventsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinLogEventsStatement) MySqlAlterTableOption(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlAlterTableOption) MySqlSetCharSetStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSetCharSetStatement) MySqlLoadXmlStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlLoadXmlStatement) MySqlShowCreateFunctionStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateFunctionStatement) MySqlKillStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlKillStatement) SQLBooleanExpr(com.alibaba.druid.sql.ast.expr.SQLBooleanExpr) MySqlDeleteStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlDeleteStatement) MySqlUnionQuery(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUnionQuery) MySqlShowCharacterSetStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCharacterSetStatement) MySqlShowContributorsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowContributorsStatement) MySqlShowBinaryLogsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowBinaryLogsStatement) MySqlShowEngineStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement) MySqlUserName(com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlUserName) MySqlShowGrantsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowGrantsStatement) MySqlSetNamesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSetNamesStatement) MySqlUnlockTablesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUnlockTablesStatement) MySqlShowIndexesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowIndexesStatement) MySqlShowCreateDatabaseStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateDatabaseStatement) MySqlIgnoreIndexHint(com.alibaba.druid.sql.dialect.mysql.ast.MySqlIgnoreIndexHint) SQLLimit(com.alibaba.druid.sql.ast.SQLLimit) MySqlAlterTableCharacter(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlAlterTableCharacter) MySqlUpdateStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUpdateStatement) MySqlIntervalExpr(com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlIntervalExpr) MySqlShowWarningsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowWarningsStatement) MySqlShowMasterLogsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement) MySqlForceIndexHint(com.alibaba.druid.sql.dialect.mysql.ast.MySqlForceIndexHint) MySqlShowOpenTablesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowOpenTablesStatement) MySqlUnique(com.alibaba.druid.sql.dialect.mysql.ast.MySqlUnique) MySqlShowSlaveHostsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveHostsStatement) MySqlReplaceStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlReplaceStatement) MySqlAlterTableDiscardTablespace(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlAlterTableDiscardTablespace) MySqlShowMasterStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterStatusStatement) MySqlCharExpr(com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlCharExpr) MySqlOutFileExpr(com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlOutFileExpr) MySqlShowCreateTriggerStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTriggerStatement) MySqlShowProcessListStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowProcessListStatement) MySqlShowTableStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTableStatusStatement) MySqlShowCreateEventStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateEventStatement) MySqlSetTransactionStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSetTransactionStatement) MySqlShowPrivilegesStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowPrivilegesStatement) MySqlUseIndexHint(com.alibaba.druid.sql.dialect.mysql.ast.MySqlUseIndexHint) MySqlRollbackStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlRollbackStatement) MySqlShowStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement) MySqlShowEventsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement) MySqlLockTableStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlLockTableStatement) CobarShowStatus(com.alibaba.druid.sql.dialect.mysql.ast.statement.CobarShowStatus) MySqlInsertStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlInsertStatement) MySqlExecuteStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlExecuteStatement) MySqlShowCreateViewStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateViewStatement) MySqlShowSlaveStatusStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveStatusStatement) MySqlAlterTableImportTablespace(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlAlterTableImportTablespace) MySqlShowRelayLogEventsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowRelayLogEventsStatement) MySqlShowTriggersStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTriggersStatement) MySqlPrimaryKey(com.alibaba.druid.sql.dialect.mysql.ast.MySqlPrimaryKey) MySqlAlterTableChangeColumn(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlAlterTableChangeColumn) MySqlShowAuthorsStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowAuthorsStatement) MySqlShowCreateProcedureStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateProcedureStatement) MySqlBinlogStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlBinlogStatement) MySqlShowCreateTableStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTableStatement)

Aggregations

MySqlShowCreateTriggerStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowCreateTriggerStatement)3 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 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 MySqlShowErrorsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement)2 MySqlShowEventsStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement)2