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

Spellcheck / formatting / docs

上级 b424b429
......@@ -1655,7 +1655,7 @@ Issue 454: Use Charset for type-safety.
Queries with both LIMIT and OFFSET could throw an IllegalArgumentException.
@changelog_1006_li
MVStore: multiple issues were fixed: 460, 461, 462.
MVStore: multiple issues were fixed: 460, 461, 462, 464, 466.
@changelog_1007_li
MVStore: larger stores (multiple GB) are now much faster.
......
......@@ -1655,7 +1655,7 @@ Centralリポジトリの利用
#Queries with both LIMIT and OFFSET could throw an IllegalArgumentException.
@changelog_1006_li
#MVStore: multiple issues were fixed: 460, 461, 462.
#MVStore: multiple issues were fixed: 460, 461, 462, 464, 466.
@changelog_1007_li
#MVStore: larger stores (multiple GB) are now much faster.
......
......@@ -550,7 +550,7 @@ changelog_1002_li=The auto-analyze feature now only reads 1000 rows per table in
changelog_1003_li=The optimization for IN(...) queries combined with OR could result in a strange exception of the type "column x must be included in the group by list".
changelog_1004_li=Issue 454\: Use Charset for type-safety.
changelog_1005_li=Queries with both LIMIT and OFFSET could throw an IllegalArgumentException.
changelog_1006_li=MVStore\: multiple issues were fixed\: 460, 461, 462.
changelog_1006_li=MVStore\: multiple issues were fixed\: 460, 461, 462, 464, 466.
changelog_1007_li=MVStore\: larger stores (multiple GB) are now much faster.
changelog_1008_li=When using local temporary tables and not dropping them manually before closing the session, and then killing the process could result in a database that couldn't be opened (except when using the recover tool).
changelog_1009_li=Support TRUNC(timestamp) for improved Oracle compatibility.
......
......@@ -101,6 +101,11 @@ public class MVTableEngine implements TableEngine {
return openTables;
}
/**
* Remove a table.
*
* @param table the table
*/
public void removeTable(MVTable table) {
openTables.remove(table);
}
......
......@@ -269,8 +269,10 @@ public abstract class TestBase {
} else {
url = name;
}
// url = addOption(url, "DEFAULT_TABLE_ENGINE",
// "org.h2.mvstore.db.MVTableEngine");
if (config.mvStore) {
url = addOption(url, "DEFAULT_TABLE_ENGINE",
"org.h2.mvstore.db.MVTableEngine");
}
if (!config.memory) {
if (config.smallLog && admin) {
url = addOption(url, "MAX_LOG_SIZE", "1");
......
......@@ -26,7 +26,7 @@ public class BenchB implements Bench, Runnable {
private static final int TELLERS = 10;
private static final int ACCOUNTS = 100000;
private int noThreads = 10;
private int threadCount = 10;
// master data
private Database database;
......@@ -200,8 +200,8 @@ public class BenchB implements Bench, Runnable {
}
private void processTransactions() throws Exception {
Thread[] threads = new Thread[noThreads];
for (int i = 0; i < noThreads; i++) {
Thread[] threads = new Thread[threadCount];
for (int i = 0; i < threadCount; i++) {
threads[i] = new Thread(new BenchB(this, i), "BenchB-" + i);
}
for (Thread t : threads) {
......@@ -217,7 +217,7 @@ public class BenchB implements Bench, Runnable {
return "BenchB";
}
public void setNoThreads(int noThreads) {
this.noThreads = noThreads;
public void setThreadCount(int threadCount) {
this.threadCount = threadCount;
}
}
......@@ -30,13 +30,9 @@ import org.h2.util.StringUtils;
*/
class Database {
public interface DatabaseParentInterface {
boolean isCollect();
void trace(String msg);
}
private static final boolean TRACE = true;
private DatabaseParentInterface test;
private DatabaseTest test;
private int id;
private String name, url, user, password;
private final ArrayList<String[]> replace = new ArrayList<String[]>();
......@@ -49,7 +45,7 @@ class Database {
private final ArrayList<Object[]> results = new ArrayList<Object[]>();
private int totalTime;
private final AtomicInteger executedStatements = new AtomicInteger(0);
private int noThreads;
private int threadCount;
private Server serverH2;
private Object serverDerby;
......@@ -153,13 +149,15 @@ class Database {
* @param test the test application
* @param id the database id
* @param dbString the configuration string
* @param threadCount the number of threads to use
* @return a new database object with the given settings
*/
static Database parse(DatabaseParentInterface test, int id, String dbString) {
static Database parse(DatabaseTest test, int id, String dbString, int threadCount) {
try {
StringTokenizer tokenizer = new StringTokenizer(dbString, ",");
Database db = new Database();
db.id = id;
db.threadCount = threadCount;
db.test = test;
db.name = tokenizer.nextToken().trim();
String driver = tokenizer.nextToken().trim();
......@@ -177,12 +175,6 @@ class Database {
}
}
static Database parse(DatabaseParentInterface test, int id, String dbString, int noThreads) {
Database db = parse(test, id, dbString);
db.noThreads = noThreads;
return db;
}
/**
* Open a new database connection. This connection must be closed
* by calling conn.close().
......@@ -464,8 +456,29 @@ class Database {
return id;
}
int getNoThreads() {
return noThreads;
int getThreadsCount() {
return threadCount;
}
/**
* The interface used for a test.
*/
public interface DatabaseTest {
/**
* Whether data needs to be collected.
*
* @return true if yes
*/
boolean isCollect();
/**
* Print a message to system out if trace is enabled.
*
* @param msg the message
*/
void trace(String msg);
}
}
......@@ -27,7 +27,7 @@ import org.h2.util.JdbcUtils;
* The main controller class of the benchmark application.
* To run the benchmark, call the main method of this class.
*/
public class TestPerformance implements Database.DatabaseParentInterface {
public class TestPerformance implements Database.DatabaseTest {
/**
* Whether data should be collected.
......@@ -97,7 +97,7 @@ public class TestPerformance implements Database.DatabaseParentInterface {
}
String dbString = prop.getProperty("db" + i);
if (dbString != null) {
Database db = Database.parse(this, i, dbString);
Database db = Database.parse(this, i, dbString, 1);
if (db != null) {
db.setTranslations(prop);
dbs.add(db);
......@@ -248,14 +248,10 @@ public class TestPerformance implements Database.DatabaseParentInterface {
bench.runTest();
}
/**
* Print a message to system out if trace is enabled.
*
* @param s the message
*/
public void trace(String s) {
@Override
public void trace(String msg) {
if (trace) {
System.out.println(s);
System.out.println(msg);
}
}
......
......@@ -24,7 +24,7 @@ import org.h2.util.JdbcUtils;
* Used to compare scalability between the old engine and the new MVStore engine.
* Mostly it runs BenchB with various numbers of threads.
*/
public class TestScalability implements Database.DatabaseParentInterface {
public class TestScalability implements Database.DatabaseTest {
/**
* Whether data should be collected.
......@@ -81,7 +81,7 @@ public class TestScalability implements Database.DatabaseParentInterface {
dbs.add(createDbEntry(id++, "H2", 50, h2Url));
dbs.add(createDbEntry(id++, "H2", 100, h2Url));
final String mvUrl = "jdbc:h2:data/mvtest;LOCK_TIMEOUT=10000;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine";
final String mvUrl = "jdbc:h2:data/mvTest;LOCK_TIMEOUT=10000;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine";
dbs.add(createDbEntry(id++, "MV", 1, mvUrl));
dbs.add(createDbEntry(id++, "MV", 10, mvUrl));
dbs.add(createDbEntry(id++, "MV", 20, mvUrl));
......@@ -144,9 +144,9 @@ public class TestScalability implements Database.DatabaseParentInterface {
}
}
private Database createDbEntry(int id, String namePrefix, int noThreads, String url) {
private Database createDbEntry(int id, String namePrefix, int threadCount, String url) {
Database db = Database.parse(this, id,
namePrefix + "(" + noThreads + "thread), org.h2.Driver, " + url + ", sa, sa", noThreads);
namePrefix + "(" + threadCount + "threads), org.h2.Driver, " + url + ", sa, sa", threadCount);
return db;
}
......@@ -181,7 +181,7 @@ public class TestScalability implements Database.DatabaseParentInterface {
private static void runDatabase(Database db, BenchB bench, int size) throws Exception {
bench.init(db, size);
bench.setNoThreads(db.getNoThreads());
bench.setThreadCount(db.getThreadsCount());
bench.runTest();
}
......
db1 = H2(embedded), org.h2.Driver, jdbc:h2:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
db1 = H2, org.h2.Driver, jdbc:h2:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
#xdb1 = H2, org.h2.Driver, jdbc:h2:data/test;LOCK_TIMEOUT=10000;LOCK_MODE=3;DEFAULT_TABLE_ENGINE=org.h2.mvstore.db.MVTableEngine, sa, sa
......@@ -14,7 +14,7 @@ db1 = H2(embedded), org.h2.Driver, jdbc:h2:data/test;LOCK_TIMEOUT=10000;LOCK_MOD
db2 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:data/test;hsqldb.default_table_type=cached;sql.enforce_size=true, sa
db3 = Derby, org.apache.derby.jdbc.EmbeddedDriver, jdbc:derby:data/derby;create=true, sa, sa
db4 = H2(tcpserver), org.h2.Driver, jdbc:h2:tcp://localhost/data/testServer;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
db4 = H2 (Server), org.h2.Driver, jdbc:h2:tcp://localhost/data/testServer;LOCK_TIMEOUT=10000;LOCK_MODE=3, sa, sa
db5 = HSQLDB, org.hsqldb.jdbcDriver, jdbc:hsqldb:hsql://localhost/xdb, sa
db6 = Derby, org.apache.derby.jdbc.ClientDriver, jdbc:derby://localhost/data/derbyServer;create=true, sa, sa
db7 = PostgreSQL, org.postgresql.Driver, jdbc:postgresql:test, sa, sa
......
......@@ -146,8 +146,10 @@ int test;
stat.execute("drop table child, parent");
// currently not supported, as previous rows are not visible
// stat.execute("create table test(id identity, parent bigint, foreign key(parent) references(id))");
// stat.execute("insert into test values(0, 0), (1, NULL), (2, 1), (3, 3), (4, 3)");
// stat.execute("create table test(id identity, parent bigint,
// foreign key(parent) references(id))");
// stat.execute("insert into test values(0, 0), (1, NULL),
// (2, 1), (3, 3), (4, 3)");
// stat.execute("drop table test");
stat.execute("create table parent(id int, x int)");
......
-- Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License,
-- Version 1.0, and under the Eclipse Public License, Version 1.0
-- (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--- special grammar and test cases ---------------------------------------------------------------------------------------------
select * from dual where x = x + 1 or x in(2, 0);
> X
......
......@@ -726,4 +726,4 @@ simo unpredictable overtakes conditionally decreases warned coupled spin
unsynchronized reality cores effort slice addleman koskela ville blocking seen
isam charindex removal getdate jesse fake covers covering cheaper adjacent spot
transition anthony goubard netherlands versioned orderable customizer cachable
customizers retains
customizers retains scalability
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论