提交 9e922260 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 dc573a3b
...@@ -191,6 +191,7 @@ ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ] ...@@ -191,6 +191,7 @@ ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
"," ","
Adds a constraint to a table. If NOCHECK is specified, existing rows are not Adds a constraint to a table. If NOCHECK is specified, existing rows are not
checked for consistency (the default is to check consistency for existing rows). checked for consistency (the default is to check consistency for existing rows).
The required indexes are automatically created if they don't exist yet.
It is not possible to disable checking for unique constraints. It is not possible to disable checking for unique constraints.
This command commits an open transaction. This command commits an open transaction.
"," ","
...@@ -1443,13 +1444,15 @@ columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT ...@@ -1443,13 +1444,15 @@ columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT
[ SELECTIVITY selectivity ] [ PRIMARY KEY [ HASH ] | UNIQUE ] [ SELECTIVITY selectivity ] [ PRIMARY KEY [ HASH ] | UNIQUE ]
"," ","
Default expressions are used if no explicit value was used when adding a row. Default expressions are used if no explicit value was used when adding a row.
The computed column expression is evaluated and assigned whenever the row changes.
Identity and auto-increment columns are columns with a sequence as the Identity and auto-increment columns are columns with a sequence as the
default. The column declared as the identity columns is implicitly the default. The column declared as the identity columns is implicitly the
primary key column of this table (unlike auto-increment columns). primary key column of this table (unlike auto-increment columns).
"," ","
CREATE TABLE(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT ''); CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT '');
CREATE TABLE(ID BIGINT IDENTITY); CREATE TABLE TEST(ID BIGINT IDENTITY);
CREATE TABLE TEST(QUANTITY INT, PRICE DECIMAL, AMOUNT DECIMAL AS QUANTITY*PRICE);
" "
"Other Grammar","Comments"," "Other Grammar","Comments","
......
...@@ -18,27 +18,26 @@ Change Log ...@@ -18,27 +18,26 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Page store: after a duplicate key exception, an ArrayIndexOutOfBoundsException <ul><li>Clustering: there is now a way to detect which cluster instances are running.
could be thrown (only for very large rows). </li><li>ConvertTraceFile: the SQL statement statistics are better formatted (newline are removed).
</li><li>Page store: the recover tool sometimes generated a script file that contained </li><li>The file lock thread is now stopped when the database is closed.
duplicate data. </li><li>Issue 140: the Script tool now supports writing to a stream.
</li><li>Issue 138: the trace output of Statement.execute(String, int) and executeUpdate was incorrect.
</li><li>Page store: new databases can not be opened with older versions.
</li><li>Page store: multi-column indexes didn't work if the cache was very small.
</li><li>Page store: opening a database could theoretically result in an endless loop.
</li><li>Page store: adding large indexed columns could get very slow.
</li><li>Page store: after a duplicate key exception, an ArrayIndexOutOfBoundsException could be thrown (only for very large rows).
</li><li>Page store: the recover tool sometimes generated a script file that contained duplicate data.
</li><li>Page store: sometimes opening a read-only database failed. </li><li>Page store: sometimes opening a read-only database failed.
</li><li>Page store: opening a database sometimes failed if large rows where updated, </li><li>Page store: opening a database sometimes failed if large rows where updated, or if a table was truncated before.
or if a table was truncated before. </li><li>Page store: when using a very small page size (128 bytes or smaller), writing a large row could result in an endless recursion. This is only a theoretical problem, as the page size is 2 KB.
</li><li>Page store: when using a very small page size (128 bytes or smaller), </li><li>Page store: getting the min value from a descending index with NULL entries could return the wrong result.
writing a large row could result in an endless recursion. This is only a theoretical problem,
as the page size is 2 KB.
</li><li>Page store: getting the min value from a descending index
with NULL entries could return the wrong result.
</li><li>The JDBC client did not detect that it was not talking to an H2 server.
This could result in strange exceptions when trying to connect to another kind of server.
</li><li>User defined functions can be created with source code. Example:
CREATE ALIAS HI AS 'String hi() { return "Hello"; }'
</li><li>Database file lock: the exception "lock file modified in the future" is longer thrown;
instead, opening the file will be delayed by 2 seconds.
</li><li>Page store: improved auto-recovery after power failure. </li><li>Page store: improved auto-recovery after power failure.
</li><li>Inserting LOBs got slower each time the process was restarted. </li><li>The JDBC client did not detect that it was not talking to an H2 server. This could result in strange exceptions when trying to connect to another kind of server.
It could loop endlessly after about 1000 process restarts. </li><li>User defined functions can be created with source code. Example: CREATE ALIAS HI AS 'String hi() { return "Hello"; }'
</li><li>Database file lock: the exception "lock file modified in the future" is longer thrown; instead, opening the file will be delayed by 2 seconds.
</li><li>Inserting LOBs got slower each time the process was restarted. It could loop endlessly after about 1000 process restarts.
</li><li>Issue 117: Multi-version concurrency: concurrent MERGE statements now work. </li><li>Issue 117: Multi-version concurrency: concurrent MERGE statements now work.
</li><li>Improved read-only database detection. </li><li>Improved read-only database detection.
</li></ul> </li></ul>
......
...@@ -189,7 +189,7 @@ encrypted using AES-256 and XTEA encryption algorithms ...@@ -189,7 +189,7 @@ encrypted using AES-256 and XTEA encryption algorithms
</tr><tr> </tr><tr>
<td>In-Memory Mode</td> <td>In-Memory Mode</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
......
...@@ -96,7 +96,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are: ...@@ -96,7 +96,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
</tr><tr> </tr><tr>
<td>Memory Mode</td> <td>Memory Mode</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
......
...@@ -384,6 +384,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -384,6 +384,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Support reading JCR data: one table per node type; query table; cache option </li><li>Support reading JCR data: one table per node type; query table; cache option
</li><li>OSGi: create a sample application, test, document. </li><li>OSGi: create a sample application, test, document.
</li><li>help.csv: use complete examples for functions; run as test case. </li><li>help.csv: use complete examples for functions; run as test case.
</li><li>Functions to calculate the memory and disk space usage of a table, a row, or a value.
</li><li>Re-implement PooledConnection; use a lightweight connection object. </li><li>Re-implement PooledConnection; use a lightweight connection object.
</li><li>Doclet: convert tests in javadocs to a java class. </li><li>Doclet: convert tests in javadocs to a java class.
</li><li>Doclet: format fields like methods, but support sorting by name and value. </li><li>Doclet: format fields like methods, but support sorting by name and value.
...@@ -425,7 +426,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -425,7 +426,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>IBM DB2 compatibility: support PREVIOUS VALUE FOR sequence. </li><li>IBM DB2 compatibility: support PREVIOUS VALUE FOR sequence.
</li><li>MySQL compatibility: alter table add index i(c), add constraint c foreign key(c) references t(c); </li><li>MySQL compatibility: alter table add index i(c), add constraint c foreign key(c) references t(c);
</li><li>Compatibility: use different LIKE ESCAPE characters depending on the mode (disable for Derby, HSQLDB, DB2, Oracle, MSSQLServer). </li><li>Compatibility: use different LIKE ESCAPE characters depending on the mode (disable for Derby, HSQLDB, DB2, Oracle, MSSQLServer).
</li><li>Functions to calculate the memory and disk space usage of a row or value.
</li><li>Oracle compatibility: support CREATE SYNONYM table FOR schema.table. </li><li>Oracle compatibility: support CREATE SYNONYM table FOR schema.table.
</li><li>Optimize A=? OR B=? to UNION if the cost is lower. </li><li>Optimize A=? OR B=? to UNION if the cost is lower.
</li><li>FTP: document the server, including -ftpTask option to execute / kill remote processes </li><li>FTP: document the server, including -ftpTask option to execute / kill remote processes
...@@ -465,6 +465,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -465,6 +465,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>H2 Console: support CLOB/BLOB download using a link. </li><li>H2 Console: support CLOB/BLOB download using a link.
</li><li>H2 Console: support CLOB/BLOB upload. </li><li>H2 Console: support CLOB/BLOB upload.
</li><li>Recover tool: stream blob / clob data (problem: currently using varchar data type). </li><li>Recover tool: stream blob / clob data (problem: currently using varchar data type).
</li><li>Move away from system properties where possible.
</li><li>
</li></ul> </li></ul>
<h2>Not Planned</h2> <h2>Not Planned</h2>
......
...@@ -482,6 +482,16 @@ add the following configuration to your <code>web.xml</code>: ...@@ -482,6 +482,16 @@ add the following configuration to your <code>web.xml</code>:
&lt;servlet&gt; &lt;servlet&gt;
&lt;servlet-name&gt;H2Console&lt;/servlet-name&gt; &lt;servlet-name&gt;H2Console&lt;/servlet-name&gt;
&lt;servlet-class&gt;org.h2.server.web.WebServlet&lt;/servlet-class&gt; &lt;servlet-class&gt;org.h2.server.web.WebServlet&lt;/servlet-class&gt;
&lt;!--
&lt;init-param&gt;
&lt;param-name&gt;webAllowOthers&lt;/param-name&gt;
&lt;param-value&gt;&lt;/param-value&gt;
&lt;/init-param&gt;
&lt;init-param&gt;
&lt;param-name&gt;trace&lt;/param-name&gt;
&lt;param-value&gt;&lt;/param-value&gt;
&lt;/init-param&gt;
--&gt;
&lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt; &lt;/servlet&gt;
&lt;servlet-mapping&gt; &lt;servlet-mapping&gt;
......
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.
...@@ -557,6 +557,12 @@ public class SysProperties { ...@@ -557,6 +557,12 @@ public class SysProperties {
*/ */
public static final boolean PAGE_STORE_TRIM = getBooleanSetting("h2.pageStoreTrim", true); public static final boolean PAGE_STORE_TRIM = getBooleanSetting("h2.pageStoreTrim", true);
/**
* System property <code>h2.pageStoreInternalCount</code> (default: false).<br />
* Update the row counts on a node level.
*/
public static final boolean PAGE_STORE_INTERNAL_COUNT = getBooleanSetting("h2.pageStoreInternalCount", false);
/** /**
* System property <code>h2.pgClientEncoding</code> (default: UTF-8).<br /> * System property <code>h2.pgClientEncoding</code> (default: UTF-8).<br />
* Default client encoding for PG server. It is used if the client does not * Default client encoding for PG server. It is used if the client does not
......
...@@ -305,6 +305,8 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -305,6 +305,8 @@ public class JdbcConnection extends TraceObject implements Connection {
synchronized (session) { synchronized (session) {
if (!session.isClosed()) { if (!session.isClosed()) {
try { try {
// roll back unless that would require to re-connect
// (the transaction can't be rolled back when re-connecting)
if (!session.isReconnectNeeded(true)) { if (!session.isReconnectNeeded(true)) {
rollbackInternal(); rollbackInternal();
} }
......
...@@ -62,7 +62,7 @@ public class SimpleRowValue implements SearchRow { ...@@ -62,7 +62,7 @@ public class SimpleRowValue implements SearchRow {
} }
public String toString() { public String toString() {
return "( /* " + key + " */ " + data.getTraceSQL() + " )"; return "( /* " + key + " */ " + (data == null ? "null" : data.getTraceSQL()) + " )";
} }
} }
...@@ -232,6 +232,11 @@ java org.h2.test.TestAll timer ...@@ -232,6 +232,11 @@ java org.h2.test.TestAll timer
*/ */
public boolean googleAppEngine; public boolean googleAppEngine;
/**
* If a small cache and a low number for MAX_MEMORY_ROWS should be used.
*/
public boolean diskResult;
/** /**
* If the transaction log files should be kept small (that is, log files * If the transaction log files should be kept small (that is, log files
* should be switched early). * should be switched early).
...@@ -248,11 +253,6 @@ java org.h2.test.TestAll timer ...@@ -248,11 +253,6 @@ java org.h2.test.TestAll timer
*/ */
boolean diskUndo; boolean diskUndo;
/**
* If a small cache and a low number for MAX_MEMORY_ROWS should be used.
*/
boolean diskResult;
/** /**
* If TRACE_LEVEL_SYSTEM_OUT should be set to 2 (for debugging only). * If TRACE_LEVEL_SYSTEM_OUT should be set to 2 (for debugging only).
*/ */
...@@ -295,15 +295,14 @@ java org.h2.test.TestAll timer ...@@ -295,15 +295,14 @@ java org.h2.test.TestAll timer
System.setProperty("h2.maxMemoryRowsDistinct", "128"); System.setProperty("h2.maxMemoryRowsDistinct", "128");
System.setProperty("h2.check2", "true"); System.setProperty("h2.check2", "true");
/* /*
remove PageStore.checkUndo
verify logUndo is correct
test with page size 64
check auto-build
DoubleTrace.java
Compiler documentation Compiler documentation
ConvertTraceFile: remove newlines and duplicate spaces from output in statistics test with small freeList pages, page size 64
test if compact always works as expected
implement node row counts (disabled by default)
check auto-build
check memory usage when inserting a lot of rows check memory usage when inserting a lot of rows
http://www.apache.org/dev/contrib-email-tips.html http://www.apache.org/dev/contrib-email-tips.html
...@@ -356,8 +355,8 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -356,8 +355,8 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
} else { } else {
System.setProperty(SysProperties.H2_PAGE_STORE, "true"); System.setProperty(SysProperties.H2_PAGE_STORE, "true");
test.pageStore = true; test.pageStore = true;
test.runTests(); // test.runTests();
TestPerformance.main("-init", "-db", "1"); // TestPerformance.main("-init", "-db", "1");
// Recover.execute("data", null); // Recover.execute("data", null);
// RunScript.execute("jdbc:h2:data/test2", // RunScript.execute("jdbc:h2:data/test2",
// "sa1", "sa1", "data/test.h2.sql", null, false); // "sa1", "sa1", "data/test.h2.sql", null, false);
......
...@@ -20,6 +20,10 @@ Initial Developer: H2 Group ...@@ -20,6 +20,10 @@ Initial Developer: H2 Group
<servlet-name>H2Console</servlet-name> <servlet-name>H2Console</servlet-name>
<servlet-class>org.h2.server.web.WebServlet</servlet-class> <servlet-class>org.h2.server.web.WebServlet</servlet-class>
<!-- <!--
<init-param>
<param-name>webAllowOthers</param-name>
<param-value></param-value>
</init-param>
<init-param> <init-param>
<param-name>trace</param-name> <param-name>trace</param-name>
<param-value></param-value> <param-value></param-value>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论