Skip to content

Commit

Permalink
Merge pull request #70 from zhangtianxiao/master
Browse files Browse the repository at this point in the history
Server:解决 < LEFT JOIN  或 > RIGHT JOIN 在主副表都有条件时 preparedValueList 里的主副表值顺序错误,导致 MySQL 查询结果不对,PostgreSQL 可能类型报错
  • Loading branch information
TommyLemon committed Feb 17, 2019
2 parents 493faa2 + b2e42ff commit c633ffb
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,8 @@ public String getJoinString() throws Exception {

if (joinList != null) {
String quote = getQuote();
List<Object> pvl = new ArrayList<>();
boolean changed = false;

String sql = null;
SQLConfig jc;
Expand Down Expand Up @@ -1898,7 +1900,10 @@ public String getJoinString() throws Exception {
+ quote + tn + quote + "." + quote + j.getTargetKey() + quote;
jc.setMain(false).setKeyPrefix(true);

preparedValueList.addAll(jc.getPreparedValueList());
// preparedValueList.addAll(jc.getPreparedValueList());

pvl.addAll(jc.getPreparedValueList());
changed = true;
break;

case "": // FULL JOIN
Expand All @@ -1916,6 +1921,13 @@ public String getJoinString() throws Exception {

joinOns += " \n " + sql;
}


if (changed) {
pvl.addAll(preparedValueList);
preparedValueList = pvl;
}

}

return joinOns;
Expand Down

0 comments on commit c633ffb

Please sign in to comment.