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

Documentation.

上级 9b0bd1b3
...@@ -3396,6 +3396,9 @@ Instead of a file, an URL may be used, for example ...@@ -3396,6 +3396,9 @@ Instead of a file, an URL may be used, for example
""jar:file:///c:/temp/example.zip!/org/example/nested.csv"". ""jar:file:///c:/temp/example.zip!/org/example/nested.csv"".
To read a stream from the classpath, use the prefix ""classpath:"". To read a stream from the classpath, use the prefix ""classpath:"".
For performance reason, CSVREAD should not be used inside a join.
Instead, import the data first (possibly into a temporary table) and then use the table.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
CALL CSVREAD('test.csv'); CALL CSVREAD('test.csv');
......
...@@ -1506,10 +1506,13 @@ prior opening a database connection. ...@@ -1506,10 +1506,13 @@ prior opening a database connection.
</p> </p>
<p> <p>
Since version 1.2.140 it is possible to let the old h2 classes (v 1.2.128) connect to the database. Since version 1.2.140 it is possible to let the old h2 classes (v 1.2.128) connect to the database.
The automatic upgrade .jar file must be present, and the URL must start with <code>jdbc:h2v1_1:</code>. The automatic upgrade .jar file must be present, and the URL must start with <code>jdbc:h2v1_1:</code>
(the JDBC driver class is <code>org.h2.upgrade.v1_1.Driver</code>).
If the database should automatically connect using the old version if a database with the old format exists If the database should automatically connect using the old version if a database with the old format exists
(without upgrade), and use the new version otherwise, then append <code>;NO_UPGRADE=TRUE</code> (without upgrade), and use the new version otherwise, then append <code>;NO_UPGRADE=TRUE</code>
to the database URL. to the database URL.
Please note the old driver did not process the system property <code>"h2.baseDir"</code> correctly,
so that using this setting is not supported when upgrading.
</p> </p>
<h2 id="limits_limitations">Limits and Limitations</h2> <h2 id="limits_limitations">Limits and Limitations</h2>
......
...@@ -1146,7 +1146,8 @@ jdbc:h2:/data/test;AUTO_SERVER=TRUE ...@@ -1146,7 +1146,8 @@ jdbc:h2:/data/test;AUTO_SERVER=TRUE
Use the same URL for all connections to this database. Internally, when using this mode, Use the same URL for all connections to this database. Internally, when using this mode,
the first connection to the database is made in embedded mode, and additionally a server the first connection to the database is made in embedded mode, and additionally a server
is started internally (as a daemon thread). If the database is already open in another process, is started internally (as a daemon thread). If the database is already open in another process,
the server mode is used automatically. the server mode is used automatically. The IP address and port of the server are stored in the file
<code>.lock.db</code>, that's why in-memory databases can't be supported.
</p> </p>
<p> <p>
The application that opens the first connection to the database uses the embedded mode, The application that opens the first connection to the database uses the embedded mode,
......
...@@ -417,6 +417,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -417,6 +417,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>User defined functions: allow to store the bytecode (of just the class, or the jar file of the extension) in the database. </li><li>User defined functions: allow to store the bytecode (of just the class, or the jar file of the extension) in the database.
</li><li>Compatibility: ResultSet.getObject() on a CLOB (TEXT) should return String for PostgreSQL and MySQL. </li><li>Compatibility: ResultSet.getObject() on a CLOB (TEXT) should return String for PostgreSQL and MySQL.
</li><li>Optimizer: WHERE X=? AND Y IN(?), it always uses the index on Y. Should be cost based. </li><li>Optimizer: WHERE X=? AND Y IN(?), it always uses the index on Y. Should be cost based.
</li><li>Common Table Expression (CTE) / recursive queries: support parameters. Issue 314.
</li><li>Oracle compatibility: support INSERT ALL. </li><li>Oracle compatibility: support INSERT ALL.
</li><li>Issue 178: Optimizer: index usage when both ascending and descending indexes are available. </li><li>Issue 178: Optimizer: index usage when both ascending and descending indexes are available.
</li><li>Issue 179: Related subqueries in HAVING clause. </li><li>Issue 179: Related subqueries in HAVING clause.
...@@ -454,7 +455,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>. ...@@ -454,7 +455,6 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Common Table Expression (CTE) / recursive queries: avoid endless loop. Issue 218. </li><li>Common Table Expression (CTE) / recursive queries: avoid endless loop. Issue 218.
</li><li>Common Table Expression (CTE) / recursive queries: support multiple named queries. Issue 220. </li><li>Common Table Expression (CTE) / recursive queries: support multiple named queries. Issue 220.
</li><li>Common Table Expression (CTE) / recursive queries: identifier scope may be incorrect. Issue 222. </li><li>Common Table Expression (CTE) / recursive queries: identifier scope may be incorrect. Issue 222.
</li><li>Common Table Expression (CTE) / recursive queries: support parameters.
</li><li>Log long running transactions (similar to long running statements). </li><li>Log long running transactions (similar to long running statements).
</li><li>Parameter data type is data type of other operand. Issue 205. </li><li>Parameter data type is data type of other operand. Issue 205.
</li><li>Some combinations of nested join with right outer join are not supported. </li><li>Some combinations of nested join with right outer join are not supported.
......
...@@ -795,6 +795,11 @@ A CSV file can be read using the function <code>CSVREAD</code>. Example: ...@@ -795,6 +795,11 @@ A CSV file can be read using the function <code>CSVREAD</code>. Example:
<pre> <pre>
SELECT * FROM CSVREAD('test.csv'); SELECT * FROM CSVREAD('test.csv');
</pre> </pre>
<p>
Please note for performance reason, <code>CSVREAD</code> should not be used inside a join.
Instead, import the data first (possibly into a temporary table), create the required indexes
if necessary, and then query this table.
</p>
<h3>Importing Data from a CSV File</h3> <h3>Importing Data from a CSV File</h3>
<p> <p>
...@@ -1285,7 +1290,7 @@ The workaround is to add the following XML file to the root of the classpath: ...@@ -1285,7 +1290,7 @@ The workaround is to add the following XML file to the root of the classpath:
http://www.springframework.org/schema/beans/spring-beans.xsd" http://www.springframework.org/schema/beans/spring-beans.xsd"
&gt; &gt;
&lt;import resource="classpath:org/springframework/jdbc/support/sql-error-codes.xml"/&gt; &lt;import resource="classpath:org/springframework/jdbc/support/sql-error-codes.xml"/&gt;
&lt;bean id="H2" class="org.springframework.jdbc.support.SQLErrorCodes"&gt; &lt;bean id = "H2" class="org.springframework.jdbc.support.SQLErrorCodes"&gt;
&lt;property name="badSqlGrammarCodes"&gt; &lt;property name="badSqlGrammarCodes"&gt;
&lt;value&gt; &lt;value&gt;
42000,42001,42101,42102,42111,42112,42121,42122,42132 42000,42001,42101,42102,42111,42112,42121,42122,42132
......
...@@ -246,7 +246,7 @@ public class DbSettings extends SettingsBase { ...@@ -246,7 +246,7 @@ public class DbSettings extends SettingsBase {
public final boolean optimizeUpdate = get("OPTIMIZE_UPDATE", true); public final boolean optimizeUpdate = get("OPTIMIZE_UPDATE", true);
/** /**
* Database setting <code>PAGE_STORE_MAX_GROWTH_RATE</code> * Database setting <code>PAGE_STORE_MAX_GROWTH</code>
* (default: Integer.MAX_VALUE).<br /> * (default: Integer.MAX_VALUE).<br />
* The maximum number of pages the file grows at any time. * The maximum number of pages the file grows at any time.
*/ */
......
...@@ -192,7 +192,7 @@ CREATE [ CACHED | MEMORY ] [ TEMP | [ GLOBAL | LOCAL ] TEMPORARY ] ...@@ -192,7 +192,7 @@ CREATE [ CACHED | MEMORY ] [ TEMP | [ GLOBAL | LOCAL ] TEMPORARY ]
TABLE [ IF NOT EXISTS ] name TABLE [ IF NOT EXISTS ] name
{ { ( { columnDefinition | constraint } [,...] ) [ AS select ] } { { ( { columnDefinition | constraint } [,...] ) [ AS select ] }
| { AS select } } | { AS select } }
[ ENGINE tableEngineName ] [ TRANSACTIONAL ] [ NOT PERSISTENT ] [ ENGINE tableEngineName ] [ NOT PERSISTENT ] [ TRANSACTIONAL ]
"," ","
Creates a new table." Creates a new table."
"Commands (DDL)","CREATE TRIGGER"," "Commands (DDL)","CREATE TRIGGER","
...@@ -892,7 +892,7 @@ MOD(long, long) ...@@ -892,7 +892,7 @@ MOD(long, long)
"," ","
The modulo operation." The modulo operation."
"Functions (Numeric)","CEILING"," "Functions (Numeric)","CEILING","
CEILING(double) { CEILING | CEIL } (double)
"," ","
See also Java ""Math." See also Java ""Math."
"Functions (Numeric)","DEGREES"," "Functions (Numeric)","DEGREES","
...@@ -908,7 +908,7 @@ FLOOR(double) ...@@ -908,7 +908,7 @@ FLOOR(double)
"," ","
See also Java ""Math." See also Java ""Math."
"Functions (Numeric)","LOG"," "Functions (Numeric)","LOG","
LOG(double) { LOG | LN } (double)
"," ","
See also Java ""Math." See also Java ""Math."
"Functions (Numeric)","LOG10"," "Functions (Numeric)","LOG10","
...@@ -932,7 +932,7 @@ POWER(double, double) ...@@ -932,7 +932,7 @@ POWER(double, double)
"," ","
See also Java ""Math." See also Java ""Math."
"Functions (Numeric)","RAND"," "Functions (Numeric)","RAND","
RAND( [ int ] ) { RAND | RANDOM } ( [ int ] )
"," ","
Calling the function without parameter returns the next a pseudo random number." Calling the function without parameter returns the next a pseudo random number."
"Functions (Numeric)","RANDOM_UUID"," "Functions (Numeric)","RANDOM_UUID","
...@@ -1244,7 +1244,7 @@ CAST(value AS dataType) ...@@ -1244,7 +1244,7 @@ CAST(value AS dataType)
"," ","
Converts a value to another data type." Converts a value to another data type."
"Functions (System)","COALESCE"," "Functions (System)","COALESCE","
COALESCE(aValue, bValue [,...]) { COALESCE | NVL } (aValue, bValue [,...])
"," ","
Returns the first value that is not null." Returns the first value that is not null."
"Functions (System)","CONVERT"," "Functions (System)","CONVERT","
...@@ -1321,6 +1321,10 @@ Returns the next value of the sequence." ...@@ -1321,6 +1321,10 @@ Returns the next value of the sequence."
NULLIF(aValue, bValue) NULLIF(aValue, bValue)
"," ","
Returns NULL if 'a' is equals to 'b', otherwise 'a'." Returns NULL if 'a' is equals to 'b', otherwise 'a'."
"Functions (System)","NVL2","
NVL2(testValue, aValue, bValue)
","
If the test value is null, then 'b' is returned."
"Functions (System)","READONLY"," "Functions (System)","READONLY","
READONLY() READONLY()
"," ","
......
...@@ -175,6 +175,13 @@ public class LobStorage { ...@@ -175,6 +175,13 @@ public class LobStorage {
return ValueLob.createSmallLob(type, small); return ValueLob.createSmallLob(type, small);
} }
/**
* Read a block of data from the given LOB.
*
* @param lob the lob id
* @param seq the block sequence number
* @return the block (expanded if stored compressed)
*/
byte[] readBlock(long lob, int seq) throws SQLException { byte[] readBlock(long lob, int seq) throws SQLException {
synchronized (handler) { synchronized (handler) {
String sql = "SELECT COMPRESSED, DATA FROM " + LOB_MAP + " M " + String sql = "SELECT COMPRESSED, DATA FROM " + LOB_MAP + " M " +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论