版本: 1.1.13
语句:
SELECT TO_CHAR(ADD_MONTHS(TO_DATE('2014', 'yyyy'), (ROWNUM) * 12), 'yyyy') as YEAR
FROM DUAL
CONNECT BY ROWNUM <=
months_between(to_date(to_char(sysdate,'yyyy'),'yyyy') ,
to_date('2014', 'yyyy')) / 12
执行以下语句:
PagerUtils.limit(sql, "oracle", 0, 10);
得到结果:
SELECT TO_CHAR(ADD_MONTHS(TO_DATE('2014', 'yyyy'), ROWNUM * 12), 'yyyy') AS YEAR
FROM DUAL
WHERE ROWNUM <= 10
CONNECT BY ROWNUM <= months_between(to_date(to_char(SYSDATE, 'yyyy'), 'yyyy'), to_date('2014', 'yyyy')) / 12
结果服务器执行语句失败
正确语法应该是
SELECT TO_CHAR(ADD_MONTHS(TO_DATE('2014', 'yyyy'), ROWNUM * 12), 'yyyy') AS YEAR
FROM DUAL
CONNECT BY ROWNUM <= months_between(to_date(to_char(SYSDATE, 'yyyy'), 'yyyy'), to_date('2014', 'yyyy')) / 12 and ROWNUM <= 10
6条答案
按热度按时间x8diyxa71#
我看到生成的SQL是这个:
0md85ypi2#
r8xiu3jd3#
MF文件内容如下:
Manifest-Version: 1.0
Implementation-Title: druid
Implementation-Version: 1.1.13
Archiver-Version: Plexus Archiver
Built-By: wenshao
Implementation-Build: 2019-01-30 21:26:09
Implementation-Vendor-Id: com.alibaba
Created-By: Apache Maven 3.5.0
Build-Jdk: 1.8.0_181
Implementation-Vendor: Alibaba Group
cbjzeqam4#
经过尝试发现,当offset大于0时确实正常,但当offset等于0时就会出现以上bug。
PagerUtils.java:309
if ((queryBlock.getGroupBy() == null) && (orderBy == null) && (offset <= 0))
enyaitl35#
看上去bug还在,我看下怎么修复
vwhgwdsa6#
备份一下测试代码