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

Documentation.

上级 1b972af6
...@@ -178,7 +178,7 @@ The statement <a href="grammar.html#create_linked_table" class="notranslate" >CR ...@@ -178,7 +178,7 @@ The statement <a href="grammar.html#create_linked_table" class="notranslate" >CR
supports an optional schema name parameter. supports an optional schema name parameter.
</p> </p>
<p> <p>
The following are not supported because they may result in a deadlock: The following are not supported because they may result in a deadlock:
creating a linked table to the same database, creating a linked table to the same database,
and creating a linked table to another database using the server mode if the other database is open in the same server and creating a linked table to another database using the server mode if the other database is open in the same server
(use the embedded mode instead). (use the embedded mode instead).
......
...@@ -40,7 +40,7 @@ Change Log ...@@ -40,7 +40,7 @@ Change Log
</li><li>Java functions: array component types are now preserved, so that a ResultSet.getObject() </li><li>Java functions: array component types are now preserved, so that a ResultSet.getObject()
will return Integer[] if the Java functions returns Integer[]. Thanks to Noel Grandin for the patch. will return Integer[] if the Java functions returns Integer[]. Thanks to Noel Grandin for the patch.
Component types are transferred over the network, but not persisted in the database file as of now. Component types are transferred over the network, but not persisted in the database file as of now.
</li><li>Recover tool: the script generated by the recover tool didn't work </li><li>Recover tool: the script generated by the recover tool didn't work
if fulltext search was used, because the triggers were created before the primary keys. if fulltext search was used, because the triggers were created before the primary keys.
</li><li>Issue 321: the database does not expect XA rollback without XA prepare </li><li>Issue 321: the database does not expect XA rollback without XA prepare
(an exception was unnecessarily written into the .trace.db file). (an exception was unnecessarily written into the .trace.db file).
......
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.
...@@ -219,6 +219,9 @@ public abstract class Query extends Prepared { ...@@ -219,6 +219,9 @@ public abstract class Query extends Prepared {
return true; return true;
} }
/**
* Disable caching of result sets.
*/
public void disableCache() { public void disableCache() {
this.noCache = true; this.noCache = true;
} }
......
...@@ -174,7 +174,7 @@ public class ViewIndex extends BaseIndex { ...@@ -174,7 +174,7 @@ public class ViewIndex extends BaseIndex {
throw DbException.get(ErrorCode.SYNTAX_ERROR_2, "recursive queries without UNION ALL"); throw DbException.get(ErrorCode.SYNTAX_ERROR_2, "recursive queries without UNION ALL");
} }
Query left = union.getLeft(); Query left = union.getLeft();
// to ensure the last result isn't closed // to ensure the last result is not closed
left.disableCache(); left.disableCache();
LocalResult r = left.query(0); LocalResult r = left.query(0);
LocalResult result = union.getEmptyResult(); LocalResult result = union.getEmptyResult();
...@@ -184,7 +184,7 @@ public class ViewIndex extends BaseIndex { ...@@ -184,7 +184,7 @@ public class ViewIndex extends BaseIndex {
Query right = union.getRight(); Query right = union.getRight();
r.reset(); r.reset();
view.setRecursiveResult(r); view.setRecursiveResult(r);
// to ensure the last result isn't closed // to ensure the last result is not closed
right.disableCache(); right.disableCache();
while (true) { while (true) {
r = right.query(0); r = right.query(0);
......
...@@ -946,9 +946,9 @@ RANDOM_UUID() ...@@ -946,9 +946,9 @@ RANDOM_UUID()
"," ","
Returns a new UUID with 122 pseudo random bits." Returns a new UUID with 122 pseudo random bits."
"Functions (Numeric)","ROUND"," "Functions (Numeric)","ROUND","
ROUND(numeric, digitsInt) ROUND(numeric [, digitsInt])
"," ","
Rounds to a number of digits." Rounds to a number of digits, or to the nearest long if the number of digits if not set."
"Functions (Numeric)","ROUNDMAGIC"," "Functions (Numeric)","ROUNDMAGIC","
ROUNDMAGIC(numeric) ROUNDMAGIC(numeric)
"," ","
......
...@@ -210,7 +210,7 @@ public class LobStorage { ...@@ -210,7 +210,7 @@ public class LobStorage {
* Retrieve the sequence id and offset that is smaller than the requested * Retrieve the sequence id and offset that is smaller than the requested
* offset. Those values can be used to quickly skip to a given position * offset. Those values can be used to quickly skip to a given position
* without having to read all data. * without having to read all data.
* *
* @param lob the lob * @param lob the lob
* @param offset the required offset * @param offset the required offset
* @return null if the data is not available, or an array of two elements: * @return null if the data is not available, or an array of two elements:
...@@ -284,22 +284,6 @@ public class LobStorage { ...@@ -284,22 +284,6 @@ public class LobStorage {
return super.skip(n); return super.skip(n);
} }
// public long skip(long n) throws IOException {
// n -= skipSmall(n);
// while (n > BLOCK_LENGTH) {
// try {
// n -= skipBuffer(lob, seq++);
// pos = 0;
// buffer = null;
// } catch (SQLException e) {
// throw DbException.convertToIOException(e);
// }
// }
// fillBuffer();
// n -= skipSmall(n);
// return super.skip(n);
// }
//
private int skipSmall(long n) { private int skipSmall(long n) {
if (n > 0 && buffer != null && pos < buffer.length) { if (n > 0 && buffer != null && pos < buffer.length) {
int x = MathUtils.convertLongToInt(Math.min(n, buffer.length - pos)); int x = MathUtils.convertLongToInt(Math.min(n, buffer.length - pos));
...@@ -553,8 +537,6 @@ public class LobStorage { ...@@ -553,8 +537,6 @@ public class LobStorage {
long lobId = getNextLobId(); long lobId = getNextLobId();
String sql = "INSERT INTO " + LOB_MAP + "(LOB, SEQ, OFFSET, HASH, BLOCK) " + String sql = "INSERT INTO " + LOB_MAP + "(LOB, SEQ, OFFSET, HASH, BLOCK) " +
"SELECT ?, SEQ, OFFSET, HASH, BLOCK FROM " + LOB_MAP + " WHERE LOB = ?"; "SELECT ?, SEQ, OFFSET, HASH, BLOCK FROM " + LOB_MAP + " WHERE LOB = ?";
// String sql = "INSERT INTO " + LOB_MAP + "(LOB, SEQ, LEN, HASH, BLOCK) " +
// "SELECT ?, SEQ, LEN, HASH, BLOCK FROM " + LOB_MAP + " WHERE LOB = ?";
PreparedStatement prep = prepare(sql); PreparedStatement prep = prepare(sql);
prep.setLong(1, lobId); prep.setLong(1, lobId);
prep.setLong(2, oldLobId); prep.setLong(2, oldLobId);
...@@ -608,7 +590,6 @@ public class LobStorage { ...@@ -608,7 +590,6 @@ public class LobStorage {
*/ */
void storeBlock(long lobId, int seq, long offset, byte[] b, String compressAlgorithm) throws SQLException { void storeBlock(long lobId, int seq, long offset, byte[] b, String compressAlgorithm) throws SQLException {
long block; long block;
// int len = b.length;
boolean blockExists = false; boolean blockExists = false;
if (compressAlgorithm != null) { if (compressAlgorithm != null) {
b = compress.compress(b, compressAlgorithm); b = compress.compress(b, compressAlgorithm);
...@@ -643,11 +624,9 @@ public class LobStorage { ...@@ -643,11 +624,9 @@ public class LobStorage {
reuse(sql, prep); reuse(sql, prep);
} }
String sql = "INSERT INTO " + LOB_MAP + "(LOB, SEQ, OFFSET, HASH, BLOCK) VALUES(?, ?, ?, ?, ?)"; String sql = "INSERT INTO " + LOB_MAP + "(LOB, SEQ, OFFSET, HASH, BLOCK) VALUES(?, ?, ?, ?, ?)";
// String sql = "INSERT INTO " + LOB_MAP + "(LOB, SEQ, LEN, HASH, BLOCK) VALUES(?, ?, ?, ?, ?)";
PreparedStatement prep = prepare(sql); PreparedStatement prep = prepare(sql);
prep.setLong(1, lobId); prep.setLong(1, lobId);
prep.setInt(2, seq); prep.setInt(2, seq);
// prep.setInt(3, len);
prep.setLong(3, offset); prep.setLong(3, offset);
prep.setLong(4, hash); prep.setLong(4, hash);
prep.setLong(5, block); prep.setLong(5, block);
......
...@@ -77,8 +77,10 @@ public class CloseWatcher extends PhantomReference<Object> { ...@@ -77,8 +77,10 @@ public class CloseWatcher extends PhantomReference<Object> {
* called in a loop to remove old references. * called in a loop to remove old references.
* *
* @param o the object * @param o the object
* @param closeable the object to close
* @param stackTrace whether the stack trace should be registered (this is * @param stackTrace whether the stack trace should be registered (this is
* relatively slow) * relatively slow)
* @return the close watcher
*/ */
public static CloseWatcher register(Object o, Closeable closeable, boolean stackTrace) { public static CloseWatcher register(Object o, Closeable closeable, boolean stackTrace) {
ReferenceQueue<Object> q = queue; ReferenceQueue<Object> q = queue;
......
...@@ -27,7 +27,7 @@ public class ValueArray extends Value { ...@@ -27,7 +27,7 @@ public class ValueArray extends Value {
this.componentType = componentType; this.componentType = componentType;
this.values = list; this.values = list;
} }
private ValueArray(Value[] list) { private ValueArray(Value[] list) {
this(Object.class, list); this(Object.class, list);
} }
...@@ -47,13 +47,14 @@ public class ValueArray extends Value { ...@@ -47,13 +47,14 @@ public class ValueArray extends Value {
* Get or create a array value for the given value array. * Get or create a array value for the given value array.
* Do not clone the data. * Do not clone the data.
* *
* @param componentType the array class (null for Object[])
* @param list the value array * @param list the value array
* @return the value * @return the value
*/ */
public static ValueArray get(Class<?> componentType, Value[] list) { public static ValueArray get(Class<?> componentType, Value[] list) {
return new ValueArray(componentType, list); return new ValueArray(componentType, list);
} }
public int hashCode() { public int hashCode() {
if (hash != 0) { if (hash != 0) {
return hash; return hash;
...@@ -73,7 +74,7 @@ public class ValueArray extends Value { ...@@ -73,7 +74,7 @@ public class ValueArray extends Value {
public int getType() { public int getType() {
return Value.ARRAY; return Value.ARRAY;
} }
public Class<?> getComponentType() { public Class<?> getComponentType() {
return componentType; return componentType;
} }
......
...@@ -603,7 +603,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1` ...@@ -603,7 +603,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new TestBatchUpdates().runTest(this); new TestBatchUpdates().runTest(this);
new TestCallableStatement().runTest(this); new TestCallableStatement().runTest(this);
new TestCancel().runTest(this); new TestCancel().runTest(this);
new TestDatabaseEventListener().runTest(this); new TestDatabaseEventListener().runTest(this);
new TestDriver().runTest(this); new TestDriver().runTest(this);
new TestLobApi().runTest(this); new TestLobApi().runTest(this);
new TestManyJdbcObjects().runTest(this); new TestManyJdbcObjects().runTest(this);
......
...@@ -601,7 +601,7 @@ public abstract class TestBase { ...@@ -601,7 +601,7 @@ public abstract class TestBase {
} }
} }
} }
/** /**
* Check if two readers are equal, and if not throw an exception. * Check if two readers are equal, and if not throw an exception.
* *
......
...@@ -52,7 +52,7 @@ public class TestSelectCountNonNullColumn extends TestBase { ...@@ -52,7 +52,7 @@ public class TestSelectCountNonNullColumn extends TestBase {
} }
void checkStarCount(long expect) throws SQLException { private void checkStarCount(long expect) throws SQLException {
String sql = "SELECT COUNT(*) FROM SIMPLE"; String sql = "SELECT COUNT(*) FROM SIMPLE";
if (expect < 0) { if (expect < 0) {
sql = "EXPLAIN " + sql; sql = "EXPLAIN " + sql;
...@@ -68,7 +68,7 @@ public class TestSelectCountNonNullColumn extends TestBase { ...@@ -68,7 +68,7 @@ public class TestSelectCountNonNullColumn extends TestBase {
} }
} }
void checkKeyCount(long expect) throws SQLException { private void checkKeyCount(long expect) throws SQLException {
String sql = "SELECT COUNT(KEY) FROM SIMPLE"; String sql = "SELECT COUNT(KEY) FROM SIMPLE";
if (expect < 0) { if (expect < 0) {
sql = "EXPLAIN " + sql; sql = "EXPLAIN " + sql;
...@@ -84,7 +84,7 @@ public class TestSelectCountNonNullColumn extends TestBase { ...@@ -84,7 +84,7 @@ public class TestSelectCountNonNullColumn extends TestBase {
} }
} }
void checkNameCount(long expect) throws SQLException { private void checkNameCount(long expect) throws SQLException {
String sql = "SELECT COUNT(NAME) FROM SIMPLE"; String sql = "SELECT COUNT(NAME) FROM SIMPLE";
if (expect < 0) { if (expect < 0) {
sql = "EXPLAIN " + sql; sql = "EXPLAIN " + sql;
......
...@@ -684,3 +684,5 @@ diagnostics checkout somewhat icu delegation classifications karlsson applet ...@@ -684,3 +684,5 @@ diagnostics checkout somewhat icu delegation classifications karlsson applet
litailang springsource eccn springframework spr growth teams gigabytes europe litailang springsource eccn springframework spr growth teams gigabytes europe
mcleod decade experience travel willing scjp himself routinely tsi retrieving mcleod decade experience travel willing scjp himself routinely tsi retrieving
multiplied ross judson closeable watcher enqueued referent refs watch tracked multiplied ross judson closeable watcher enqueued referent refs watch tracked
preserving disallowed restrictive
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论