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

Page store bugfix, prepare release

上级 ca717c37
...@@ -18,10 +18,19 @@ Change Log ...@@ -18,10 +18,19 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Issue 124: Hibernate schema validation failed for decimal/numeric columns.
<h2>Version 1.2.120 (2009-09-26)</h2>
<ul><li>This is a beta version.
</li><li>In version 1.2, the following system properties are now enabled by default:
h2.pageStore, h2.nullConcatIsNull, h2.optimizeInList. The default value for
h2.defaultMaxLengthInplaceLob is now 4096 (it was 1024 with version 1.1).
</li><li>New databases are now stored in the new 'page store' file format.
Existing databases are kept in the old file format. To use the old file format,
append ;PAGE_STORE=FALSE to the database URL or set the system property h2.pageStore to false.
</li><li>Issue 125: Renaming primary keys was not persistent. Fixed.
</li><li>Issue 124: Hibernate schema validation failed for decimal/numeric columns.
This problem is fixed in the Hibernate dialect that is included with H2 This problem is fixed in the Hibernate dialect that is included with H2
(src/tools/org/hibernate/dialect/H2Dialect.java.txt), but not in Hibernate yet. (src/tools/org/hibernate/dialect/H2Dialect.java.txt), but not in Hibernate yet.
</li><li>Issue 125: Renaming primary keys was not persistent. Fixed.
Unfortunately, databases created by this version can not be opened with older versions because of this change. Unfortunately, databases created by this version can not be opened with older versions because of this change.
</li><li>PostgreSQL compatibility: function LASTVAL() as an alias for IDENTITY(). </li><li>PostgreSQL compatibility: function LASTVAL() as an alias for IDENTITY().
</li><li>Linked tables now support default values when inserting, updating or merging. </li><li>Linked tables now support default values when inserting, updating or merging.
......
...@@ -14,12 +14,12 @@ public class Constants { ...@@ -14,12 +14,12 @@ public class Constants {
/** /**
* The build id is incremented for each public release. * The build id is incremented for each public release.
*/ */
public static final int BUILD_ID = 119; public static final int BUILD_ID = 120;
/** /**
* The build id of the last stable release. * The build id of the last stable release.
*/ */
public static final int BUILD_ID_STABLE = 118; public static final int BUILD_ID_STABLE = 119;
/** /**
* If H2 is compiled to be included in a product, this should be set to * If H2 is compiled to be included in a product, this should be set to
...@@ -32,12 +32,12 @@ public class Constants { ...@@ -32,12 +32,12 @@ public class Constants {
/** /**
* The build date is updated for each public release. * The build date is updated for each public release.
*/ */
public static final String BUILD_DATE = "2009-09-26"; public static final String BUILD_DATE = "2009-10-04";
/** /**
* The build date is updated for each public release. * The build date is updated for each public release.
*/ */
public static final String BUILD_DATE_STABLE = "2009-09-04"; public static final String BUILD_DATE_STABLE = "2009-09-26";
/** /**
* The TCP protocol version number 5. This protocol is used by the TCP * The TCP protocol version number 5. This protocol is used by the TCP
...@@ -59,7 +59,7 @@ public class Constants { ...@@ -59,7 +59,7 @@ public class Constants {
/** /**
* The minor version of this database. * The minor version of this database.
*/ */
public static final int VERSION_MINOR = 1; public static final int VERSION_MINOR = 2;
/** /**
* The version number (major.minor) of this database. * The version number (major.minor) of this database.
......
...@@ -1302,8 +1302,10 @@ public class Recover extends Tool implements DataHandler { ...@@ -1302,8 +1302,10 @@ public class Recover extends Tool implements DataHandler {
while (true) { while (true) {
store.seek(pageSize * next); store.seek(pageSize * next);
store.readFully(s2.getBytes(), 0, pageSize); store.readFully(s2.getBytes(), 0, pageSize);
s2.setPos(4); s2.reset();
int type = s2.readByte(); int type = s2.readByte();
s2.readShortInt();
s2.readInt();
if (type == (Page.TYPE_DATA_OVERFLOW | Page.FLAG_LAST)) { if (type == (Page.TYPE_DATA_OVERFLOW | Page.FLAG_LAST)) {
int size = s2.readShortInt(); int size = s2.readShortInt();
writer.println("-- chain: " + next + " type: " + type + " size: " + size); writer.println("-- chain: " + next + " type: " + type + " size: " + size);
......
--- special grammar and test cases --------------------------------------------------------------------------------------------- --- special grammar and test cases ---------------------------------------------------------------------------------------------
create table test(a int, b int) as select x, x from system_range(1, 100);
> ok
-- the table t1 should be processed first
explain select * from test t2, test t1 where t1.a=1 and t1.b = t2.b;
> PLAN
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT T2.A, T2.B, T1.A, T1.B FROM PUBLIC.TEST T1 /* PUBLIC.TEST_TABLE_SCAN */ /* WHERE T1.A = 1 */ INNER JOIN PUBLIC.TEST T2 /* PUBLIC.TEST_TABLE_SCAN */ ON 1=1 WHERE (T1.A = 1) AND (T1.B = T2.B)
> rows: 1
explain select * from test t1, test t2 where t1.a=1 and t1.b = t2.b;
> PLAN
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT T1.A, T1.B, T2.A, T2.B FROM PUBLIC.TEST T1 /* PUBLIC.TEST_TABLE_SCAN */ /* WHERE T1.A = 1 */ INNER JOIN PUBLIC.TEST T2 /* PUBLIC.TEST_TABLE_SCAN */ ON 1=1 WHERE (T1.A = 1) AND (T1.B = T2.B)
> rows: 1
drop table test;
> ok
create table test(id int, constraint pk primary key(id), constraint x unique(id));
> ok
select constraint_name from information_schema.indexes where table_name = 'TEST';
> CONSTRAINT_NAME
> ---------------
> PK
> rows: 1
drop table test;
> ok
create table test(id int, name varchar);
> ok
alter table test alter column id identity;
> ok
drop table test;
> ok
create table test(id int primary key, name varchar);
> ok
alter table test alter column id int auto_increment;
> ok
drop table test;
> ok
create table test(id identity) as select x from system_range(1, 4); create table test(id identity) as select x from system_range(1, 4);
> ok > ok
...@@ -2483,7 +2532,7 @@ select * from test2, test where test2.name = test.name; ...@@ -2483,7 +2532,7 @@ select * from test2, test where test2.name = test.name;
explain plan for select * from test, test2 where test2.name = test.name; explain plan for select * from test, test2 where test2.name = test.name;
> PLAN > PLAN
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT TEST.ID, TEST.NAME, TEST2.ID, TEST2.NAME FROM PUBLIC.TEST /* PUBLIC.TEST_TABLE_SCAN */ INNER JOIN PUBLIC.TEST2 /* PUBLIC.TEST2_TABLE_SCAN */ ON 1=1 WHERE TEST2.NAME = CAST(TEST.NAME AS VARCHAR_IGNORECASE(255)) > SELECT TEST.ID, TEST.NAME, TEST2.ID, TEST2.NAME FROM PUBLIC.TEST2 /* PUBLIC.TEST2_TABLE_SCAN */ INNER JOIN PUBLIC.TEST /* PUBLIC.TEST_TABLE_SCAN */ ON 1=1 WHERE TEST2.NAME = CAST(TEST.NAME AS VARCHAR_IGNORECASE(255))
> rows: 1 > rows: 1
select * from test, test2 where test2.name = test.name; select * from test, test2 where test2.name = test.name;
...@@ -6098,7 +6147,7 @@ not exists(select * from system_range(2, 32) r2 where r.x>r2.x and mod(r.x, r2.x ...@@ -6098,7 +6147,7 @@ not exists(select * from system_range(2, 32) r2 where r.x>r2.x and mod(r.x, r2.x
SELECT COUNT(*) FROM SYSTEM_RANGE(0, 2111222333); SELECT COUNT(*) FROM SYSTEM_RANGE(0, 2111222333);
> COUNT(*) > COUNT(*)
> ---------- > ----------
> 2111222333 > 2111222334
> rows: 1 > rows: 1
select * from system_range(2, 100) r where select * from system_range(2, 100) r where
...@@ -6182,7 +6231,7 @@ select * from t1 natural join t2; ...@@ -6182,7 +6231,7 @@ select * from t1 natural join t2;
explain select * from t1 natural join t2; explain select * from t1 natural join t2;
> PLAN > PLAN
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT T1.ID, T1.NAME FROM PUBLIC.T1 /* PUBLIC.T1_TABLE_SCAN */ INNER JOIN PUBLIC.T2 /* PUBLIC.T2_TABLE_SCAN */ ON 1=1 WHERE (PUBLIC.T1.ID = PUBLIC.T2.ID) AND (PUBLIC.T1.NAME = PUBLIC.T2.NAME) > SELECT T1.ID, T1.NAME FROM PUBLIC.T2 /* PUBLIC.T2_TABLE_SCAN */ INNER JOIN PUBLIC.T1 /* PUBLIC.T1_TABLE_SCAN */ ON 1=1 WHERE (PUBLIC.T1.ID = PUBLIC.T2.ID) AND (PUBLIC.T1.NAME = PUBLIC.T2.NAME)
> rows: 1 > rows: 1
drop table t1; drop table t1;
...@@ -6218,8 +6267,8 @@ select c.*, i.*, l.* from customer c natural join invoice i natural join INVOICE ...@@ -6218,8 +6267,8 @@ select c.*, i.*, l.* from customer c natural join invoice i natural join INVOICE
explain select c.*, i.*, l.* from customer c natural join invoice i natural join INVOICE_LINE l; explain select c.*, i.*, l.* from customer c natural join invoice i natural join INVOICE_LINE l;
> PLAN > PLAN
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT C.CUSTOMERID, C.CUSTOMER_NAME, I.INVOICEID, I.INVOICE_TEXT, L.LINE_ID, L.LINE_TEXT FROM PUBLIC.CUSTOMER C /* PUBLIC.CUSTOMER_TABLE_SCAN */ INNER JOIN PUBLIC.INVOICE I /* PUBLIC.INVOICE_TABLE_SCAN */ ON 1=1 /* WHERE PUBLIC.C.CUSTOMERID = PUBLIC.I.CUSTOMERID */ INNER JOIN PUBLIC.INVOICE_LINE L /* PUBLIC.INVOICE_LINE_TABLE_SCAN */ ON 1=1 WHERE (PUBLIC.C.CUSTOMERID = PUBLIC.I.CUSTOMERID) AND ((PUBLIC.I.CUSTOMERID = PUBLIC.L.CUSTOMERID) AND (PUBLIC.I.INVOICEID = PUBLIC.L.INVOICEID)) > SELECT C.CUSTOMERID, C.CUSTOMER_NAME, I.INVOICEID, I.INVOICE_TEXT, L.LINE_ID, L.LINE_TEXT FROM PUBLIC.INVOICE I /* PUBLIC.INVOICE_TABLE_SCAN */ INNER JOIN PUBLIC.INVOICE_LINE L /* PUBLIC.INVOICE_LINE_TABLE_SCAN */ ON 1=1 /* WHERE (PUBLIC.I.CUSTOMERID = PUBLIC.L.CUSTOMERID) AND (PUBLIC.I.INVOICEID = PUBLIC.L.INVOICEID) */ INNER JOIN PUBLIC.CUSTOMER C /* PUBLIC.CUSTOMER_TABLE_SCAN */ ON 1=1 WHERE (PUBLIC.C.CUSTOMERID = PUBLIC.I.CUSTOMERID) AND ((PUBLIC.I.CUSTOMERID = PUBLIC.L.CUSTOMERID) AND (PUBLIC.I.INVOICEID = PUBLIC.L.INVOICEID))
> rows: 1 > rows: 1
drop table customer; drop table customer;
...@@ -7000,7 +7049,7 @@ SELECT ID, X1||'!', XT||'!', X_SM||'!', XB||'!', XD||'!', XD2||'!', XR||'!' FROM ...@@ -7000,7 +7049,7 @@ SELECT ID, X1||'!', XT||'!', X_SM||'!', XB||'!', XD||'!', XD2||'!', XR||'!' FROM
> 0 FALSE! 0! 0! 0! 0.00! 0.0! 0.0! > 0 FALSE! 0! 0! 0! 0.00! 0.0! 0.0!
> 1 TRUE! 1! 1! 1! 1.00! 1.0! 1.0! > 1 TRUE! 1! 1! 1! 1.00! 1.0! 1.0!
> 4 TRUE! 4! 4! 4! 4.00! 4.0! 4.0! > 4 TRUE! 4! 4! 4! 4.00! 4.0! 4.0!
> null ! ! ! ! ! ! ! > null null null null null null null null
> rows: 5 > rows: 5
DROP TABLE TEST; DROP TABLE TEST;
...@@ -7232,9 +7281,9 @@ INSERT INTO TEST VALUES(?, ?, ?); ...@@ -7232,9 +7281,9 @@ INSERT INTO TEST VALUES(?, ?, ?);
}; };
> update count: 9 > update count: 9
SELECT NAME || ': ' || GROUP_CONCAT(VALUE ORDER BY NAME, VALUE DESC SEPARATOR ', ') FROM TEST GROUP BY NAME; SELECT IFNULL(NAME, '') || ': ' || GROUP_CONCAT(VALUE ORDER BY NAME, VALUE DESC SEPARATOR ', ') FROM TEST GROUP BY NAME;
> (NAME || ': ') || GROUP_CONCAT(VALUE ORDER BY NAME, VALUE DESC SEPARATOR ', ') > (IFNULL(NAME, '') || ': ') || GROUP_CONCAT(VALUE ORDER BY NAME, VALUE DESC SEPARATOR ', ')
> ------------------------------------------------------------------------------ > ------------------------------------------------------------------------------------------
> Apples: 1.50, 1.20, 1.10 > Apples: 1.50, 1.20, 1.10
> Oranges: 2.05, 1.80 > Oranges: 2.05, 1.80
> Bananas: 2.50 > Bananas: 2.50
......
...@@ -298,7 +298,10 @@ public class TestTools extends TestBase { ...@@ -298,7 +298,10 @@ public class TestTools extends TestBase {
conn = DriverManager.getConnection(url, "another", "another"); conn = DriverManager.getConnection(url, "another", "another");
stat = conn.createStatement(); stat = conn.createStatement();
String suffix = config.pageStore ? ".h2.sql" : ".data.sql"; String suffix = ".data.sql";
if (new File(baseDir + "/toolsRecover.h2.sql").exists()) {
suffix = ".h2.sql";
}
stat.execute("runscript from '" + baseDir + "/toolsRecover" + suffix + "'"); stat.execute("runscript from '" + baseDir + "/toolsRecover" + suffix + "'");
rs = stat.executeQuery("select * from \"test 2\""); rs = stat.executeQuery("select * from \"test 2\"");
assertFalse(rs.next()); assertFalse(rs.next());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论