mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for Not EXPR
This commit is contained in:
@@ -292,7 +292,7 @@ public class SQLExprParser extends SQLParser {
|
||||
|
||||
return primaryRest(sqlExpr);
|
||||
} else {
|
||||
SQLExpr restExpr = expr();
|
||||
SQLExpr restExpr = equality();
|
||||
sqlExpr = new SQLNotExpr(restExpr);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.alibaba.druid.bvt.sql;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLNotExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser;
|
||||
|
||||
public class EqualTest_not_2 extends TestCase {
|
||||
|
||||
public void test_exits() throws Exception {
|
||||
String sql = "NOT A=1 AND NOT B=1";
|
||||
SQLNotExpr exprA, exprB;
|
||||
{
|
||||
OracleExprParser parser = new OracleExprParser(sql);
|
||||
SQLBinaryOpExpr binaryEpr = (SQLBinaryOpExpr) parser.expr();
|
||||
exprA = (SQLNotExpr) binaryEpr.getLeft();
|
||||
exprB = (SQLNotExpr) binaryEpr.getRight();
|
||||
}
|
||||
|
||||
Assert.assertNotNull(exprA);
|
||||
Assert.assertNotNull(exprB);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.alibaba.druid.bvt.utils;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
public class JdbcUtilsTest2 extends TestCase {
|
||||
public void test_get_0() throws Exception {
|
||||
Assert.assertEquals(JdbcConstants.ORACLE_DRIVER, JdbcUtils.getDriverClassName("JDBC:oracle:"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user