improved sql parser.

This commit is contained in:
wenshao
2017-08-03 10:41:23 +08:00
parent 9df6894d83
commit b0c38aef68
70 changed files with 1091 additions and 109 deletions
@@ -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"));
}
}