use of com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser in project druid by alibaba.
the class EqualTest_inquery_oracle method test_exits.
public void test_exits() throws Exception {
String sql = "fstate in (select state from t_status)";
String sql_c = "fstate_c in (select state from t_status)";
SQLInSubQueryExpr exprA, exprB, exprC;
{
SQLExprParser parser = new OracleExprParser(sql);
exprA = (SQLInSubQueryExpr) parser.expr();
}
{
SQLExprParser parser = new OracleExprParser(sql);
exprB = (SQLInSubQueryExpr) parser.expr();
}
{
SQLExprParser parser = new OracleExprParser(sql_c);
exprC = (SQLInSubQueryExpr) parser.expr();
}
Assert.assertEquals(exprA, exprB);
Assert.assertNotEquals(exprA, exprC);
Assert.assertTrue(exprA.equals(exprA));
Assert.assertFalse(exprA.equals(new Object()));
Assert.assertEquals(exprA.hashCode(), exprB.hashCode());
Assert.assertEquals(new SQLInSubQueryExpr(), new SQLInSubQueryExpr());
Assert.assertEquals(new SQLInSubQueryExpr().hashCode(), new SQLInSubQueryExpr().hashCode());
}
use of com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser in project druid by alibaba.
the class EqualTest_extract_oracle method test_exits.
public void test_exits() throws Exception {
String sql = "EXTRACT(MONTH FROM x)";
String sql_c = "EXTRACT(MONTH FROM 7)";
SQLMethodInvokeExpr exprA, exprB, exprC;
{
OracleExprParser parser = new OracleExprParser(sql);
exprA = (SQLMethodInvokeExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql);
exprB = (SQLMethodInvokeExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql_c);
exprC = (SQLMethodInvokeExpr) parser.expr();
}
Assert.assertEquals(exprA, exprB);
Assert.assertNotEquals(exprA, exprC);
Assert.assertTrue(exprA.equals(exprA));
Assert.assertFalse(exprA.equals(new Object()));
Assert.assertEquals(exprA.hashCode(), exprB.hashCode());
Assert.assertEquals(new SQLMethodInvokeExpr(), new SQLMethodInvokeExpr());
Assert.assertEquals(new SQLMethodInvokeExpr().hashCode(), new SQLMethodInvokeExpr().hashCode());
}
use of com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser in project druid by alibaba.
the class EqualTest_number method test_exits.
public void test_exits() throws Exception {
String sql = "3.5";
String sql_c = "3.51";
SQLNumberExpr exprA, exprB, exprC;
{
OracleExprParser parser = new OracleExprParser(sql);
exprA = (SQLNumberExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql);
exprB = (SQLNumberExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql_c);
exprC = (SQLNumberExpr) parser.expr();
}
Assert.assertEquals(exprA, exprB);
Assert.assertNotEquals(exprA, exprC);
Assert.assertTrue(exprA.equals(exprA));
Assert.assertFalse(exprA.equals(new Object()));
Assert.assertEquals(exprA.hashCode(), exprB.hashCode());
Assert.assertEquals(new SQLNumberExpr(), new SQLNumberExpr());
Assert.assertEquals(new SQLNumberExpr().hashCode(), new SQLNumberExpr().hashCode());
}
use of com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser in project druid by alibaba.
the class EqualTest_some method test_exits.
public void test_exits() throws Exception {
String sql = "some(select id from t)";
String sql_c = "some(select id from t1)";
SQLSomeExpr exprA, exprB, exprC;
{
OracleExprParser parser = new OracleExprParser(sql);
exprA = (SQLSomeExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql);
exprB = (SQLSomeExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql_c);
exprC = (SQLSomeExpr) parser.expr();
}
Assert.assertEquals(exprA, exprB);
Assert.assertNotEquals(exprA, exprC);
Assert.assertTrue(exprA.equals(exprA));
Assert.assertFalse(exprA.equals(new Object()));
Assert.assertEquals(exprA.hashCode(), exprB.hashCode());
Assert.assertEquals(new SQLSomeExpr(), new SQLSomeExpr());
Assert.assertEquals(new SQLSomeExpr().hashCode(), new SQLSomeExpr().hashCode());
}
use of com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser in project druid by alibaba.
the class EqualTest_between method test_exits.
public void test_exits() throws Exception {
String sql = "x between 1 AND 2";
String sql_c = "x between 1 AND 3";
SQLBetweenExpr exprA, exprB, exprC;
{
OracleExprParser parser = new OracleExprParser(sql);
exprA = (SQLBetweenExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql);
exprB = (SQLBetweenExpr) parser.expr();
}
{
OracleExprParser parser = new OracleExprParser(sql_c);
exprC = (SQLBetweenExpr) parser.expr();
}
Assert.assertEquals(exprA, exprB);
Assert.assertNotEquals(exprA, exprC);
Assert.assertTrue(exprA.equals(exprA));
Assert.assertFalse(exprA.equals(new Object()));
Assert.assertEquals(exprA.hashCode(), exprB.hashCode());
Assert.assertEquals(new SQLBetweenExpr(), new SQLBetweenExpr());
Assert.assertEquals(new SQLBetweenExpr().hashCode(), new SQLBetweenExpr().hashCode());
}
Aggregations