Procházet zdrojové kódy

升级jsqlparser至5.3

聂秋荣 před 1 měsícem
rodič
revize
962ac61fa7

+ 1 - 1
mybatis-plus-jsqlparser-support/mybatis-plus-jsqlparser/build.gradle

@@ -3,7 +3,7 @@ compileJava {
 }
 
 dependencies {
-    api "com.github.jsqlparser:jsqlparser:5.2"
+    api "com.github.jsqlparser:jsqlparser:5.3"
     api project(":mybatis-plus-jsqlparser-support:mybatis-plus-jsqlparser-common")
     implementation "${lib."slf4j-api"}"
     implementation "de.ruedigermoeller:fst:3.0.3"

+ 3 - 0
mybatis-plus-jsqlparser-support/mybatis-plus-jsqlparser/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/BaseMultiTableInnerInterceptor.java

@@ -189,6 +189,9 @@ public abstract class BaseMultiTableInnerInterceptor extends JsqlParserSupport i
                 Expression inExpression = expression.getRightExpression();
                 if (inExpression instanceof Select) {
                     processSelectBody(((Select) inExpression), whereSegment);
+                } else if (inExpression instanceof AndExpression) {
+                    Expression leftExpression = ((AndExpression) inExpression).getLeftExpression();
+                    processWhereSubSelect(leftExpression, whereSegment);
                 }
             } else if (where instanceof ExistsExpression) {
                 // exists

+ 3 - 0
mybatis-plus-jsqlparser-support/mybatis-plus-jsqlparser/src/main/java/com/baomidou/mybatisplus/extension/plugins/inner/IllegalSQLInnerInterceptor.java

@@ -196,6 +196,9 @@ public class IllegalSQLInnerInterceptor extends JsqlParserSupport implements Inn
                 Subtraction subSelect = (Subtraction) inExpression.getRightExpression();
                 throw new MybatisPlusException("非法SQL,where条件中不能使用子查询,错误子查询SQL信息:" + subSelect.toString());
             }
+            if (inExpression.getRightExpression() instanceof OrExpression) {
+                validExpression(inExpression.getRightExpression());
+            }
         }
 
     }