improved sql parser.

This commit is contained in:
wenshao
2017-09-28 09:39:01 +08:00
parent aa957fab13
commit 6277b490bd
166 changed files with 2030 additions and 446 deletions
@@ -0,0 +1,29 @@
package com.alibaba.druid.bvt.bug;
import com.alibaba.druid.filter.stat.StatFilter;
import com.alibaba.druid.util.JdbcConstants;
import junit.framework.TestCase;
public class Issue2002 extends TestCase {
public void test_for_issue() throws Exception {
String sql = "select id,sum(uv[1]) uv1,sum(uv[2]) uv2\n" +
"from xxxxx where a in\n" +
" ( \n" +
" ?\n" +
" ) \n" +
" and ta->'taAge' ??|\n" +
" \n" +
" '{ \n" +
" 1\n" +
" , \n" +
" 2\n" +
" , \n" +
" 3\n" +
" }' \n" +
"group by id";
StatFilter filter = new StatFilter();
String psql = filter.mergeSql(sql, JdbcConstants.POSTGRESQL);
System.out.println(psql);
}
}