mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for mysql concat literal string.
This commit is contained in:
+2
-2
@@ -89,7 +89,7 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
|
||||
stmt.setName(this.exprParser.name());
|
||||
|
||||
if (lexer.token() == Token.LIKE) {
|
||||
lexer.nextToken();
|
||||
lexer.nextTokenValue();
|
||||
SQLName name = this.exprParser.name();
|
||||
stmt.setLike(name);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class MySqlCreateTableParser extends SQLCreateTableParser {
|
||||
lexer.nextToken();
|
||||
|
||||
if (lexer.token() == Token.LIKE) {
|
||||
lexer.nextToken();
|
||||
lexer.nextTokenValue();
|
||||
SQLName name = this.exprParser.name();
|
||||
stmt.setLike(name);
|
||||
} else if (lexer.token() == Token.SELECT) {
|
||||
|
||||
@@ -228,14 +228,13 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
return primaryRest(expr);
|
||||
}
|
||||
} else if (expr instanceof SQLCharExpr) {
|
||||
SQLMethodInvokeExpr concat = new SQLMethodInvokeExpr("CONCAT");
|
||||
concat.addParameter(expr);
|
||||
String text2 = ((SQLCharExpr) expr).getText();
|
||||
do {
|
||||
String chars = lexer.stringVal();
|
||||
concat.addParameter(new SQLCharExpr(chars));
|
||||
text2 += chars;
|
||||
lexer.nextToken();
|
||||
} while (lexer.token() == Token.LITERAL_CHARS || lexer.token() == Token.LITERAL_ALIAS);
|
||||
expr = concat;
|
||||
expr = new SQLCharExpr(text2);
|
||||
}
|
||||
} else if (lexer.token() == Token.IDENTIFIER) {
|
||||
if (expr instanceof SQLHexExpr) {
|
||||
|
||||
@@ -101,7 +101,7 @@ public class MySqlSelectParser extends SQLSelectParser {
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.SELECT) {
|
||||
lexer.nextToken();
|
||||
lexer.nextTokenValue();
|
||||
|
||||
if (lexer.token() == Token.HINT) {
|
||||
this.exprParser.parseHints(queryBlock.getHints());
|
||||
|
||||
Reference in New Issue
Block a user