mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for postgresql sql parser. support begin. for issue #2182
This commit is contained in:
@@ -16,13 +16,24 @@
|
||||
package com.alibaba.druid.bvt.sql.postgresql;
|
||||
|
||||
import com.alibaba.druid.sql.PGTest;
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGStartTransactionStatement;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PGBeginTest extends PGTest {
|
||||
public void testBegin() throws Exception {
|
||||
String sql = "start transaction;";
|
||||
String expected = "START TRANSACTION";
|
||||
String expected = "START TRANSACTION;";
|
||||
testParseSql(sql, expected, expected, PGStartTransactionStatement.class);
|
||||
}
|
||||
|
||||
public void testBegin_1() throws Exception {
|
||||
String sql = "begin";
|
||||
List<SQLStatement> stmtList = SQLUtils.parseStatements(sql, JdbcConstants.POSTGRESQL);
|
||||
assertEquals(1, stmtList.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user