提交 6be972e5 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 bd0d2b2e
#Mon Dec 10 07:25:40 CET 2007
#Tue Dec 25 18:57:49 CET 2007
javac=javac
benchmark.drivers.dir=C\:/data/java
path.servlet.jar=C\:/data/classpath/servlet-api.jar
version.name.maven=1.0.63
version.name.maven=1.0.64
path.lucene.jar=C\:/data/classpath/lucene-core-2.2.0.jar
jdk=1.4
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
<!--
Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
......@@ -41,7 +41,7 @@ Newer version or compatible software works too.
</p>
<ul>
<li>Windows XP
</li><li>Sun JDK Version 1.4 or 1.5
</li><li>Sun JDK Version 1.4
</li><li>Apache Ant Version 1.6.5
</li><li>Mozilla Firefox 1.5
</li><li>Eclipse Version 3.2.2
......@@ -71,18 +71,18 @@ The other targets may be used as well.
<h2>Using Maven 2</h2>
<h3>Using a Central Repository</h3>
<p>
You can include the database in your Maven 2 project as a dependency.
You can include the database in your Maven 2 project as a dependency.
Example:
</p>
<pre>
&lt;dependency&gt;
&lt;groupId&gt;com.h2database&lt;/groupId&gt;
&lt;artifactId&gt;h2&lt;/artifactId&gt;
&lt;version&gt;1.0.63&lt;/version&gt;
&lt;version&gt;1.0.64&lt;/version&gt;
&lt;/dependency&gt;
</pre>
<p>
New versions of this database are first uploaded to http://hsql.sourceforge.net/m2-repo/ and then automatically
New versions of this database are first uploaded to http://hsql.sourceforge.net/m2-repo/ and then automatically
synchronized with the main maven repository; however after a new release it may take a few hours before
they are available there.
</p>
......
......@@ -15,10 +15,10 @@ H2 Database Engine
<h1>Downloads</h1>
<h3>Version 1.0.63 (2007-12-02, Current)</h3>
<h3>Version 1.0.64 (2007-12-26, Current)</h3>
<p>
<a href="http://www.h2database.com/h2-setup-2007-12-02.exe">Windows Installer</a><br />
<a href="http://www.h2database.com/h2-2007-12-02.zip">Platform-Independent Zip</a><br />
<a href="http://www.h2database.com/h2-setup-2007-12-26.exe">Windows Installer</a><br />
<a href="http://www.h2database.com/h2-2007-12-26.zip">Platform-Independent Zip</a><br />
</p>
<h3>Version 1.0.63 (2007-12-02, Last Stable)</h3>
......
......@@ -31,17 +31,17 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
<table style="border: 0px; margin: 5px; background-color: #eee;">
<tr><td style="border: 0px; background-color: #eee;" colspan="2">
<h3>Download</h3>
Version 1.0.63 (2007-12-02):
Version 1.0.64 (2007-12-26):
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-2007-12-02.exe"><img border="1" src="images/download.png" alt="download" /></a>
<a href="http://www.h2database.com/h2-setup-2007-12-26.exe"><img border="1" src="images/download.png" alt="download" /></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-2007-12-02.exe">Windows Installer (2.8 MB)</a>
<a href="http://www.h2database.com/h2-setup-2007-12-26.exe">Windows Installer (2.8 MB)</a>
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-2007-12-02.zip"><img border="1" src="images/download.png" alt="download" /></a>
<a href="http://www.h2database.com/h2-2007-12-26.zip"><img border="1" src="images/download.png" alt="download" /></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-2007-12-02.zip">All platforms (zip, 3.9 MB)</a>
<a href="http://www.h2database.com/h2-2007-12-26.zip">All platforms (zip, 3.9 MB)</a>
</td></tr>
<tr><td style="border: 0px; background-color: #eee;" colspan="2">
<a href="download.html">All Downloads</a>
......@@ -57,7 +57,7 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
<a href="http://groups.google.co.jp/group/h2-database-jp" target="_top">Japanese Google Group</a><br /><br />
Or send an e-mail to: <br />
<script type="text/javascript">
<!--
<!--
var a = '-support.png';
var b = 'mail';
var c = 'support ';
......@@ -93,14 +93,14 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
<tr><td style="border: 0px; background-color: #eee;">
<h3>News</h3>
<p>
<b>Newsfeeds:</b> Two are available:
<b>Newsfeeds:</b> Two are available:
<a href="http://www.h2database.com/html/newsfeed-atom.xml" target="_blank">Full text (Atom)</a>
and <a href="http://www.h2database.com/html/newsfeed-rss.xml" target="_blank">Header only (RSS)</a>.
</p><p>
<b>Email Newsletter:</b> Subscribe to
<b>Email Newsletter:</b> Subscribe to
<a href="http://groups.google.com/group/h2database-news/subscribe">
H2 Database News (Google account required)</a>
to get informed about new releases.
to get informed about new releases.
Your email address is only used in this context.
</p>
</td></tr>
......@@ -115,21 +115,21 @@ Welcome to H2, the free SQL database. The main feature of H2 are:
<h3>Contribute</h3>
<p>
You can contribute to the development of H2 by sending feedback and bug
reports, or translate the H2 Console application (files
h2/src/main/org/h2/server/web/res/_text_*.properties).
Or click on the PayPal button below to
donate money. You will be listed as a supporter:
reports, or translate the H2 Console application (files
h2/src/main/org/h2/server/web/res/_text_*.properties).
Or click on the PayPal button below to
donate money. You will be listed as a supporter:
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" name="submit" alt="PayPal"/>
<img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1" />
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHNwYJKoZIhvcNAQcEoIIHKDCCByQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MR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DYt93luzANBgkqhkiG9w0BAQEFAASBgLJMfUrlr/Ckx/peA6UOkMqsB20W7M9FC4dYaGrlhSf0Og2N3NVlBrliloxGq85KpLnwJsKsh1wbP2aMGHvbicpCOsRoogPVvFI0cLb2UfPFkT0fRuEKerxcVVZQq26WjMq3h/Gps5tQEBGEB5Ok9IGP/dusNA+YijCt5XA/WM47-----END PKCS7-----"/>
</form>
</form>
</td></tr>
</table>
</td></tr>
<tr><td colspan="3" style="border: 0px">&nbsp;</td></tr>
<tr><td colspan="3" style="background-color: #eee;">
......
......@@ -32,7 +32,8 @@ public class SysProperties {
public static final boolean OPTIMIZE_EVALUATABLE_SUBQUERIES = getBooleanSetting("h2.optimizeEvaluatableSubqueries", true);
public static final boolean OPTIMIZE_IN = getBooleanSetting("h2.optimizeIn", true);
public static final boolean OPTIMIZE_IN_JOIN = getBooleanSetting("h2.optimizeInJoin", true);
public static final boolean OPTIMIZE_IN_JOIN = getBooleanSetting("h2.optimizeInJoin", false);
public static final boolean OPTIMIZE_MIN_MAX = getBooleanSetting("h2.optimizeMinMax", true);
public static final boolean OPTIMIZE_SUBQUERY_CACHE = getBooleanSetting("h2.optimizeSubqueryCache", true);
......
......@@ -73,8 +73,8 @@ import org.h2.constant.SysProperties;
*/
public class Constants {
public static final int BUILD_ID = 63;
private static final String BUILD = "2007-12-02";
public static final int BUILD_ID = 64;
private static final String BUILD = "2007-12-26";
public static final int VERSION_MAJOR = 1;
public static final int VERSION_MINOR = 0;
......
......@@ -40,7 +40,7 @@ public abstract class Expression {
* Map the columns of the resolver to expression columns.
*
* @param resolver the column resolver
* @return level the subquery nesting level
* @param level the subquery nesting level
*/
public abstract void mapColumns(ColumnResolver resolver, int level) throws SQLException;
......
......@@ -76,4 +76,20 @@ public interface FunctionCall {
*/
String getSQL();
/**
* Check if the function can return the row count
* (if the function returns a number of rows).
*
* @return true if the function can return the row count
*/
// boolean canGetRowCount();
/**
* Get the number of rows
* (if the function returns a number of rows).
*
* @return the row count
*/
// int getRowCount(Session session);
}
/*
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.expression;
import java.sql.SQLException;
import org.h2.engine.Database;
import org.h2.engine.Session;
import org.h2.result.LocalResult;
import org.h2.table.Column;
import org.h2.table.ColumnResolver;
import org.h2.table.TableFilter;
import org.h2.tools.SimpleResultSet;
import org.h2.util.MathUtils;
import org.h2.value.DataType;
import org.h2.value.Value;
import org.h2.value.ValueArray;
import org.h2.value.ValueNull;
import org.h2.value.ValueResultSet;
/**
* Implementation of the functions TABLE(..) and TABLE_DISTINCT(..).
*/
public class TableFunction extends Expression implements FunctionCall {
private boolean distinct;
private Expression[] args;
private Column[] columnList;
public Value getValue(Session session) throws SQLException {
return getTable(session, args, false, distinct);
}
public String getSQL() {
StringBuffer buff = new StringBuffer();
buff.append(getName());
buff.append('(');
for (int i = 0; i < args.length; i++) {
if (i > 0) {
buff.append(", ");
}
buff.append(columnList[i].getCreateSQL());
buff.append("=");
Expression e = args[i];
buff.append(e.getSQL());
}
buff.append(')');
return buff.toString();
}
public ValueResultSet getTable(Session session, Expression[] args, boolean onlyColumnList, boolean distinct) throws SQLException {
int len = columnList.length;
Expression[] header = new Expression[len];
Database db = session.getDatabase();
for (int i = 0; i < len; i++) {
Column c = columnList[i];
ExpressionColumn col = new ExpressionColumn(db, c);
header[i] = col;
}
LocalResult result = new LocalResult(session, header, len);
if (distinct) {
result.setDistinct();
}
if (!onlyColumnList) {
Value[][] list = new Value[len][];
int rowCount = 0;
for (int i = 0; i < len; i++) {
Value v = args[i].getValue(session);
if (v == ValueNull.INSTANCE) {
list[i] = new Value[0];
} else {
ValueArray array = (ValueArray) v.convertTo(Value.ARRAY);
Value[] l = array.getList();
list[i] = l;
rowCount = Math.max(rowCount, l.length);
}
}
for (int row = 0; row < rowCount; row++) {
Value[] r = new Value[len];
for (int j = 0; j < len; j++) {
Value[] l = list[j];
Value v;
if (l.length <= row) {
v = ValueNull.INSTANCE;
} else {
Column c = columnList[j];
v = l[row];
v = v.convertTo(c.getType());
v = v.convertPrecision(c.getPrecision());
v = v.convertScale(true, c.getScale());
}
r[j] = v;
}
result.addRow(r);
}
}
result.done();
ValueResultSet vr = ValueResultSet.get(getSimpleResultSet(result, Integer.MAX_VALUE));
return vr;
}
SimpleResultSet getSimpleResultSet(LocalResult rs, int maxrows) throws SQLException {
int columnCount = rs.getVisibleColumnCount();
SimpleResultSet simple = new SimpleResultSet();
for (int i = 0; i < columnCount; i++) {
String name = rs.getColumnName(i);
int sqlType = DataType.convertTypeToSQLType(rs.getColumnType(i));
int precision = MathUtils.convertLongToInt(rs.getColumnPrecision(i));
int scale = rs.getColumnScale(i);
simple.addColumn(name, sqlType, precision, scale);
}
rs.reset();
for (int i = 0; i < maxrows && rs.next(); i++) {
Object[] list = new Object[columnCount];
for (int j = 0; j < columnCount; j++) {
list[j] = rs.currentRow()[j].getObject();
}
simple.addRow(list);
}
return simple;
}
public int getScale() {
return 0;
}
public void mapColumns(ColumnResolver resolver, int level) throws SQLException {
for (int i = 0; i < args.length; i++) {
args[i].mapColumns(resolver, level);
}
}
public int getCost() {
int cost = 3;
for (int i = 0; i < args.length; i++) {
cost += args[i].getCost();
}
return cost;
}
public int getDisplaySize() {
return Integer.MAX_VALUE;
}
public long getPrecision() {
return 0;
}
public int getType() {
return Value.RESULT_SET;
}
public boolean isEverything(ExpressionVisitor visitor) {
for (int i = 0; i < args.length; i++) {
Expression e = args[i];
if (e != null && !e.isEverything(visitor)) {
return false;
}
}
return true;
}
public Expression optimize(Session session) throws SQLException {
boolean allConst = true;
for (int i = 0; i < args.length; i++) {
Expression e = args[i].optimize(session);
args[i] = e;
if (!e.isConstant()) {
allConst = false;
}
}
if (allConst) {
return ValueExpression.get(getValue(session));
}
return this;
}
public void setEvaluatable(TableFilter tableFilter, boolean value) {
for (int i = 0; i < args.length; i++) {
Expression e = args[i];
if (e != null) {
e.setEvaluatable(tableFilter, value);
}
}
}
public void updateAggregate(Session session) throws SQLException {
for (int i = 0; i < args.length; i++) {
Expression e = args[i];
if (e != null) {
e.updateAggregate(session);
}
}
}
public boolean canGetRowCount() {
return true;
}
public Expression[] getArgs() {
return args;
}
public String getName() {
return distinct ? "TABLE_DISTINCT" : "TABLE";
}
public int getParameterCount() {
return args.length;
}
public int getRowCount(Session session) throws SQLException {
int len = columnList.length;
int rowCount = 0;
for (int i = 0; i < len; i++) {
Expression expr = args[i];
if (expr.isConstant()) {
Value v = expr.getValue(session);
if (v != ValueNull.INSTANCE) {
ValueArray array = (ValueArray) v.convertTo(Value.ARRAY);
Value[] l = array.getList();
rowCount = Math.max(rowCount, l.length);
}
}
}
return rowCount;
}
public ValueResultSet getValueForColumnList(Session session, Expression[] nullArgs) throws SQLException {
return getTable(session, args, true, false);
}
}
......@@ -50,7 +50,8 @@ public class FunctionIndex extends BaseIndex {
if (masks != null) {
throw Message.getUnsupportedException();
}
return Long.MAX_VALUE;
return Integer.MAX_VALUE;
// return functionTable.getRowCount(session) * 10;
}
public void remove(Session session) throws SQLException {
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
Javadoc package documentation
</title></head><body style="font: 8pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;">
Implementation of the JDBC API.
</body></html>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论