提交 1a9d4192 authored 作者: Thomas Mueller's avatar Thomas Mueller

The SQL parser silently ignored characters such as '^' or '\'. Now a syntax error is thrown.

上级 5c925d5e
......@@ -3227,7 +3227,9 @@ public class Parser {
} else if (c >= '0' && c <= '9') {
type = CHAR_VALUE;
} else {
if (Character.isJavaIdentifierPart(c)) {
if (c <= ' ' || Character.isWhitespace(c)) {
// whitespace
} else if (Character.isJavaIdentifierPart(c)) {
type = CHAR_NAME;
if (identifiersToUpper) {
char u = Character.toUpperCase(c);
......@@ -3236,6 +3238,8 @@ public class Parser {
changed = true;
}
}
} else {
type = CHAR_SPECIAL_1;
}
}
}
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
select 2^2;
> exception
select * from dual where x in (select x from dual group by x order by max(x));
> X
> -
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论