diff --git a/README.md b/README.md index 70de378686..4f2f2fa58c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ More information: https://h2database.com com.h2database h2 - 2.1.210 + 2.1.212 ``` diff --git a/h2/pom.xml b/h2/pom.xml index 1bc18cf054..9ee85482e9 100644 --- a/h2/pom.xml +++ b/h2/pom.xml @@ -4,7 +4,7 @@ com.h2database h2 - 2.2.219-SNAPSHOT + 2.1.212 jar H2 Database Engine https://h2database.com diff --git a/h2/src/docsrc/html/changelog.html b/h2/src/docsrc/html/changelog.html index cfe9e509ab..2552c84e4f 100644 --- a/h2/src/docsrc/html/changelog.html +++ b/h2/src/docsrc/html/changelog.html @@ -21,11 +21,17 @@

Change Log

Next Version (unreleased)

+ +

Next Version 2.1.212 (2022-04-09)

+ -

Version 1.4.200 (2019-10-14)

- - diff --git a/h2/src/docsrc/html/download-archive.html b/h2/src/docsrc/html/download-archive.html index 09b4b11a50..730287d723 100644 --- a/h2/src/docsrc/html/download-archive.html +++ b/h2/src/docsrc/html/download-archive.html @@ -28,6 +28,10 @@

Distribution

+ + + + diff --git a/h2/src/docsrc/html/download.html b/h2/src/docsrc/html/download.html index 768c2ea78c..a0f1a00f33 100644 --- a/h2/src/docsrc/html/download.html +++ b/h2/src/docsrc/html/download.html @@ -27,12 +27,12 @@

Version ${version} (${versionDate})


-

Version 2.0.206 (2022-01-04)

+

Version 2.1.210 (2022-01-17)

-Windows Installer -(SHA1 checksum: 982dff9c88412b00b3ced52b6870753e0133be07)
-Platform-Independent Zip -(SHA1 checksum: 85d6d8f552661c2f8e1b86c10a12ab4bb6b0d29b)
+Windows Installer +(SHA1 checksum: ff795bf6ccefd5950d5080b596d835d13206b325)
+Platform-Independent Zip +(SHA1 checksum: 6ede99a0a987971557e878de4eddcb796d604323)

Archive Downloads

diff --git a/h2/src/main/org/h2/engine/Constants.java b/h2/src/main/org/h2/engine/Constants.java index becd10a21a..d85c844e8c 100644 --- a/h2/src/main/org/h2/engine/Constants.java +++ b/h2/src/main/org/h2/engine/Constants.java @@ -15,18 +15,18 @@ public class Constants { /** * The build date is updated for each public release. */ - public static final String BUILD_DATE = "2022-01-17"; + public static final String BUILD_DATE = "2022-04-09"; /** * Sequential version number. Even numbers are used for official releases, * odd numbers are used for development builds. */ - public static final int BUILD_ID = 219; + public static final int BUILD_ID = 212; /** * Whether this is a snapshot version. */ - public static final boolean BUILD_SNAPSHOT = true; + public static final boolean BUILD_SNAPSHOT = false; /** * If H2 is compiled to be included in a product, this should be set to @@ -78,7 +78,7 @@ public class Constants { /** * The minor version of this database. */ - public static final int VERSION_MINOR = 2; + public static final int VERSION_MINOR = 1; /** * The lock mode that means no locking is used at all. diff --git a/h2/src/main/org/h2/expression/ArrayElementReference.java b/h2/src/main/org/h2/expression/ArrayElementReference.java index d02245e968..77f00ee421 100644 --- a/h2/src/main/org/h2/expression/ArrayElementReference.java +++ b/h2/src/main/org/h2/expression/ArrayElementReference.java @@ -8,6 +8,7 @@ import org.h2.api.ErrorCode; import org.h2.engine.SessionLocal; import org.h2.message.DbException; +import org.h2.mvstore.db.Store; import org.h2.value.TypeInfo; import org.h2.value.Value; import org.h2.value.ValueArray; @@ -59,7 +60,7 @@ public Expression optimize(SessionLocal session) { } break; default: - throw DbException.getInvalidExpressionTypeException("Array", left); + throw Store.getInvalidExpressionTypeException("Array", left); } return this; } diff --git a/h2/src/main/org/h2/expression/FieldReference.java b/h2/src/main/org/h2/expression/FieldReference.java index 248b937a55..64f33b8f52 100644 --- a/h2/src/main/org/h2/expression/FieldReference.java +++ b/h2/src/main/org/h2/expression/FieldReference.java @@ -10,6 +10,7 @@ import org.h2.api.ErrorCode; import org.h2.engine.SessionLocal; import org.h2.message.DbException; +import org.h2.mvstore.db.Store; import org.h2.util.ParserUtil; import org.h2.value.ExtTypeInfoRow; import org.h2.value.TypeInfo; @@ -50,7 +51,7 @@ public Expression optimize(SessionLocal session) { arg = arg.optimize(session); TypeInfo type = arg.getType(); if (type.getValueType() != Value.ROW) { - throw DbException.getInvalidExpressionTypeException("ROW", arg); + throw Store.getInvalidExpressionTypeException("ROW", arg); } int ordinal = 0; for (Entry entry : ((ExtTypeInfoRow) type.getExtTypeInfo()).getFields()) { diff --git a/h2/src/main/org/h2/expression/function/ArrayFunction.java b/h2/src/main/org/h2/expression/function/ArrayFunction.java index ff9798d0a4..1da2c408f4 100644 --- a/h2/src/main/org/h2/expression/function/ArrayFunction.java +++ b/h2/src/main/org/h2/expression/function/ArrayFunction.java @@ -13,6 +13,7 @@ import org.h2.expression.Expression; import org.h2.expression.TypedValueExpression; import org.h2.message.DbException; +import org.h2.mvstore.db.Store; import org.h2.value.TypeInfo; import org.h2.value.Value; import org.h2.value.ValueArray; @@ -152,7 +153,7 @@ public Expression optimize(SessionLocal session) { type = arg.getType(); int t = type.getValueType(); if (t != Value.ARRAY && t != Value.NULL) { - throw DbException.getInvalidExpressionTypeException(getName() + " array argument", arg); + throw Store.getInvalidExpressionTypeException(getName() + " array argument", arg); } break; } diff --git a/h2/src/main/org/h2/expression/function/BitFunction.java b/h2/src/main/org/h2/expression/function/BitFunction.java index 7172ff8b66..ac9cd23508 100644 --- a/h2/src/main/org/h2/expression/function/BitFunction.java +++ b/h2/src/main/org/h2/expression/function/BitFunction.java @@ -13,6 +13,7 @@ import org.h2.expression.aggregate.Aggregate; import org.h2.expression.aggregate.AggregateType; import org.h2.message.DbException; +import org.h2.mvstore.db.Store; import org.h2.util.Bits; import org.h2.value.DataType; import org.h2.value.TypeInfo; @@ -713,7 +714,7 @@ public static TypeInfo checkArgType(Expression arg) { case Value.BIGINT: return t; } - throw DbException.getInvalidExpressionTypeException("bit function argument", arg); + throw Store.getInvalidExpressionTypeException("bit function argument", arg); } @Override diff --git a/h2/src/main/org/h2/expression/function/DateTimeFunction.java b/h2/src/main/org/h2/expression/function/DateTimeFunction.java index 9f9c2add21..8dae5d514c 100644 --- a/h2/src/main/org/h2/expression/function/DateTimeFunction.java +++ b/h2/src/main/org/h2/expression/function/DateTimeFunction.java @@ -5,6 +5,7 @@ */ package org.h2.expression.function; +import org.h2.mvstore.db.Store; import static org.h2.util.DateTimeUtils.MILLIS_PER_DAY; import static org.h2.util.DateTimeUtils.NANOS_PER_DAY; import static org.h2.util.DateTimeUtils.NANOS_PER_HOUR; @@ -973,7 +974,7 @@ public Expression optimize(SessionLocal session) { int valueType = type.getValueType(); // TODO set scale when possible if (!DataType.isDateTimeType(valueType)) { - throw DbException.getInvalidExpressionTypeException("DATE_TRUNC datetime argument", left); + throw Store.getInvalidExpressionTypeException("DATE_TRUNC datetime argument", left); } else if (session.getMode().getEnum() == ModeEnum.PostgreSQL && valueType == Value.DATE) { type = TypeInfo.TYPE_TIMESTAMP_TZ; } diff --git a/h2/src/main/org/h2/expression/function/MathFunction.java b/h2/src/main/org/h2/expression/function/MathFunction.java index cfae2b4a9e..62731d6f0a 100644 --- a/h2/src/main/org/h2/expression/function/MathFunction.java +++ b/h2/src/main/org/h2/expression/function/MathFunction.java @@ -13,6 +13,7 @@ import org.h2.expression.Expression; import org.h2.expression.TypedValueExpression; import org.h2.message.DbException; +import org.h2.mvstore.db.Store; import org.h2.value.DataType; import org.h2.value.TypeInfo; import org.h2.value.Value; @@ -238,7 +239,7 @@ public Expression optimize(SessionLocal session) { if (valueType == Value.NULL) { commonType = TypeInfo.TYPE_BIGINT; } else if (!DataType.isNumericType(valueType)) { - throw DbException.getInvalidExpressionTypeException("MOD argument", + throw Store.getInvalidExpressionTypeException("MOD argument", DataType.isNumericType(left.getType().getValueType()) ? right : left); } type = DataType.isNumericType(divisorType.getValueType()) ? divisorType : commonType; @@ -378,7 +379,7 @@ private Expression optimizeRound(int scale, boolean scaleIsKnown, boolean scaleI break; } default: - throw DbException.getInvalidExpressionTypeException(getName() + " argument", left); + throw Store.getInvalidExpressionTypeException(getName() + " argument", left); } if (scaleIsNull) { return TypedValueExpression.get(ValueNull.INSTANCE, type); diff --git a/h2/src/main/org/h2/message/DbException.java b/h2/src/main/org/h2/message/DbException.java index a2549073df..756dcca55f 100644 --- a/h2/src/main/org/h2/message/DbException.java +++ b/h2/src/main/org/h2/message/DbException.java @@ -33,13 +33,9 @@ import org.h2.jdbc.JdbcSQLTimeoutException; import org.h2.jdbc.JdbcSQLTransactionRollbackException; import org.h2.jdbc.JdbcSQLTransientException; -import org.h2.util.HasSQL; import org.h2.util.SortedProperties; import org.h2.util.StringUtils; import org.h2.util.Utils; -import org.h2.value.TypeInfo; -import org.h2.value.Typed; -import org.h2.value.Value; /** * This exception wraps a checked exception. @@ -302,21 +298,6 @@ public static DbException getInvalidValueException(String param, Object value) { return get(INVALID_VALUE_2, value == null ? "null" : value.toString(), param); } - /** - * Gets a SQL exception meaning the type of expression is invalid or unknown. - * - * @param param the name of the parameter - * @param e the expression - * @return the exception - */ - public static DbException getInvalidExpressionTypeException(String param, Typed e) { - TypeInfo type = e.getType(); - if (type.getValueType() == Value.UNKNOWN) { - return get(UNKNOWN_DATA_TYPE_1, (e instanceof HasSQL ? (HasSQL) e : type).getTraceSQL()); - } - return get(INVALID_VALUE_2, type.getTraceSQL(), param); - } - /** * Gets a SQL exception meaning this value is too long. * diff --git a/h2/src/main/org/h2/mvstore/MVStoreTool.java b/h2/src/main/org/h2/mvstore/MVStoreTool.java index ff7771e75b..feefd0b93d 100644 --- a/h2/src/main/org/h2/mvstore/MVStoreTool.java +++ b/h2/src/main/org/h2/mvstore/MVStoreTool.java @@ -21,7 +21,6 @@ import org.h2.compress.CompressLZF; import org.h2.compress.Compressor; import org.h2.engine.Constants; -import org.h2.message.DbException; import org.h2.mvstore.tx.TransactionStore; import org.h2.mvstore.type.BasicDataType; import org.h2.mvstore.type.StringDataType; @@ -442,7 +441,7 @@ public static void compact(String fileName, boolean compress) { compact(fileName, tempName, compress); try { FileUtils.moveAtomicReplace(tempName, fileName); - } catch (DbException e) { + } catch (MVStoreException e) { String newName = fileName + Constants.SUFFIX_MV_STORE_NEW_FILE; FileUtils.delete(newName); FileUtils.move(tempName, newName); diff --git a/h2/src/main/org/h2/mvstore/db/Store.java b/h2/src/main/org/h2/mvstore/db/Store.java index 35c3a58207..4f051b2e0d 100644 --- a/h2/src/main/org/h2/mvstore/db/Store.java +++ b/h2/src/main/org/h2/mvstore/db/Store.java @@ -31,8 +31,12 @@ import org.h2.store.InDoubtTransaction; import org.h2.store.fs.FileChannelInputStream; import org.h2.store.fs.FileUtils; +import org.h2.util.HasSQL; import org.h2.util.StringUtils; import org.h2.util.Utils; +import org.h2.value.TypeInfo; +import org.h2.value.Typed; +import org.h2.value.Value; /** * A store with open tables. @@ -167,6 +171,22 @@ DbException convertMVStoreException(MVStoreException e) { } } + /** + * Gets a SQL exception meaning the type of expression is invalid or unknown. + * + * @param param the name of the parameter + * @param e the expression + * @return the exception + */ + public static DbException getInvalidExpressionTypeException(String param, Typed e) { + TypeInfo type = e.getType(); + if (type.getValueType() == Value.UNKNOWN) { + return DbException.get(ErrorCode.UNKNOWN_DATA_TYPE_1, + (e instanceof HasSQL ? (HasSQL) e : type).getTraceSQL()); + } + return DbException.get(ErrorCode.INVALID_VALUE_2, type.getTraceSQL(), param); + } + public MVStore getMvStore() { return mvStore; } diff --git a/h2/src/test/org/h2/samples/newsfeed.sql b/h2/src/test/org/h2/samples/newsfeed.sql index 82c483be5c..60f9a1060c 100644 --- a/h2/src/test/org/h2/samples/newsfeed.sql +++ b/h2/src/test/org/h2/samples/newsfeed.sql @@ -7,6 +7,7 @@ CREATE TABLE VERSION(ID INT PRIMARY KEY, VERSION VARCHAR, CREATED VARCHAR); INSERT INTO VERSION VALUES +(155, '2.1.212', '2022-04-09'), (154, '2.1.210', '2022-01-17'), (153, '2.0.206', '2022-01-04'), (152, '2.0.204', '2021-12-21'), @@ -19,8 +20,7 @@ INSERT INTO VERSION VALUES (145, '1.4.195', '2017-04-23'), (144, '1.4.194', '2017-03-10'), (143, '1.4.193', '2016-10-31'), -(142, '1.4.192', '2016-05-26'), -(141, '1.4.191', '2016-01-21'); +(142, '1.4.192', '2016-05-26'); CREATE TABLE CHANNEL(TITLE VARCHAR, LINK VARCHAR, DESC VARCHAR, LANGUAGE VARCHAR, PUB TIMESTAMP, LAST TIMESTAMP, AUTHOR VARCHAR); diff --git a/h2/src/tools/org/h2/build/doc/dictionary.txt b/h2/src/tools/org/h2/build/doc/dictionary.txt index 906b5aa4f7..32bf11dd5e 100644 --- a/h2/src/tools/org/h2/build/doc/dictionary.txt +++ b/h2/src/tools/org/h2/build/doc/dictionary.txt @@ -847,6 +847,6 @@ ptf overlay precedes regr slope sqlerror multiset submultiset inout sxx sxy inte orientation eternal consideration erased fedc npgsql powers fffd uencode ampersand noversion ude considerable intro entirely skeleton discouraged pearson coefficient squares covariance mytab debuggers fonts glyphs filestore backstop tie breaker lockable lobtx btx waiter accounted aiobe spf resolvers generators -accidental wbr subtree recognising supplementary happier hasn officially rnrn sonatype abandoned ldt odt -ver wal rough configuring xerial seemed journaling cited occasional worse pragma interactions journal approximately -drastically competitive +abandoned accidental approximately cited competitive configuring drastically happier hasn interactions journal +journaling ldt occasional odt officially pragma ration recognising rnrn rough seemed sonatype supplementary subtree ver +wal wbr worse xerial
2.1.212Windows InstallerPlatform-Independent Zip
2.1.210 Windows Installer Platform-Independent Zip