提交 fe74b101 authored 作者: noelgrandin's avatar noelgrandin

Support 123L syntax as in Java; example: SELECT (2000000000L*2).

上级 a6316dd0
...@@ -25,7 +25,8 @@ Change Log ...@@ -25,7 +25,8 @@ Change Log
</li><li>Improve error message when dropping an index that belongs to a constraint, </li><li>Improve error message when dropping an index that belongs to a constraint,
specify constraint in error message. specify constraint in error message.
</li><li>Issue 518: java.sql.Connection.commit() freezes after LOB modification with EXCLUSIVE connection </li><li>Issue 518: java.sql.Connection.commit() freezes after LOB modification with EXCLUSIVE connection
</li><li>Issue 517: Create or replace view statement has no effect on the others already existing JDBC connection </li><li>Issue 517: Create or replace view statement has no effect on the others already existing JDBC connection
</li><li>Support 123L syntax as in Java; example: SELECT (2000000000L*2).
</li></ul> </li></ul>
<h2>Version 1.3.174 (2013-10-19)</h2> <h2>Version 1.3.174 (2013-10-19)</h2>
......
...@@ -133,7 +133,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -133,7 +133,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Optimize getGeneratedKey: send last identity after each execute (server). </li><li>Optimize getGeneratedKey: send last identity after each execute (server).
</li><li>Test and document UPDATE TEST SET (ID, NAME) = (SELECT ID*10, NAME || '!' FROM TEST T WHERE T.ID=TEST.ID). </li><li>Test and document UPDATE TEST SET (ID, NAME) = (SELECT ID*10, NAME || '!' FROM TEST T WHERE T.ID=TEST.ID).
</li><li>Max memory rows / max undo log size: use block count / row size not row count. </li><li>Max memory rows / max undo log size: use block count / row size not row count.
</li><li>Support 123L syntax as in Java; example: SELECT (2000000000*2).
</li><li>Implement point-in-time recovery. </li><li>Implement point-in-time recovery.
</li><li>Support PL/SQL (programming language / control flow statements). </li><li>Support PL/SQL (programming language / control flow statements).
</li><li>LIKE: improved version for larger texts (currently using naive search). </li><li>LIKE: improved version for larger texts (currently using naive search).
......
...@@ -3048,11 +3048,7 @@ public class Parser { ...@@ -3048,11 +3048,7 @@ public class Parser {
while (true) { while (true) {
c = chars[i]; c = chars[i];
if (c < '0' || c > '9') { if (c < '0' || c > '9') {
if (c == '.') { if (c == '.' || c == 'E' || c == 'L') {
readDecimal(start, i);
break;
}
if (c == 'E') {
readDecimal(start, i); readDecimal(start, i);
break; break;
} }
...@@ -3183,6 +3179,10 @@ public class Parser { ...@@ -3183,6 +3179,10 @@ public class Parser {
if (!containsE && sub.indexOf('.') < 0) { if (!containsE && sub.indexOf('.') < 0) {
BigInteger bi = new BigInteger(sub); BigInteger bi = new BigInteger(sub);
if (bi.compareTo(ValueLong.MAX) <= 0) { if (bi.compareTo(ValueLong.MAX) <= 0) {
// parse constants like "10000000L"
if (chars[i] == 'L') {
parseIndex++;
}
currentValue = ValueLong.get(bi.longValue()); currentValue = ValueLong.get(bi.longValue());
currentTokenType = VALUE; currentTokenType = VALUE;
return; return;
......
select 1000L / 10;
> 100;
select * from (select x as y from dual order by y); select * from (select x as y from dual order by y);
> 1; > 1;
select a.x from dual a, dual b order by x; select a.x from dual a, dual b order by x;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论