You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by su...@apache.org on 2022/11/13 09:04:10 UTC

[shardingsphere] branch master updated: Refactor LogSQLParseResultReporter (#22139)

This is an automated email from the ASF dual-hosted git repository.

sunnianjun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new cc251ac067f Refactor LogSQLParseResultReporter (#22139)
cc251ac067f is described below

commit cc251ac067f413baa5bcf3aceaa2de218db9b280
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Nov 13 17:04:05 2022 +0800

    Refactor LogSQLParseResultReporter (#22139)
---
 .../test/integration/sql/parser/engine/SQLParserParameterizedIT.java | 1 -
 .../sql/parser/result/type/log/LogSQLParseResultReporter.java        | 5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/engine/SQLParserParameterizedIT.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/engine/SQLParserParameterizedIT.java
index 6c190ab9966..0321072f660 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/engine/SQLParserParameterizedIT.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/engine/SQLParserParameterizedIT.java
@@ -55,7 +55,6 @@ public abstract class SQLParserParameterizedIT {
             new SQLVisitorEngine(databaseType, "STATEMENT", true, new Properties()).visit(parseASTNode);
         } catch (final ShardingSphereExternalException | ClassCastException | NullPointerException | IllegalArgumentException | IndexOutOfBoundsException ignore) {
             isSuccess = false;
-            log.warn("ParserError: " + sqlCaseId + " value: " + sql + " db-type: " + databaseType);
         }
         resultReporter.printResult(sqlCaseId, databaseType, isSuccess, sql);
     }
diff --git a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/type/log/LogSQLParseResultReporter.java b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/type/log/LogSQLParseResultReporter.java
index 49b4d7c60f3..ad2045651a4 100644
--- a/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/type/log/LogSQLParseResultReporter.java
+++ b/test/integration-test/sql-parser/src/test/java/org/apache/shardingsphere/test/integration/sql/parser/result/type/log/LogSQLParseResultReporter.java
@@ -28,7 +28,8 @@ public final class LogSQLParseResultReporter implements SQLParseResultReporter {
     
     @Override
     public void printResult(final String sqlCaseId, final String databaseType, final boolean isSuccess, final String sql) {
-        // TODO set up the log format
-        log.info("Printing the SQL parser process result");
+        if (!isSuccess) {
+            log.warn("SQL parse failed. SQL Case ID is: {}, database type is: {}, SQL is: {}", sqlCaseId, databaseType, sql);
+        }
     }
 }