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

--no commit message

--no commit message
上级 3f6edd17
......@@ -368,7 +368,7 @@ build_1023_h3=Using Snapshot Version
build_1024_p=To build a 'snapshot' H2 .jar file and upload it the to the local Maven 2 repository, execute the following command\:
build_1025_p=Afterwards, you can include the database in your Maven 2 project as a dependency\:
download_1000_h1=Downloads
download_1001_h3=Version 1.0 / 2007-08-02 (Current)
download_1001_h3=Version 1.0.57 (2008-08-25, Current)
download_1002_a=Windows Installer
download_1003_a=Platform-Independent Zip
download_1004_h3=Version 1.0 / 2007-03-04 (Last Stable)
......@@ -1441,15 +1441,16 @@ history_1525_li=Trace\: write dangerous operations (set log 0,...) in every case
history_1526_li=ParameterMetaData should return correct data type where possible (INSERT for example)
history_1527_li=Support indexes for views (probably requires materialized views)
history_1528_li=Linked tables that point to the same database should share the connection
history_1529_h3=Not Planned
history_1530_li=HSQLDB (did) support this\: select id i from test where i>0 (other databases don't)
history_1531_li=String.intern (so that Strings can be compared with \=\=) will not be used because some VMs have problems when used extensively
history_1532_h2=Supporters
history_1533_p=Many thanks for those who helped by finding and reporting bugs, gave valuable feedback, spread the word and have translated this project. Also many thanks to the donors who contributed via PayPal\:
history_1534_li=Florent Ramiere, France
history_1535_li=Pete Haidinyak, USA
history_1536_li=Jun Iyama, Japan
history_1537_li=Antonio Casqueiro, Portugal
history_1529_li=Use log for rollback
history_1530_h3=Not Planned
history_1531_li=HSQLDB (did) support this\: select id i from test where i>0 (other databases don't)
history_1532_li=String.intern (so that Strings can be compared with \=\=) will not be used because some VMs have problems when used extensively
history_1533_h2=Supporters
history_1534_p=Many thanks for those who helped by finding and reporting bugs, gave valuable feedback, spread the word and have translated this project. Also many thanks to the donors who contributed via PayPal\:
history_1535_li=Florent Ramiere, France
history_1536_li=Pete Haidinyak, USA
history_1537_li=Jun Iyama, Japan
history_1538_li=Antonio Casqueiro, Portugal
installation_1000_h1=Installation
installation_1001_a=Requirements
installation_1002_a=Supported Platforms
......@@ -1606,9 +1607,9 @@ mainWeb_1003_li=Written Java; can be compiled with GCJ (Linux)
mainWeb_1004_li=Embedded, Server and Cluster modes
mainWeb_1005_li=JDBC and (partial) ODBC API; Web Client application
mainWeb_1006_h3=Download
mainWeb_1007_td=Version 1.0 / 2007-08-02\:
mainWeb_1008_a=Windows Installer (2.6 MB)
mainWeb_1009_a=All platforms (zip, 3.4 MB)
mainWeb_1007_td=Version 1.0.57 (2007-08-25)\:
mainWeb_1008_a=Windows Installer (2.7 MB)
mainWeb_1009_a=All platforms (zip, 3.8 MB)
mainWeb_1010_a=All Downloads
mainWeb_1011_td=   
mainWeb_1012_h3=Support
......@@ -1623,16 +1624,15 @@ mainWeb_1020_h3=News
mainWeb_1021_b=Newsfeeds\:
mainWeb_1022_p=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> .
mainWeb_1023_b=Email Newsletter\:
mainWeb_1024_form=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. Your email address is only used in this context. If you don't want a Google account, there is a manually maintained list as well\:
mainWeb_1025_form=Email\:
mainWeb_1026_td=&nbsp;
mainWeb_1027_h3=Contribute
mainWeb_1028_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\:
mainWeb_1029_td=&nbsp;
mainWeb_1030_h3=Feedback
mainWeb_1031_td=You may also send questions, feature requests, or feedback of any kind here\:
mainWeb_1032_p=Email (optional)\:
mainWeb_1033_form=Message\:
mainWeb_1024_p=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. Your email address is only used in this context.
mainWeb_1025_td=&nbsp;
mainWeb_1026_h3=Contribute
mainWeb_1027_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\:
mainWeb_1028_td=&nbsp;
mainWeb_1029_h3=Feedback
mainWeb_1030_td=You may also send questions, feature requests, or feedback of any kind here\:
mainWeb_1031_p=Email (optional)\:
mainWeb_1032_form=Message\:
main_1000_h1=H2 Database Engine
main_1001_p=Welcome to H2, the free SQL database engine.
main_1002_a=Quickstart
......
......@@ -58,7 +58,7 @@ import org.h2.constant.SysProperties;
* - TestSystemExit
* - Test with hibernate
* - Scan for viruses
* - ant mavenDeployCental
* - ant mavenDeployCentral
* - Upload to SourceForge
* - Newsletter: send to h2database-news@googlegroups.com (http://groups.google.com/group/h2database-news)
* - Newsletter: prepare, send (always send to BCC!!)
......
......@@ -60,8 +60,8 @@ public class ConditionAndOr extends Condition {
}
public Expression getNotIfPossible(Session session) {
// (NOT (A OR B)) > (NOT(A) OR NOT(B))
// (NOT (A AND B)) > (NOT(A) OR NOT(B))
// (NOT (A OR B)): (NOT(A) AND NOT(B))
// (NOT (A AND B)): (NOT(A) OR NOT(B))
Expression l = left.getNotIfPossible(session);
if (l == null) {
l = new ConditionNot(left);
......@@ -116,11 +116,8 @@ public class ConditionAndOr extends Condition {
}
public Expression optimize(Session session) throws SQLException {
// TODO NULL: see
// http://www-cs-students.stanford.edu/~wlam/compsci/sqlnulls
// TODO test if all optimizations are switched off against all on
// (including performance)
// TODO document NULL exactly for every case
// TODO NULL: see wikipedia, http://www-cs-students.stanford.edu/~wlam/compsci/sqlnulls
// TODO test if all optimizations are switched off against all on (including performance)
left = left.optimize(session);
right = right.optimize(session);
int lc = left.getCost(), rc = right.getCost();
......@@ -129,9 +126,13 @@ public class ConditionAndOr extends Condition {
left = right;
right = t;
}
// TODO optimization: convert ((A=1 AND B=2) OR (A=1 AND B=3)) to (A=1
// AND (B=2 OR B=3))
if (SysProperties.OPTIMIZE_TWO_EQUALS && andOrType == AND) {
// TODO optimization: convert ((A=1 AND B=2) OR (A=1 AND B=3)) to (A=1 AND (B=2 OR B=3))
// this optimization does not work in the following case, but NOT is optimized before:
// CREATE TABLE TEST(A INT, B INT);
// INSERT INTO TEST VALUES(1, NULL);
// SELECT * FROM TEST WHERE NOT (B=A AND B=0); // no rows
// SELECT * FROM TEST WHERE NOT (B=A AND B=0 AND A=0); // 1, NULL
if (SysProperties.OPTIMIZE_NOT && SysProperties.OPTIMIZE_TWO_EQUALS && andOrType == AND) {
// try to add conditions (A=B AND B=1: add A=1)
if (left instanceof Comparison && right instanceof Comparison) {
Comparison compLeft = (Comparison) left;
......
......@@ -39,15 +39,16 @@ public class ConditionNot extends Condition {
public Expression optimize(Session session) throws SQLException {
if (!SysProperties.OPTIMIZE_NOT) {
condition = condition.optimize(session);
return this;
}
// TODO optimization: some cases are maybe possible to optimize further:
// (NOT ID >= 5)
Expression expr = condition.optimize(session);
Expression e2 = expr.getNotIfPossible(session);
Expression e2 = condition.getNotIfPossible(session);
if (e2 != null) {
return e2.optimize(session);
}
Expression expr = condition.optimize(session);
if (expr.isConstant()) {
Value v = expr.getValue(session);
if (v == ValueNull.INSTANCE) {
......
......@@ -139,11 +139,7 @@ public class Storage {
}
record.setDeleted(true);
int blockCount = record.getBlockCount();
if (database.isMultiVersion()) {
int todoMustFreeSpaceOnCommit;
} else {
free(pos, blockCount);
}
free(pos, blockCount);
recordCount--;
file.removeRecord(session, pos, record, blockCount);
}
......
......@@ -141,7 +141,7 @@ public class TableFilter implements ColumnResolver {
}
}
public void prepare() {
public void prepare() throws SQLException {
// forget all unused index conditions
for (int i = 0; i < indexConditions.size(); i++) {
IndexCondition condition = (IndexCondition) indexConditions.get(i);
......@@ -160,6 +160,12 @@ public class TableFilter implements ColumnResolver {
}
join.prepare();
}
if (filterCondition != null) {
filterCondition = filterCondition.optimize(session);
}
if (joinCondition != null) {
joinCondition = joinCondition.optimize(session);
}
}
public void startQuery(Session session) throws SQLException {
......@@ -364,9 +370,6 @@ public class TableFilter implements ColumnResolver {
TableFilter join = getTableFilter(0);
join.addJoin(filter, outer, on);
}
if (on != null) {
on.optimize(session);
}
}
private void mapAndAddFilter(Expression on) throws SQLException {
......
......@@ -148,6 +148,36 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript
/*
DROP TABLE ONE;
DROP TABLE TWO;
CREATE TABLE ONE(A INT PRIMARY KEY, B INT);
INSERT INTO ONE VALUES(0, NULL);
INSERT INTO ONE VALUES(1, 0);
INSERT INTO ONE VALUES(2, 1);
INSERT INTO ONE VALUES(3, 4);
CREATE TABLE TWO(A INT PRIMARY KEY, B INT);
INSERT INTO TWO VALUES(0, NULL);
INSERT INTO TWO VALUES(1, 0);
INSERT INTO TWO VALUES(2, 2);
INSERT INTO TWO VALUES(3, 3);
INSERT INTO TWO VALUES(4, NULL);
SELECT * FROM ONE A LEFT JOIN ONE B ON NOT A.A=A.A;
SELECT T0.A FROM TWO T0 WHERE NOT ((T0.B=T0.A ) AND (T0.B=0 )) AND (T0.B IS NULL );
SELECT T0.A, T1.A, T2.A, T3.A FROM ONE T0 LEFT JOIN ONE T1 ON NOT T0.B=T0.B LEFT JOIN ONE T2 ON T1.A=T2.A LEFT JOIN ONE T3 ON (T3.B=0 ) OR (T2.A<-1 );
SELECT T0.A, T1.A, T2.A, T3.A FROM TWO T0 LEFT JOIN ONE T1 ON T0.B<T0.A LEFT JOIN ONE T2 ON T1.A=T2.A LEFT JOIN TWO T3 ON (T2.A=T3.A ) OR (T3.B=0 );
SELECT T0.A, T1.A, T2.A, T3.A FROM TWO T0 LEFT JOIN ONE T1 ON T0.B>2 LEFT JOIN ONE T2 ON T1.A=T2.A LEFT JOIN TWO T3 ON T2.A IS NULL;
SELECT T0.A, T1.A FROM TWO T0 INNER JOIN TWO T1 ON NOT (((T0.A=T0.B ) AND (T0.B=0 )) OR (T0.A=T1.A )) OR (T0.A=T0.B );
SELECT T0.A, T1.A FROM ONE T0 INNER JOIN ONE T1 ON NOT ((T0.A=T0.B ) AND (T0.B=1 )) OR (T0.B=2 );
maximum file size increment is 16 MB
dont increase database size by more than 128 MB
......
......@@ -54,13 +54,20 @@ public class TestJoin extends TestBase {
// connections.add(c2);
/*
* DROP TABLE ONE; DROP TABLE TWO; CREATE TABLE ONE(A INT PRIMARY KEY, B
* INT); INSERT INTO ONE VALUES(0, NULL); INSERT INTO ONE VALUES(1, 0);
* INSERT INTO ONE VALUES(2, 1); INSERT INTO ONE VALUES(3, 4); CREATE
* TABLE TWO(A INT PRIMARY KEY, B INT); INSERT INTO TWO VALUES(0, NULL);
* INSERT INTO TWO VALUES(1, 0); INSERT INTO TWO VALUES(2, 2); INSERT
* INTO TWO VALUES(3, 3); INSERT INTO TWO VALUES(4, NULL);
*/
DROP TABLE ONE;
DROP TABLE TWO;
CREATE TABLE ONE(A INT PRIMARY KEY, B INT);
INSERT INTO ONE VALUES(0, NULL);
INSERT INTO ONE VALUES(1, 0);
INSERT INTO ONE VALUES(2, 1);
INSERT INTO ONE VALUES(3, 4);
CREATE TABLE TWO(A INT PRIMARY KEY, B INT);
INSERT INTO TWO VALUES(0, NULL);
INSERT INTO TWO VALUES(1, 0);
INSERT INTO TWO VALUES(2, 2);
INSERT INTO TWO VALUES(3, 3);
INSERT INTO TWO VALUES(4, NULL);
*/
execute("DROP TABLE ONE", null, true);
execute("DROP TABLE TWO", null, true);
......
......@@ -79,7 +79,7 @@ public class TestTimer extends TestBase {
println("validate");
try {
Connection conn = getConnection("timer");
int todoValidateTransactions;
// TODO validate transactions
Statement stat = conn.createStatement();
ResultSet rs = stat.executeQuery("SELECT COUNT(*) FROM TEST");
rs.next();
......
......@@ -1964,8 +1964,8 @@ SELECT CASE WHEN NOT (false IN (null)) THEN false END;
> rows: 1
select a.v as av, b.v as bv, a.v IN (b.v), not a.v IN (b.v) from test a, test b;
> AV BV A.V = B.V A.V <> B.V
> ----- ----- --------- ----------
> AV BV A.V = B.V NOT (A.V = B.V)
> ----- ----- --------- ---------------
> FALSE FALSE TRUE FALSE
> FALSE TRUE FALSE TRUE
> FALSE null null null
......
......@@ -506,3 +506,4 @@ lightweight builder
tunes elephant codewave incorrectly mytunesrss speeds cte honoured httpdocs department whereever dog dept edh oops flower music appends research plant
testview gaps birth vid weblog blojsom unsubscribe
imports bnot severity colon braces suppress star bxor band bor unary bsr puppy lor rcurly lcurly puppycrawl crawl ctor subclasses ell slist lnot land unchecked curly dtds question
forge
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论