From 405aa8734075504355643a9d608e387b3124823a Mon Sep 17 00:00:00 2001 From: Andrei Tokar Date: Thu, 7 Apr 2022 23:51:04 -0400 Subject: [PATCH 1/7] break DbException dependency on Value to control the size of MVStore jar --- .../h2/expression/ArrayElementReference.java | 3 ++- .../org/h2/expression/FieldReference.java | 3 ++- .../h2/expression/function/ArrayFunction.java | 3 ++- .../h2/expression/function/BitFunction.java | 3 ++- .../expression/function/DateTimeFunction.java | 3 ++- .../h2/expression/function/MathFunction.java | 5 +++-- h2/src/main/org/h2/message/DbException.java | 19 ------------------- h2/src/main/org/h2/mvstore/MVStoreTool.java | 3 +-- h2/src/main/org/h2/mvstore/db/Store.java | 19 +++++++++++++++++++ 9 files changed, 33 insertions(+), 28 deletions(-) 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..d887aea276 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,21 @@ 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; } From 02bff4503e8e85a64e5f152ca625ff993033de90 Mon Sep 17 00:00:00 2001 From: Andrei Tokar Date: Thu, 7 Apr 2022 23:59:38 -0400 Subject: [PATCH 2/7] dictionary, long lines, changelist --- h2/src/docsrc/html/changelog.html | 350 +----------------- .../main/org/h2/mvstore/db/LobStorageMap.java | 3 +- h2/src/main/org/h2/mvstore/db/Store.java | 3 +- h2/src/test/org/h2/test/db/TestLob.java | 5 +- h2/src/tools/org/h2/build/doc/dictionary.txt | 4 +- 5 files changed, 23 insertions(+), 342 deletions(-) diff --git a/h2/src/docsrc/html/changelog.html b/h2/src/docsrc/html/changelog.html index 8f6b322ac5..1e1ab80767 100644 --- a/h2/src/docsrc/html/changelog.html +++ b/h2/src/docsrc/html/changelog.html @@ -21,8 +21,20 @@

Change Log

Next Version (unreleased)

    +
  • Nothing yet ... +
  • +
+ +

Next Version 2.1.220 (2022-04-07)

+
    +
  • Issue #3471: Possibility of corruption after SHUTDOWN DEFRAG +
  • +
  • Issue #3473: DROP TABLE/INDEX causes memory leak +
  • Issue #1808: Occasional NPE in concurrent update of LOB
  • +
  • Issue #3457: Increase max length of VAR* types +
  • Issue #3439: Cannot use enum values in JSON without explicit casts
  • Issue #3426: Regression: BIT(1) is not accepted in MySQL compatibility mode @@ -32,7 +44,7 @@

    Next Version (unreleased)

  • Issue #3414: H2 2.1.210: Query with Parameters throws NPE at org.h2.command.query.Query.getParameterValues(Query.java:449)
  • -
  • Issue #3413: Parser can't parse REFERENCES … NOT NULL +
  • Issue #3413: Parser can't parse REFERENCES … NOT NULL
  • Issue #3410: OOME with nested derived tables
  • @@ -941,340 +953,4 @@

    Version 2.0.202 (2021-11-25)

-

Version 1.4.200 (2019-10-14)

-
    -
  • PR #2168: Add non-standard SNAPSHOT isolation level to MVStore databases -
  • -
  • Issue #2165: Problem with secondary index on SERIALIZABLE isolation level -
  • -
  • Issue #2161: Remove undocumented PageStore-only FILE_LOCK=SERIALIZED -
  • -
  • PR #2155: Reduce code duplication -
  • -
  • Issue #1894: Confusing error message when database creation is disallowed -
  • -
  • Issue #2123: Random failures in TestTransactionStore -
  • -
  • Issue #2153: Different behavior in SET LOCK_TIMEOUT after 1.4.197 -
  • -
  • Issue #2150: Remove MULTI_THREADED setting and use multi-threaded MVStore and single-threaded PageStore backends -
  • -
  • Issue #216: Support READ UNCOMMITTED isolation level in MVStore mode -
  • -
  • Issue #678: Support REPEATABLE READ isolation level in MVStore mode -
  • -
  • Issue #174: Support SERIALIZABLE isolation level in MVStore mode -
  • -
  • Issue #2144: MVStore: read uncommitted doesn't see committed rows -
  • -
  • Issue #2142: CURRVAL / CURRENT VALUE FOR should return the value for the current session -
  • -
  • Issue #2136: ConstraintCheck concurrency regression -
  • -
  • PR #2137: Don't use SYSTEM_RANGE for SELECT without a FROM -
  • -
  • PR #2134: Assorted fixes and other changes in DateTimeUtils -
  • -
  • PR #2133: Optimize COUNT([ALL] constant) and other changes -
  • -
  • PR #2132: Typo and another bug in MVStore.readStoreHeader() -
  • -
  • Issue #2130: Group-sorted query returns invalid results with duplicate grouped columns in select list -
  • -
  • Issue #2120: Add IF EXISTS clause to column name in ALTER TABLE ALTER COLUMN statement -
  • -
  • Issue #521: Add support for the TIME WITH TIME ZONE data type -
  • -
  • PR #2127: Fix race condition / performance issue during snapshotting -
  • -
  • Issue #2124: MVStore build is broken -
  • -
  • PR #2122: Add support for LMT in time zones and fix large years in datetime values -
  • -
  • Issue #2067: Incorrect chunk space allocation during chunks movement -
  • -
  • PR #2066: Not so happy path - "four alternatives" implementation -
  • -
  • PR #2121: Reduce code duplication for datetime API with custom Calendar instances -
  • -
  • PR #2119: SQL: statement read consistency -
  • -
  • Issue #2116: Empty IN() operator should result in error (MSSQL) -
  • -
  • Issue #2036: CAST from TIME to TIMESTAMP returns incorrect result -
  • -
  • PR #2114: Assorted changes -
  • -
  • PR #2113: Add feature F411: Time zone specification -
  • -
  • PR #2111: CURRENT_CATALOG, SET CATALOG and other changes -
  • -
  • Issue #2109: IW date formatting does not produce proper output -
  • -
  • PR #2104: Fix ordinary grouping set with parentheses and empty grouping set in GROUP BY -
  • -
  • Issue #2103: Add QUOTE_IDENT() function to enquote an identifier in SQL -
  • -
  • Issue #2075: Add EXECUTE IMMEDIATE implementation -
  • -
  • PR #2101: Fix infinite loop in Schema.removeChildrenAndResources() -
  • -
  • Issue #2096: Convert LEFT and RIGHT to keywords and disallow comma before closing parenthesis -
  • -
  • PR #2098: Fix typos -
  • -
  • Issue #1305 / PR #2097: Remove unused and outdated website translation infrastructure -
  • -
  • PR #2093: CURRENT VALUE FOR and other sequence-related changes -
  • -
  • PR #2092: Allow to simulate usage of multiple catalogs by one connection -
  • -
  • PR #2091: Oracle mode now uses DECIMAL with NEXTVAL -
  • -
  • Issue #2088: Division by zero caused by evaluation of global conditions before local conditions -
  • -
  • Issue #2086: TCP_QUICKACK on server socket -
  • -
  • Issue #2073: TableLink should not pass queries to DatabaseMetaData.getColumns() -
  • -
  • Issue #2074: MySQL and MSSQLServer Mode: TRUNCATE TABLE should always RESTART IDENTITY -
  • -
  • Issue #2063: MySQL mode: "drop foreign key if exists" support -
  • -
  • PR #2061: Use VirtualTable as a base class for RangeTable -
  • -
  • PR #2059: Parse IN predicate with multiple subqueries correctly -
  • -
  • PR #2057: Fix TestCrashAPI failure with Statement.enquoteIdentifier() -
  • -
  • PR #2056: Happy path: speed up database opening -
  • -
  • Issue #2051: The website shows outdated information about the storage engine -
  • -
  • PR #2049: bugfix - mvstore data lost issue when partial write occurs -
  • -
  • PR #2047: File maintenance -
  • -
  • PR #2046: Recovery mode -
  • -
  • Issue #2044: setTransactionIsolation always call commit() even if transaction is auto-commit -
  • -
  • Issue #2042: Add possibility to specify generated columns for query in web console -
  • -
  • Issue #2040: INFORMATION_SCHEMA.SETTINGS contains irrelevant settings -
  • -
  • PR #2038: MVMap: lock reduction on updates -
  • -
  • PR #2037: Fix SYS_GUID, RAWTOHEX, and HEXTORAW in Oracle mode -
  • -
  • Issue #2016: ExpressionColumn.mapColumns() performance complexity is quadratic -
  • -
  • Issue #2028: Sporadic inconsistent state after concurrent UPDATE in 1.4.199 -
  • -
  • PR #2033: Assorted changes -
  • -
  • Issue #2025: Incorrect query result when (OFFSET + FETCH) > Integer.MAX_VALUE -
  • -
  • PR #2023: traverseDown() code deduplication -
  • -
  • PR #2022: Mvmap minor cleanup -
  • -
  • Issue #2020: Wrong implementation of IN predicate with subquery -
  • -
  • PR #2003: Change dead chunks determination algorithm -
  • -
  • Issue #2013: DECIMAL is casted to double in ROUND function -
  • -
  • PR #2011: ZonedDateTime and (INTERVAL / INTERVAL) -
  • -
  • Issue #1997: TestRandomSQL failure with ClassCastException -
  • -
  • Issue #2007: PostgreSQL compatibility mode: support ON CONFLICT DO NOTHING -
  • -
  • Issue #1927: Do not allow commit() when auto-commit is enabled -
  • -
  • PR #1998: Reduce TxCounter memory footprint -
  • -
  • PR #1999: Make RootReference lock re-entrant -
  • -
  • PR #2001: Test improvements, OOME elimination -
  • -
  • Issue #1995: Obscure condition in MVPrimaryIndex.extractPKFromRow() -
  • -
  • Issue #1975: Add client ip address to information_schema -
  • -
  • PR #1982: Hindi language translation added -
  • -
  • Issue #1985: Add thread number to TCP server thread names -
  • -
  • Do not allow empty password for management DB -
  • -
  • Issue #1978: getGeneratedKeys() can use the same rules as FINAL TABLE -
  • -
  • PR #1977: Change JSON literals and add support for compound character literals -
  • -
  • PR #1974: Use proleptic Gregorian calendar for datetime values -
  • -
  • Issue #1847: Add support for data change delta tables -
  • -
  • PR #1971: Add maximum cardinality parameter to ARRAY data type -
  • -
  • PR #1970: Switch from log map rename to "committed" marker log record -
  • -
  • PR #1969: Add unique predicate -
  • -
  • Issue #1963: Expression.addFilterConditions() with outer joins -
  • -
  • PR #1966: Add standard CURRENT_SCHEMA function -
  • -
  • PR #1964: Add Feature T571: Truth value tests -
  • -
  • PR #1962: Fix data types of optimized conditions -
  • -
  • PR #1961: Failure to open DB after improper shutdown -
  • -
  • Issue #1957: NullPointerException with DISTINCT and ORDER BY CASE -
  • -
  • PR #1956: Fix row value handling in the null predicate -
  • -
  • PR #1955: Add standard UNKNOWN literal -
  • -
  • Issue #1952: Connection.setSchema doesn't work with query cache -
  • -
  • PR #1951: Assorted changes -
  • -
  • PR #1950: Fix NULL handling in ARRAY_AGG -
  • -
  • PR #1949: Extract aggregate and window functions into own pages in documentation -
  • -
  • PR #1948: Add standard LOG() function with two arguments -
  • -
  • Issue #1935: Improve file locking on shared filesystems like SMB -
  • -
  • PR #1946: Reimplement table value constructor on top of Query -
  • -
  • PR #1945: Fix IN (SELECT UNION with OFFSET/FETCH) -
  • -
  • Issue #1942: MySQL Mode: convertInsertNullToZero should be turned off by default? -
  • -
  • Issue #1940: MySQL Mode: Modify column from NOT NULL to NULL syntax -
  • -
  • PR #1941: Extract OFFSET / FETCH handling from Select and SelectUnion to Query -
  • -
  • Issue #1938: Regression with CREATE OR REPLACE VIEW. Causes "Duplicate column name" exception. -
  • -
  • PR #1937: Get rid of FunctionCursorResultSet -
  • -
  • Issue #1932: Incoherence between DbSettings.mvStore and getSettings() -
  • -
  • PR #1931: Fix wildcard expansion for multiple schemas -
  • -
  • PR #1930: Move PageStore table engine into own package -
  • -
  • PR #1929: Initial implementation of type predicate and other changes -
  • -
  • PR #1926: Assorted improvements for BINARY data type -
  • -
  • Issue #1925: Support SQL Server binary literal syntax -
  • -
  • Issue #1918: MySQL: CREATE TABLE with both CHARSET and COMMENT failed -
  • -
  • Issue #1913: MySQL: auto_increment changing SQL not supported -
  • -
  • Issue #1585: The translate function on DB2 mode could have parameters order changed -
  • -
  • PR #1914: Change storage and network format of JSON to byte[] -
  • -
  • Issue #1911: Foreign key constraint does not prevent table being dropped -
  • -
  • PR #1909: Add JSON_OBJECTAGG and JSON_ARRAYAGG aggregate functions -
  • -
  • PR #1908: Cast VARCHAR to JSON properly and require FORMAT JSON in literals -
  • -
  • PR #1906: Add JSON_OBJECT and JSON_ARRAY functions -
  • -
  • Issue #1887: Infinite recursion in ConditionAndOr.java -
  • -
  • Issue #1903: MSSQLServer Mode - Support Update TOP(X) -
  • -
  • Issue #1900: Support SQLServer stored procedure execution syntax -
  • -
  • PR #1898: Add IS JSON predicate -
  • -
  • Issue #1896: MSSQLServer compatibility mode - GETDATE() incorrectly omits time -
  • -
  • PR #1895: Add standard array concatenation operation -
  • -
  • Issue #1892: Window aggregate functions return incorrect result without window ordering and with ROWS unit -
  • -
  • Issue #1890: ArrayIndexOutOfBoundsException in MVSortedTempResult.getKey -
  • -
  • Issue #308: Mode MySQL and LAST_INSERT_ID with argument -
  • -
  • Issue #1883: Suspicious code in Session.getLocks() -
  • -
  • Issue #1878: OPTIMIZE_REUSE_RESULTS causes incorrect result after rollback since 1.4.198 -
  • -
  • PR #1880: Collation names like CHARSET_* recognition -
  • -
  • Issue #1844: MySQL Compatibility: create table error when primary key has comment -
  • -
  • PR #1873: Concurrency in database metadata -
  • -
  • Issue #1864: Failing to format NotSerializableException corrupting the database -
  • -
  • PR #1868: add more checking to TestFileLock -
  • -
  • Issue #1819: Trace.db file exceed file size limit (64MB) -
  • -
  • Issue #1861: Use COALESCE in named columns join for some data types -
  • -
  • PR #1860: Additional fix for deadlock on shutdown (exclusively in PageStore mode) -
  • -
  • Issue #1855: Wrong qualified asterisked projections in named column join -
  • -
  • Issue #1854: Wrong asterisked projection and result in named column right outer join -
  • -
  • Issue #1852: Named column joins doesn't work with the VALUES constructor and derived column lists -
  • -
  • Issue #1851: Wrong asterisked projection in named column joins -
  • -
  • PR #1850: Duplicate map identifiers -
  • -
  • PR #1849: Reimplement MVStore.findOldChunks() with PriorityQueue -
  • -
  • PR #1848: Reimplement MVStore.findChunksToMove() with PriorityQueue -
  • -
  • Issue #1843: Named columns join syntax is not supported -
  • -
  • Issue #1841: Deadlock during concurrent shutdown attempts with 1.4.199 -
  • -
  • Issue #1834: NUMERIC does not preserve its scale for some values -
  • -
  • PR #1838: Implement conversion from JSON to GEOMETRY -
  • -
  • PR #1837: Implement conversion from GEOMETRY to JSON -
  • -
  • PR #1836: Add LSHIFT and RSHIFT function -
  • -
  • PR #1833: Add BITNOT function -
  • -
  • PR #1832: JSON validation and normalization -
  • -
  • PR #1829: MVStore chunks occupancy rate calculation fixes -
  • -
  • PR #1828: Basis for implementation of SQL/JSON standard -
  • -
  • PR #1827: Add support for Lucene 8.0.0 -
  • -
  • Issue #1820: Performance problem on commit -
  • -
  • Issue #1822: Use https:// in h2database.com hyperlinks -
  • -
  • PR #1817: Assorted minor changes in documentation and other places -
  • -
  • PR #1812: An IllegalStateException that wraps EOFException is thrown when partial writes happens -
  • -
