mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
format code
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@527 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -28,7 +28,7 @@ public class MySqlBooleanExpr extends SQLLiteralExpr implements MySqlExpr {
|
||||
public MySqlBooleanExpr(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public MySqlBooleanExpr(boolean value){
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
+2
-1
@@ -59,7 +59,8 @@ public class MySqlMatchAgainstExpr extends SQLExprImpl implements MySqlExpr {
|
||||
|
||||
public static enum SearchModifier {
|
||||
IN_BOOLEAN_MODE("IN BOOLEAN MODE"), IN_NATURAL_LANGUAGE_MODE("IN NATURAL LANGUAGE MODE"),
|
||||
IN_NATURAL_LANGUAGE_MODE_WITH_QUERY_EXPANSION("IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION"), WITH_QUERY_EXPANSION("WITH QUERY EXPANSION"), ;
|
||||
IN_NATURAL_LANGUAGE_MODE_WITH_QUERY_EXPANSION("IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION"),
|
||||
WITH_QUERY_EXPANSION("WITH QUERY EXPANSION"), ;
|
||||
|
||||
public final String name;
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class MySqlTableIndex extends SQLObjectImpl implements SQLTableElement {
|
||||
accept0((MySqlASTVisitor) visitor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, name);
|
||||
acceptChild(visitor, columns);
|
||||
|
||||
@@ -190,7 +190,8 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
String collate = lexer.stringVal();
|
||||
lexer.nextToken();
|
||||
|
||||
SQLBinaryOpExpr binaryExpr = new SQLBinaryOpExpr(expr, SQLBinaryOperator.COLLATE, new SQLIdentifierExpr(collate));
|
||||
SQLBinaryOpExpr binaryExpr = new SQLBinaryOpExpr(expr, SQLBinaryOperator.COLLATE,
|
||||
new SQLIdentifierExpr(collate));
|
||||
|
||||
expr = binaryExpr;
|
||||
|
||||
|
||||
@@ -29,8 +29,9 @@ import com.alibaba.druid.sql.parser.SQLParseException;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
public class MySqlLexer extends Lexer {
|
||||
public final static Keywords DEFAULT_MYSQL_KEYWORDS;
|
||||
|
||||
|
||||
public final static Keywords DEFAULT_MYSQL_KEYWORDS;
|
||||
|
||||
static {
|
||||
Map<String, Token> map = new HashMap<String, Token>();
|
||||
map.put("EXISTS", Token.EXISTS);
|
||||
@@ -102,11 +103,11 @@ public class MySqlLexer extends Lexer {
|
||||
map.put("LOCK", Token.LOCK);
|
||||
map.put("SOME", Token.SOME);
|
||||
map.put("ANY", Token.ANY);
|
||||
|
||||
|
||||
map.put("TRUE", Token.TRUE);
|
||||
map.put("FALSE", Token.FALSE);
|
||||
map.put("LIMIT", Token.LIMIT);
|
||||
|
||||
|
||||
DEFAULT_MYSQL_KEYWORDS = new Keywords(map);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class MySqlSelectParser extends SQLSelectParser {
|
||||
this(new MySqlLexer(sql));
|
||||
this.lexer.nextToken();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected SQLSelectQuery query() throws ParserException {
|
||||
if (lexer.token() == (Token.LPAREN)) {
|
||||
|
||||
@@ -771,7 +771,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
|
||||
SQLName tableName = this.exprParser.name();
|
||||
insertStatement.setTableName(tableName);
|
||||
|
||||
|
||||
if (lexer.token() == Token.IDENTIFIER) {
|
||||
insertStatement.setAlias(lexer.stringVal());
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -131,7 +131,8 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
print(select.getOutFileCharset());
|
||||
}
|
||||
|
||||
if (select.getOutFileColumnsTerminatedBy() != null || select.getOutFileColumnsEnclosedBy() != null || select.getOutFileColumnsEscaped() != null) {
|
||||
if (select.getOutFileColumnsTerminatedBy() != null || select.getOutFileColumnsEnclosedBy() != null
|
||||
|| select.getOutFileColumnsEscaped() != null) {
|
||||
print(" COLUMNS");
|
||||
if (select.getOutFileColumnsTerminatedBy() != null) {
|
||||
print(" TERMINATED BY ");
|
||||
|
||||
Reference in New Issue
Block a user