mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add feature support for issue #1815
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.alibaba.druid.demo.sql;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by wenshao on 11/07/2017.
|
||||
*/
|
||||
public class Demo_for_issue_1815 extends TestCase {
|
||||
public void test_0() throws Exception {
|
||||
String sql = "select * from t1;select * from t2;";
|
||||
|
||||
List<SQLStatement> stmtList = SQLUtils.parseStatements(sql, JdbcConstants.ORACLE);
|
||||
|
||||
assertEquals("SELECT *\n" +
|
||||
"FROM t1;", stmtList.get(0).toString());
|
||||
|
||||
SQLASTOutputVisitor.defaultPrintStatementAfterSemi = false;
|
||||
|
||||
assertEquals("SELECT *\n" +
|
||||
"FROM t1", stmtList.get(0).toString());
|
||||
|
||||
SQLASTOutputVisitor.defaultPrintStatementAfterSemi = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user