mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for sql parser. issue #1507
This commit is contained in:
@@ -79,9 +79,10 @@ public class OdpsSelectQueryBlock extends SQLSelectQueryBlock {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (obj == null) return false;
|
||||
if (getClass() != obj.getClass()) return false;
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
OdpsSelectQueryBlock other = (OdpsSelectQueryBlock) obj;
|
||||
if (limit == null) {
|
||||
if (other.limit != null) return false;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.alibaba.druid.bvt.sql;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLAnyExpr;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLSelect;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLSelectStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EqualTest_select extends TestCase {
|
||||
|
||||
public void test_eq_select() throws Exception {
|
||||
List stmtsA = SQLUtils.parseStatements("select * from a", JdbcConstants.ODPS);
|
||||
List stmtsB = SQLUtils.parseStatements("select * from b", JdbcConstants.ODPS);
|
||||
SQLSelect selectA = ((SQLSelectStatement) stmtsA.get(0)).getSelect();
|
||||
SQLSelect selectB = ((SQLSelectStatement) stmtsB.get(0)).getSelect();
|
||||
boolean eq = selectA.equals(selectB);
|
||||
assertFalse(eq);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user