From 09ca484efaacd42f74efefa7e58dc0acb6f56a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=81=E5=86=AC?= Date: Thu, 23 Mar 2023 12:52:49 +0800 Subject: [PATCH] fix output visitor for binlog statements --- .../dialect/mysql/visitor/MySqlOutputVisitor.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/polardbx-parser/src/main/java/com/alibaba/polardbx/druid/sql/dialect/mysql/visitor/MySqlOutputVisitor.java b/polardbx-parser/src/main/java/com/alibaba/polardbx/druid/sql/dialect/mysql/visitor/MySqlOutputVisitor.java index 3e98b16b0..6c8921f6b 100644 --- a/polardbx-parser/src/main/java/com/alibaba/polardbx/druid/sql/dialect/mysql/visitor/MySqlOutputVisitor.java +++ b/polardbx-parser/src/main/java/com/alibaba/polardbx/druid/sql/dialect/mysql/visitor/MySqlOutputVisitor.java @@ -3352,12 +3352,20 @@ public void endVisit(MySqlShowBinaryLogsStatement x) { @Override public boolean visit(MySqlShowBinaryLogsStatement x) { print0(ucase ? "SHOW BINARY LOGS" : "show binary logs"); + if (x.getWith() != null) { + print0(ucase ? " WITH " : " with "); + x.getWith().accept(this); + } return false; } @Override public boolean visit(MySqlShowMasterLogsStatement x) { print0(ucase ? "SHOW MASTER LOGS" : "show master logs"); + if (x.getWith() != null) { + print0(ucase ? " WITH " : " with "); + x.getWith().accept(this); + } return false; } @@ -3388,6 +3396,10 @@ public void endVisit(MySqlShowCollationStatement x) { @Override public boolean visit(MySqlShowBinLogEventsStatement x) { print0(ucase ? "SHOW BINLOG EVENTS" : "show binlog events"); + if (x.getWith() != null) { + print0(ucase ? " WITH " : " with "); + x.getWith().accept(this); + } if (x.getIn() != null) { print0(ucase ? " IN " : " in "); x.getIn().accept(this);