提交 11d651b5 authored 作者: Thomas Mueller's avatar Thomas Mueller

Prepare release.

上级 c097b6e2
......@@ -18,7 +18,13 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Conditions of the form columnName IS NULL now use an index. To disable this feature,
<ul><li>-
</li></ul>
<h2>Next Version (unreleased)</h2>
<ul><li>When using ORDER BY and there are both ascending and descending indexes, the database used
the first index even when the second one could be used for sorting.
</li><li>Conditions of the form columnName IS NULL now use an index. To disable this feature,
set the system property h2.optimizeIsNull to false.
</li><li>H2 Console: when the settings were not stored yet (for example when running for the first time),
the last recently used settings were not stored. A workaround was to create the file
......@@ -684,21 +690,5 @@ Change Log
</li><li>Data types: LONG is now an alias for BIGINT.
</li></ul>
<h2>Version 1.1.114 (2009-06-01)</h2>
<ul><li>ResultSetMetaData.getColumnClassName returned the wrong
class for CLOB and BLOB columns.
</li><li>Fulltext search: data is no longer deleted and
re-inserted if the indexed columns didn't change.
</li><li>In some situations, an ArrayIndexOutOfBoundsException was thrown when adding rows.
This was caused by a bug in the b-tree code.
</li><li>Microsoft Windows Vista: when using the the installer, Vista wrote
"This program may not have installed correctly." This message should no longer appear
(in the h2.nsi file, the line 'RequestExecutionLevel highest' was added).
</li><li>The Recover tool did not always work when the database contains
referential integrity constraints.
</li><li>Java 1.5 is now required to run H2. If required, Retrotranslator can be used
to create a Java 1.4 version (http://retrotranslator.sourceforge.net/).
</li></ul>
<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>
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.
......@@ -777,31 +777,31 @@ public class Select extends Query {
if (sort != null && !isQuickAggregateQuery && !isGroupQuery) {
Index index = getSortIndex();
if (index != null) {
Index current = topTableFilter.getIndex();
if (current.getIndexType().isScan() || current == index) {
topTableFilter.setIndex(index);
if (!topTableFilter.hasInComparisons()) {
// in(select ...) and in(1,2,3) my return the key is another order
sortUsingIndex = true;
}
} else if (index.getIndexColumns().length >= current.getIndexColumns().length) {
IndexColumn[] ic = index.getIndexColumns();
IndexColumn[] cic = current.getIndexColumns();
boolean swapIndex = false;
for (int i = 0; i < cic.length; i++) {
if (ic[i].column != cic[i].column) {
swapIndex = false;
break;
}
if (ic[i].sortType != cic[i].sortType) {
swapIndex = true;
}
}
if (swapIndex) {
topTableFilter.setIndex(index);
sortUsingIndex = true;
}
}
Index current = topTableFilter.getIndex();
if (current.getIndexType().isScan() || current == index) {
topTableFilter.setIndex(index);
if (!topTableFilter.hasInComparisons()) {
// in(select ...) and in(1,2,3) my return the key is another order
sortUsingIndex = true;
}
} else if (index.getIndexColumns().length >= current.getIndexColumns().length) {
IndexColumn[] sortColumns = index.getIndexColumns();
IndexColumn[] currentColumns = current.getIndexColumns();
boolean swapIndex = false;
for (int i = 0; i < currentColumns.length; i++) {
if (sortColumns[i].column != currentColumns[i].column) {
swapIndex = false;
break;
}
if (sortColumns[i].sortType != currentColumns[i].sortType) {
swapIndex = true;
}
}
if (swapIndex) {
topTableFilter.setIndex(index);
sortUsingIndex = true;
}
}
}
}
if (!isQuickAggregateQuery && isGroupQuery && getGroupByExpressionCount() > 0) {
......
......@@ -14,12 +14,12 @@ public class Constants {
/**
* The build id is incremented for each public release.
*/
public static final int BUILD_ID = 135;
public static final int BUILD_ID = 136;
/**
* The build id of the last stable release.
*/
public static final int BUILD_ID_STABLE = 134;
public static final int BUILD_ID_STABLE = 135;
/**
* If H2 is compiled to be included in a product, this should be set to
......@@ -32,12 +32,12 @@ public class Constants {
/**
* The build date is updated for each public release.
*/
public static final String BUILD_DATE = "2010-05-08";
public static final String BUILD_DATE = "2010-05-24";
/**
* The build date is updated for each public release.
*/
public static final String BUILD_DATE_STABLE = "2010-04-23";
public static final String BUILD_DATE_STABLE = "2010-05-08";
/**
* The TCP protocol version number. This protocol is used by the TCP
......
......@@ -57,8 +57,8 @@ public class TableFilter implements ColumnResolver {
private final ArrayList<IndexCondition> indexConditions = New.arrayList();
/**
* Additional conditions that can't be used for index lookup,
* but for row filter for this table (ID=ID, NAME LIKE '%X%')
* Additional conditions that can't be used for index lookup, but for row
* filter for this table (ID=ID, NAME LIKE '%X%')
*/
private Expression filterCondition;
......@@ -121,7 +121,8 @@ public class TableFilter implements ColumnResolver {
}
/**
* Get the best plan item (index, cost) to use use for the current join order.
* Get the best plan item (index, cost) to use use for the current join
* order.
*
* @param s the session
* @param level 1 for the first table in a join, 2 for the second, and so on
......@@ -320,7 +321,8 @@ public class TableFilter implements ColumnResolver {
private void checkTimeout() {
session.checkCanceled();
// System.out.println(this.alias+ " " + table.getName() + ": " + scanCount);
// System.out.println(this.alias+ " " + table.getName() + ": " +
// scanCount);
}
private boolean isOk(Expression condition) {
......@@ -491,7 +493,8 @@ public class TableFilter implements ColumnResolver {
if (isJoin) {
buff.append(" ON ");
if (joinCondition == null) {
// need to have a ON expression, otherwise the nesting is unclear
// need to have a ON expression, otherwise the nesting is
// unclear
buff.append("1=1");
} else {
buff.append(StringUtils.unEnclose(joinCondition.getSQL()));
......@@ -718,12 +721,22 @@ public class TableFilter implements ColumnResolver {
return false;
}
/**
* Add the current row to the array, if there is a current row.
*
* @param rows the rows to lock
*/
public void lockRow(ArrayList<Row> rows) {
if (state == FOUND) {
rows.add(get());
}
}
/**
* Lock the given rows.
*
* @param forUpdateRows the rows to lock
*/
public void lockRows(ArrayList<Row> forUpdateRows) {
for (Row row : forUpdateRows) {
table.removeRow(session, row);
......
......@@ -7,6 +7,7 @@
CREATE TABLE VERSION(ID INT PRIMARY KEY, VERSION VARCHAR, CREATED VARCHAR);
INSERT INTO VERSION VALUES
(86, '1.2.136', '2010-05-24'),
(85, '1.2.135', '2010-05-08'),
(84, '1.2.134', '2010-04-23'),
(83, '1.2.133', '2010-04-10'),
......@@ -19,7 +20,6 @@ INSERT INTO VERSION VALUES
(76, '1.2.126', '2009-12-18'),
(75, '1.2.125', '2009-12-06'),
(74, '1.2.124', '2009-11-20'),
(73, '1.2.123', '2009-11-08'),
;
CREATE TABLE CHANNEL(TITLE VARCHAR, LINK VARCHAR, DESC VARCHAR,
......
......@@ -70,15 +70,15 @@ public class TestOptimizations extends TestBase {
stat.execute("create index idx_id_desc on test(id desc)");
stat.execute("create index idx_id_asc on test(id)");
ResultSet rs;
rs = stat.executeQuery("explain select * from test where id > 10 order by id");
rs.next();
assertTrue(rs.getString(1).indexOf("IDX_ID_ASC") >= 0);
rs = stat.executeQuery("explain select * from test where id < 10 order by id desc");
rs.next();
assertTrue(rs.getString(1).indexOf("IDX_ID_DESC") >= 0);
rs.next();
stat.execute("drop table test");
conn.close();
......
......@@ -21,6 +21,11 @@ import org.h2.util.JdbcUtils;
*/
public class TestDiskSpaceLeak {
/**
* Run just this test.
*
* @param args ignored
*/
public static void main(String... args) throws Exception {
System.setProperty("h2.lobInDatabase", "true");
DeleteDbFiles.execute("data", null, true);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论