Projects >> druid >>2f2ab71c2e8189cc41d3ba37fd8bd5d328d54228

Chunk
Conflicting content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
<<<<<<< HEAD
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
Solution content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
File
MySqlStatementParser.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
<<<<<<< HEAD

            if (identifierEquals("ERRORS")) {
                lexer.nextToken();
=======
                
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
                MySqlShowErrorsStatement stmt = new MySqlShowErrorsStatement();
                stmt.setCount(true);
Solution content
            if (identifierEquals("ERRORS")) {
                lexer.nextToken();

                MySqlShowErrorsStatement stmt = new MySqlShowErrorsStatement();
                stmt.setCount(true);
File
MySqlStatementParser.java
Developer's decision
Version 1
Kind of conflict
Blank
Chunk
Conflicting content
            lexer.nextToken();

            MySqlShowErrorsStatement stmt = new MySqlShowErrorsStatement();
<<<<<<< HEAD
            stmt.setLimit(parseLimit());
=======
            if (lexer.token() == Token.LIMIT) {
                lexer.nextToken();

                MySqlSelectQueryBlock.Limit limit = new MySqlSelectQueryBlock.Limit();

                SQLExpr temp = this.exprParser.expr();
                if (lexer.token() == (Token.COMMA)) {
                    limit.setOffset(temp);
                    lexer.nextToken();
                    limit.setRowCount(exprParser.expr());
                } else if (identifierEquals("OFFSET")) {
                    limit.setRowCount(temp);
                    lexer.nextToken();
                    limit.setOffset(exprParser.expr());
                } else {
                    limit.setRowCount(temp);
                }

                stmt.setLimit(limit);
            }
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466

            return stmt;
        }
Solution content
            lexer.nextToken();

            MySqlShowErrorsStatement stmt = new MySqlShowErrorsStatement();
            stmt.setLimit(parseLimit());

            return stmt;
        }
File
MySqlStatementParser.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
            return stmt;
        }

<<<<<<< HEAD
        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 (identifierEquals("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;
        }
        
        //MySqlShowFunctionStatusStatement

=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
        throw new ParserException("TODO " + lexer.stringVal());
    }
Solution content
        
            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 (identifierEquals("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;
        }
        
        //MySqlShowFunctionStatusStatement

        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;
        }

        throw new ParserException("TODO " + lexer.stringVal());
    }
File
MySqlStatementParser.java
Developer's decision
Manual
Kind of conflict
Comment
If statement
Chunk
Conflicting content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
<<<<<<< HEAD
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
Solution content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
File
MySqlASTVisitor.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
    boolean visit(MySqlShowErrorsStatement x);
    
    void endVisit(MySqlShowErrorsStatement x);
<<<<<<< HEAD
    
    boolean visit(MySqlShowEventsStatement x);
    
    void endVisit(MySqlShowEventsStatement x);
    
    boolean visit(MySqlShowFunctionCodeStatement x);
    
    void endVisit(MySqlShowFunctionCodeStatement x);
    
    boolean visit(MySqlShowFunctionStatusStatement x);
    
    void endVisit(MySqlShowFunctionStatusStatement x);
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
}
Solution content
    boolean visit(MySqlShowErrorsStatement x);
    
    void endVisit(MySqlShowErrorsStatement x);
    
    boolean visit(MySqlShowEventsStatement x);
    
    void endVisit(MySqlShowEventsStatement x);
    
    boolean visit(MySqlShowFunctionCodeStatement x);
    
    void endVisit(MySqlShowFunctionCodeStatement x);
    
    boolean visit(MySqlShowFunctionStatusStatement x);
    
    void endVisit(MySqlShowFunctionStatusStatement x);
}
File
MySqlASTVisitor.java
Developer's decision
Version 1
Kind of conflict
Method interface
Chunk
Conflicting content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
<<<<<<< HEAD
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
Solution content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
File
MySqlASTVisitorAdapter.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
    public void endVisit(MySqlShowErrorsStatement x) {
        
    }
<<<<<<< HEAD
    
    @Override
    public boolean visit(MySqlShowEventsStatement x) {
        return false;
    }
    
    @Override
    public void endVisit(MySqlShowEventsStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionCodeStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionCodeStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionStatusStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionStatusStatement x) {
        
    }
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
}
Solution content
    
    @Override
    public void endVisit(MySqlShowErrorsStatement x) {
        
    }
    public boolean visit(MySqlShowEventsStatement x) {
        return false;
    }
    
    @Override
    public void endVisit(MySqlShowEventsStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionCodeStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionCodeStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionStatusStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionStatusStatement x) {
        
    }
}
File
MySqlASTVisitorAdapter.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
<<<<<<< HEAD
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
Solution content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
File
MySqlOutputVisitor.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
<<<<<<< HEAD
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
Solution content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
File
MySqlSchemaStatVisitor.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
    public void endVisit(MySqlShowErrorsStatement x) {
        
    }
<<<<<<< HEAD

    @Override
    public boolean visit(MySqlShowEventsStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowEventsStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionCodeStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionCodeStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionStatusStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionStatusStatement x) {
        
    }
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
}
Solution content
    public void endVisit(MySqlShowErrorsStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowEventsStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowEventsStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionCodeStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionCodeStatement x) {
        
    }

    @Override
    public boolean visit(MySqlShowFunctionStatusStatement x) {
        return false;
    }

    @Override
    public void endVisit(MySqlShowFunctionStatusStatement x) {
        
    }
}
File
MySqlSchemaStatVisitor.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
<<<<<<< HEAD
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
=======
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.alibaba.druid.sql.parser.Token;
Solution content
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEngineStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEnginesStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowErrorsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowEventsStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionCodeStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowFunctionStatusStatement;
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowMasterLogsStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.alibaba.druid.sql.parser.Token;
File
DALParserTest.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
        Assert.assertEquals("SHOW ERRORS LIMIT 1, 2", output);
    }
    
