-
Notifications
You must be signed in to change notification settings - Fork 2.2k
多表关联模糊查询时,查询条件顺序错乱bug #445
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
已经升级过,当前版本是 apijson-framework-5.2.0 <dependency>
<groupId>com.github.APIJSON</groupId>
<artifactId>apijson-framework</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>com.github.APIJSON</groupId>
<artifactId>apijson-column</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>com.github.APIJSON</groupId>
<artifactId>apijson-router</artifactId>
<version>1.0.5</version>
</dependency> |
有没有哪里单独指定了 APIJSON 5.1.5? |
没有单独指定。是两个项目,但是apijson-framework 是需要引用 APIJSON 的, |
感谢反馈,外查询和子查询都有条件时触发了这个 bug。 这里得把 preparedValueList 反过来装 参考 concatJoinWhereString,先外查询 preparedValueList、子查询的 preparedValueList 取出来用一个变量暂存,然后清空,再用子查询的 subPreparedValueList.add(preparedValueList) 然后 setPreparedValueList |
已提交,如可用请合并。 |
|
getFrom 值不为 null 就一定是有 FROM(SELECT ...) 这种子查询, |
取两个列表、合并两个列表、设置两个列表,也就 5 行代码 |
6.3.0版本,List subPvl = cfg.getPreparedValueList()一直是空集合,导致最终No value specified for parameter 4 |
@gxmanito 升级 6.4+ 或 7.0.3 试试。还不行的话麻烦提供详细信息,方便排查问题 |
#445 (comment) 另还有个多表join(left、inner、app均使用)其中查询有模糊查,会报错,把"deviceName$": "%设备名称%"条件去掉就没问题,打断点查看第一遍会先生成(SELECT |
@gxmanito JOIN 带条件有占位符错误问题,我们再排查下,感谢反馈。 APP JOIN 和 LEFT JOIN 可以互换试试,结果应该一样,只是性能区别 |
#445 (comment) |
#445 (comment) |
@gxmanito WITH AS 确实有这个问题,可以先关掉,只是对性能有点影响 |
@gxmanito 改用刚发布的 7.0.3-jdk1.8 或 7.0.3-jdk1.8.0.0 试试 如果有用到 apijson-framework,必须 6.3.0+,并且排除它依赖的 APIJSON ORM, apijson-column, apijson-router 都只能用 1.8.0+,并且排除它们依赖的 APIJSON ORM <dependency>
<groupId>com.github.Tencent</groupId>
<artifactId>APIJSON</artifactId>
<version>7.0.3-jdk1.8</version>
</dependency>
<dependency>
<groupId>com.github.APIJSON</groupId>
<artifactId>apijson-framework</artifactId>
<version>6.3.0</version>
<exclusions>
<exclusion>
<groupId>com.github.Tencent</groupId>
<artifactId>APIJSON</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.APIJSON</groupId>
<artifactId>apijson-column</artifactId>
<version>1.8.0</version>
<exclusions>
<exclusion>
<groupId>com.github.Tencent</groupId>
<artifactId>APIJSON</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.APIJSON</groupId>
<artifactId>apijson-router</artifactId>
<version>1.8.0</version>
<exclusions>
<exclusion>
<groupId>com.github.Tencent</groupId>
<artifactId>APIJSON</artifactId>
</exclusion>
</exclusions>
</dependency> |
@gxmanito 复现了: 删除这两个 INNER JOIN 对应任何一张表里的条件可以正常返回结果: ![]() ![]() 这个得继续排查是 AbstractSQLConfig 哪步出错的。 可能 getJoinString 对 LEFT/RIGHT 等 OUTER JOIN 处理条件时清空现有副表的 preparedValueList,然后加到主表,这块有问题 ![]() ![]() |
Uh oh!
There was an error while loading. Please reload this page.
环境信息
系统: Windows 10
JDK: 1.8.0_17
数据库: postgresql-12
APIJSON: 5.2.0
APIJSON-framework: 5.2.0
项目:https://github.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server/APIJSONDemo-Druid
问题描述
在使用临时表进行多表关联查询,执行如下sql时,查询条件的顺序会颠倒,导致查询报错。
执行时sql参数顺序乱了,

sex=1
变成了sex=%a%
explain返回的sql是正确的

The text was updated successfully, but these errors were encountered: