提交 e0b3be30 authored 作者: Thomas Mueller's avatar Thomas Mueller

Merge pull request #1 from thomasmueller/master

Java 8 compatibility for regexp_replace and tests
.classpath
.project
bin
docs
ext
error.*
temp
test.out.txt
......@@ -20,7 +20,7 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>-
<ul><li>Java 8 compatibility for "regexp_replace".
</li></ul>
<h2>Version 1.4.187 Beta (2015-04-10)</h2>
......
......@@ -1360,6 +1360,9 @@ public class Function extends Expression implements FunctionCall {
} catch (PatternSyntaxException e) {
throw DbException.get(
ErrorCode.LIKE_ESCAPE_ERROR_1, e, regexp);
} catch (IllegalArgumentException e) {
throw DbException.get(
ErrorCode.LIKE_ESCAPE_ERROR_1, e, replacement);
}
break;
}
......
......@@ -349,7 +349,7 @@ public class TestScript extends TestBase {
private void writeResult(String sql, String s, SQLException e)
throws Exception {
assertKnownException(e);
assertKnownException(sql, e);
s = ("> " + s).trim();
String compare = readLine();
if (compare != null && compare.startsWith(">")) {
......@@ -377,7 +377,6 @@ public class TestScript extends TestBase {
putBack = compare;
}
write(s);
}
private void write(String s) {
......
......@@ -1614,7 +1614,7 @@ SELECT * FROM TEST;
DROP TABLE TEST;
> ok
call 'a' regexp '\Ho.*';
call 'a' regexp 'Ho.*\';
> exception
set @t = 0;
......@@ -9376,10 +9376,10 @@ select degrees(null) vn, degrees(1) v1, degrees(1.1) v2, degrees(-1.1) v3, degre
> null 57.29577951308232 63.02535746439057 -63.02535746439057 108.86198107485642 -108.86198107485642
> rows: 1
select exp(null) vn, exp(1) v1, exp(1.1) v2, exp(-1.1) v3, exp(1.9) v4, exp(-1.9) v5 from test;
> VN V1 V2 V3 V4 V5
> ---- ------------------ ------------------ ------------------ ------------------ -------------------
> null 2.7182818284590455 3.0041660239464334 0.3328710836980795 6.6858944422792685 0.14956861922263506
select exp(null) vn, left(exp(1), 4) v1, left(exp(1.1), 4) v2, left(exp(-1.1), 4) v3, left(exp(1.9), 4) v4, left(exp(-1.9), 4) v5 from test;
> VN V1 V2 V3 V4 V5
> ---- ---- ---- ---- ---- ----
> null 2.71 3.00 0.33 6.68 0.14
> rows: 1
select radians(null) vn, radians(1) v1, radians(1.1) v2, radians(-1.1) v3, radians(1.9) v4, radians(-1.9) v5 from test;
......
......@@ -783,8 +783,22 @@ public class Build extends BuildBase {
*/
public void test() {
downloadTest();
String testClass = System.getProperty("test", "org.h2.test.TestAll");
java(testClass, null);
String cp = "temp" + File.pathSeparator + "bin" +
File.pathSeparator + "ext/postgresql-8.3-603.jdbc3.jar" +
File.pathSeparator + "ext/servlet-api-3.0.1.jar" +
File.pathSeparator + "ext/lucene-core-3.0.2.jar" +
File.pathSeparator + "ext/h2mig_pagestore_addon.jar" +
File.pathSeparator + "ext/org.osgi.core-4.2.0.jar" +
File.pathSeparator + "ext/org.osgi.enterprise-4.2.0.jar" +
File.pathSeparator + "ext/jts-1.13.jar" +
File.pathSeparator + "ext/slf4j-api-1.6.0.jar" +
File.pathSeparator + "ext/slf4j-nop-1.6.0.jar" +
File.pathSeparator + System.getProperty("java.home") +
"/../lib/tools.jar";
exec("java", args(
"-Xmx128m",
"-cp", cp,
"org.h2.test.TestAll"));
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论