[fix](jdbc scan) 1=1 does not translate to TRUE (#21688)

For most database systems, they recognize where 1=1 but not where true, so we should send the original 1=1 to the database
This commit is contained in:
zy-kkk
2023-07-11 14:04:49 +08:00
committed by GitHub
parent d3be10ee58
commit 5ed42705d4
13 changed files with 88 additions and 37 deletions

View File

@ -134,6 +134,9 @@ public class JdbcScanNode extends ExternalScanNode {
for (Expr p : conjunctsList) {
if (shouldPushDownConjunct(jdbcType, p)) {
String filter = conjunctExprToString(jdbcType, p);
if (filter.equals("TRUE")) {
filter = "1 = 1";
}
filters.add(filter);
conjuncts.remove(p);
}