mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
mysql parser show
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.mysql.ast.statement;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;
|
||||
|
||||
public class MySqlShowTriggersStatement extends MySqlStatementImpl {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private SQLName database;
|
||||
private SQLExpr like;
|
||||
private SQLExpr where;
|
||||
|
||||
public SQLName getDatabase() {
|
||||
return database;
|
||||
}
|
||||
|
||||
public void setDatabase(SQLName database) {
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
public SQLExpr getLike() {
|
||||
return like;
|
||||
}
|
||||
|
||||
public void setLike(SQLExpr like) {
|
||||
this.like = like;
|
||||
}
|
||||
|
||||
public SQLExpr getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(SQLExpr where) {
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public void accept0(MySqlASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, database);
|
||||
acceptChild(visitor, like);
|
||||
acceptChild(visitor, where);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 1999-2011 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.mysql.ast.statement;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;
|
||||
|
||||
public class MySqlShowVariantsStatement extends MySqlStatementImpl {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private boolean global = false;
|
||||
private boolean session = false;
|
||||
|
||||
private SQLExpr like;
|
||||
private SQLExpr where;
|
||||
|
||||
public boolean isGlobal() {
|
||||
return global;
|
||||
}
|
||||
|
||||
public void setGlobal(boolean global) {
|
||||
this.global = global;
|
||||
}
|
||||
|
||||
public boolean isSession() {
|
||||
return session;
|
||||
}
|
||||
|
||||
public void setSession(boolean session) {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
public SQLExpr getLike() {
|
||||
return like;
|
||||
}
|
||||
|
||||
public void setLike(SQLExpr like) {
|
||||
this.like = like;
|
||||
}
|
||||
|
||||
public SQLExpr getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(SQLExpr where) {
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public void accept0(MySqlASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, like);
|
||||
acceptChild(visitor, where);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
@@ -96,6 +96,8 @@ import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveStatusSta
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTableStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTriggersStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowVariantsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowWarningsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlStartTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlUpdateStatement;
|
||||
@@ -504,6 +506,14 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
if (identifierEquals("VARIABLES")) {
|
||||
lexer.nextToken();
|
||||
|
||||
MySqlShowVariantsStatement stmt = parseShowVariants();
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
if (identifierEquals("GLOBAL")) {
|
||||
lexer.nextToken();
|
||||
@@ -514,6 +524,13 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setGlobal(true);
|
||||
return stmt;
|
||||
}
|
||||
|
||||
if (identifierEquals("VARIABLES")) {
|
||||
lexer.nextToken();
|
||||
MySqlShowVariantsStatement stmt = parseShowVariants();
|
||||
stmt.setGlobal(true);
|
||||
return stmt;
|
||||
}
|
||||
}
|
||||
|
||||
if (identifierEquals("SESSION")) {
|
||||
@@ -525,6 +542,13 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setSession(true);
|
||||
return stmt;
|
||||
}
|
||||
|
||||
if (identifierEquals("VARIABLES")) {
|
||||
lexer.nextToken();
|
||||
MySqlShowVariantsStatement stmt = parseShowVariants();
|
||||
stmt.setSession(true);
|
||||
return stmt;
|
||||
}
|
||||
}
|
||||
|
||||
if (identifierEquals("COBAR_STATUS")) {
|
||||
@@ -1020,6 +1044,31 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
if (identifierEquals("TRIGGERS")) {
|
||||
lexer.nextToken();
|
||||
MySqlShowTriggersStatement stmt = new MySqlShowTriggersStatement();
|
||||
|
||||
if (lexer.token() == Token.FROM) {
|
||||
lexer.nextToken();
|
||||
SQLName database = exprParser.name();
|
||||
stmt.setDatabase(database);
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.LIKE) {
|
||||
lexer.nextToken();
|
||||
SQLExpr like = exprParser.expr();
|
||||
stmt.setLike(like);
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.WHERE) {
|
||||
lexer.nextToken();
|
||||
SQLExpr where = exprParser.expr();
|
||||
stmt.setWhere(where);
|
||||
}
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
// MySqlShowSlaveHostsStatement
|
||||
throw new ParserException("TODO " + lexer.stringVal());
|
||||
@@ -1042,6 +1091,24 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
private MySqlShowVariantsStatement parseShowVariants() throws ParserException {
|
||||
MySqlShowVariantsStatement stmt = new MySqlShowVariantsStatement();
|
||||
|
||||
if (lexer.token() == Token.LIKE) {
|
||||
lexer.nextToken();
|
||||
SQLExpr like = exprParser.expr();
|
||||
stmt.setLike(like);
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.WHERE) {
|
||||
lexer.nextToken();
|
||||
SQLExpr where = exprParser.expr();
|
||||
stmt.setWhere(where);
|
||||
}
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
private MySqlShowWarningsStatement parseShowWarnings() throws ParserException {
|
||||
MySqlShowWarningsStatement stmt = new MySqlShowWarningsStatement();
|
||||
|
||||
@@ -87,6 +87,8 @@ import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveStatusSta
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTableStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTriggersStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowVariantsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowWarningsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlStartTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlTableIndex;
|
||||
@@ -406,4 +408,12 @@ public interface MySqlASTVisitor extends SQLASTVisitor {
|
||||
boolean visit(MySqlShowTableStatusStatement x);
|
||||
|
||||
void endVisit(MySqlShowTableStatusStatement x);
|
||||
|
||||
boolean visit(MySqlShowTriggersStatement x);
|
||||
|
||||
void endVisit(MySqlShowTriggersStatement x);
|
||||
|
||||
boolean visit(MySqlShowVariantsStatement x);
|
||||
|
||||
void endVisit(MySqlShowVariantsStatement x);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveStatusSta
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTableStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTriggersStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowVariantsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowWarningsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlStartTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlTableIndex;
|
||||
@@ -882,4 +884,24 @@ public class MySqlASTVisitorAdapter extends SQLASTVisitorAdapter implements
|
||||
public void endVisit(MySqlShowTableStatusStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowTriggersStatement x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowTriggersStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowVariantsStatement x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowVariantsStatement x) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,8 @@ import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveStatusSta
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTableStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTriggersStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowVariantsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowWarningsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlStartTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlTableIndex;
|
||||
@@ -1820,7 +1822,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowGrantsStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1835,13 +1837,13 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlUserName x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowIndexesStatement x) {
|
||||
print("SHOW INDEX");
|
||||
|
||||
|
||||
if (x.getTable() != null) {
|
||||
print(" FROM ");
|
||||
if (x.getDatabase() != null) {
|
||||
@@ -1850,19 +1852,19 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
}
|
||||
x.getTable().accept(this);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowIndexesStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowKeysStatement x) {
|
||||
print("SHOW KEYS");
|
||||
|
||||
|
||||
if (x.getTable() != null) {
|
||||
print(" FROM ");
|
||||
if (x.getDatabase() != null) {
|
||||
@@ -1876,7 +1878,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowKeysStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1887,18 +1889,18 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowMasterStatusStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowOpenTablesStatement x) {
|
||||
print("SHOW OPEN TABLES");
|
||||
|
||||
|
||||
if (x.getDatabase() != null) {
|
||||
print(" FROM ");
|
||||
x.getDatabase().accept(this);
|
||||
}
|
||||
|
||||
|
||||
if (x.getLike() != null) {
|
||||
print(" LIKE ");
|
||||
x.getLike().accept(this);
|
||||
@@ -1908,13 +1910,13 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
print(" WHERE ");
|
||||
x.getWhere().accept(this);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowOpenTablesStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1925,18 +1927,18 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowPluginsStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowPrivilegesStatement x) {
|
||||
print("SHOW PRIVILEGES");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowPrivilegesStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1948,7 +1950,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowProcedureCodeStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1968,7 +1970,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowProcedureStatusStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1983,7 +1985,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowProcessListStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1997,12 +1999,12 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
}
|
||||
print(x.getTypes().get(i).name);
|
||||
}
|
||||
|
||||
|
||||
if (x.getForQuery() != null) {
|
||||
print(" FOR QUERY ");
|
||||
x.getForQuery().accept(this);
|
||||
}
|
||||
|
||||
|
||||
if (x.getLimit() != null) {
|
||||
print(' ');
|
||||
x.getLimit().accept(this);
|
||||
@@ -2012,7 +2014,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowProfileStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2023,34 +2025,34 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowProfilesStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowRelayLogEventsStatement x) {
|
||||
print("SHOW RELAYLOG EVENTS");
|
||||
|
||||
|
||||
if (x.getLogName() != null) {
|
||||
print(" IN ");
|
||||
x.getLogName().accept(this);
|
||||
}
|
||||
|
||||
|
||||
if (x.getFrom() != null) {
|
||||
print(" FROM ");
|
||||
x.getFrom().accept(this);
|
||||
}
|
||||
|
||||
|
||||
if (x.getLimit() != null) {
|
||||
print(' ');
|
||||
x.getLimit().accept(this);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowRelayLogEventsStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2061,7 +2063,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowSlaveHostsStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2072,7 +2074,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowSlaveStatusStatement x) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2082,7 +2084,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
print(" FROM ");
|
||||
x.getDatabase().accept(this);
|
||||
}
|
||||
|
||||
|
||||
if (x.getLike() != null) {
|
||||
print(" LIKE ");
|
||||
x.getLike().accept(this);
|
||||
@@ -2092,12 +2094,73 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
print(" WHERE ");
|
||||
x.getWhere().accept(this);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowTableStatusStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowTriggersStatement x) {
|
||||
print("SHOW TRIGGERS");
|
||||
|
||||
if (x.getDatabase() != null) {
|
||||
print(" FROM ");
|
||||
x.getDatabase().accept(this);
|
||||
}
|
||||
|
||||
if (x.getLike() != null) {
|
||||
print(" LIKE ");
|
||||
x.getLike().accept(this);
|
||||
}
|
||||
|
||||
if (x.getWhere() != null) {
|
||||
print(" WHERE ");
|
||||
x.getWhere().setParent(x);
|
||||
x.getWhere().accept(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowTriggersStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowVariantsStatement x) {
|
||||
print("SHOW ");
|
||||
|
||||
if (x.isGlobal()) {
|
||||
print("GLOBAL ");
|
||||
}
|
||||
|
||||
if (x.isSession()) {
|
||||
print("SESSION ");
|
||||
}
|
||||
|
||||
print("VARIABLES");
|
||||
|
||||
if (x.getLike() != null) {
|
||||
print(" LIKE ");
|
||||
x.getLike().accept(this);
|
||||
}
|
||||
|
||||
if (x.getWhere() != null) {
|
||||
print(" WHERE ");
|
||||
x.getWhere().setParent(x);
|
||||
x.getWhere().accept(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowVariantsStatement x) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,8 @@ import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowSlaveStatusSta
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTableStatusStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTablesStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowTriggersStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowVariantsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlShowWarningsStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlStartTransactionStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlTableIndex;
|
||||
@@ -945,4 +947,24 @@ public class MySqlSchemaStatVisitor extends SchemaStatVisitor implements MySqlAS
|
||||
public void endVisit(MySqlShowTableStatusStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowTriggersStatement x) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowTriggersStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(MySqlShowVariantsStatement x) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(MySqlShowVariantsStatement x) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
continue;
|
||||
}
|
||||
|
||||
throw new ParserException("TODO " + lexer.token());
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user