提交 8dc58a75 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 f22ff7e4
......@@ -88,10 +88,10 @@ Java implementations (such as Swing) are not used, or only used for optional fea
<h2 id="supporters">Supporters</h2>
<p>
Many thanks for those who reported bugs, gave valuable feedback,
spread the word, and translated this project. Also many thanks to the donors who contributed
via PayPal:
spread the word, and translated this project. Also many thanks to the donors:
</p>
<ul><li><a href="http://www.code42.com">Code 42 Software, Inc., Minneapolis</a>
<ul><li><a href="http://www.codelutin.com">Code Lutin, France</a>
</li><li><a href="http://www.code42.com">Code 42 Software, Inc., Minneapolis</a>
</li><li><a href="http://www.netsuxxess.de">NetSuxxess GmbH, Germany</a>
</li><li><a href="http://pokercopilot.com">Poker Copilot, Steve McLeod, Germany</a>
</li><li><a href="http://skycash.com">SkyCash, Poland</a>
......
......@@ -298,26 +298,25 @@ java org.h2.test.TestAll timer
System.setProperty("h2.maxMemoryRowsDistinct", "128");
System.setProperty("h2.check2", "true");
// System.setProperty("h2.lobInDatabase", "true");
// System.setProperty("h2.analyzeAuto", "100");
// System.setProperty("h2.syncMethod", "");
/*
change or remove documentation for FILE_LOCK=NO
h2.selectForUpdateMvcc:
Implement (sum, count) and test (join, ...)
comparative sql tests
recovery tests with small freeList pages, page size 64
reopen org.h2.test.unit.TestPageStore
-Xmx1500m -D reopenOffset=3 -D reopenShift=1
test with small freeList pages, page size 64
power failure test
power failure test: MULTI_THREADED=TRUE
power failure test: larger binaries and additional index.
power failure test with randomly generating / dropping indexes and tables.
lob in db: check for memory leaks (temp table with blob, then crash;
crash while truncating a table with a blob)
drop table test;
create table test(id identity, name varchar(100) default space(100));
@LOOP 10 insert into test select null, null from system_range(1, 100000);
......
......@@ -657,7 +657,7 @@ public abstract class TestBase {
assertTrue(message, rs1.next());
for (int i = 0; i < columns; i++) {
assertEquals(message, rs0.getString(i + 1), rs1.getString(i + 1));
}
}
}
assertFalse(message, rs0.next());
assertFalse(message, rs1.next());
......
......@@ -53,7 +53,9 @@ public class TestFuzzOptimizations extends TestBase {
create index idx_1 on test0(a);
create index idx_2 on test0(b, a);
create table test1(a int, b int, c int);
insert into test0 select x / 100, mod(x / 10, 10), mod(x, 10) from system_range(0, 999);
insert into test0 select x / 100,
mod(x / 10, 10), mod(x, 10)
from system_range(0, 999);
update test0 set a = null where a = 9;
update test0 set b = null where b = 9;
update test0 set c = null where c = 9;
......@@ -80,49 +82,16 @@ public class TestFuzzOptimizations extends TestBase {
db.execute("insert into test1 select * from test0");
Random seedGenerator = new Random();
String[] columns = new String[] { "a", "b", "c" };
String[] values = new String[] { null, "0", "0", "1", "2", "10", "?" };
String[] compares = new String[] { "in", "not in", "=", "=", ">", "<", ">=", "<=", "<>" };
String[] values = new String[] { null, "0", "0", "1", "2", "10", "a", "?" };
String[] compares = new String[] { "in(", "not in(", "=", "=", ">", "<", ">=", "<=", "<>", "in(select", "not in(select" };
int size = getSize(1000, 10000);
for (int i = 0; i < size; i++) {
long seed = seedGenerator.nextLong();
println("seed: " + seed);
Random random = new Random(seed);
int comp = 1 + random.nextInt(4);
StringBuilder buff = new StringBuilder();
ArrayList<String> params = New.arrayList();
for (int j = 0; j < comp; j++) {
if (j > 0) {
buff.append(random.nextBoolean() ? " and " : " or ");
}
String column = columns[random.nextInt(columns.length)];
String compare = compares[random.nextInt(compares.length)];
buff.append(column).append(' ').append(compare);
if (compare.endsWith("in")) {
buff.append("(");
int len = 1+random.nextInt(3);
for (int k = 0; k < len; k++) {
if (k > 0) {
buff.append(", ");
}
String value = values[random.nextInt(values.length)];
buff.append(value);
if ("?".equals(value)) {
value = values[random.nextInt(values.length - 1)];
params.add(value);
}
}
buff.append(")");
} else {
String value = values[random.nextInt(values.length)];
buff.append(value);
if ("?".equals(value)) {
value = values[random.nextInt(values.length - 1)];
params.add(value);
}
}
}
String condition = buff.toString();
// System.out.println(condition + " " + params);
String condition = getRandomCondition(random, params, columns, compares, values);
// System.out.println(condition + " " + params);
PreparedStatement prep0 = conn.prepareStatement(
"select * from test0 where " + condition
+ " order by 1, 2, 3");
......@@ -138,7 +107,7 @@ public class TestFuzzOptimizations extends TestBase {
assertEquals("seed: " + seed + " " + condition, rs0, rs1);
if (params.size() > 0) {
for (int j = 0; j < params.size(); j++) {
String value = values[random.nextInt(values.length - 1)];
String value = values[random.nextInt(values.length - 2)];
params.set(j, value);
prep0.setString(j + 1, value);
prep1.setString(j + 1, value);
......@@ -149,6 +118,49 @@ public class TestFuzzOptimizations extends TestBase {
db.execute("drop table test0, test1");
}
private String getRandomCondition(Random random, ArrayList<String> params,
String[] columns, String[] compares, String[] values) {
int comp = 1 + random.nextInt(4);
StringBuilder buff = new StringBuilder();
for (int j = 0; j < comp; j++) {
if (j > 0) {
buff.append(random.nextBoolean() ? " and " : " or ");
}
String column = columns[random.nextInt(columns.length)];
String compare = compares[random.nextInt(compares.length)];
buff.append(column).append(' ').append(compare);
if (compare.endsWith("in(")) {
int len = 1+random.nextInt(3);
for (int k = 0; k < len; k++) {
if (k > 0) {
buff.append(", ");
}
String value = values[random.nextInt(values.length)];
buff.append(value);
if ("?".equals(value)) {
value = values[random.nextInt(values.length - 2)];
params.add(value);
}
}
buff.append(")");
} else if (compare.endsWith("(select")) {
String col = columns[random.nextInt(columns.length)];
buff.append(" ").append(col).append(" from test1 where ");
String condition = getRandomCondition(random, params, columns, compares, values);
buff.append(condition);
buff.append(")");
} else {
String value = values[random.nextInt(values.length)];
buff.append(value);
if ("?".equals(value)) {
value = values[random.nextInt(values.length - 2)];
params.add(value);
}
}
}
return buff.toString();
}
private void testInSelect() {
Db db = new Db(conn);
db.execute("CREATE TABLE TEST(A INT, B INT)");
......
......@@ -644,4 +644,4 @@ pulakka pagination collide visual aejaks simulation joonas finland minneapolis
determine timestampdiff harmony doap shortdesc wireless iceland sigurdsson
darri chunks bjorn chunked watson regardless usefulinc represented pushd
recorder grajciar recording slovensky uninitialized arriving lubomir unchanged
erik dick calculations
erik dick calculations lutin
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论