Search in sources :

Example 6 with MySqlSetTransactionStatement

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

the class DALParserTest method testSetTxn_2.

public void testSetTxn_2() throws Exception {
    String sql = "SET transaction ISOLATION LEVEL REPEATABLE READ ";
    MySqlStatementParser parser = new MySqlStatementParser(sql);
    MySqlSetTransactionStatement set = (MySqlSetTransactionStatement) parser.parseStatementList().get(0);
    parser.match(Token.EOF);
    String output = SQLUtils.toMySqlString(set);
    Assert.assertEquals("SET TRANSACTION ISOLATION LEVEL REPEATABLE READ", output);
}
Also used : MySqlSetTransactionStatement(com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSetTransactionStatement) MySqlStatementParser(com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)

Aggregations

MySqlSetTransactionStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSetTransactionStatement)6 MySqlStatementParser (com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser)3 MySqlSetCharSetStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSetCharSetStatement)2 MySqlSetNamesStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSetNamesStatement)2 SQLLimit (com.alibaba.druid.sql.ast.SQLLimit)1 SQLBinaryExpr (com.alibaba.druid.sql.ast.expr.SQLBinaryExpr)1 SQLBooleanExpr (com.alibaba.druid.sql.ast.expr.SQLBooleanExpr)1 SQLVariantRefExpr (com.alibaba.druid.sql.ast.expr.SQLVariantRefExpr)1 SQLStartTransactionStatement (com.alibaba.druid.sql.ast.statement.SQLStartTransactionStatement)1 MySqlForceIndexHint (com.alibaba.druid.sql.dialect.mysql.ast.MySqlForceIndexHint)1 MySqlIgnoreIndexHint (com.alibaba.druid.sql.dialect.mysql.ast.MySqlIgnoreIndexHint)1 MySqlKey (com.alibaba.druid.sql.dialect.mysql.ast.MySqlKey)1 MySqlPrimaryKey (com.alibaba.druid.sql.dialect.mysql.ast.MySqlPrimaryKey)1 MySqlUnique (com.alibaba.druid.sql.dialect.mysql.ast.MySqlUnique)1 MySqlUseIndexHint (com.alibaba.druid.sql.dialect.mysql.ast.MySqlUseIndexHint)1 MySqlCharExpr (com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlCharExpr)1 MySqlIntervalExpr (com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlIntervalExpr)1 MySqlOutFileExpr (com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlOutFileExpr)1 MySqlUserName (com.alibaba.druid.sql.dialect.mysql.ast.expr.MySqlUserName)1 CobarShowStatus (com.alibaba.druid.sql.dialect.mysql.ast.statement.CobarShowStatus)1