bug fixed for sql parser

This commit is contained in:
wenshao
2014-10-27 16:17:10 +08:00
parent 8c13304258
commit 3ac6bd8800
5 changed files with 39 additions and 20 deletions
@@ -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 {