mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.alibaba.druid.bvt;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
|
||||
|
||||
public class OrTest extends TestCase {
|
||||
public void test_xx() throws Exception {
|
||||
String sql = "select * from t where not match('', '') or (c > 0 and d >0)";
|
||||
|
||||
List<SQLStatement> stmtList = SQLUtils.parseStatements(sql, null);
|
||||
SQLStatement stmt = stmtList.get(0);
|
||||
System.out.println(stmt.toString());
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class LogicalOperatorsTest extends TestCase {
|
||||
|
||||
String text = output(stmtList);
|
||||
|
||||
Assert.assertEquals("SELECT !(1 + 1);", text);
|
||||
Assert.assertEquals("SELECT !1 + 1;", text);
|
||||
}
|
||||
|
||||
public void test_8() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user