mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.alibaba.druid.bvt.sql.repository;
|
||||
|
||||
import com.alibaba.druid.sql.repository.SchemaRepository;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Created by wenshao on 03/08/2017.
|
||||
*/
|
||||
public class OracleJoinResolveTest extends TestCase {
|
||||
protected SchemaRepository repository = new SchemaRepository(JdbcConstants.ORACLE);
|
||||
|
||||
public void test_for_issue() throws Exception {
|
||||
repository.console("create table t_user (uid number(20, 0), gid number(20, 0), uname varchar2(20))");
|
||||
repository.console("create table t_group (id number(20, 0), name varchar2(20))");
|
||||
|
||||
assertEquals("SELECT a.uid, a.gid, a.uname\n" +
|
||||
"FROM t_user a\n" +
|
||||
"\tINNER JOIN t_group b\n" +
|
||||
"WHERE a.uid = b.id"
|
||||
, repository.resolve("select a.* from t_user a inner join t_group b where a.uid = id"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user