提交 260035dc authored 作者: Thomas Mueller's avatar Thomas Mueller

Test cases.

上级 11aa040c
...@@ -234,6 +234,9 @@ public abstract class TestBase { ...@@ -234,6 +234,9 @@ public abstract class TestBase {
if (url.indexOf("TRACE_LEVEL_FILE=") < 0) { if (url.indexOf("TRACE_LEVEL_FILE=") < 0) {
url += ";TRACE_LEVEL_FILE=" + config.traceLevelFile; url += ";TRACE_LEVEL_FILE=" + config.traceLevelFile;
} }
if (url.indexOf("TRACE_MAX_FILE_SIZE") < 0) {
url += ";TRACE_MAX_FILE_SIZE=8";
}
} }
if (config.throttle > 0) { if (config.throttle > 0) {
url += ";THROTTLE=" + config.throttle; url += ";THROTTLE=" + config.throttle;
......
...@@ -78,17 +78,22 @@ public class TestCases extends TestBase { ...@@ -78,17 +78,22 @@ public class TestCases extends TestBase {
} }
private void testDeleteIndexOutOfBounds() throws SQLException { private void testDeleteIndexOutOfBounds() throws SQLException {
if (config.memory || !config.big) {
return;
}
deleteDb("cases"); deleteDb("cases");
Connection conn = getConnection("cases"); Connection conn = getConnection("cases");
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("CREATE TABLE IF NOT EXISTS test (rowid INTEGER PRIMARY KEY AUTO_INCREMENT, txt VARCHAR(64000));"); stat.execute("CREATE TABLE IF NOT EXISTS test (rowid INTEGER PRIMARY KEY AUTO_INCREMENT, txt VARCHAR(64000));");
StringBuilder builder = new StringBuilder(); PreparedStatement prep = conn.prepareStatement("insert into test (txt) values(space(?))");
for (int i = 0; i < 3000; i++) { for (int i = 0; i < 3000; i++) {
builder.append("abc"); prep.setInt(1, i * 3);
stat.execute("insert into test (txt) values ('" + builder.toString() + "');"); prep.execute();
} }
stat.execute("DELETE FROM test;"); stat.execute("DELETE FROM test;");
conn.close(); conn.close();
System.out.println("end");
} }
private void testInsertDeleteRollback() throws SQLException { private void testInsertDeleteRollback() throws SQLException {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论