提交 48006f2f authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 73c9811b
...@@ -27,6 +27,7 @@ import java.util.Calendar; ...@@ -27,6 +27,7 @@ import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.h2.constant.ErrorCode;
import org.h2.constant.SysProperties; import org.h2.constant.SysProperties;
import org.h2.jdbc.JdbcConnection; import org.h2.jdbc.JdbcConnection;
import org.h2.test.TestAll; import org.h2.test.TestAll;
...@@ -70,7 +71,9 @@ public class TestCrashAPI extends TestBase { ...@@ -70,7 +71,9 @@ public class TestCrashAPI extends TestBase {
// int testing; // int testing;
// add = ";STORAGE=TEXT"; // add = ";STORAGE=TEXT";
// if (openCount >= 33) { // if(openCount >= 32) {
// int test;
// Runtime.getRuntime().halt(0);
// System.exit(1); // System.exit(1);
// } // }
// add = ";LOG=2"; // add = ";LOG=2";
...@@ -81,6 +84,11 @@ public class TestCrashAPI extends TestBase { ...@@ -81,6 +84,11 @@ public class TestCrashAPI extends TestBase {
String url = getURL(DIR + "/crashApi" + seed, true) + add; String url = getURL(DIR + "/crashApi" + seed, true) + add;
// int test;
// url += ";DB_CLOSE_ON_EXIT=FALSE";
// int test;
// url += ";TRACE_LEVEL_FILE=3";
Connection conn = null; Connection conn = null;
// System.gc(); // System.gc();
conn = DriverManager.getConnection(url, "sa", ""); conn = DriverManager.getConnection(url, "sa", "");
...@@ -114,7 +122,7 @@ public class TestCrashAPI extends TestBase { ...@@ -114,7 +122,7 @@ public class TestCrashAPI extends TestBase {
String sql = (String) statements.get(i); String sql = (String) statements.get(i);
try { try {
// if(openCount == 32 && i == 1219) { // if(openCount == 32) {
// int test; // int test;
// System.out.println("stop!"); // System.out.println("stop!");
// } // }
...@@ -257,17 +265,16 @@ public class TestCrashAPI extends TestBase { ...@@ -257,17 +265,16 @@ public class TestCrashAPI extends TestBase {
// do nothing // do nothing
} else if (t instanceof SQLException) { } else if (t instanceof SQLException) {
SQLException s = (SQLException) t; SQLException s = (SQLException) t;
String state = s.getSQLState(); int errorCode = s.getErrorCode();
if (state == null) { if (errorCode == 0) {
printError(seed, id, s); printError(seed, id, s);
} else if (state.equals("90008")) { } else if (errorCode == ErrorCode.OBJECT_CLOSED) {
if (objectId >= 0) { if (objectId >= 0) {
// The object is already closed [90008]
// TODO at least call a few more times after close - maybe // TODO at least call a few more times after close - maybe
// there is still an error // there is still an error
objects.remove(objectId); objects.remove(objectId);
} }
} else if (state.equals("HY000")) { } else if (errorCode == ErrorCode.GENERAL_ERROR_1) {
// General error [HY000] // General error [HY000]
printError(seed, id, s); printError(seed, id, s);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论