提交 83697c14 authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 572: MySQL compatibility for "order by" in update statements.

上级 c364baf4
......@@ -747,16 +747,16 @@ public class Parser {
Expression condition = readExpression();
command.setCondition(condition);
}
if (readIf("LIMIT")) {
Expression limit = readTerm().optimize(session);
command.setLimit(limit);
}
if (readIf("ORDER")) {
// for MySQL compatibility
// (this syntax is supported, but ignored)
read("BY");
parseSimpleOrderList();
}
if (readIf("LIMIT")) {
Expression limit = readTerm().optimize(session);
command.setLimit(limit);
}
setSQL(command, "UPDATE", start);
return command;
}
......
......@@ -799,8 +799,7 @@ select count(*) from test;
> 3;
select max(col1) from test;
> 3;
update test set col1 = col1 + 1
order by col1 asc;
update test set col1 = col1 + 1 limit 1 order by col1 asc;
select count(*) from test;
> 3;
select max(col1) from test;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论