提交 3606b2a5 authored 作者: Thomas Mueller's avatar Thomas Mueller

MySQL compatibility: support for := assignment as in @sum:=@sum+x

INSERT INTO TEST(SELECT * FROM TEST) is now supported.
上级 390ecb87
......@@ -880,8 +880,14 @@ public class Parser {
Table table = readTableOrView();
command.setTable(table);
if (readIf("(")) {
Column[] columns = parseColumnList(table);
command.setColumns(columns);
if (isToken("SELECT") || isToken("FROM")) {
command.setQuery(parseSelect());
read(")");
return command;
} else {
Column[] columns = parseColumnList(table);
command.setColumns(columns);
}
}
if (readIf("DEFAULT")) {
read("VALUES");
......@@ -2144,6 +2150,13 @@ public class Parser {
case AT:
read();
r = new Variable(session, readAliasIdentifier());
if (readIf(":=")) {
Expression value = readExpression();
Function function = Function.getFunction(database, "SET");
function.setParameter(0, r);
function.setParameter(1, value);
r = function;
}
break;
case PARAMETER:
// there must be no space between ? and the number
......@@ -3014,6 +3027,8 @@ public class Parser {
case ':':
if ("::".equals(s)) {
return KEYWORD;
} else if (":=".equals(s)) {
return KEYWORD;
}
break;
case '>':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论