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,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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user