<<<<<<< HEAD
    public void test_show_events() throws Exception {
        String sql = "SHOW EVENTS";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS", output);
    }
    
    public void test_show_events_1() throws Exception {
        String sql = "SHOW EVENTS from x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x", output);
    }
    
    public void test_show_events_2() throws Exception {
        String sql = "SHOW EVENTS in x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x", output);
    }
    
    public void test_show_events_3() throws Exception {
        String sql = "SHOW EVENTS in x like '%'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x LIKE '%'", output);
    }
    
    public void test_show_events_4() throws Exception {
        String sql = "SHOW EVENTS in x where 1 = 1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x WHERE 1 = 1", output);
    }
    
    public void test_show_function_code() throws Exception {
        String sql = "SHOW function code x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionCodeStatement show = (MySqlShowFunctionCodeStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION CODE x", output);
    }
    
    public void test_show_function_status() throws Exception {
        String sql = "SHOW function status like '%'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionStatusStatement show = (MySqlShowFunctionStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION STATUS LIKE '%'", output);
    }
    
    public void test_show_function_status_1() throws Exception {
        String sql = "SHOW function status where 1 = 1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionStatusStatement show = (MySqlShowFunctionStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION STATUS WHERE 1 = 1", output);
    }
    
//
//    public void testShow() throws Exception {
//
=======
//
//    public void testShow() throws Exception {
//
//        sql = "SHOW events";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
//        show = (DALShowStatement) parser.show();
//        parser.match(Token.EOF);
//        output = output2MySQL(show, sql);
//        Assert.assertEquals("SHOW EVENTS", output);
//
//        sql = "SHOW events from expr like 'var' ";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
//        show = (DALShowStatement) parser.show();
//        parser.match(Token.EOF);
//        output = output2MySQL(show, sql);
//        Assert.assertEquals("SHOW EVENTS FROM expr LIKE 'var'", output);
//
//        sql = "SHOW events from expr where expr1";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
//        show = (DALShowStatement) parser.show();
//        parser.match(Token.EOF);
//        output = output2MySQL(show, sql);
//        Assert.assertEquals("SHOW EVENTS FROM expr WHERE expr1", output);
//
//        sql = "SHOW function code expr";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
//        show = (DALShowStatement) parser.show();
//        parser.match(Token.EOF);
//        output = output2MySQL(show, sql);
//        Assert.assertEquals("SHOW FUNCTION CODE expr", output);
//
//        sql = "SHOW function status like 'expr'";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
//        show = (DALShowStatement) parser.show();
//        parser.match(Token.EOF);
//        output = output2MySQL(show, sql);
//        Assert.assertEquals("SHOW FUNCTION STATUS LIKE 'expr'", output);
//
//        sql = "SHOW function status where a is true";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
//        show = (DALShowStatement) parser.show();
//        parser.match(Token.EOF);
//        output = output2MySQL(show, sql);
//        Assert.assertEquals("SHOW FUNCTION STATUS WHERE a IS TRUE", output);
//
>>>>>>> 836d8946f8a35f048404aea027653b78ae83f466
//        sql = "SHOW function status ";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
Solution content
        Assert.assertEquals("SHOW ERRORS LIMIT 1, 2", output);
    }
    
    public void test_show_events() throws Exception {
        String sql = "SHOW EVENTS";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS", output);
    }
    
    public void test_show_events_1() throws Exception {
        String sql = "SHOW EVENTS from x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x", output);
    }
    
    public void test_show_events_2() throws Exception {
        String sql = "SHOW EVENTS in x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x", output);
    }
    
    public void test_show_events_3() throws Exception {
        String sql = "SHOW EVENTS in x like '%'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x LIKE '%'", output);
    }
    
    public void test_show_events_4() throws Exception {
        String sql = "SHOW EVENTS in x where 1 = 1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowEventsStatement show = (MySqlShowEventsStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW EVENTS FROM x WHERE 1 = 1", output);
    }
    
    public void test_show_function_code() throws Exception {
        String sql = "SHOW function code x";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionCodeStatement show = (MySqlShowFunctionCodeStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION CODE x", output);
    }
    
    public void test_show_function_status() throws Exception {
        String sql = "SHOW function status like '%'";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionStatusStatement show = (MySqlShowFunctionStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION STATUS LIKE '%'", output);
    }
    
    public void test_show_function_status_1() throws Exception {
        String sql = "SHOW function status where 1 = 1";
        MySqlStatementParser parser = new MySqlStatementParser(sql);
        MySqlShowFunctionStatusStatement show = (MySqlShowFunctionStatusStatement) parser.parseStatementList().get(0);
        parser.match(Token.EOF);
        String output = SQLUtils.toMySqlString(show);
        Assert.assertEquals("SHOW FUNCTION STATUS WHERE 1 = 1", output);
    }
    
//
//    public void testShow() throws Exception {
//
//        sql = "SHOW function status ";
//        lexer = new SQLLexer(sql);
//        parser = new DALParser(lexer, new SQLExprParser(lexer));
File
DALParserTest.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration