提交 72a96f3b authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 c95dc470
......@@ -61,6 +61,7 @@ Newer version or compatible software works too.
<br /><a name="building"></a>
<h2>Building the Software</h2>
<p>
You need to install a JDK, for example the Sun JDK version 1.4, 1.5 or 1.6.
On the command line, go to the directory h2 and execute the following command:
</p>
<pre>
......@@ -69,7 +70,6 @@ build -?
<p>
For Linux and OS X, use <code>./build.sh</code> instead of <code>build</code>.
</p>
<p>
You will get a list of targets. If you want to build the jar file, execute (Windows):
</p>
......@@ -77,6 +77,15 @@ You will get a list of targets. If you want to build the jar file, execute (Wind
build jar
</pre>
<h3>Switching the Source Code</h3>
<p>
By default the source code uses Java 1.6 features, however Java 1.4 and 1.5 are supported as well.
To disable Java 1.6 specific features, run:
</p>
<pre>
build switchSource
</pre>
<br /><a name="build_targets"></a>
<h2>Build Targets</h2>
<p>
......
......@@ -18,7 +18,11 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Aliases for built-in data types (such as MEDIUMBLOB which is an alias for BLOB)
<ul><li>ALTER TABLE used a lot of memory when using multi-version concurrency.
</li><li>Referential integrity for in-memory databases didn't work in some cases in version 1.1.102.
</li><li>New column INFORMATION_SCHEMA.COLUMNS.SEQUENCE_NAME to get the name
of the sequence for auto-increment columns.
</li><li>Aliases for built-in data types (such as MEDIUMBLOB which is an alias for BLOB)
can now be re-mapped to another data type using CREATE DOMAIN. However
main built-in data types (such as INTEGER) can not be re-mapped.
</li><li>The Japanese translation has been completed by Masahiro Ikemoto.
......
......@@ -100,7 +100,8 @@ spread the word and have translated this project. Also many thanks to the donors
via PayPal:
</p>
<ul>
<li>Frank Berger, Germany
<li>lumber-mill.co.jp, Japan
</li><li>Frank Berger, Germany
</li><li>Ashwin Jayaprakash, USA
</li><li>Florent Ramiere, France
</li><li>Jun Iyama, Japan
......@@ -111,7 +112,6 @@ via PayPal:
</li><li>William Gilbert, USA
</li><li>Antonio Dieguez, Chile
</li><li><a href="http://ontologyworks.com/">Ontology Works, USA</a>
</li><li>lumber-mill.co.jp, Japan
</li><li>Pete Haidinyak, USA
</li></ul>
......
......@@ -432,6 +432,11 @@ SemmleCode</a><br />
Eclipse plugin to help you improve software quality.
</p>
<p><a href="http://sequalite.sourceforge.net">
SeQuaLite</a><br />
A free, light-weight, java data access framework released under GPL.
</p>
<p><a href="http://www.shellbook.com">
Shellbook</a><br />
Desktop publishing application.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -394,7 +394,7 @@ CREATE DOMAIN EMAIL AS VARCHAR(255) CHECK (POSITION('@', VALUE) > 1)
"Commands (DDL)","CREATE INDEX","
CREATE {[UNIQUE [HASH]] INDEX [IF NOT EXISTS] newIndexName
| PRIMARY KEY [HASH]} ON tableName(columnName [,...])
| PRIMARY KEY [HASH]} ON tableName(indexColumn [,...])
","
Creates a new index.
","
......@@ -603,6 +603,7 @@ Drops an existing table, or a list of existing tables.
","
DROP TABLE TEST
"
"Commands (DDL)","DROP TRIGGER","
DROP TRIGGER [IF EXISTS] triggerName
","
......@@ -610,6 +611,7 @@ Drops an existing trigger.
","
DROP TRIGGER TRIG_INS
"
"Commands (DDL)","DROP USER","
DROP USER [IF EXISTS] userName
","
......@@ -620,6 +622,7 @@ For compatibility, only unquoted or uppercase user names are allowed.
","
DROP USER TOM
"
"Commands (DDL)","DROP VIEW","
DROP VIEW [IF EXISTS] viewName
","
......@@ -627,6 +630,7 @@ Drops a view.
","
DROP VIEW TEST_VIEW
"
"Commands (DDL)","TRUNCATE TABLE","
TRUNCATE TABLE tableName
","
......@@ -638,6 +642,7 @@ This command commits an open transaction.
","
TRUNCATE TABLE TEST
"
"Commands (Other)","COMMIT","
COMMIT [WORK]
","
......@@ -645,6 +650,7 @@ Commits a transaction.
","
COMMIT
"
"Commands (Other)","COMMIT TRANSACTION","
COMMIT TRANSACTION transactionName
","
......@@ -654,6 +660,7 @@ This command is part of the 2-phase-commit protocol.
","
COMMIT TRANSACTION XID_TEST
"
"Commands (Other)","CHECKPOINT","
CHECKPOINT
","
......@@ -662,6 +669,7 @@ Admin rights are required to execute this command.
","
CHECKPOINT
"
"Commands (Other)","CHECKPOINT SYNC","
CHECKPOINT SYNC
","
......@@ -670,6 +678,7 @@ Admin rights are required to execute this command.
","
CHECKPOINT SYNC
"
"Commands (Other)","GRANT RIGHT","
GRANT {SELECT | INSERT | UPDATE | DELETE | ALL} [,...]
ON tableName [,...] TO {PUBLIC | userName | roleName}
......@@ -679,6 +688,7 @@ Admin rights are required to execute this command.
","
GRANT SELECT ON TEST TO READONLY
"
"Commands (Other)","GRANT ROLE","
GRANT roleName TO {PUBLIC | userName | roleName}
","
......@@ -694,6 +704,7 @@ Displays the help pages of SQL commands or keywords
","
HELP SELECT
"
"Commands (Other)","PREPARE COMMIT","
PREPARE COMMIT newTransactionName
","
......@@ -702,6 +713,7 @@ This command is part of the 2-phase-commit protocol.
","
PREPARE COMMIT XID_TEST
"
"Commands (Other)","REVOKE RIGHT","
REVOKE {SELECT | INSERT | UPDATE | DELETE | ALL} [,...]
ON tableName [,...] FROM {PUBLIC | userName | roleName}
......@@ -711,6 +723,7 @@ Admin rights are required to execute this command.
","
REVOKE SELECT ON TEST FROM READONLY
"
"Commands (Other)","REVOKE ROLE","
REVOKE roleName
FROM {PUBLIC | userName | roleName}
......@@ -720,6 +733,7 @@ Admin rights are required to execute this command.
","
REVOKE READONLY FROM TOM
"
"Commands (Other)","ROLLBACK","
ROLLBACK [TO SAVEPOINT savepointName]
","
......@@ -728,6 +742,7 @@ If a savepoint name is used, the transaction is only rolled back to the specifie
","
ROLLBACK
"
"Commands (Other)","ROLLBACK TRANSACTION","
ROLLBACK TRANSACTION transactionName
","
......@@ -1279,8 +1294,7 @@ TEST AS T LEFT JOIN TEST AS T1 ON T.ID = T1.ID
"
"Other Grammar","Order","
{int | expression} [ASC | DESC]
[NULLS {FIRST | LAST}]
{int | expression} [ASC | DESC] [NULLS {FIRST | LAST}]
","
Sorts the result by the given column number, or by an expression.
If the expression is a single parameter, then the value is interpreted
......@@ -1289,6 +1303,16 @@ as a column number. Negative column numbers reverse the sort order.
NAME DESC NULLS LAST
"
"Other Grammar","Index Column","
columnName [ASC | DESC] [NULLS {FIRST | LAST}]
","
Indexes this column in ascending or descending order.
Usually it is not required to specify the order; however doing
so will speed up large queries that order the column in the same way.
","
NAME
"
"Other Grammar","Expression","
andCondition [OR andCondition]
","
......@@ -1296,6 +1320,7 @@ Value or condition.
","
ID=1 OR NAME='Hi'
"
"Other Grammar","And Condition","
condition [AND condition]
","
......@@ -1303,6 +1328,7 @@ Value or condition.
","
ID=1 AND NAME='Hi'
"
"Other Grammar","Condition","
operand [conditionRightHandSide]
| NOT condition
......@@ -1312,6 +1338,7 @@ Boolean value or condition.
","
ID<>2
"
"Other Grammar","Condition Right Hand Side","
compare { {{ALL|ANY|SOME}(select)} | operand }
| IS [NOT] NULL
......@@ -1335,6 +1362,7 @@ Comparison operator. The operator != is the same as <>.
","
<>
"
"Other Grammar","Operand","
summand [ || summand]
","
......@@ -1342,6 +1370,7 @@ A value or a concatenation of values.
","
'Hi' || ' Eva'
"
"Other Grammar","Summand","
factor [{+ | -} factor]
","
......@@ -1349,6 +1378,7 @@ A value or a numeric sum.
","
ID + 20
"
"Other Grammar","Factor","
term [{* | /} term]
","
......@@ -1356,6 +1386,7 @@ A value or a numeric factor.
","
ID * 10
"
"Other Grammar","Term","
value
| columnName
......@@ -1373,6 +1404,7 @@ A value. Parameters can be indexed, for example ?1 meaning the first parameter.
","
'Hello'
"
"Other Grammar","Value","
string | dollarQuotedString | hexNumber | int | long | decimal | double |
date | time | timestamp | boolean | bytes | array | null
......@@ -1381,6 +1413,7 @@ A value of any data type, or null
","
10
"
"Other Grammar","Case","
CASE expression {WHEN expression THEN expression}
[...] [ELSE expression] END
......@@ -1390,6 +1423,7 @@ If no else part is specified, return NULL
","
CASE CNT WHEN 0 THEN 'No' WHEN 1 THEN 'One' ELSE 'Some' END
"
"Other Grammar","Case When","
CASE {WHEN expression THEN expression}
[...] [ELSE expression] END
......@@ -1399,6 +1433,7 @@ If no else part is specified, return NULL
","
CASE WHEN CNT<10 THEN 'Low' ELSE 'High' END
"
"Other Grammar","Cipher","
[AES | XTEA]
","
......@@ -1407,6 +1442,7 @@ The AES algorithm is about half as fast as XTEA.
","
AES
"
"Other Grammar","Select Expression","
* | expression [[AS] columnAlias] | tableAlias.*
","
......@@ -1414,6 +1450,7 @@ An expression in a SELECT statement.
","
ID AS VALUE
"
"Other Grammar","Data Type","
intType | booleanType | tinyintType | smallintType | bigintType | identityType |
decimalType | doubleType | realType | dateType | timeType | timestampType |
......@@ -1424,6 +1461,7 @@ A data type definition.
","
INT
"
"Other Grammar","Name","
{ { A-Z|_ } [ { A-Z|_|0-9} [...] ] } | quotedName
","
......@@ -1432,6 +1470,7 @@ There is no maximum name length.
","
TEST
"
"Other Grammar","Alias","
name
","
......
......@@ -71,7 +71,7 @@ public interface Cache {
/**
* Set the maximum memory to be used by this cache.
*
* @param memorySize in number of double words (4 bytes)
* @param size in number of double words (4 bytes)
*/
void setMaxSize(int size) throws SQLException;
......
......@@ -281,6 +281,12 @@ java org.h2.test.TestAll timer
/*
fix TODO multithreaded kernel
*.bat, *.sh: maybe can use wildcards
select last_value from conf.report_id_seq
test web site with firefox 3, internet explorer, opera, safari, google chrome
test with 1.0
......
......@@ -7,6 +7,9 @@
package org.h2.test.synth;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Random;
import org.h2.test.TestBase;
......@@ -24,21 +27,101 @@ public class TestMultiThreaded extends TestBase {
public static void main(String[] a) throws Exception {
TestBase.createCaller().init().test();
}
/**
* Processes random operations.
*/
private static class Processor extends Thread {
private int id;
private Statement stat;
private Random random;
private volatile Throwable exception;
Processor(Connection conn, int id) throws SQLException {
this.id = id;
stat = conn.createStatement();
random = new Random(id);
}
public Throwable getException() {
return exception;
}
public void run() {
int count = 0;
try {
int test;
while (!isInterrupted()) {
switch(random.nextInt(3)) {
case 0:
//System.out.println("insert " + id + " count: " + count);
stat.execute("INSERT INTO TEST(NAME) VALUES('"+ id +"')");
count++;
break;
case 1:
if (count > 0) {
//System.out.println("delete " + id + " count: " + count);
int updateCount = stat.executeUpdate(
"DELETE FROM TEST WHERE NAME = '"+ id +"' AND ROWNUM()<2");
if (updateCount != 1) {
throw new Error("Expected: 1 Deleted: " + updateCount);
}
count--;
}
break;
case 2:
//System.out.println("select " + id + " count: " + count);
ResultSet rs = stat.executeQuery("SELECT COUNT(*) FROM TEST WHERE NAME = '"+ id +"'");
rs.next();
int got = rs.getInt(1);
if (got != count) {
throw new Error("Expected: " + count + " got: " + got);
}
break;
}
}
} catch (Throwable e) {
exception = e;
}
}
}
public void test() throws Exception {
if (config.mvcc) {
int test;
return;
}
int test;
deleteDb("multiThreaded");
int size = getSize(2, 4);
Connection[] conn = new Connection[size];
for(int i=0; i<size; i++) {
conn[i] = getConnection("multiThreaded;MULTI_THREADED=1");
//int size = 10;
Connection[] connList = new Connection[size];
for (int i = 0; i < size; i++) {
connList[i] = getConnection("multiThreaded;MULTI_THREADED=1");
}
Connection conn = connList[0];
Statement stat = conn.createStatement();
stat.execute("CREATE TABLE TEST(ID IDENTITY, NAME VARCHAR)");
Processor[] processors = new Processor[size];
for (int i = 0; i < size; i++) {
processors[i] = new Processor(conn, i);
processors[i].start();
}
for (int t = 0; t < 2; t++) {
Thread.sleep(1000);
for (int i = 0; i < size; i++) {
Processor p = processors[i];
if (p.getException() != null) {
throw new Exception(p.getException());
}
}
}
for (int i = 0; i < size; i++) {
Processor p = processors[i];
p.interrupt();
p.join(100);
if (p.getException() != null) {
throw new Exception(p.getException());
}
}
Random random = new Random(1);
for(int i=0; i<size; i++) {
conn[i].close();
for (int i = 0; i < size; i++) {
connList[i].close();
}
}
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
create table parent as select 1 id, 2 x;
> ok
create table child(id int references parent(id)) as select 1;
> ok
delete from parent;
> exception
drop table parent, child;
> ok
create domain integer as varchar;
> exception
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
create table parent as select 1 id, 2 x;
> ok
create table child(id int references parent(id)) as select 1;
> ok
delete from parent;
> exception
drop table parent, child;
> ok
create domain integer as varchar;
> exception
......@@ -1645,13 +1657,13 @@ create memory table orders ( orderid varchar(10), name varchar(20), customer_id
> ok
select * from information_schema.columns where table_name = 'ORDERS';
> TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_PRECISION_RADIX NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT REMARKS
> ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ -------------- --------- -------- ----------- ----------- ---------------- -------
> SCRIPT PUBLIC ORDERS COMPLETED 4 null NO 3 1 1 1 10 0 Unicode OFF DECIMAL 0 FALSE 50
> SCRIPT PUBLIC ORDERS CUSTOMER_ID 3 null YES 12 10 10 10 10 0 Unicode OFF VARCHAR 1 FALSE 50
> SCRIPT PUBLIC ORDERS NAME 2 null YES 12 20 20 20 10 0 Unicode OFF VARCHAR 1 FALSE 50
> SCRIPT PUBLIC ORDERS ORDERID 1 null YES 12 10 10 10 10 0 Unicode OFF VARCHAR 1 FALSE 50
> SCRIPT PUBLIC ORDERS VERIFIED 5 null YES 3 1 1 1 10 0 Unicode OFF DECIMAL 1 FALSE 50
> TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_PRECISION_RADIX NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS
> ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- -------
> SCRIPT PUBLIC ORDERS COMPLETED 4 null NO 3 1 1 1 10 0 Unicode OFF DECIMAL 0 FALSE 50 null
> SCRIPT PUBLIC ORDERS CUSTOMER_ID 3 null YES 12 10 10 10 10 0 Unicode OFF VARCHAR 1 FALSE 50 null
> SCRIPT PUBLIC ORDERS NAME 2 null YES 12 20 20 20 10 0 Unicode OFF VARCHAR 1 FALSE 50 null
> SCRIPT PUBLIC ORDERS ORDERID 1 null YES 12 10 10 10 10 0 Unicode OFF VARCHAR 1 FALSE 50 null
> SCRIPT PUBLIC ORDERS VERIFIED 5 null YES 3 1 1 1 10 0 Unicode OFF DECIMAL 1 FALSE 50 null
> rows: 5
drop table orders;
......
Benchmark:
Hi,
If you are running benchmarks, could you profile them please? To do that use java -Xrunhprof:cpu=samples,depth=8 ... - and then upload/post the file java.hprof.txt
If the benchmark application is not a self contained application, another way is to generate 'full thread dumps' (maybe 30 or so) while running the benchmark, and upload them? To get a full thread dump, you can use "kill -QUIT <pid>", or (Windows) press Ctrl+Pause, or (Java 1.6) use jps -l to get the <pid>, and then use jstack <pid>.
Regards,
Thomas
-----------------
Can not reproduce:
Hi,
Sorry I can not reproduce this problem. Could you post a simple, standalone test case that reproduces the problem? It would be great if the test case does not have any dependencies except the H2 jar file (that is, a simple SQL script that can be run in the H2 Console, or a Java class uses the JDBC API and is run using a static main method). Please include any initialization code (CREATE TABLE, INSERT and so on) in the Java class or in a .sql script file.
......
......@@ -568,4 +568,4 @@ classname recaptcha unload unloaded unloads activator statistic hence rathsack
reflects doy bloom minimal gmx conserve panic serious robert thursday
wednesday saturday friday tuesday sharing opposite fassi dario clauses
factorial blogspot displaying thedevcloud dayof safety chrome favorite thumbs
localization olivier
\ No newline at end of file
localization olivier hprof jps jstack gpl qua processor
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论