- diff --git a/h2/src/main/org/h2/mvstore/db/LobStorageMap.java b/h2/src/main/org/h2/mvstore/db/LobStorageMap.java index cd62c1cba8..729b0df25d 100644 --- a/h2/src/main/org/h2/mvstore/db/LobStorageMap.java +++ b/h2/src/main/org/h2/mvstore/db/LobStorageMap.java @@ -404,7 +404,8 @@ public void cleanup(long oldestVersionToKeep) { MVStore.TxCounter txCounter = mvStore.registerVersionUsage(); try { LobRemovalInfo lobRemovalInfo; - while ((lobRemovalInfo = pendingLobRemovals.poll()) != null && lobRemovalInfo.version < oldestVersionToKeep) { + while ((lobRemovalInfo = pendingLobRemovals.poll()) != null && + lobRemovalInfo.version < oldestVersionToKeep) { doRemoveLob(lobRemovalInfo.mapId, lobRemovalInfo.lobId); } if (lobRemovalInfo != null) { diff --git a/h2/src/main/org/h2/mvstore/db/Store.java b/h2/src/main/org/h2/mvstore/db/Store.java index d887aea276..4f051b2e0d 100644 --- a/h2/src/main/org/h2/mvstore/db/Store.java +++ b/h2/src/main/org/h2/mvstore/db/Store.java @@ -181,7 +181,8 @@ DbException convertMVStoreException(MVStoreException e) { 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.UNKNOWN_DATA_TYPE_1, + (e instanceof HasSQL ? (HasSQL) e : type).getTraceSQL()); } return DbException.get(ErrorCode.INVALID_VALUE_2, type.getTraceSQL(), param); } diff --git a/h2/src/test/org/h2/test/db/TestLob.java b/h2/src/test/org/h2/test/db/TestLob.java index 076c98db4a..293f40c99a 100644 --- a/h2/src/test/org/h2/test/db/TestLob.java +++ b/h2/src/test/org/h2/test/db/TestLob.java @@ -1581,7 +1581,7 @@ private void testLimitsLarge(byte[] b, String s, ValueLob v) throws IOException assertEquals(s, IOUtils.readStringAndClose(v.getReader(), -1)); } } - + public void testConcurrentSelectAndUpdate() throws SQLException, InterruptedException { deleteDb("lob"); try (JdbcConnection conn1 = (JdbcConnection) getConnection("lob")) { @@ -1605,7 +1605,8 @@ public void testConcurrentSelectAndUpdate() throws SQLException, InterruptedExce try { String update = "update t1 set ver = ver + 1 where id = 1"; try (PreparedStatement ps = conn2.prepareStatement(update)) { - while (!Thread.currentThread().isInterrupted() && System.nanoTime() - startTimeNs < 10_000_000_000L) { + while (!Thread.currentThread().isInterrupted() && + System.nanoTime() - startTimeNs < 10_000_000_000L) { ps.executeUpdate(); } } diff --git a/h2/src/tools/org/h2/build/doc/dictionary.txt b/h2/src/tools/org/h2/build/doc/dictionary.txt index 289fe62130..32bf11dd5e 100644 --- a/h2/src/tools/org/h2/build/doc/dictionary.txt +++ b/h2/src/tools/org/h2/build/doc/dictionary.txt @@ -847,4 +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 +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 From eb99ab0c43c3070e0651b8bb2c9a1994b2d23bb5 Mon Sep 17 00:00:00 2001 From: Andrei Tokar Date: Fri, 8 Apr 2022 00:09:52 -0400 Subject: [PATCH 3/7] Version advancement --- README.md | 2 +- h2/pom.xml | 2 +- h2/src/docsrc/html/changelog.html | 2 +- h2/src/docsrc/html/download-archive.html | 4 ++++ h2/src/main/org/h2/engine/Constants.java | 6 +++--- h2/src/test/org/h2/samples/newsfeed.sql | 4 ++-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 70de378686..a26b652202 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ More information: https://h2database.com com.h2database h2 - 2.1.210 + 2.1.220 ``` diff --git a/h2/pom.xml b/h2/pom.xml index 1bc18cf054..81cbd730eb 100644 --- a/h2/pom.xml +++ b/h2/pom.xml @@ -4,7 +4,7 @@ com.h2database h2 - 2.2.219-SNAPSHOT + 2.2.220 jar H2 Database Engine https://h2database.com diff --git a/h2/src/docsrc/html/changelog.html b/h2/src/docsrc/html/changelog.html index 1e1ab80767..e9972754a7 100644 --- a/h2/src/docsrc/html/changelog.html +++ b/h2/src/docsrc/html/changelog.html @@ -25,7 +25,7 @@

Next Version (unreleased)

-

Next Version 2.1.220 (2022-04-07)

+

Next Version 2.1.220 (2022-04-09)

  • Issue #3471: Possibility of corruption after SHUTDOWN DEFRAG
  • diff --git a/h2/src/docsrc/html/download-archive.html b/h2/src/docsrc/html/download-archive.html index 09b4b11a50..f3a06d8357 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/main/org/h2/engine/Constants.java b/h2/src/main/org/h2/engine/Constants.java index becd10a21a..aa40700d3c 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 = 220; /** * 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 diff --git a/h2/src/test/org/h2/samples/newsfeed.sql b/h2/src/test/org/h2/samples/newsfeed.sql index 82c483be5c..15684baa17 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.220', '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); From dacad17830ae1c7eb6b88195ee5f3c16c3883e13 Mon Sep 17 00:00:00 2001 From: Andrei Tokar Date: Sat, 9 Apr 2022 00:43:53 -0400 Subject: [PATCH 4/7] Pre-release changes for 2.1.212 --- h2/pom.xml | 2 +- h2/src/docsrc/html/changelog.html | 3 +-- h2/src/docsrc/html/download-archive.html | 6 +++--- h2/src/docsrc/html/download.html | 10 +++++----- h2/src/test/org/h2/samples/newsfeed.sql | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/h2/pom.xml b/h2/pom.xml index 81cbd730eb..9ee85482e9 100644 --- a/h2/pom.xml +++ b/h2/pom.xml @@ -4,7 +4,7 @@ com.h2database h2 - 2.2.220 + 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 16796e18e4..2552c84e4f 100644 --- a/h2/src/docsrc/html/changelog.html +++ b/h2/src/docsrc/html/changelog.html @@ -47,8 +47,7 @@

    Next Version 2.1.212 (2022-04-09)

  • PR #3422: Allow combination of any geometry types with the same SRID
  • -
  • Issue #3414: H2 2.1.210: Query with Parameters throws NPE at -org.h2.command.query.Query.getParameterValues(Query.java:449) +
  • Issue #3414: H2 2.1.210: Query with Parameters throws NPE
  • Issue #3413: Parser can't parse REFERENCES … NOT NULL
  • diff --git a/h2/src/docsrc/html/download-archive.html b/h2/src/docsrc/html/download-archive.html index f3a06d8357..730287d723 100644 --- a/h2/src/docsrc/html/download-archive.html +++ b/h2/src/docsrc/html/download-archive.html @@ -28,9 +28,9 @@

    Distribution

    2.1.220Windows InstallerPlatform-Independent Zip
    2.1.210 Windows Installer Platform-Independent Zip
    - - - + + + 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/test/org/h2/samples/newsfeed.sql b/h2/src/test/org/h2/samples/newsfeed.sql index 15684baa17..60f9a1060c 100644 --- a/h2/src/test/org/h2/samples/newsfeed.sql +++ b/h2/src/test/org/h2/samples/newsfeed.sql @@ -7,7 +7,7 @@ CREATE TABLE VERSION(ID INT PRIMARY KEY, VERSION VARCHAR, CREATED VARCHAR); INSERT INTO VERSION VALUES -(155, '2.1.220', '2022-04-09'), +(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'), From 783421446f79c81ccdf951196463f0fad469b073 Mon Sep 17 00:00:00 2001 From: Andrei Tokar Date: Sat, 9 Apr 2022 00:54:27 -0400 Subject: [PATCH 5/7] Pre-release 212 indeed --- h2/src/main/org/h2/engine/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h2/src/main/org/h2/engine/Constants.java b/h2/src/main/org/h2/engine/Constants.java index aa40700d3c..05ff4b48c7 100644 --- a/h2/src/main/org/h2/engine/Constants.java +++ b/h2/src/main/org/h2/engine/Constants.java @@ -21,7 +21,7 @@ public class Constants { * Sequential version number. Even numbers are used for official releases, * odd numbers are used for development builds. */ - public static final int BUILD_ID = 220; + public static final int BUILD_ID = 212; /** * Whether this is a snapshot version. From 024b2b2298819808f6c12628588be36578bfc46e Mon Sep 17 00:00:00 2001 From: Andrei Tokar Date: Sat, 9 Apr 2022 00:58:12 -0400 Subject: [PATCH 6/7] Pre-release 212 indeed --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a26b652202..4f2f2fa58c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ More information: https://h2database.com com.h2database h2 - 2.1.220 + 2.1.212 ``` From fd7122e9ec815601630134624a830c1c7ee3f528 Mon Sep 17 00:00:00 2001 From: Andrei Tokar Date: Sat, 9 Apr 2022 01:10:11 -0400 Subject: [PATCH 7/7] Pre-release 2.1.212 indeed --- h2/src/main/org/h2/engine/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h2/src/main/org/h2/engine/Constants.java b/h2/src/main/org/h2/engine/Constants.java index 05ff4b48c7..d85c844e8c 100644 --- a/h2/src/main/org/h2/engine/Constants.java +++ b/h2/src/main/org/h2/engine/Constants.java @@ -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.
    2.1.220Windows InstallerPlatform-Independent Zip
    2.1.212Windows InstallerPlatform-Independent Zip
    2.1.210 Windows Installer