diff --git a/README.md b/README.md index 3105990c31..70de378686 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ More information: https://h2database.com com.h2database h2 - 2.0.204 + 2.1.210 ``` diff --git a/h2/pom.xml b/h2/pom.xml index 1a7bf3295b..a0c0085569 100644 --- a/h2/pom.xml +++ b/h2/pom.xml @@ -4,7 +4,7 @@ com.h2database h2 - 2.0.203-SNAPSHOT + 2.1.210 jar H2 Database Engine https://h2database.com @@ -45,7 +45,8 @@ 8.5.2 5.0.0 42.2.14 - 4.0.1 + 4.0.1 + 5.0.0 1.7.30 UTF-8 @@ -56,7 +57,12 @@ javax.servlet javax.servlet-api - ${servlet.version} + ${javax.servlet.version} + + + jakarta.servlet + jakarta.servlet-api + ${jakarta.servlet.version} org.apache.lucene diff --git a/h2/src/docsrc/help/information_schema.csv b/h2/src/docsrc/help/information_schema.csv index fc47ab89b4..8008bb1e46 100644 --- a/h2/src/docsrc/help/information_schema.csv +++ b/h2/src/docsrc/help/information_schema.csv @@ -1,4 +1,4 @@ -# Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +# Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, # and the EPL 1.0 (https://h2database.com/html/license.html). # Initial Developer: H2 Group diff --git a/h2/src/docsrc/html/advanced.html b/h2/src/docsrc/html/advanced.html index f5189b37e1..68e865b1ff 100644 --- a/h2/src/docsrc/html/advanced.html +++ b/h2/src/docsrc/html/advanced.html @@ -1,6 +1,6 @@ @@ -453,14 +453,17 @@

Keywords / Reserved Words

- - - - - - - - + + + + + + + + + + + @@ -554,8 +557,6 @@

Keywords / Reserved Words

- - @@ -571,13 +572,13 @@

Keywords / Reserved Words

- + - + @@ -635,13 +636,13 @@

Keywords / Reserved Words

- + - + @@ -671,15 +672,30 @@

Keywords / Reserved Words

KeywordH2SQL:​2016SQL:​2011SQL:​2008SQL:​2003SQL:​1999SQL-92KeywordH2SQL Standard
2016201120082003199992
+++++++
INTERSECT +++++++
INTERSECTS+
INTERVAL +++++++
IS
LIKE +++++++
LIMIT++
MS+
LOCALTIME ++++++
LOCALTIMESTAMP ++++++
MINUS+
MS
MINUTE +++++++
MONTH
TO +++++++
TOPCS
MS
CS
TRAILING CS++++++
TRUE +++++++
UESCAPE+++++
+++++
UNION +++++++
UNIQUE

-Some keywords in H2 are context-sensitive (CS), such keywords may be used as identifiers in some places, +Mode-sensitive keywords (MS) are keywords only in some compatibility modes. +

+ +

+Context-sensitive keywords (CS) can be used as identifiers in some places, but cannot be used as identifiers in others. +Normal keywords (+) are always treated as keywords. +

+

Most keywords in H2 are also reserved (+) or non-reserved (NR) words in the SQL Standard. Newer versions of H2 may have more keywords than older ones. +Reserved words from the SQL Standard are potential candidates for keywords in future versions.

There is a compatibility setting SET NON_KEYWORDS -that can be used as a temporary workaround for applications that use keywords as unquoted identifiers.

. +that can be used as a temporary workaround for applications that use keywords as unquoted identifiers.

Standards Compliance

@@ -1354,9 +1370,10 @@

Protection against Remote Access

If you enable remote access using -webAllowOthers, please ensure the web server can only be accessed from trusted networks. +If this option is specified, -webExternalNames should be also specified with +comma-separated list of external names or addresses of this server. The options -baseDir don't protect -access to the tools section, prevent remote shutdown of the web server, -changes to the preferences, the saved connection settings, +access to the saved connection settings, or access to other databases accessible from the system.

diff --git a/h2/src/docsrc/html/architecture.html b/h2/src/docsrc/html/architecture.html index a7603e81c3..af4ccdca18 100644 --- a/h2/src/docsrc/html/architecture.html +++ b/h2/src/docsrc/html/architecture.html @@ -1,6 +1,6 @@ @@ -50,6 +50,7 @@

Introduction

Top-down Overview

Working from the top down, the layers look like this: +

-

JDBC Driver

@@ -69,6 +69,7 @@

JDBC Driver

Connection/session management

The primary classes of interest are: +

@@ -79,7 +80,6 @@

Connection/session management

PackageDescription
org.h2.engine.Databasethe root/global class
org.h2.engine.SessionRemote remote session
-

Parser

@@ -95,14 +95,15 @@

Command execution and planning

Unlike other databases, we do not have an intermediate step where we generate some kind of IR (intermediate representation) of the query. The parser class directly generates a command execution object. Then we run some optimisation steps over the command to possibly generate a more efficient command. - +

+

The primary packages of interest are: +

PackageDescription
org.h2.command.ddlCommands that modify schema data structures
org.h2.command.dmlCommands that modify data
-

Table/Index/Constraints

@@ -110,12 +111,12 @@

Table/Index/Constraints

The primary packages of interest are: +

PackageDescription
org.h2.tableImplementations of different kinds of tables
org.h2.indexImplementations of different kinds of indices
-

Undo log, redo log, and transactions layer

diff --git a/h2/src/docsrc/html/build.html b/h2/src/docsrc/html/build.html index b09c398506..87a588d72b 100644 --- a/h2/src/docsrc/html/build.html +++ b/h2/src/docsrc/html/build.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/changelog.html b/h2/src/docsrc/html/changelog.html index 32fb19a0a2..23c1e63e38 100644 --- a/h2/src/docsrc/html/changelog.html +++ b/h2/src/docsrc/html/changelog.html @@ -1,6 +1,6 @@ @@ -25,6 +25,72 @@

Next Version (unreleased)

+

Version 2.1.210 (2022-01-17)

+ + +

Version 2.0.206 (2022-01-04)

+ +

Version 2.0.204 (2021-12-21)

-

Version 1.4.199 (2019-03-13)

- - diff --git a/h2/src/docsrc/html/cheatSheet.html b/h2/src/docsrc/html/cheatSheet.html index 370d16cb03..7226e3b749 100644 --- a/h2/src/docsrc/html/cheatSheet.html +++ b/h2/src/docsrc/html/cheatSheet.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/commands.html b/h2/src/docsrc/html/commands.html index 2cc02d559d..cb236b61b0 100644 --- a/h2/src/docsrc/html/commands.html +++ b/h2/src/docsrc/html/commands.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/datatypes.html b/h2/src/docsrc/html/datatypes.html index 47fc897f5f..367ab2d00d 100644 --- a/h2/src/docsrc/html/datatypes.html +++ b/h2/src/docsrc/html/datatypes.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/download-archive.html b/h2/src/docsrc/html/download-archive.html index f00961c253..09b4b11a50 100644 --- a/h2/src/docsrc/html/download-archive.html +++ b/h2/src/docsrc/html/download-archive.html @@ -1,6 +1,6 @@ @@ -28,6 +28,18 @@

Distribution

+ + + + + + + + + + + + diff --git a/h2/src/docsrc/html/download.html b/h2/src/docsrc/html/download.html index 280763d5bc..768c2ea78c 100644 --- a/h2/src/docsrc/html/download.html +++ b/h2/src/docsrc/html/download.html @@ -1,6 +1,6 @@ @@ -27,10 +27,12 @@

Version ${version} (${versionDate})


-

Version ${stableVersion} (${stableVersionDate}), Last Stable

+

Version 2.0.206 (2022-01-04)

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

Archive Downloads

diff --git a/h2/src/docsrc/html/faq.html b/h2/src/docsrc/html/faq.html index 211e94d4c2..932ef197ac 100644 --- a/h2/src/docsrc/html/faq.html +++ b/h2/src/docsrc/html/faq.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/features.html b/h2/src/docsrc/html/features.html index 5fb164503b..5d1f7c7f22 100644 --- a/h2/src/docsrc/html/features.html +++ b/h2/src/docsrc/html/features.html @@ -1,6 +1,6 @@ @@ -811,7 +811,7 @@

Compatibility

(example: jdbc:h2:~/test;IGNORECASE=TRUE).

-

Compatibility Modes

+

Compatibility Modes

For certain features, this database can emulate the behavior of specific databases. However, only a small subset of the differences between databases are implemented in this way. @@ -822,6 +822,14 @@

REGULAR Compatibility mode

This mode is used by default.

+

STRICT Compatibility Mode

@@ -829,8 +837,20 @@

STRICT Compatibility Mode

or the SQL statement SET MODE STRICT. In this mode some deprecated features are disabled.

+

+If your application or library uses only the H2 or it generates different SQL for different database systems +it is recommended to use this compatibility mode in unit tests +to reduce possibility of accidental misuse of such features. +This mode cannot be used as SQL validator, however. +

+

+It is not recommended to enable this mode in production builds of libraries, +because this mode may become more restrictive in future releases of H2 that may break your library +if it will be used together with newer version of H2. +

@@ -1027,6 +1057,7 @@

Oracle Compatibility Mode

  • ALTER TABLE MODIFY COLUMN command is partially supported.
  • SEQUENCE.NEXTVAL and SEQUENCE.CURRVAL are supported and return values with DECIMAL/NUMERIC data type.
  • Merge when matched clause may have WHERE clause. +
  • MINUS can be used instead of EXCEPT.
  • PostgreSQL Compatibility Mode

    diff --git a/h2/src/docsrc/html/fragments.html b/h2/src/docsrc/html/fragments.html index 5cb2deb980..b35432e0f1 100644 --- a/h2/src/docsrc/html/fragments.html +++ b/h2/src/docsrc/html/fragments.html @@ -1,5 +1,5 @@ @@ -99,6 +99,7 @@ Links
    MVStore
    Architecture
    +Migration to 2.0

    diff --git a/h2/src/docsrc/html/frame.html b/h2/src/docsrc/html/frame.html index 8bdeb4f594..42c7d4932f 100644 --- a/h2/src/docsrc/html/frame.html +++ b/h2/src/docsrc/html/frame.html @@ -1,5 +1,5 @@ diff --git a/h2/src/docsrc/html/functions-aggregate.html b/h2/src/docsrc/html/functions-aggregate.html index 1dc2ed2830..dd40bca0d3 100644 --- a/h2/src/docsrc/html/functions-aggregate.html +++ b/h2/src/docsrc/html/functions-aggregate.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/functions-window.html b/h2/src/docsrc/html/functions-window.html index f1dac38eb6..f7ad4e5933 100644 --- a/h2/src/docsrc/html/functions-window.html +++ b/h2/src/docsrc/html/functions-window.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/functions.html b/h2/src/docsrc/html/functions.html index d98204fc91..d62066ff5d 100644 --- a/h2/src/docsrc/html/functions.html +++ b/h2/src/docsrc/html/functions.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/grammar.html b/h2/src/docsrc/html/grammar.html index 8d664f70d9..e4f4b98297 100644 --- a/h2/src/docsrc/html/grammar.html +++ b/h2/src/docsrc/html/grammar.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/history.html b/h2/src/docsrc/html/history.html index a1617ea313..b5068a54c6 100644 --- a/h2/src/docsrc/html/history.html +++ b/h2/src/docsrc/html/history.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/installation.html b/h2/src/docsrc/html/installation.html index 896687215d..f787f957ed 100644 --- a/h2/src/docsrc/html/installation.html +++ b/h2/src/docsrc/html/installation.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/license.html b/h2/src/docsrc/html/license.html index 4ee57c53f0..1f228df8f1 100644 --- a/h2/src/docsrc/html/license.html +++ b/h2/src/docsrc/html/license.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/links.html b/h2/src/docsrc/html/links.html index daddd1df8c..98cf0cad6a 100644 --- a/h2/src/docsrc/html/links.html +++ b/h2/src/docsrc/html/links.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/main.html b/h2/src/docsrc/html/main.html index d34f218d2e..ea060a9132 100644 --- a/h2/src/docsrc/html/main.html +++ b/h2/src/docsrc/html/main.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/mainWeb.html b/h2/src/docsrc/html/mainWeb.html index 683ab36be3..07f12b2267 100644 --- a/h2/src/docsrc/html/mainWeb.html +++ b/h2/src/docsrc/html/mainWeb.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/migration-to-v2.html b/h2/src/docsrc/html/migration-to-v2.html index 07325533c0..47ec8ecd9e 100644 --- a/h2/src/docsrc/html/migration-to-v2.html +++ b/h2/src/docsrc/html/migration-to-v2.html @@ -1,6 +1,6 @@ @@ -25,31 +25,42 @@

    Contents

    Upgrading
    File Format
    - - Date / Time / Timestamp
    + + Data types
    + + Identity columns and sequences
    + + INFORMATION_SCHEMA
    General

    Introduction

    -Between version 1.4.198 and version 2.0.0 there have been considerable changes, such that a simple update is +Between version 1.4.200 and version 2.0.202 there have been considerable changes, such that a simple update is not possible.

    It would have been nice to write some kind of migration tool, or auto-detect the file and upgrade. Unfortunately, this -is purely a volunteer-run project, so this is just the way it has to be. +is purely a volunteer-run project, so this is just the way it has to be. There exists a migration tool H2MigrationTool available +in GitHub, but it hasn't been tested by our team. Use at +your own risk.

    Upgrading

    -The official way to upgrade is to do a BACKUP of your existing database USING YOUR CURRENT VERSION OF H2. +The official way to upgrade is to export it into SQL script with the +SCRIPT command +USING YOUR CURRENT VERSION OF H2.

    -Then create a fresh database USING THE NEW VERSION OF H2, then perform a SCRIPT to load your data. +Then create a fresh database USING THE NEW VERSION OF H2, then perform a +RUNSCRIPT to load your data. +You may need to specify FROM_1X flag, see documentation of this command for details.

    MVStore file format

    @@ -60,17 +71,117 @@

    MVStore file format

    for the purposes of improving crash safety and also read/write performance.

    -

    Date / Time / Timestamp

    +

    Data types

    -TODO - Correctness. +The maximum length of CHARACTER +and CHARACTER VARYING data types +is n 1,048,576 characters. For larger values use +CHARACTER LARGE OBJECT. +

    + +

    +BINARY +and BINARY VARYING +are now different data types. BINARY means fixed-length data type and its default length is 1. +The maximum length of binary strings is 1,048,576 bytes. For larger values use +BINARY LARGE OBJECT +

    + +

    +NUMERIC / DECIMAL / DEC without parameters +now have scale 0. For a variable-scale data type see +DECFLOAT. +Negative scale isn't allowed for these data types any more. +The maximum precision is now 100,000. +

    + +

    +ENUM values now have 1-based ordinal numbers. +

    + +

    +Arrays are now typed. +Arrays with mixed types of elements aren't supported. +In some cases they can be replaced with a new ROW +data type. +

    + +

    +All non-standard data types, with exception for TINYINT, JAVA_OBJECT, ENUM, GEOMETRY, JSON, and UUID are deprecated. +

    + +

    Identity columns and sequences

    + +

    +Various legacy vendor-specific declarations and expressions are deprecated +and may not work at all depending on compatibility mode. +

    + +

    +Identity columns should be normally declared with GENERATED BY DEFAULT AS IDENTITY or GENERATED ALWAYS AS IDENTITY +clauses, options may also be specified. +GENERATED ALWAYS AS IDENTITY columns cannot be assigned to a user-provided value +unless OVERRIDING SYSTEM VALUE is specified. +

    + +

    +NULL cannot be specified as a value for IDENTITY column to force identity generation +(with exception for some compatibility modes). +Use DEFAULT or simply exclude this column from insert column list. +

    + +

    +IDENTITY() and SCOPE_IDENTITY() aren't available in Regular mode. If you need to get a generated value, +you need to use data change delta tables +or Statement.getGeneratedKeys(). +

    + +

    +Undocumented Oracle-style .NEXTVAL and .CURRVAL expressions are restricted to Oracle compatibility mode. +Other functions are deprecated for Regular mode. +Use sequence value expression instead. +

    + +

    INFORMATION_SCHEMA

    + +

    +INFORMATION_SCHEMA in H2 is now compliant with the SQL Standard and other database systems, +but it isn't compliant with previous versions of H2. +You may need to update your queries.

    General

    There are a lot more SQL keywords now. Many SQL statements feature far better support of SQL-Standard behaviour. -Some old non-standard SQL syntax support has been removed. +There is a NON_KEYWORDS setting that +can be used as a temporary workaround if your application uses them as unquoted identifiers. +

    + +

    +Numeric and boolean values aren't comparable. It means you need to use TRUE, FALSE, or UNKNOWN (NULL) +as boolean literals. 1 and 0 don't work any more (with exception for some compatibility modes). +

    + +

    +Some other non-standard SQL syntax has been restricted to related compatibility modes. +Since H2 2.0.204 there is a LEGACY compatibility mode that provides some limited compatibility with previous versions. +

    + +

    +Various deprecated grammar elements are marked in red in documentation. Please, avoid their usage. +

    + +

    +Migrating an old database to the new version works most of the times. However, there are a couple of important changes in the new version to keep in mind:

    + +
    2.1.210Windows InstallerPlatform-Independent Zip
    2.0.206Windows InstallerPlatform-Independent Zip
    2.0.204Windows InstallerPlatform-Independent Zip
    1.4.202 Windows Installer Platform-Independent Zip
    diff --git a/h2/src/docsrc/html/mvstore.html b/h2/src/docsrc/html/mvstore.html index c15b55960d..a5fd229d05 100644 --- a/h2/src/docsrc/html/mvstore.html +++ b/h2/src/docsrc/html/mvstore.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/navigation.js b/h2/src/docsrc/html/navigation.js index 660812dab9..1262d1bf5f 100644 --- a/h2/src/docsrc/html/navigation.js +++ b/h2/src/docsrc/html/navigation.js @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/docsrc/html/performance.html b/h2/src/docsrc/html/performance.html index 4d00a9ac94..54d1b4ba15 100644 --- a/h2/src/docsrc/html/performance.html +++ b/h2/src/docsrc/html/performance.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/quickstart.html b/h2/src/docsrc/html/quickstart.html index 5298e98402..5bb4fc0a41 100644 --- a/h2/src/docsrc/html/quickstart.html +++ b/h2/src/docsrc/html/quickstart.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/search.js b/h2/src/docsrc/html/search.js index 11ba89828c..6d32a658d3 100644 --- a/h2/src/docsrc/html/search.js +++ b/h2/src/docsrc/html/search.js @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/docsrc/html/security.html b/h2/src/docsrc/html/security.html index 0a2627c0cf..fe8d29f841 100644 --- a/h2/src/docsrc/html/security.html +++ b/h2/src/docsrc/html/security.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/source.html b/h2/src/docsrc/html/source.html index a8a6678847..5b8f130680 100644 --- a/h2/src/docsrc/html/source.html +++ b/h2/src/docsrc/html/source.html @@ -1,5 +1,5 @@ @@ -10,7 +10,10 @@ // @@ -40,6 +40,9 @@ function getVersion(build) { if (build == 64) { return '1.0/version-1.0.' + build; + } else if (build > 200) { + var b = build + 1; + return Math.floor(b / 100) + '.' + Math.floor(b % 100 / 10) + '.' + build; } else if (build >= 177) { return '1.4.' + build; } else if (build >= 146 && build != 147) { @@ -84,7 +87,7 @@ } else { url = 'https://github.com/h2database/h2database/tree/' if (build && build > 0) { - url += 'version-' + getVersion(build) + '/h2'; + url += 'version-' + getVersion(parseInt(build)) + '/h2'; } else { var tag = 'master/h2'; } @@ -114,7 +117,7 @@ hasData = true; idx = errorCode.indexOf("-"); build = parseInt(errorCode.substring(idx + 1)); - get('version').innerHTML = getVersion(build); + get('version').innerHTML = getVersion(parseInt(build)); errorCode = errorCode.substring(0, idx); while (errorCode.length > 1 && errorCode.charAt(0) == '0') { errorCode = errorCode.substring(1); diff --git a/h2/src/docsrc/html/stylesheet.css b/h2/src/docsrc/html/stylesheet.css index 6f866f72d2..a30f4d5adc 100644 --- a/h2/src/docsrc/html/stylesheet.css +++ b/h2/src/docsrc/html/stylesheet.css @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/docsrc/html/stylesheetPdf.css b/h2/src/docsrc/html/stylesheetPdf.css index e30c3f3199..dacc282997 100644 --- a/h2/src/docsrc/html/stylesheetPdf.css +++ b/h2/src/docsrc/html/stylesheetPdf.css @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/docsrc/html/systemtables.html b/h2/src/docsrc/html/systemtables.html index 0c90636631..fa19549629 100644 --- a/h2/src/docsrc/html/systemtables.html +++ b/h2/src/docsrc/html/systemtables.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/html/tutorial.html b/h2/src/docsrc/html/tutorial.html index 721122c22c..3dadf0f822 100644 --- a/h2/src/docsrc/html/tutorial.html +++ b/h2/src/docsrc/html/tutorial.html @@ -1,6 +1,6 @@ @@ -789,6 +789,15 @@

    Using a Servlet Listener to Start and Stop a Database

    </listener>

    +If your servlet container is already Servlet 5-compatible, use the following +snippet instead: +

    +
    +<listener>
    +    <listener-class>org.h2.server.web.JakartaDbStarter</listener-class>
    +</listener>
    +
    +

    For details on how to access the database, see the file DbStarter.java. By default this tool opens an embedded connection using the database URL jdbc:h2:~/test, @@ -873,6 +882,10 @@

    Using the H2 Console Servlet

    For details, see also src/tools/WEB-INF/web.xml.

    +If your application is already Servlet 5-compatible, use the servlet class +org.h2.server.web.JakartaWebServlet instead. +

    +

    To create a web application with just the H2 Console, run the following command:

    @@ -1359,30 +1372,35 @@ 

    User-Defined Variables

    Date and Time

    -Date, time and timestamp values support ISO 8601 formatting, including time zone: +Date, time and timestamp values support standard literals:

    -CALL TIMESTAMP '2008-01-01 12:00:00+01:00';
    +VALUES (
    +    DATE '2008-01-01',
    +    TIME '12:00:00',
    +    TIME WITH TIME ZONE '12:00:00+01:00',
    +    TIMESTAMP '2008-01-01 12:00:00',
    +    TIMESTAMP WITH TIME ZONE '2008-01-01 12:00:00+01:00'
    +);
     

    -If the time zone is not set, the value is parsed using the current time zone setting of the system. -Date and time information is stored in H2 database files with or without time zone information depending on used data type. +ISO 8601-style datetime formats with T instead of space between date and time parts are also supported.

    - +

    Using Spring

    Using the TCP Server

    diff --git a/h2/src/docsrc/index.html b/h2/src/docsrc/index.html index c6d5168adc..2e09c2fef2 100644 --- a/h2/src/docsrc/index.html +++ b/h2/src/docsrc/index.html @@ -1,6 +1,6 @@ diff --git a/h2/src/docsrc/javadoc/animate.js b/h2/src/docsrc/javadoc/animate.js deleted file mode 100644 index 825f4b4a7b..0000000000 --- a/h2/src/docsrc/javadoc/animate.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, - * and the EPL 1.0 (https://h2database.com/html/license.html). - * Initial Developer: H2 Group - */ - -function on(id) { - return switchTag(id, 'titleOff', 'detailOn'); -} - -function off(id) { - return switchTag(id, '', 'detail'); -} - -function allDetails() { - for (i = 0;; i++) { - x = document.getElementById('_' + i); - if (x == null) { - break; - } - switchTag(i, 'titleOff', 'detailOn'); - } - return false; -} - -function switchTag(id, title, detail) { - if (document.getElementById('__' + id) != null) { - document.getElementById('__' + id).className = title; - document.getElementById('_' + id).className = detail; - } - return false; -} - -function openLink() { - page = new String(self.document.location); - var pos = page.lastIndexOf("#") + 1; - if (pos == 0) { - return; - } - var ref = page.substr(pos); - link = decodeURIComponent(ref); - el = document.getElementById(link); - if (el.nodeName.toLowerCase() == 'h4') { - // constant - return true; - } - el = el.parentNode.parentNode; - window.scrollTo(0, el.offsetTop); - on(el.id.substr(2)); - return false; -} \ No newline at end of file diff --git a/h2/src/docsrc/javadoc/classes.html b/h2/src/docsrc/javadoc/classes.html deleted file mode 100644 index b7a95b1d26..0000000000 --- a/h2/src/docsrc/javadoc/classes.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - H2 Documentation - - - - - - -
    -
    - - - -
    - diff --git a/h2/src/docsrc/javadoc/index.html b/h2/src/docsrc/javadoc/index.html deleted file mode 100644 index 2d7b63b095..0000000000 --- a/h2/src/docsrc/javadoc/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - H2 Documentation - - - - - - - -<body> - Sorry, Lynx is not supported -</body> - - - diff --git a/h2/src/docsrc/javadoc/overview.html b/h2/src/docsrc/javadoc/overview.html deleted file mode 100644 index 5087b7b3c2..0000000000 --- a/h2/src/docsrc/javadoc/overview.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - API Overview - - - - - -
    -
    - -

    API Overview

    - -

    JDBC API

    - -

    -Use the JDBC API to connect to a database and execute queries. -

    - -

    Tools API

    - -

    -The Tools API can be used to do maintenance operations, -such as deleting database files or changing the database file password, -that do not require a connection to the database. -

    - -
    - - diff --git a/h2/src/docsrc/javadoc/stylesheet.css b/h2/src/docsrc/javadoc/stylesheet.css deleted file mode 100644 index 8445132e72..0000000000 --- a/h2/src/docsrc/javadoc/stylesheet.css +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, - * and the EPL 1.0 (https://h2database.com/html/license.html). - * Initial Developer: H2 Group - */ - -td, input, select, textarea, body, code, pre, td, th { - font: 13px/1.4 Arial, sans-serif; - font-weight: normal; -} - -pre { - background-color: #ece9d8; - border: 1px solid rgb(172, 168, 153); - padding: 4px; -} - -body { - margin: 0px; - max-width: 800px; -} - -h1 { - background-color: #0000bb; - padding: 2px 4px 2px 4px; - margin-top: 11px; - color: #fff; - font-size: 22px; - line-height: normal; -} - -h2 { - font-size: 19px; -} - -h3 { - font-size: 16px; -} - -h4 { - font-size: 13px; -} - -hr { - color: #CCC; - background-color: #CCC; - height: 1px; - border: 0px solid blue; -} - -.menu { - margin: 10px 10px 10px 10px; -} - -.block { - border: 0px; -} - -.titleOff { - display: none; -} - -.detail { - border: 0px; - display: none; -} - -.detailOn { - border: 0px; -} - -td.return { - white-space:nowrap; - width: 1%; -} - -td.method { - width: 99%; -} - -.deprecated { - text-decoration: line-through; -} - -.methodText { - color: #000000; - font-weight: normal; - margin: 0px 0px 0px 20px; -} - -.method { -} - -.fieldText { - margin: 6px 20px 6px 20px; -} - -.methodName { - font-weight: bold; -} - -.itemTitle { -} - -.item { - margin: 0px 0px 0px 20px; -} - -table { - background-color: #ffffff; - border-collapse: collapse; - border: 1px solid #aca899; -} - -th { - text-align: left; - background-color: #ece9d8; - border: 1px solid #aca899; - padding: 2px; -} - -td { - background-color: #ffffff; - text-align: left; - vertical-align:top; - border: 1px solid #aca899; - padding: 2px; -} - - -ul, ol { - list-style-position: outside; - padding-left: 20px; -} - -li { - margin-top: 8px; - line-height: 100%; -} - -a { - text-decoration: none; - color: #0000ff; -} - -a:hover { - text-decoration: underline; -} - -table.content { - width: 100%; - height: 100%; - border: 0px; -} - -tr.content { - border:0px; - border-left:1px solid #aca899; -} - -td.content { - border:0px; - border-left:1px solid #aca899; -} - -.contentDiv { - margin:10px; -} - - - diff --git a/h2/src/installer/release.txt b/h2/src/installer/release.txt index ed36488846..54bc01212d 100644 --- a/h2/src/installer/release.txt +++ b/h2/src/installer/release.txt @@ -34,9 +34,8 @@ Update org.h2.engine.Constants.java: set VERSION_MAJOR / VERSION_MINOR to the new version number if the last TCP_PROTOCOL_VERSION_## doesn't have a release date set it to current BUILD_DATE - set BUILD_DATE_STABLE to BUILD_DATE of the latest stable release - set BUILD_ID_STABLE to BUILD_ID of the latest stable release - check prefix in VERSION_STABLE and update if necessary + check and update if necessary links to the latest releases in previous + series of releases and their checksums in download.html Update README.md. set version to the new version diff --git a/h2/src/java10/src/org/h2/util/Utils10.java b/h2/src/java10/src/org/h2/util/Utils10.java index b80c4a5118..2ba397e893 100644 --- a/h2/src/java10/src/org/h2/util/Utils10.java +++ b/h2/src/java10/src/org/h2/util/Utils10.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/java10/src/org/h2/util/package.html b/h2/src/java10/src/org/h2/util/package.html index 5bf8372b08..5860dd0957 100644 --- a/h2/src/java10/src/org/h2/util/package.html +++ b/h2/src/java10/src/org/h2/util/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/java9/src/org/h2/util/Bits.java b/h2/src/java9/src/org/h2/util/Bits.java index e70af386d6..fc323a8abf 100644 --- a/h2/src/java9/src/org/h2/util/Bits.java +++ b/h2/src/java9/src/org/h2/util/Bits.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/java9/src/org/h2/util/package.html b/h2/src/java9/src/org/h2/util/package.html index 3f0cc7b6ec..9ef3d9ca4e 100644 --- a/h2/src/java9/src/org/h2/util/package.html +++ b/h2/src/java9/src/org/h2/util/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/META-INF/MANIFEST.MF b/h2/src/main/META-INF/MANIFEST.MF index 087eb4cc2a..c4a0ae3b15 100644 --- a/h2/src/main/META-INF/MANIFEST.MF +++ b/h2/src/main/META-INF/MANIFEST.MF @@ -28,6 +28,8 @@ Import-Package: javax.crypto, javax.security.auth.login;resolution:=optional, javax.servlet;resolution:=optional, javax.servlet.http;resolution:=optional, + jakarta.servlet;resolution:=optional, + jakarta.servlet.http;resolution:=optional, javax.sql, javax.tools;resolution:=optional, javax.transaction.xa;resolution:=optional, diff --git a/h2/src/main/org/h2/Driver.java b/h2/src/main/org/h2/Driver.java index 5790217c62..a0660fc5fd 100644 --- a/h2/src/main/org/h2/Driver.java +++ b/h2/src/main/org/h2/Driver.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -56,7 +56,7 @@ public Connection connect(String url, Properties info) throws SQLException { if (url == null) { throw DbException.getJdbcSQLException(ErrorCode.URL_FORMAT_ERROR_2, null, Constants.URL_FORMAT, null); } else if (url.startsWith(Constants.START_URL)) { - return new JdbcConnection(url, info, null, null); + return new JdbcConnection(url, info, null, null, false); } else if (url.equals(DEFAULT_URL)) { return DEFAULT_CONNECTION.get(); } else { diff --git a/h2/src/main/org/h2/JdbcDriverBackwardsCompat.java b/h2/src/main/org/h2/JdbcDriverBackwardsCompat.java index 228ad29948..4d033fd00c 100644 --- a/h2/src/main/org/h2/JdbcDriverBackwardsCompat.java +++ b/h2/src/main/org/h2/JdbcDriverBackwardsCompat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/Aggregate.java b/h2/src/main/org/h2/api/Aggregate.java index 6df633f98a..6169d0cec4 100644 --- a/h2/src/main/org/h2/api/Aggregate.java +++ b/h2/src/main/org/h2/api/Aggregate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/AggregateFunction.java b/h2/src/main/org/h2/api/AggregateFunction.java index 276dd39aa3..916853edcd 100644 --- a/h2/src/main/org/h2/api/AggregateFunction.java +++ b/h2/src/main/org/h2/api/AggregateFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/CredentialsValidator.java b/h2/src/main/org/h2/api/CredentialsValidator.java index 786ea4c4ca..79dae86059 100644 --- a/h2/src/main/org/h2/api/CredentialsValidator.java +++ b/h2/src/main/org/h2/api/CredentialsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/api/DatabaseEventListener.java b/h2/src/main/org/h2/api/DatabaseEventListener.java index 21615f3aca..67f3c8eb9e 100644 --- a/h2/src/main/org/h2/api/DatabaseEventListener.java +++ b/h2/src/main/org/h2/api/DatabaseEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/ErrorCode.java b/h2/src/main/org/h2/api/ErrorCode.java index df1684e3af..bb74ebef80 100644 --- a/h2/src/main/org/h2/api/ErrorCode.java +++ b/h2/src/main/org/h2/api/ErrorCode.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/H2Type.java b/h2/src/main/org/h2/api/H2Type.java index 3b0dcccdb6..ecc61311e8 100644 --- a/h2/src/main/org/h2/api/H2Type.java +++ b/h2/src/main/org/h2/api/H2Type.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/Interval.java b/h2/src/main/org/h2/api/Interval.java index 761dbfdb7d..42024b9466 100644 --- a/h2/src/main/org/h2/api/Interval.java +++ b/h2/src/main/org/h2/api/Interval.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/IntervalQualifier.java b/h2/src/main/org/h2/api/IntervalQualifier.java index 5c6cd3e75b..1772d1790e 100644 --- a/h2/src/main/org/h2/api/IntervalQualifier.java +++ b/h2/src/main/org/h2/api/IntervalQualifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/JavaObjectSerializer.java b/h2/src/main/org/h2/api/JavaObjectSerializer.java index b951ebe123..9daa53065d 100644 --- a/h2/src/main/org/h2/api/JavaObjectSerializer.java +++ b/h2/src/main/org/h2/api/JavaObjectSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/TableEngine.java b/h2/src/main/org/h2/api/TableEngine.java index 2b5e02da05..497b291949 100644 --- a/h2/src/main/org/h2/api/TableEngine.java +++ b/h2/src/main/org/h2/api/TableEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/Trigger.java b/h2/src/main/org/h2/api/Trigger.java index 58f6f481bc..37a1cb74c2 100644 --- a/h2/src/main/org/h2/api/Trigger.java +++ b/h2/src/main/org/h2/api/Trigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/api/UserToRolesMapper.java b/h2/src/main/org/h2/api/UserToRolesMapper.java index 26632b8447..55d59468e2 100644 --- a/h2/src/main/org/h2/api/UserToRolesMapper.java +++ b/h2/src/main/org/h2/api/UserToRolesMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/api/package.html b/h2/src/main/org/h2/api/package.html index 77ca0e4b09..3dd9f31c6c 100644 --- a/h2/src/main/org/h2/api/package.html +++ b/h2/src/main/org/h2/api/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/bnf/Bnf.java b/h2/src/main/org/h2/bnf/Bnf.java index 22dabbf57d..3faccea4e4 100644 --- a/h2/src/main/org/h2/bnf/Bnf.java +++ b/h2/src/main/org/h2/bnf/Bnf.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/BnfVisitor.java b/h2/src/main/org/h2/bnf/BnfVisitor.java index 67014a33fb..1a8ec01d6f 100644 --- a/h2/src/main/org/h2/bnf/BnfVisitor.java +++ b/h2/src/main/org/h2/bnf/BnfVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/Rule.java b/h2/src/main/org/h2/bnf/Rule.java index 831784a6b4..0070e4e28b 100644 --- a/h2/src/main/org/h2/bnf/Rule.java +++ b/h2/src/main/org/h2/bnf/Rule.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/RuleElement.java b/h2/src/main/org/h2/bnf/RuleElement.java index 6b6d257ed4..aca908583b 100644 --- a/h2/src/main/org/h2/bnf/RuleElement.java +++ b/h2/src/main/org/h2/bnf/RuleElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/RuleExtension.java b/h2/src/main/org/h2/bnf/RuleExtension.java index 21585a78df..217a946da7 100644 --- a/h2/src/main/org/h2/bnf/RuleExtension.java +++ b/h2/src/main/org/h2/bnf/RuleExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/RuleFixed.java b/h2/src/main/org/h2/bnf/RuleFixed.java index f3d210ef0a..8557e0ae52 100644 --- a/h2/src/main/org/h2/bnf/RuleFixed.java +++ b/h2/src/main/org/h2/bnf/RuleFixed.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/RuleHead.java b/h2/src/main/org/h2/bnf/RuleHead.java index 464da2f46c..95891bd1a0 100644 --- a/h2/src/main/org/h2/bnf/RuleHead.java +++ b/h2/src/main/org/h2/bnf/RuleHead.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/RuleList.java b/h2/src/main/org/h2/bnf/RuleList.java index 76b274d146..30e8f67893 100644 --- a/h2/src/main/org/h2/bnf/RuleList.java +++ b/h2/src/main/org/h2/bnf/RuleList.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/RuleOptional.java b/h2/src/main/org/h2/bnf/RuleOptional.java index 1fd560b033..52cfee7f42 100644 --- a/h2/src/main/org/h2/bnf/RuleOptional.java +++ b/h2/src/main/org/h2/bnf/RuleOptional.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/RuleRepeat.java b/h2/src/main/org/h2/bnf/RuleRepeat.java index 226b645b3c..347d03a8e7 100644 --- a/h2/src/main/org/h2/bnf/RuleRepeat.java +++ b/h2/src/main/org/h2/bnf/RuleRepeat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/Sentence.java b/h2/src/main/org/h2/bnf/Sentence.java index 7000f26b20..a0993b0892 100644 --- a/h2/src/main/org/h2/bnf/Sentence.java +++ b/h2/src/main/org/h2/bnf/Sentence.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/context/DbColumn.java b/h2/src/main/org/h2/bnf/context/DbColumn.java index 7891defc35..db187c3e0a 100644 --- a/h2/src/main/org/h2/bnf/context/DbColumn.java +++ b/h2/src/main/org/h2/bnf/context/DbColumn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/context/DbContents.java b/h2/src/main/org/h2/bnf/context/DbContents.java index a657fc09fe..1cedefb0da 100644 --- a/h2/src/main/org/h2/bnf/context/DbContents.java +++ b/h2/src/main/org/h2/bnf/context/DbContents.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/context/DbContextRule.java b/h2/src/main/org/h2/bnf/context/DbContextRule.java index 39dc9a458c..1d295cdb42 100644 --- a/h2/src/main/org/h2/bnf/context/DbContextRule.java +++ b/h2/src/main/org/h2/bnf/context/DbContextRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/context/DbProcedure.java b/h2/src/main/org/h2/bnf/context/DbProcedure.java index 28a4cf6ae5..0e9a71c2b7 100644 --- a/h2/src/main/org/h2/bnf/context/DbProcedure.java +++ b/h2/src/main/org/h2/bnf/context/DbProcedure.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -71,6 +71,7 @@ public boolean isReturnsResult() { * Read the column for this table from the database meta data. * * @param meta the database meta data + * @throws SQLException on failure */ void readParameters(DatabaseMetaData meta) throws SQLException { ResultSet rs = meta.getProcedureColumns(null, schema.name, name, null); diff --git a/h2/src/main/org/h2/bnf/context/DbSchema.java b/h2/src/main/org/h2/bnf/context/DbSchema.java index 342366a6f7..f37e06fbe1 100644 --- a/h2/src/main/org/h2/bnf/context/DbSchema.java +++ b/h2/src/main/org/h2/bnf/context/DbSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/context/DbTableOrView.java b/h2/src/main/org/h2/bnf/context/DbTableOrView.java index 0d304353c2..e97ffe4385 100644 --- a/h2/src/main/org/h2/bnf/context/DbTableOrView.java +++ b/h2/src/main/org/h2/bnf/context/DbTableOrView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/bnf/context/package.html b/h2/src/main/org/h2/bnf/context/package.html index 026e5dd43a..0a6386fb30 100644 --- a/h2/src/main/org/h2/bnf/context/package.html +++ b/h2/src/main/org/h2/bnf/context/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/bnf/package.html b/h2/src/main/org/h2/bnf/package.html index 7e3889414b..36296736e3 100644 --- a/h2/src/main/org/h2/bnf/package.html +++ b/h2/src/main/org/h2/bnf/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/command/Command.java b/h2/src/main/org/h2/command/Command.java index ba9bed93df..f26fb686b8 100644 --- a/h2/src/main/org/h2/command/Command.java +++ b/h2/src/main/org/h2/command/Command.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/CommandContainer.java b/h2/src/main/org/h2/command/CommandContainer.java index 4776e4b40a..30fcf5bc53 100644 --- a/h2/src/main/org/h2/command/CommandContainer.java +++ b/h2/src/main/org/h2/command/CommandContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -136,9 +136,10 @@ private void recompileIfRequired() { // TODO test with 'always recompile' prepared.setModificationMetaId(0); String sql = prepared.getSQL(); + ArrayList tokens = prepared.getSQLTokens(); ArrayList oldParams = prepared.getParameters(); Parser parser = new Parser(session); - prepared = parser.parse(sql); + prepared = parser.parse(sql, tokens); long mod = prepared.getModificationMetaId(); prepared.setModificationMetaId(0); ArrayList newParams = prepared.getParameters(); diff --git a/h2/src/main/org/h2/command/CommandInterface.java b/h2/src/main/org/h2/command/CommandInterface.java index 90ed593d76..fbe1223ad7 100644 --- a/h2/src/main/org/h2/command/CommandInterface.java +++ b/h2/src/main/org/h2/command/CommandInterface.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/CommandList.java b/h2/src/main/org/h2/command/CommandList.java index ddf218124b..f3d17e1162 100644 --- a/h2/src/main/org/h2/command/CommandList.java +++ b/h2/src/main/org/h2/command/CommandList.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/CommandRemote.java b/h2/src/main/org/h2/command/CommandRemote.java index 9b0f99f84d..7807ef4b7a 100644 --- a/h2/src/main/org/h2/command/CommandRemote.java +++ b/h2/src/main/org/h2/command/CommandRemote.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/Parser.java b/h2/src/main/org/h2/command/Parser.java index b8f0b26ca3..6aa8a51d37 100644 --- a/h2/src/main/org/h2/command/Parser.java +++ b/h2/src/main/org/h2/command/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group * @@ -8,6 +8,38 @@ */ package org.h2.command; +import static org.h2.command.Token.ASTERISK; +import static org.h2.command.Token.AT; +import static org.h2.command.Token.BIGGER; +import static org.h2.command.Token.BIGGER_EQUAL; +import static org.h2.command.Token.CLOSE_BRACE; +import static org.h2.command.Token.CLOSE_BRACKET; +import static org.h2.command.Token.CLOSE_PAREN; +import static org.h2.command.Token.COLON; +import static org.h2.command.Token.COLON_COLON; +import static org.h2.command.Token.COLON_EQ; +import static org.h2.command.Token.COMMA; +import static org.h2.command.Token.CONCATENATION; +import static org.h2.command.Token.DOT; +import static org.h2.command.Token.END_OF_INPUT; +import static org.h2.command.Token.EQUAL; +import static org.h2.command.Token.LITERAL; +import static org.h2.command.Token.MINUS_SIGN; +import static org.h2.command.Token.NOT_EQUAL; +import static org.h2.command.Token.NOT_TILDE; +import static org.h2.command.Token.OPEN_BRACE; +import static org.h2.command.Token.OPEN_BRACKET; +import static org.h2.command.Token.OPEN_PAREN; +import static org.h2.command.Token.PARAMETER; +import static org.h2.command.Token.PERCENT; +import static org.h2.command.Token.PLUS_SIGN; +import static org.h2.command.Token.SEMICOLON; +import static org.h2.command.Token.SLASH; +import static org.h2.command.Token.SMALLER; +import static org.h2.command.Token.SMALLER_EQUAL; +import static org.h2.command.Token.SPATIAL_INTERSECTS; +import static org.h2.command.Token.TILDE; +import static org.h2.command.Token.TOKENS; import static org.h2.util.ParserUtil.ALL; import static org.h2.util.ParserUtil.AND; import static org.h2.util.ParserUtil.ANY; @@ -51,7 +83,6 @@ import static org.h2.util.ParserUtil.IN; import static org.h2.util.ParserUtil.INNER; import static org.h2.util.ParserUtil.INTERSECT; -import static org.h2.util.ParserUtil.INTERSECTS; import static org.h2.util.ParserUtil.INTERVAL; import static org.h2.util.ParserUtil.IS; import static org.h2.util.ParserUtil.JOIN; @@ -101,9 +132,6 @@ import static org.h2.util.ParserUtil.YEAR; import static org.h2.util.ParserUtil._ROWID_; -import java.io.ByteArrayOutputStream; -import java.math.BigDecimal; -import java.math.BigInteger; import java.nio.charset.Charset; import java.text.Collator; import java.util.ArrayList; @@ -111,7 +139,6 @@ import java.util.BitSet; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedHashSet; @@ -120,9 +147,9 @@ import org.h2.api.ErrorCode; import org.h2.api.IntervalQualifier; import org.h2.api.Trigger; -import org.h2.command.ddl.AlterDomainExpressions; import org.h2.command.ddl.AlterDomainAddConstraint; import org.h2.command.ddl.AlterDomainDropConstraint; +import org.h2.command.ddl.AlterDomainExpressions; import org.h2.command.ddl.AlterDomainRename; import org.h2.command.ddl.AlterDomainRenameConstraint; import org.h2.command.ddl.AlterIndexRename; @@ -362,7 +389,6 @@ import org.h2.value.ValueArray; import org.h2.value.ValueBigint; import org.h2.value.ValueDate; -import org.h2.value.ValueDecfloat; import org.h2.value.ValueDouble; import org.h2.value.ValueGeometry; import org.h2.value.ValueInteger; @@ -376,7 +402,6 @@ import org.h2.value.ValueTimestamp; import org.h2.value.ValueTimestampTimeZone; import org.h2.value.ValueUuid; -import org.h2.value.ValueVarbinary; import org.h2.value.ValueVarchar; /** @@ -392,434 +417,6 @@ public class Parser { "WITH statement supports only SELECT, TABLE, VALUES, " + "CREATE TABLE, INSERT, UPDATE, MERGE or DELETE statements"; - // used during the tokenizer phase - private static final int CHAR_END = 1, CHAR_VALUE = 2, CHAR_QUOTED = 3; - private static final int CHAR_NAME = 4, CHAR_SPECIAL_1 = 5, - CHAR_SPECIAL_2 = 6; - private static final int CHAR_STRING = 7, CHAR_DOT = 8, - CHAR_DOLLAR_QUOTED_STRING = 9; - - // these are token types, see also types in ParserUtil - - /** - * Token with parameter. - */ - private static final int PARAMETER = LAST_KEYWORD + 1; - - /** - * End of input. - */ - private static final int END_OF_INPUT = PARAMETER + 1; - - /** - * Token with literal. - */ - private static final int LITERAL = END_OF_INPUT + 1; - - /** - * The token "=". - */ - private static final int EQUAL = LITERAL + 1; - - /** - * The token ">=". - */ - private static final int BIGGER_EQUAL = EQUAL + 1; - - /** - * The token ">". - */ - private static final int BIGGER = BIGGER_EQUAL + 1; - - /** - * The token "<". - */ - private static final int SMALLER = BIGGER + 1; - - /** - * The token "<=". - */ - private static final int SMALLER_EQUAL = SMALLER + 1; - - /** - * The token "<>" or "!=". - */ - private static final int NOT_EQUAL = SMALLER_EQUAL + 1; - - /** - * The token "@". - */ - private static final int AT = NOT_EQUAL + 1; - - /** - * The token "-". - */ - private static final int MINUS_SIGN = AT + 1; - - /** - * The token "+". - */ - private static final int PLUS_SIGN = MINUS_SIGN + 1; - - /** - * The token "||". - */ - private static final int CONCATENATION = PLUS_SIGN + 1; - - /** - * The token "(". - */ - private static final int OPEN_PAREN = CONCATENATION + 1; - - /** - * The token ")". - */ - private static final int CLOSE_PAREN = OPEN_PAREN + 1; - - /** - * The token &. - */ - private static final int AMPERSAND = CLOSE_PAREN + 1; - - /** - * The token "&&". - */ - private static final int SPATIAL_INTERSECTS = AMPERSAND + 1; - - /** - * The token "*". - */ - private static final int ASTERISK = SPATIAL_INTERSECTS + 1; - - /** - * The token ",". - */ - private static final int COMMA = ASTERISK + 1; - - /** - * The token ".". - */ - private static final int DOT = COMMA + 1; - - /** - * The token "{". - */ - private static final int OPEN_BRACE = DOT + 1; - - /** - * The token "}". - */ - private static final int CLOSE_BRACE = OPEN_BRACE + 1; - - /** - * The token "/". - */ - private static final int SLASH = CLOSE_BRACE + 1; - - /** - * The token "%". - */ - private static final int PERCENT = SLASH + 1; - - /** - * The token ";". - */ - private static final int SEMICOLON = PERCENT + 1; - - /** - * The token ":". - */ - private static final int COLON = SEMICOLON + 1; - - /** - * The token "[". - */ - private static final int OPEN_BRACKET = COLON + 1; - - /** - * The token "]". - */ - private static final int CLOSE_BRACKET = OPEN_BRACKET + 1; - - /** - * The token "~". - */ - private static final int TILDE = CLOSE_BRACKET + 1; - - /** - * The token "::". - */ - private static final int COLON_COLON = TILDE + 1; - - /** - * The token ":=". - */ - private static final int COLON_EQ = COLON_COLON + 1; - - /** - * The token "!~". - */ - private static final int NOT_TILDE = COLON_EQ + 1; - - private static final String[] TOKENS = { - // Unused - null, - // KEYWORD - null, - // IDENTIFIER - null, - // ALL - "ALL", - // AND - "AND", - // ANY - "ANY", - // ARRAY - "ARRAY", - // AS - "AS", - // ASYMMETRIC - "ASYMMETRIC", - // AUTHORIZATION - "AUTHORIZATION", - // BETWEEN - "BETWEEN", - // CASE - "CASE", - // CAST - "CAST", - // CHECK - "CHECK", - // CONSTRAINT - "CONSTRAINT", - // CROSS - "CROSS", - // CURRENT_CATALOG - "CURRENT_CATALOG", - // CURRENT_DATE - "CURRENT_DATE", - // CURRENT_PATH - "CURRENT_PATH", - // CURRENT_ROLE - "CURRENT_ROLE", - // CURRENT_SCHEMA - "CURRENT_SCHEMA", - // CURRENT_TIME - "CURRENT_TIME", - // CURRENT_TIMESTAMP - "CURRENT_TIMESTAMP", - // CURRENT_USER - "CURRENT_USER", - // DAY - "DAY", - // DEFAULT - "DEFAULT", - // DISTINCT - "DISTINCT", - // ELSE - "ELSE", - // END - "END", - // EXCEPT - "EXCEPT", - // EXISTS - "EXISTS", - // FALSE - "FALSE", - // FETCH - "FETCH", - // FOR - "FOR", - // FOREIGN - "FOREIGN", - // FROM - "FROM", - // FULL - "FULL", - // GROUP - "GROUP", - // HAVING - "HAVING", - // HOUR - "HOUR", - // IF - "IF", - // IN - "IN", - // INNER - "INNER", - // INTERSECT - "INTERSECT", - // INTERSECTS - "INTERSECTS", - // INTERVAL - "INTERVAL", - // IS - "IS", - // JOIN - "JOIN", - // KEY - "KEY", - // LEFT - "LEFT", - // LIKE - "LIKE", - // LIMIT - "LIMIT", - // LOCALTIME - "LOCALTIME", - // LOCALTIMESTAMP - "LOCALTIMESTAMP", - // MINUS - "MINUS", - // MINUTE - "MINUTE", - // MONTH - "MONTH", - // NATURAL - "NATURAL", - // NOT - "NOT", - // NULL - "NULL", - // OFFSET - "OFFSET", - // ON - "ON", - // OR - "OR", - // ORDER - "ORDER", - // PRIMARY - "PRIMARY", - // QUALIFY - "QUALIFY", - // RIGHT - "RIGHT", - // ROW - "ROW", - // ROWNUM - "ROWNUM", - // SECOND - "SECOND", - // SELECT - "SELECT", - // SESSION_USER - "SESSION_USER", - // SET - "SET", - // SOME - "SOME", - // SYMMETRIC - "SYMMETRIC", - // SYSTEM_USER - "SYSTEM_USER", - // TABLE - "TABLE", - // TO - "TO", - // TRUE - "TRUE", - // UESCAPE - "UESCAPE", - // UNION - "UNION", - // UNIQUE - "UNIQUE", - // UNKNOWN - "UNKNOWN", - // USER - "USER", - // USING - "USING", - // VALUE - "VALUE", - // VALUES - "VALUES", - // WHEN - "WHEN", - // WHERE - "WHERE", - // WINDOW - "WINDOW", - // WITH - "WITH", - // YEAR - "YEAR", - // _ROWID_ - "_ROWID_", - // PARAMETER - "?", - // END - null, - // VALUE - null, - // EQUAL - "=", - // BIGGER_EQUAL - ">=", - // BIGGER - ">", - // SMALLER - "<", - // SMALLER_EQUAL - "<=", - // NOT_EQUAL - "<>", - // AT - "@", - // MINUS_SIGN - "-", - // PLUS_SIGN - "+", - // STRING_CONCAT - "||", - // OPEN_PAREN - "(", - // CLOSE_PAREN - ")", - // SPATIAL_INTERSECTS - "&&", - // ASTERISK - "*", - // COMMA - ",", - // DOT - ".", - // OPEN_BRACE - "{", - // CLOSE_BRACE - "}", - // SLASH - "/", - // PERCENT - "%", - // SEMICOLON - ";", - // COLON - ":", - // OPEN_BRACKET - "[", - // CLOSE_BRACKET - "]", - // TILDE - "~", - // COLON_COLON - "::", - // COLON_EQ - ":=", - // NOT_TILDE - "!~", - // End - }; - - private static final Comparator TABLE_FILTER_COMPARATOR = (o1, o2) -> { - if (o1 == o2) - return 0; - assert o1.getOrderInFrom() != o2.getOrderInFrom(); - return o1.getOrderInFrom() > o2.getOrderInFrom() ? 1 : -1; - }; - private final Database database; private final SessionLocal session; @@ -839,29 +436,18 @@ public class Parser { private final BitSet nonKeywords; - /** indicates character-type for each char in sqlCommand */ - private int[] characterTypes; + ArrayList tokens; + int tokenIndex; + Token token; private int currentTokenType; private String currentToken; - private boolean currentTokenQuoted; - private Value currentValue; - private String originalSQL; - /** copy of originalSQL, with comments blanked out */ private String sqlCommand; - /** cached array if chars from sqlCommand */ - private char[] sqlCommandChars; - /** index into sqlCommand of previous token */ - private int lastParseIndex; - /** index into sqlCommand of current token */ - private int parseIndex; private CreateView createView; private Prepared currentPrepared; private Select currentSelect; private List cteCleanups; private ArrayList parameters; - private ArrayList indexedParameterList; private ArrayList suppliedParameters; - private ArrayList suppliedParameterList; private String schemaName; private ArrayList expectedList; private boolean rightsChecked; @@ -946,7 +532,7 @@ public Parser() { * @return the prepared object */ public Prepared prepare(String sql) { - Prepared p = parse(sql); + Prepared p = parse(sql, null); p.prepare(); if (currentTokenType != END_OF_INPUT) { throw getSyntaxError(); @@ -962,7 +548,7 @@ public Prepared prepare(String sql) { */ public Command prepareCommand(String sql) { try { - Prepared p = parse(sql); + Prepared p = parse(sql, null); if (currentTokenType != SEMICOLON && currentTokenType != END_OF_INPUT) { addExpected(SEMICOLON); throw getSyntaxError(); @@ -973,50 +559,58 @@ public Command prepareCommand(String sql) { CommandContainer.clearCTE(session, p); throw t; } - if (parseIndex < sql.length()) { - sql = sql.substring(0, parseIndex); + int sqlIndex = token.start(); + if (sqlIndex < sql.length()) { + sql = sql.substring(0, sqlIndex); } CommandContainer c = new CommandContainer(session, sql, p); - if (currentTokenType == SEMICOLON) { - String remaining = originalSQL.substring(parseIndex); - if (!StringUtils.isWhitespaceOrEmpty(remaining)) { - return prepareCommandList(c, p, sql, remaining); - } + while (currentTokenType == SEMICOLON) { + read(); + } + if (currentTokenType != END_OF_INPUT) { + int offset = token.start(); + return prepareCommandList(c, p, sql, sqlCommand.substring(offset), getRemainingTokens(offset)); } return c; } catch (DbException e) { - throw e.addSQL(originalSQL); + throw e.addSQL(sqlCommand); } } - private CommandList prepareCommandList(CommandContainer command, Prepared p, String sql, String remaining) { + private CommandList prepareCommandList(CommandContainer command, Prepared p, String sql, String remainingSql, + ArrayList remainingTokens) { try { ArrayList list = Utils.newSmallArrayList(); - do { + for (;;) { if (p instanceof DefineCommand) { // Next commands may depend on results of this command. - return new CommandList(session, sql, command, list, parameters, remaining); + return new CommandList(session, sql, command, list, parameters, remainingSql); } suppliedParameters = parameters; - suppliedParameterList = indexedParameterList; try { - p = parse(remaining); + p = parse(remainingSql, remainingTokens); } catch (DbException ex) { // This command may depend on results of previous commands. if (ex.getErrorCode() == ErrorCode.CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS) { throw ex; } - return new CommandList(session, sql, command, list, parameters, remaining); + return new CommandList(session, sql, command, list, parameters, remainingSql); } list.add(p); - if (currentTokenType == END_OF_INPUT) { - break; - } - if (currentTokenType != SEMICOLON) { + if (currentTokenType != SEMICOLON && currentTokenType != END_OF_INPUT) { addExpected(SEMICOLON); throw getSyntaxError(); } - } while (!StringUtils.isWhitespaceOrEmpty(remaining = originalSQL.substring(parseIndex))); + while (currentTokenType == SEMICOLON) { + read(); + } + if (currentTokenType == END_OF_INPUT) { + break; + } + int offset = token.start(); + remainingSql = sqlCommand.substring(offset); + remainingTokens = getRemainingTokens(offset); + } return new CommandList(session, sql, command, list, parameters, null); } catch (Throwable t) { command.clearCTE(); @@ -1024,13 +618,26 @@ private CommandList prepareCommandList(CommandContainer command, Prepared p, Str } } + private ArrayList getRemainingTokens(int offset) { + List subList = tokens.subList(tokenIndex, tokens.size()); + ArrayList remainingTokens = new ArrayList<>(subList); + subList.clear(); + tokens.add(new Token.EndOfInputToken(offset)); + for (Token token : remainingTokens) { + token.subtractFromStart(offset); + } + return remainingTokens; + } + /** * Parse the statement, but don't prepare it for execution. * * @param sql the SQL statement to parse + * @param tokens tokens, or null * @return the prepared object */ - Prepared parse(String sql) { + Prepared parse(String sql, ArrayList tokens) { + initialize(sql, tokens, false); Prepared p; try { // first, try the fast variant @@ -1038,6 +645,7 @@ Prepared parse(String sql) { } catch (DbException e) { if (e.getErrorCode() == ErrorCode.SYNTAX_ERROR_1) { // now, get the detailed exception + resetTokenIndex(); p = parse(sql, true); } else { throw e.addSQL(sql); @@ -1049,14 +657,12 @@ Prepared parse(String sql) { } private Prepared parse(String sql, boolean withExpectedList) { - initialize(sql); if (withExpectedList) { expectedList = new ArrayList<>(); } else { expectedList = null; } parameters = suppliedParameters != null ? suppliedParameters : Utils.newSmallArrayList(); - indexedParameterList = suppliedParameterList; currentSelect = null; currentPrepared = null; createView = null; @@ -1077,7 +683,7 @@ private Prepared parse(String sql, boolean withExpectedList) { } private Prepared parsePrepared() { - int start = lastParseIndex; + int start = tokenIndex; Prepared c = null; switch (currentTokenType) { case END_OF_INPUT: @@ -1087,10 +693,10 @@ private Prepared parsePrepared() { return c; case PARAMETER: // read the ? as a parameter - readTerm(); // this is an 'out' parameter - set a dummy value - parameters.get(0).setValue(ValueNull.INSTANCE); + readParameter().setValue(ValueNull.INSTANCE); read(EQUAL); + start = tokenIndex; read("CALL"); c = parseCall(); break; @@ -1109,7 +715,7 @@ private Prepared parsePrepared() { c = parseSet(); break; case IDENTIFIER: - if (currentTokenQuoted) { + if (token.isQuoted()) { break; } /* @@ -1242,14 +848,12 @@ private Prepared parsePrepared() { if (c == null) { throw getSyntaxError(); } - if (indexedParameterList != null) { - for (int i = 0, size = indexedParameterList.size(); - i < size; i++) { - if (indexedParameterList.get(i) == null) { - indexedParameterList.set(i, new Parameter(i)); + if (parameters != null) { + for (int i = 0, size = parameters.size(); i < size; i++) { + if (parameters.get(i) == null) { + parameters.set(i, new Parameter(i)); } } - parameters = indexedParameterList; } boolean withParamValues = readIf(OPEN_BRACE); if (withParamValues) { @@ -1281,10 +885,9 @@ private Prepared parsePrepared() { private DbException getSyntaxError() { if (expectedList == null || expectedList.isEmpty()) { - return DbException.getSyntaxError(sqlCommand, parseIndex); + return DbException.getSyntaxError(sqlCommand, token.start()); } - return DbException.getSyntaxError(sqlCommand, parseIndex, - StringUtils.join(new StringBuilder(), expectedList, ", ").toString()); + return DbException.getSyntaxError(sqlCommand, token.start(), String.join(", ", expectedList)); } private Prepared parseBackup() { @@ -1507,7 +1110,7 @@ private Update parseUpdate(int start) { command.setTableFilter(filter); command.setSetClauseList(readUpdateSetClause(filter)); if (database.getMode().allowUsingFromClauseInUpdateStatement && readIf(FROM)) { - TableFilter fromTable = readTableFilter(); + TableFilter fromTable = readTablePrimary(); command.setFromTableFilter(fromTable); } if (readIf(WHERE)) { @@ -1788,27 +1391,127 @@ private static Prepared prepare(SessionLocal s, String sql, return prep; } + private boolean isDerivedTable() { + int offset = tokenIndex; + int level = 0; + while (tokens.get(offset).tokenType() == OPEN_PAREN) { + level++; + offset++; + } + boolean query = isDirectQuery(offset); + s: if (query && level > 0) { + offset = scanToCloseParen(offset + 1); + if (offset < 0) { + query = false; + break s; + } + for (;;) { + switch (tokens.get(offset).tokenType()) { + case SEMICOLON: + case END_OF_INPUT: + query = false; + break s; + case OPEN_PAREN: + offset = scanToCloseParen(offset + 1); + if (offset < 0) { + query = false; + break s; + } + break; + case CLOSE_PAREN: + if (--level == 0) { + break s; + } + offset++; + break; + case JOIN: + query = false; + break s; + default: + offset++; + } + } + } + return query; + } + private boolean isQuery() { - int start = lastParseIndex; - while (readIf(OPEN_PAREN)) { - // need to read ahead, it could be a nested union: - // ((select 1) union (select 1)) + int offset = tokenIndex; + int level = 0; + while (tokens.get(offset).tokenType() == OPEN_PAREN) { + level++; + offset++; + } + boolean query = isDirectQuery(offset); + s: if (query && level > 0) { + offset++; + do { + offset = scanToCloseParen(offset); + if (offset < 0) { + query = false; + break s; + } + switch (tokens.get(offset).tokenType()) { + default: + query = false; + break s; + case END_OF_INPUT: + case SEMICOLON: + case CLOSE_PAREN: + case ORDER: + case OFFSET: + case FETCH: + case LIMIT: + case UNION: + case EXCEPT: + case MINUS: + case INTERSECT: + } + } while (--level > 0); + } + return query; + } + + private int scanToCloseParen(int offset) { + for (int level = 0;;) { + switch (tokens.get(offset).tokenType()) { + case SEMICOLON: + case END_OF_INPUT: + return -1; + case OPEN_PAREN: + level++; + break; + case CLOSE_PAREN: + if (--level < 0) { + return offset + 1; + } + } + offset++; + } + } + + private boolean isQueryQuick() { + int offset = tokenIndex; + while (tokens.get(offset).tokenType() == OPEN_PAREN) { + offset++; } + return isDirectQuery(offset); + } + + private boolean isDirectQuery(int offset) { boolean query; - switch (currentTokenType) { + switch (tokens.get(offset).tokenType()) { case SELECT: case VALUES: case WITH: query = true; break; case TABLE: - read(); - query = !readIf(OPEN_PAREN); + query = tokens.get(offset + 1).tokenType() != OPEN_PAREN; break; default: query = false; } - reread(start); return query; } @@ -1827,7 +1530,7 @@ private Prepared parseMergeInto(TableFilter targetTableFilter, int start) { command.setTable(targetTableFilter.getTable()); Table table = command.getTable(); if (readIf(OPEN_PAREN)) { - if (isQuery()) { + if (isQueryQuick()) { command.setQuery(parseQuery()); read(CLOSE_PAREN); return command; @@ -1850,39 +1553,7 @@ private Prepared parseMergeInto(TableFilter targetTableFilter, int start) { private MergeUsing parseMergeUsing(TableFilter targetTableFilter, int start) { MergeUsing command = new MergeUsing(session, targetTableFilter); currentPrepared = command; - - if (isQuery()) { - Query query = parseQuery(); - String queryAlias = readFromAlias(null); - ArrayList derivedColumnNames = null; - if (queryAlias == null) { - queryAlias = Constants.PREFIX_QUERY_ALIAS + parseIndex; - } else { - derivedColumnNames = readDerivedColumnNames(); - } - - String[] querySQLOutput = new String[1]; - List columnTemplateList = TableView.createQueryColumnTemplateList(null, query, querySQLOutput); - TableView temporarySourceTableView = createCTEView( - queryAlias, querySQLOutput[0], - columnTemplateList, false/* no recursion */, - false/* do not add to session */, - true /* isTemporary */ - ); - TableFilter sourceTableFilter = new TableFilter(session, - temporarySourceTableView, queryAlias, - rightsChecked, null, 0, null); - if (derivedColumnNames != null) { - sourceTableFilter.setDerivedColumns(derivedColumnNames); - } - command.setSourceTableFilter(sourceTableFilter); - if (cteCleanups == null) { - cteCleanups = new ArrayList<>(1); - } - cteCleanups.add(temporarySourceTableView); - } else { - command.setSourceTableFilter(readTableFilter()); - } + command.setSourceTableFilter(readTableReference()); read(ON); Expression condition = readExpression(); command.setOnCondition(condition); @@ -1954,7 +1625,7 @@ private Insert parseInsert(int start) { command.setTable(table); Column[] columns = null; if (readIf(OPEN_PAREN)) { - if (isQuery()) { + if (isQueryQuick()) { command.setQuery(parseQuery()); read(CLOSE_PAREN); return command; @@ -2079,7 +1750,7 @@ private Merge parseReplace(int start) { Table table = readTableOrView(); command.setTable(table); if (readIf(OPEN_PAREN)) { - if (isQuery()) { + if (isQueryQuick()) { command.setQuery(parseQuery()); read(CLOSE_PAREN); return command; @@ -2119,39 +1790,32 @@ private void parseValuesForCommand(CommandWithValues command) { } while (readIf(COMMA)); } - private TableFilter readTableFilter() { + private TableFilter readTablePrimary() { Table table; String alias = null; label: if (readIf(OPEN_PAREN)) { - if (isQuery()) { - return readQueryTableFilter(); + if (isDerivedTable()) { + // Derived table + return readDerivedTableWithCorrelation(); } else { - TableFilter top; - top = readTableFilter(); - top = readJoin(top); + // Parenthesized joined table + TableFilter tableFilter = readTableReference(); read(CLOSE_PAREN); - alias = readFromAlias(null); - if (alias != null) { - top.setAlias(alias); - ArrayList derivedColumnNames = readDerivedColumnNames(); - if (derivedColumnNames != null) { - top.setDerivedColumns(derivedColumnNames); - } - } - return top; + return readCorrelation(tableFilter); } } else if (readIf(VALUES)) { TableValueConstructor query = parseValues(); alias = session.getNextSystemIdentifier(sqlCommand); table = query.toTable(alias, null, parameters, createView != null, currentSelect); } else if (readIf(TABLE)) { + // Table function derived table read(OPEN_PAREN); ArrayTableFunction function = readTableFunction(ArrayTableFunction.TABLE); table = new FunctionTable(database.getMainSchema(), session, function); } else { - boolean quoted = currentTokenQuoted; + boolean quoted = token.isQuoted(); String tableName = readIdentifier(); - int backupIndex = parseIndex; + int backupIndex = tokenIndex; schemaName = null; if (readIf(DOT)) { tableName = readIdentifierWithSchema2(tableName); @@ -2218,8 +1882,20 @@ private TableFilter readTableFilter() { return buildTableFilter(table, alias, derivedColumnNames, indexHints); } - private TableFilter readQueryTableFilter() { - Query query = parseSelectUnion(); + private TableFilter readCorrelation(TableFilter tableFilter) { + String alias = readFromAlias(null); + if (alias != null) { + tableFilter.setAlias(alias); + ArrayList derivedColumnNames = readDerivedColumnNames(); + if (derivedColumnNames != null) { + tableFilter.setDerivedColumns(derivedColumnNames); + } + } + return tableFilter; + } + + private TableFilter readDerivedTableWithCorrelation() { + Query query = parseQueryExpression(); read(CLOSE_PAREN); Table table; String alias; @@ -2271,7 +1947,7 @@ private TableFilter buildTableFilter(Table table, String alias, ArrayList params = new ArrayList<>(size); for (int i = paramIndex; i < size; i++) { @@ -2925,9 +2601,32 @@ private Prepared parseWithStatementOrQuery(int start) { return command; } - private Query parseSelectUnion() { - int start = lastParseIndex; - Query command = parseQuerySub(); + private Query parseQueryExpression() { + Query query; + if (readIf(WITH)) { + try { + query = (Query) parseWith(); + } catch (ClassCastException e) { + throw DbException.get(ErrorCode.SYNTAX_ERROR_1, "WITH statement supports only query in this context"); + } + // recursive can not be lazy + query.setNeverLazy(true); + } else { + query = parseQueryExpressionBodyAndEndOfQuery(); + } + return query; + } + + private Query parseQueryExpressionBodyAndEndOfQuery() { + int start = tokenIndex; + Query command = parseQueryExpressionBody(); + parseEndOfQuery(command); + setSQL(command, start); + return command; + } + + private Query parseQueryExpressionBody() { + Query command = parseQueryTerm(); for (;;) { SelectUnion.UnionType type; if (readIf(UNION)) { @@ -2939,15 +2638,19 @@ private Query parseSelectUnion() { } } else if (readIf(EXCEPT) || readIf(MINUS)) { type = SelectUnion.UnionType.EXCEPT; - } else if (readIf(INTERSECT)) { - type = SelectUnion.UnionType.INTERSECT; } else { break; } - command = new SelectUnion(session, type, command, parseQuerySub()); + command = new SelectUnion(session, type, command, parseQueryTerm()); + } + return command; + } + + private Query parseQueryTerm() { + Query command = parseQueryPrimary(); + while (readIf(INTERSECT)) { + command = new SelectUnion(session, SelectUnion.UnionType.INTERSECT, command, parseQueryPrimary()); } - parseEndOfQuery(command); - setSQL(command, start); return command; } @@ -2960,7 +2663,7 @@ private void parseEndOfQuery(Query command) { } ArrayList orderList = Utils.newSmallArrayList(); do { - boolean canBeNumber = !readIf(EQUAL); + boolean canBeNumber = currentTokenType == LITERAL; QueryOrderBy order = new QueryOrderBy(); Expression expr = readExpression(); if (canBeNumber && expr instanceof ValueExpression && expr.getType().getValueType() == Value.INTEGER) { @@ -3069,25 +2772,13 @@ private void parseIsolationClause() { } } - private Query parseQuerySub() { + private Query parseQueryPrimary() { if (readIf(OPEN_PAREN)) { - Query command = parseSelectUnion(); + Query command = parseQueryExpressionBodyAndEndOfQuery(); read(CLOSE_PAREN); return command; } - if (readIf(WITH)) { - Query query; - try { - query = (Query) parseWith(); - } catch (ClassCastException e) { - throw DbException.get(ErrorCode.SYNTAX_ERROR_1, - "WITH statement supports only SELECT (query) in this context"); - } - // recursive can not be lazy - query.setNeverLazy(true); - return query; - } - int start = lastParseIndex; + int start = tokenIndex; if (readIf(SELECT)) { return parseSelect(start); } else if (readIf(TABLE)) { @@ -3099,52 +2790,41 @@ private Query parseQuerySub() { private void parseSelectFromPart(Select command) { do { - TableFilter filter = readTableFilter(); - parseJoinTableFilter(filter, command); - } while (readIf(COMMA)); - - // Parser can reorder joined table filters, need to explicitly sort them - // to get the order as it was in the original query. - if (session.isForceJoinOrder()) { - command.getTopFilters().sort(TABLE_FILTER_COMPARATOR); - } - } - - private void parseJoinTableFilter(TableFilter top, final Select command) { - top = readJoin(top); - command.addTableFilter(top, true); - boolean isOuter = false; - while (true) { - TableFilter n = top.getNestedJoin(); - if (n != null) { - n.visit(f -> command.addTableFilter(f, false)); - } - TableFilter join = top.getJoin(); - if (join == null) { - break; - } - isOuter = isOuter | join.isJoinOuter(); - if (isOuter) { - command.addTableFilter(join, false); - } else { - // make flat so the optimizer can work better - Expression on = join.getJoinCondition(); - if (on != null) { - command.addCondition(on); + TableFilter top = readTableReference(); + command.addTableFilter(top, true); + boolean isOuter = false; + for (;;) { + TableFilter n = top.getNestedJoin(); + if (n != null) { + n.visit(f -> command.addTableFilter(f, false)); + } + TableFilter join = top.getJoin(); + if (join == null) { + break; } - join.removeJoinCondition(); - top.removeJoin(); - command.addTableFilter(join, true); + isOuter = isOuter | join.isJoinOuter(); + if (isOuter) { + command.addTableFilter(join, false); + } else { + // make flat so the optimizer can work better + Expression on = join.getJoinCondition(); + if (on != null) { + command.addCondition(on); + } + join.removeJoinCondition(); + top.removeJoin(); + command.addTableFilter(join, true); + } + top = join; } - top = join; - } + } while (readIf(COMMA)); } private void parseSelectExpressions(Select command) { - Select temp = currentSelect; - // make sure aggregate functions will not work in TOP and LIMIT - currentSelect = null; if (database.getMode().topInSelect && readIf("TOP")) { + Select temp = currentSelect; + // make sure aggregate functions will not work in TOP and LIMIT + currentSelect = null; // can't read more complex expressions here because // SELECT TOP 1 +? A FROM TEST could mean // SELECT TOP (1+?) A FROM TEST or @@ -3157,8 +2837,8 @@ private void parseSelectExpressions(Select command) { read("TIES"); command.setWithTies(true); } + currentSelect = temp; } - currentSelect = temp; if (readIf(DISTINCT)) { if (readIf(ON)) { read(OPEN_PAREN); @@ -3268,12 +2948,12 @@ private Select parseSelect(int start) { } if (readIf(WINDOW)) { do { - int index = parseIndex; + int sqlIndex = token.start(); String name = readIdentifier(); read(AS); Window w = readWindowSpecification(); if (!currentSelect.addWindow(name, w)) { - throw DbException.getSyntaxError(sqlCommand, index, "unique identifier"); + throw DbException.getSyntaxError(sqlCommand, sqlIndex, "unique identifier"); } } while (readIf(COMMA)); } @@ -3296,26 +2976,12 @@ private Select parseSelect(int start) { * grouping set */ private boolean isOrdinaryGroupingSet() { - int lastIndex = lastParseIndex, index = parseIndex; - int level = 1; - loop: for (;;) { - read(); - switch (currentTokenType) { - case CLOSE_PAREN: - if (--level <= 0) { - break loop; - } - break; - case OPEN_PAREN: - level++; - break; - case END_OF_INPUT: - addExpected(CLOSE_PAREN); - throw getSyntaxError(); - } + int offset = scanToCloseParen(tokenIndex + 1); + if (offset < 0) { + // Try to parse as expression to get better syntax error + return false; } - read(); - switch (currentTokenType) { + switch (tokens.get(offset).tokenType()) { // End of query case CLOSE_PAREN: case SEMICOLON: @@ -3337,10 +3003,9 @@ private boolean isOrdinaryGroupingSet() { case FETCH: case LIMIT: case FOR: - reread(index); + setTokenIndex(tokenIndex + 1); return true; default: - reread(lastIndex); return false; } } @@ -3356,8 +3021,38 @@ private Query parseExplicitTable(int start) { return command; } - private void setSQL(Prepared command, int startIndex) { - command.setSQL(StringUtils.trimSubstring(originalSQL, startIndex, lastParseIndex)); + private void setSQL(Prepared command, int start) { + String s = sqlCommand; + int beginIndex = tokens.get(start).start(); + int endIndex = token.start(); + while (beginIndex < endIndex && s.charAt(beginIndex) <= ' ') { + beginIndex++; + } + while (beginIndex < endIndex && s.charAt(endIndex - 1) <= ' ') { + endIndex--; + } + s = s.substring(beginIndex, endIndex); + ArrayList commandTokens; + if (start == 0 && currentTokenType == END_OF_INPUT) { + commandTokens = tokens; + if (beginIndex != 0) { + for (int i = 0, l = commandTokens.size() - 1; i < l; i++) { + commandTokens.get(i).subtractFromStart(beginIndex); + } + } + token.setStart(s.length()); + sqlCommand = s; + } else { + List subList = tokens.subList(start, tokenIndex); + commandTokens = new ArrayList<>(subList.size() + 1); + for (int i = start; i < tokenIndex; i++) { + Token t = tokens.get(i).clone(); + t.subtractFromStart(beginIndex); + commandTokens.add(t); + } + commandTokens.add(new Token.EndOfInputToken(s.length())); + } + command.setSQL(s, commandTokens); } private Expression readExpressionOrDefault() { @@ -3437,15 +3132,6 @@ private Expression readCondition() { read(CLOSE_PAREN); return new ExistsPredicate(query); } - case INTERSECTS: { - read(); - read(OPEN_PAREN); - Expression r1 = readConcat(); - read(COMMA); - Expression r2 = readConcat(); - read(CLOSE_PAREN); - return new Comparison(Comparison.SPATIAL_INTERSECTS, r1, r2, false); - } case UNIQUE: { read(); read(OPEN_PAREN); @@ -3454,8 +3140,21 @@ private Expression readCondition() { return new UniquePredicate(query); } default: + int index = tokenIndex; + if (readIf("INTERSECTS")) { + if (readIf(OPEN_PAREN)) { + Expression r1 = readConcat(); + read(COMMA); + Expression r2 = readConcat(); + read(CLOSE_PAREN); + return new Comparison(Comparison.SPATIAL_INTERSECTS, r1, r2, false); + } else { + setTokenIndex(index); + } + } if (expectedList != null) { - addMultipleExpected(NOT, EXISTS, INTERSECTS, UNIQUE); + addMultipleExpected(NOT, EXISTS, UNIQUE); + addExpected("INTERSECTS"); } } Expression l, c = readConcat(); @@ -3463,13 +3162,11 @@ private Expression readCondition() { l = c; // special case: NOT NULL is not part of an expression (as in CREATE // TABLE TEST(ID INT DEFAULT 0 NOT NULL)) - int backup = parseIndex; + int backup = tokenIndex; boolean not = readIf(NOT); if (not && isToken(NULL)) { // this really only works for NOT NULL! - parseIndex = backup; - currentToken = "NOT"; - currentTokenType = NOT; + setTokenIndex(backup); break; } c = readConditionRightHandSide(l, not, false); @@ -3643,7 +3340,7 @@ private Expression readLikePredicate(Expression left, LikeType likeType, boolean } private Expression readComparison(Expression left, int compareType, boolean whenOperand) { - int start = lastParseIndex; + int start = tokenIndex; if (readIf(ALL)) { read(OPEN_PAREN); if (isQuery()) { @@ -3651,7 +3348,7 @@ private Expression readComparison(Expression left, int compareType, boolean when left = new ConditionInQuery(left, false, whenOperand, query, true, compareType); read(CLOSE_PAREN); } else { - reread(start); + setTokenIndex(start); left = new Comparison(compareType, left, readConcat(), whenOperand); } } else if (readIf(ANY) || readIf(SOME)) { @@ -3665,7 +3362,7 @@ private Expression readComparison(Expression left, int compareType, boolean when left = new ConditionInQuery(left, false, whenOperand, query, false, compareType); read(CLOSE_PAREN); } else { - reread(start); + setTokenIndex(start); left = new Comparison(compareType, left, readConcat(), whenOperand); } } else { @@ -3747,6 +3444,7 @@ private Expression readTildeCondition(Expression r, boolean not) { private Expression readAggregate(AggregateType aggregateType, String aggregateName) { if (currentSelect == null) { + expectedList = null; throw getSyntaxError(); } Aggregate r; @@ -3821,12 +3519,12 @@ private Expression readAggregate(AggregateType aggregateType, String aggregateNa orderByList = null; } Expression[] args = new Expression[] { arg }; - int index = lastParseIndex; + int index = tokenIndex; read(CLOSE_PAREN); if (orderByList == null && isToken("WITHIN")) { r = readWithinGroup(aggregateType, args, distinct, extraArguments, false, false); } else { - reread(index); + setTokenIndex(index); r = new Aggregate(AggregateType.LISTAGG, args, currentSelect, distinct); r.setExtraArguments(extraArguments); if (orderByList != null) { @@ -3874,7 +3572,7 @@ private Expression readAggregate(AggregateType aggregateType, String aggregateNa String sql = expr.getSQL(HasSQL.DEFAULT_SQL_FLAGS), sql2 = expr2.getSQL(HasSQL.DEFAULT_SQL_FLAGS); if (!sql.equals(sql2)) { throw DbException.getSyntaxError(ErrorCode.IDENTICAL_EXPRESSIONS_SHOULD_BE_USED, sqlCommand, - lastParseIndex, sql, sql2); + token.start(), sql, sql2); } readAggregateOrder(r, expr, true); } else { @@ -4041,13 +3739,13 @@ private Window readWindowSpecification() { read(OPEN_PAREN); String parent = null; if (currentTokenType == IDENTIFIER) { - String token = currentToken; - if (currentTokenQuoted || ( // - !equalsToken(token, "PARTITION") // - && !equalsToken(token, "ROWS") // - && !equalsToken(token, "RANGE") // - && !equalsToken(token, "GROUPS"))) { - parent = token; + String current = currentToken; + if (token.isQuoted() || ( // + !equalsToken(current, "PARTITION") // + && !equalsToken(current, "ROWS") // + && !equalsToken(current, "RANGE") // + && !equalsToken(current, "GROUPS"))) { + parent = current; read(); } } @@ -4086,7 +3784,7 @@ private WindowFrame readWindowFrame() { starting = readWindowFrameStarting(); following = null; } - int idx = lastParseIndex; + int sqlIndex = token.start(); WindowFrameExclusion exclusion = WindowFrameExclusion.EXCLUDE_NO_OTHERS; if (readIf("EXCLUDE")) { if (readIf("CURRENT")) { @@ -4103,7 +3801,7 @@ private WindowFrame readWindowFrame() { } WindowFrame frame = new WindowFrame(units, starting, following, exclusion); if (!frame.isValid()) { - throw DbException.getSyntaxError(sqlCommand, idx); + throw DbException.getSyntaxError(sqlCommand, sqlIndex); } return frame; } @@ -4921,13 +4619,13 @@ private int readDateTimeField() { int field = -1; switch (currentTokenType) { case IDENTIFIER: - if (!currentTokenQuoted) { + if (!token.isQuoted()) { field = DateTimeFunction.getField(currentToken); } break; case LITERAL: - if (currentValue.getValueType() == Value.VARCHAR) { - field = DateTimeFunction.getField(currentValue.getString()); + if (token.value(session).getValueType() == Value.VARCHAR) { + field = DateTimeFunction.getField(token.value(session).getString()); } break; case YEAR: @@ -5030,7 +4728,7 @@ private void readRespectOrIgnoreNulls(WindowFunction function) { } private boolean readJsonObjectFunctionFlags(ExpressionWithFlags function, boolean forArray) { - int start = lastParseIndex; + int start = tokenIndex; boolean result = false; int flags = function.getFlags(); if (readIf(NULL)) { @@ -5039,7 +4737,7 @@ private boolean readJsonObjectFunctionFlags(ExpressionWithFlags function, boolea flags &= ~JsonConstructorUtils.JSON_ABSENT_ON_NULL; result = true; } else { - reread(start); + setTokenIndex(start); return false; } } else if (readIf("ABSENT")) { @@ -5048,7 +4746,7 @@ private boolean readJsonObjectFunctionFlags(ExpressionWithFlags function, boolea flags |= JsonConstructorUtils.JSON_ABSENT_ON_NULL; result = true; } else { - reread(start); + setTokenIndex(start); return false; } } @@ -5066,7 +4764,7 @@ private boolean readJsonObjectFunctionFlags(ExpressionWithFlags function, boolea } else if (result) { throw getSyntaxError(); } else { - reread(start); + setTokenIndex(start); return false; } } @@ -5164,7 +4862,7 @@ private SequenceValue readIfSequencePseudoColumn(String schema, String objectNam Sequence sequence = findSequence(schema, objectName); if (sequence != null) { read(); - return new SequenceValue(sequence, getCurrentSelectOrPrepared()); + return new SequenceValue(sequence, getCurrentPrepared()); } } else if (isToken("CURRVAL")) { Sequence sequence = findSequence(schema, objectName); @@ -5217,49 +4915,26 @@ private void checkDatabaseName(String databaseName) { } private Parameter readParameter() { - // there must be no space between ? and the number - boolean indexed = Character.isDigit(sqlCommandChars[parseIndex]); - + int index = ((Token.ParameterToken) token).index(); + read(); Parameter p; - if (indexed) { - readParameterIndex(); - if (indexedParameterList == null) { - if (parameters == null) { - // this can occur when parsing expressions only (for - // example check constraints) - throw getSyntaxError(); - } else if (!parameters.isEmpty()) { - throw DbException - .get(ErrorCode.CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS); - } - indexedParameterList = Utils.newSmallArrayList(); - } - int index = currentValue.getInt() - 1; - if (index < 0 || index >= Constants.MAX_PARAMETER_INDEX) { - throw DbException.getInvalidValueException( - "parameter index", index + 1); - } - if (indexedParameterList.size() <= index) { - indexedParameterList.ensureCapacity(index + 1); - while (indexedParameterList.size() <= index) { - indexedParameterList.add(null); - } - } - p = indexedParameterList.get(index); - if (p == null) { - p = new Parameter(index); - indexedParameterList.set(index, p); - parameters.add(p); - } - read(); - } else { - read(); - if (indexedParameterList != null) { - throw DbException - .get(ErrorCode.CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS); + if (parameters == null) { + parameters = Utils.newSmallArrayList(); + } + if (index > Constants.MAX_PARAMETER_INDEX) { + throw DbException.getInvalidValueException("parameter index", index); + } + index--; + if (parameters.size() <= index) { + parameters.ensureCapacity(index + 1); + while (parameters.size() < index) { + parameters.add(null); } - p = new Parameter(parameters.size()); + p = new Parameter(index); parameters.add(p); + } else if ((p = parameters.get(index)) == null) { + p = new Parameter(index); + parameters.set(index, p); } return p; } @@ -5285,7 +4960,7 @@ private Expression readTerm() { case MINUS_SIGN: read(); if (currentTokenType == LITERAL) { - r = ValueExpression.get(currentValue.negate()); + r = ValueExpression.get(token.value(session).negate()); int rType = r.getType().getValueType(); if (rType == Value.BIGINT && r.getValue(session).getLong() == Integer.MIN_VALUE) { @@ -5311,6 +4986,9 @@ private Expression readTerm() { read(); if (readIf(CLOSE_PAREN)) { r = ValueExpression.get(ValueRow.EMPTY); + } else if (isQuery()) { + r = new Subquery(parseQuery()); + read(CLOSE_PAREN); } else { r = readExpression(); if (readIfMore()) { @@ -5392,7 +5070,7 @@ private Expression readTerm() { if (currentSelect == null && currentPrepared == null) { throw getSyntaxError(); } - r = new Rownum(getCurrentSelectOrPrepared()); + r = new Rownum(getCurrentPrepared()); break; case NULL: read(); @@ -5403,7 +5081,7 @@ private Expression readTerm() { r = new ExpressionColumn(database, null, null); break; case LITERAL: - r = ValueExpression.get(currentValue); + r = ValueExpression.get(token.value(session)); read(); break; case VALUES: @@ -5515,7 +5193,7 @@ private Expression readTerm() { //$FALL-THROUGH$ case IDENTIFIER: String name = currentToken; - boolean quoted = currentTokenQuoted; + boolean quoted = token.isQuoted(); read(); if (readIf(OPEN_PAREN)) { r = readFunction(null, name); @@ -5551,7 +5229,7 @@ private Expression readTerm() { if (ti != null) { r = new CastSpecification(r, ti); } - int index = lastParseIndex; + int index = tokenIndex; if (readIf("AT")) { if (readIf("TIME")) { read("ZONE"); @@ -5561,14 +5239,14 @@ private Expression readTerm() { r = new TimeZoneOperation(r, null); continue; } else { - reread(index); + setTokenIndex(index); } } else if (readIf("FORMAT")) { if (readIf("JSON")) { r = new Format(r, FormatEnum.JSON); continue; } else { - reread(index); + setTokenIndex(index); } } break; @@ -5627,28 +5305,28 @@ private Expression readTermWithIdentifier(String name, boolean quoted) { switch (name.charAt(0) & 0xffdf) { case 'C': if (equalsToken("CURRENT", name)) { - int index = lastParseIndex; + int index = tokenIndex; if (readIf(VALUE) && readIf(FOR)) { return new SequenceValue(readSequence()); } - reread(index); + setTokenIndex(index); if (database.getMode().getEnum() == ModeEnum.DB2) { return parseDB2SpecialRegisters(name); } } break; case 'D': - if (currentTokenType == LITERAL && currentValue.getValueType() == Value.VARCHAR && + if (currentTokenType == LITERAL && token.value(session).getValueType() == Value.VARCHAR && (equalsToken("DATE", name) || equalsToken("D", name))) { - String date = currentValue.getString(); + String date = token.value(session).getString(); read(); return ValueExpression.get(ValueDate.parse(date)); } break; case 'E': - if (currentTokenType == LITERAL && currentValue.getValueType() == Value.VARCHAR // + if (currentTokenType == LITERAL && token.value(session).getValueType() == Value.VARCHAR // && equalsToken("E", name)) { - String text = currentValue.getString(); + String text = token.value(session).getString(); // the PostgreSQL ODBC driver uses // LIKE E'PROJECT\\_DATA' instead of LIKE // 'PROJECT\_DATA' @@ -5660,13 +5338,14 @@ && equalsToken("E", name)) { break; case 'G': if (currentTokenType == LITERAL) { - int t = currentValue.getValueType(); + int t = token.value(session).getValueType(); if (t == Value.VARCHAR && equalsToken("GEOMETRY", name)) { - ValueExpression v = ValueExpression.get(ValueGeometry.get(currentValue.getString())); + ValueExpression v = ValueExpression.get(ValueGeometry.get(token.value(session).getString())); read(); return v; } else if (t == Value.VARBINARY && equalsToken("GEOMETRY", name)) { - ValueExpression v = ValueExpression.get(ValueGeometry.getFromEWKB(currentValue.getBytesNoCopy())); + ValueExpression v = ValueExpression + .get(ValueGeometry.getFromEWKB(token.value(session).getBytesNoCopy())); read(); return v; } @@ -5674,13 +5353,13 @@ && equalsToken("E", name)) { break; case 'J': if (currentTokenType == LITERAL) { - int t = currentValue.getValueType(); + int t = token.value(session).getValueType(); if (t == Value.VARCHAR && equalsToken("JSON", name)) { - ValueExpression v = ValueExpression.get(ValueJson.fromJson(currentValue.getString())); + ValueExpression v = ValueExpression.get(ValueJson.fromJson(token.value(session).getString())); read(); return v; } else if (t == Value.VARBINARY && equalsToken("JSON", name)) { - ValueExpression v = ValueExpression.get(ValueJson.fromJson(currentValue.getBytesNoCopy())); + ValueExpression v = ValueExpression.get(ValueJson.fromJson(token.value(session).getBytesNoCopy())); read(); return v; } @@ -5688,11 +5367,11 @@ && equalsToken("E", name)) { break; case 'N': if (equalsToken("NEXT", name)) { - int index = lastParseIndex; + int index = tokenIndex; if (readIf(VALUE) && readIf(FOR)) { - return new SequenceValue(readSequence(), getCurrentSelectOrPrepared()); + return new SequenceValue(readSequence(), getCurrentPrepared()); } - reread(index); + setTokenIndex(index); } break; case 'T': @@ -5700,10 +5379,10 @@ && equalsToken("E", name)) { if (readIf(WITH)) { read("TIME"); read("ZONE"); - if (currentTokenType != LITERAL || currentValue.getValueType() != Value.VARCHAR) { + if (currentTokenType != LITERAL || token.value(session).getValueType() != Value.VARCHAR) { throw getSyntaxError(); } - String time = currentValue.getString(); + String time = token.value(session).getString(); read(); return ValueExpression.get(ValueTimeTimeZone.parse(time)); } else { @@ -5712,8 +5391,8 @@ && equalsToken("E", name)) { read("TIME"); read("ZONE"); } - if (currentTokenType == LITERAL && currentValue.getValueType() == Value.VARCHAR) { - String time = currentValue.getString(); + if (currentTokenType == LITERAL && token.value(session).getValueType() == Value.VARCHAR) { + String time = token.value(session).getString(); read(); return ValueExpression.get(ValueTime.parse(time)); } else if (without) { @@ -5724,10 +5403,10 @@ && equalsToken("E", name)) { if (readIf(WITH)) { read("TIME"); read("ZONE"); - if (currentTokenType != LITERAL || currentValue.getValueType() != Value.VARCHAR) { + if (currentTokenType != LITERAL || token.value(session).getValueType() != Value.VARCHAR) { throw getSyntaxError(); } - String timestamp = currentValue.getString(); + String timestamp = token.value(session).getString(); read(); return ValueExpression.get(ValueTimestampTimeZone.parse(timestamp, session)); } else { @@ -5736,30 +5415,30 @@ && equalsToken("E", name)) { read("TIME"); read("ZONE"); } - if (currentTokenType == LITERAL && currentValue.getValueType() == Value.VARCHAR) { - String timestamp = currentValue.getString(); + if (currentTokenType == LITERAL && token.value(session).getValueType() == Value.VARCHAR) { + String timestamp = token.value(session).getString(); read(); return ValueExpression.get(ValueTimestamp.parse(timestamp, session)); } else if (without) { throw getSyntaxError(); } } - } else if (currentTokenType == LITERAL && currentValue.getValueType() == Value.VARCHAR) { + } else if (currentTokenType == LITERAL && token.value(session).getValueType() == Value.VARCHAR) { if (equalsToken("T", name)) { - String time = currentValue.getString(); + String time = token.value(session).getString(); read(); return ValueExpression.get(ValueTime.parse(time)); } else if (equalsToken("TS", name)) { - String timestamp = currentValue.getString(); + String timestamp = token.value(session).getString(); read(); return ValueExpression.get(ValueTimestamp.parse(timestamp, session)); } } break; case 'U': - if (currentTokenType == LITERAL && currentValue.getValueType() == Value.VARCHAR + if (currentTokenType == LITERAL && token.value(session).getValueType() == Value.VARCHAR && (equalsToken("UUID", name))) { - String uuid = currentValue.getString(); + String uuid = token.value(session).getString(); read(); return ValueExpression.get(ValueUuid.get(uuid)); } @@ -5768,8 +5447,8 @@ && equalsToken("E", name)) { return new ExpressionColumn(database, null, null, name, quoted); } - private Prepared getCurrentSelectOrPrepared() { - return currentSelect == null ? currentPrepared : currentSelect; + private Prepared getCurrentPrepared() { + return currentPrepared; } private Expression readInterval() { @@ -5777,11 +5456,11 @@ private Expression readInterval() { if (!negative) { readIf(PLUS_SIGN); } - if (currentTokenType != LITERAL || currentValue.getValueType() != Value.VARCHAR) { + if (currentTokenType != LITERAL || token.value(session).getValueType() != Value.VARCHAR) { addExpected("string"); throw getSyntaxError(); } - String s = currentValue.getString(); + String s = token.value(session).getString(); read(); IntervalQualifier qualifier; switch (currentTokenType) { @@ -5927,14 +5606,12 @@ private SimpleCase.SimpleWhen readSimpleWhenClause(Expression caseOperand) { } private Expression readWhenOperand(Expression caseOperand) { - int backup = parseIndex; + int backup = tokenIndex; boolean not = readIf(NOT); Expression whenOperand = readConditionRightHandSide(caseOperand, not, true); if (whenOperand == null) { if (not) { - parseIndex = backup; - currentToken = "NOT"; - currentTokenType = NOT; + setTokenIndex(backup); } whenOperand = readExpression(); } @@ -5958,13 +5635,14 @@ private int readInt() { read(); } if (currentTokenType != LITERAL) { - throw DbException.getSyntaxError(sqlCommand, parseIndex, "integer"); + throw DbException.getSyntaxError(sqlCommand, token.start(), "integer"); } + Value value = token.value(session); if (minus) { // must do that now, otherwise Integer.MIN_VALUE would not work - currentValue = currentValue.negate(); + value = value.negate(); } - int i = currentValue.getInt(); + int i = value.getInt(); read(); return i; } @@ -5986,13 +5664,14 @@ private long readLong() { read(); } if (currentTokenType != LITERAL) { - throw DbException.getSyntaxError(sqlCommand, parseIndex, "long"); + throw DbException.getSyntaxError(sqlCommand, token.start(), "long"); } + Value value = token.value(session); if (minus) { // must do that now, otherwise Long.MIN_VALUE would not work - currentValue = currentValue.negate(); + value = value.negate(); } - long i = currentValue.getLong(); + long i = value.getLong(); read(); return i; } @@ -6007,7 +5686,7 @@ private boolean readBooleanSetting() { read(); return false; case LITERAL: - boolean result = currentValue.getBoolean(); + boolean result = token.value(session).getBoolean(); read(); return result; } @@ -6022,7 +5701,7 @@ private boolean readBooleanSetting() { } private String readString() { - int index = parseIndex; + int sqlIndex = token.start(); Expression expr = readExpression(); try { String s = expr.optimize(session).getValue(session).getString(); @@ -6031,7 +5710,7 @@ private String readString() { } } catch (DbException e) { } - throw DbException.getSyntaxError(sqlCommand, index, "character string"); + throw DbException.getSyntaxError(sqlCommand, sqlIndex, "character string"); } // TODO: why does this function allow defaultSchemaName=null - which resets @@ -6077,7 +5756,7 @@ private String readIdentifier() { * allow migration from older versions. */ if (!session.isQuirksMode() || !isKeyword(currentTokenType)) { - throw DbException.getSyntaxError(sqlCommand, parseIndex, "identifier"); + throw DbException.getSyntaxError(sqlCommand, token.start(), "identifier"); } } String s = currentToken; @@ -6086,7 +5765,7 @@ private String readIdentifier() { } private void read(String expected) { - if (currentTokenQuoted || !equalsToken(expected, currentToken)) { + if (token.isQuoted() || !equalsToken(expected, currentToken)) { addExpected(expected); throw getSyntaxError(); } @@ -6101,12 +5780,12 @@ private void read(int tokenType) { read(); } - private boolean readIf(String token) { - if (!currentTokenQuoted && equalsToken(token, currentToken)) { + private boolean readIf(String tokenName) { + if (!token.isQuoted() && equalsToken(tokenName, currentToken)) { read(); return true; } - addExpected(token); + addExpected(tokenName); return false; } @@ -6119,11 +5798,11 @@ private boolean readIf(int tokenType) { return false; } - private boolean isToken(String token) { - if (!currentTokenQuoted && equalsToken(token, currentToken)) { + private boolean isToken(String tokenName) { + if (!token.isQuoted() && equalsToken(tokenName, currentToken)) { return true; } - addExpected(token); + addExpected(tokenName); return false; } @@ -6164,775 +5843,64 @@ private void addMultipleExpected(int ... tokenTypes) { } } - private void reread(int index) { - if (lastParseIndex != index) { - parseIndex = index; - read(); - } - } - private void read() { - currentTokenQuoted = false; if (expectedList != null) { expectedList.clear(); } - int[] types = characterTypes; - lastParseIndex = parseIndex; - int i = parseIndex; - int type; - while ((type = types[i]) == 0) { - i++; - } - int start = i; - char[] chars = sqlCommandChars; - char c = chars[i++]; - currentToken = ""; - switch (type) { - case CHAR_NAME: - switch (c) { - case 'N': - case 'n': - if (chars[i] == '\'') { - readString(i + 1, chars, types); - return; - } - break; - case 'X': - case 'x': - if (chars[i] == '\'') { - ByteArrayOutputStream result = new ByteArrayOutputStream(); - for (;;) { - int begin = ++i; - while (chars[i] != '\'') { - i++; - } - StringUtils.convertHexWithSpacesToBytes(result, sqlCommandChars, begin, i); - begin = ++i; - while ((type = types[i]) == 0) { - i++; - } - if (begin == i || type != CHAR_STRING) { - break; - } - } - currentToken = "X'"; - checkLiterals(true); - currentValue = ValueVarbinary.get(result.toByteArray()); - parseIndex = i; - currentTokenType = LITERAL; - return; - } - break; - case 'U': - case 'u': - if (chars[i] == '&') { - switch (chars[i + 1]) { - case '\'': { - String s = readRawString(i + 2, chars, types); - currentValue = ValueVarchar.get(StringUtils.decodeUnicodeStringSQL(s, - readUescape(parseIndex, chars, types))); - return; - } - case '"': { - readQuotedIdentifier(i + 2, '"', chars, false); - String identifier = currentToken; - i = parseIndex; - while (types[i] == 0) { - i++; - } - identifier = StringUtils.decodeUnicodeStringSQL(identifier, readUescape(i, chars, types)); - if (identifier.length() > Constants.MAX_IDENTIFIER_LENGTH) { - throw DbException.get(ErrorCode.NAME_TOO_LONG_2, identifier.substring(0, 32), - "" + Constants.MAX_IDENTIFIER_LENGTH); - } - currentToken = StringUtils.cache(identifier); - currentTokenQuoted = true; - currentTokenType = IDENTIFIER; - return; - } - } - } + int size = tokens.size(); + if (tokenIndex + 1 < size) { + token = tokens.get(++tokenIndex); + currentTokenType = token.tokenType(); + currentToken = token.asIdentifier(); + if (currentToken != null && currentToken.length() > Constants.MAX_IDENTIFIER_LENGTH) { + throw DbException.get(ErrorCode.NAME_TOO_LONG_2, currentToken.substring(0, 32), + "" + Constants.MAX_IDENTIFIER_LENGTH); + } else if (currentTokenType == LITERAL) { + checkLiterals(); } - while ((type = types[i]) == CHAR_NAME || type == CHAR_VALUE) { - i++; - } - currentTokenType = ParserUtil.getTokenType(sqlCommand, !identifiersToUpper, start, i - start, false); - if (isIdentifier()) { - currentToken = StringUtils.cache(checkIdentifierLength(start, i)); - } else { - currentToken = TOKENS[currentTokenType]; - } - parseIndex = i; - return; - case CHAR_QUOTED: - readQuotedIdentifier(i, c, chars, true); - return; - case CHAR_SPECIAL_2: - if (types[i] == CHAR_SPECIAL_2) { - char c1 = chars[i++]; - currentTokenType = getSpecialType2(c, c1); - } else { - currentTokenType = getSpecialType1(c); - } - parseIndex = i; - return; - case CHAR_SPECIAL_1: - currentTokenType = getSpecialType1(c); - parseIndex = i; - return; - case CHAR_VALUE: - if (c == '0' && (chars[i] == 'X' || chars[i] == 'x')) { - readHexNumber(i + 1, start + 2, chars, types); - return; - } - long number = c - '0'; - loop: for (;; i++) { - c = chars[i]; - if (c < '0' || c > '9') { - switch (c) { - case '.': - readNumeric(start, i, false, false); - break loop; - case 'E': - case 'e': - readNumeric(start, i, false, true); - break loop; - case 'L': - case 'l': - readNumeric(start, i, true, false); - break loop; - } - checkLiterals(false); - currentValue = ValueInteger.get((int) number); - currentTokenType = LITERAL; - currentToken = "0"; - parseIndex = i; - break; - } - number = number * 10 + (c - '0'); - if (number > Integer.MAX_VALUE) { - readNumeric(start, i, true, false); - break; - } - } - return; - case CHAR_DOT: - if (types[i] != CHAR_VALUE) { - currentTokenType = DOT; - currentToken = "."; - parseIndex = i; - return; - } - readNumeric(i - 1, i, false, false); - return; - case CHAR_STRING: - readString(i, chars, types); - return; - case CHAR_DOLLAR_QUOTED_STRING: { - int begin = i - 1; - while (types[i] == CHAR_DOLLAR_QUOTED_STRING) { - i++; - } - String result = sqlCommand.substring(begin, i); - currentToken = "'"; - checkLiterals(true); - currentValue = ValueVarchar.get(result, database); - parseIndex = i; - currentTokenType = LITERAL; - return; - } - case CHAR_END: - currentTokenType = END_OF_INPUT; - parseIndex = i; - return; - default: + } else { throw getSyntaxError(); } } - private void readQuotedIdentifier(int i, char c, char[] chars, boolean checkLength) { - int begin = i; - while (chars[i] != c) { - i++; - } - String result = checkLength ? checkIdentifierLength(begin, i) : sqlCommand.substring(begin, i); - if (chars[++i] == c) { - StringBuilder builder = new StringBuilder(result); - do { - begin = i; - while (chars[++i] != c) {} - if (checkLength) { - checkIdentifierLength(builder, begin, i); - } - } while (chars[++i] == c); - result = builder.toString(); - } - currentToken = StringUtils.cache(result); - parseIndex = i; - currentTokenQuoted = true; - currentTokenType = IDENTIFIER; - } - - private String checkIdentifierLength(int begin, int end) { - if (end - begin > Constants.MAX_IDENTIFIER_LENGTH) { - throw DbException.get(ErrorCode.NAME_TOO_LONG_2, sqlCommand.substring(begin, begin + 32), - "" + Constants.MAX_IDENTIFIER_LENGTH); - } - return sqlCommand.substring(begin, end); - } - - private void checkIdentifierLength(StringBuilder builder, int begin, int end) { - int length = builder.length(); - if (length + end - begin > Constants.MAX_IDENTIFIER_LENGTH) { - if (length < 32) { - builder.append(sqlCommand, begin, begin + 32 - length); - } else { - builder.setLength(32); - } - throw DbException.get(ErrorCode.NAME_TOO_LONG_2, builder.toString(), "" + Constants.MAX_IDENTIFIER_LENGTH); - } - builder.append(sqlCommand, begin, end); - } - - private void readParameterIndex() { - int i = parseIndex; - char[] chars = sqlCommandChars; - char c = chars[i++]; - long number = c - '0'; - for (; (c = chars[i]) >= '0' && c <= '9'; i++) { - number = number * 10 + (c - '0'); - if (number > Integer.MAX_VALUE) { - throw DbException.getInvalidValueException( - "parameter index", number); - } - } - currentValue = ValueInteger.get((int) number); - currentTokenType = LITERAL; - currentToken = "0"; - parseIndex = i; - } - - private void checkLiterals(boolean text) { + private void checkLiterals() { if (!literalsChecked && session != null && !session.getAllowLiterals()) { int allowed = database.getAllowLiterals(); - if (allowed == Constants.ALLOW_LITERALS_NONE || - (text && allowed != Constants.ALLOW_LITERALS_ALL)) { + if (allowed == Constants.ALLOW_LITERALS_NONE + || ((token instanceof Token.CharacterStringToken || token instanceof Token.BinaryStringToken) + && allowed != Constants.ALLOW_LITERALS_ALL)) { throw DbException.get(ErrorCode.LITERALS_ARE_NOT_ALLOWED); } } } - private void readString(int i, char[] chars, int[] types) { - currentValue = ValueVarchar.get(readRawString(i, chars, types), database); - } - - private String readRawString(int i, char[] chars, int[] types) { - String result = null; - StringBuilder builder = null; - for (;; i++) { - boolean next = false; - for (;; i++) { - int begin = i; - while (chars[i] != '\'') { - i++; - } - if (result == null) { - result = sqlCommand.substring(begin, i); - } else { - if (builder == null) { - builder = new StringBuilder(result); - } - builder.append(sqlCommand, next ? begin - 1 : begin, i); - } - if (chars[++i] != '\'') { - break; - } - next = true; - } - int type; - while ((type = types[i]) == 0) { - i++; - } - if (type != CHAR_STRING) { - break; - } - } - checkLiterals(true); - parseIndex = i; - currentToken = "'"; - currentTokenType = LITERAL; - return builder != null ? builder.toString() : result; - } - - private int readUescape(int i, char[] chars, int[] types) { - int start = i; - while (types[i] == CHAR_NAME) { - i++; - } - if (i - start == 7 && "UESCAPE".regionMatches(!identifiersToUpper, 0, sqlCommand, start, 7)) { - int type; - while ((type = types[i]) == 0) { - i++; - } - if (type == CHAR_STRING) { - String s = readRawString(i + 1, chars, types); - if (s.codePointCount(0, s.length()) == 1) { - int escape = s.codePointAt(0); - if (!Character.isWhitespace(escape) && (escape < '0' || escape > '9') - && (escape < 'A' || escape > 'F') && (escape < 'a' || escape > 'f')) { - switch (escape) { - default: - return escape; - case '"': - case '\'': - case '+': - } - } - } - } - addExpected("''"); - throw getSyntaxError(); - } - return '\\'; - } - - private void readHexNumber(int i, int start, char[] chars, int[] types) { - if (database.getMode().zeroExLiteralsAreBinaryStrings) { - for (char c; (c = chars[i]) >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'z';) { - i++; - } - if (types[i] == CHAR_NAME) { - throw DbException.get(ErrorCode.HEX_STRING_WRONG_1, sqlCommand.substring(i, i + 1)); - } - checkLiterals(true); - currentValue = ValueVarbinary.getNoCopy(StringUtils.convertHexToBytes(sqlCommand.substring(start, i))); - parseIndex = i; - } else { - long number = 0; - for (;; i++) { - char c = chars[i]; - if (c >= '0' && c <= '9') { - number = (number << 4) + c - '0'; - } else if ((c &= 0xffdf) >= 'A' && c <= 'F') { // Convert a-z to A-Z - number = (number << 4) + c - ('A' - 10); - } else if (i == start) { - parseIndex = i; - addExpected("Hex number"); - throw getSyntaxError(); - } else { - currentValue = ValueInteger.get((int) number); - break; - } - if (number > Integer.MAX_VALUE) { - do { - c = chars[++i]; - } while ((c >= '0' && c <= '9') || ((c &= 0xffdf) >= 'A' && c <= 'F')); // Convert a-z to A-Z - String sub = sqlCommand.substring(start, i); - currentValue = ValueNumeric.get(new BigInteger(sub, 16)); - break; - } - } - char c = chars[i]; - if (c == 'L' || c == 'l') { - i++; - } - parseIndex = i; - if (types[i] == CHAR_NAME) { - addExpected("Hex number"); - throw getSyntaxError(); - } - checkLiterals(false); - } - currentTokenType = LITERAL; - currentToken = "0"; - } - - private void readNumeric(int start, int i, boolean integer, boolean approximate) { - char[] chars = sqlCommandChars; - int[] types = characterTypes; - // go until the first non-number - for (;; i++) { - int t = types[i]; - if (t == CHAR_DOT) { - integer = false; - } else if (t != CHAR_VALUE) { - break; - } - } - char c = chars[i]; - if (c == 'E' || c == 'e') { - integer = false; - approximate = true; - c = chars[++i]; - if (c == '+' || c == '-') { - i++; - } - if (types[i] != CHAR_VALUE) { - throw getSyntaxError(); - } - while (types[++i] == CHAR_VALUE) { - // go until the first non-number - } - } - parseIndex = i; - checkLiterals(false); - if (integer && i - start <= 19) { - BigInteger bi = new BigInteger(sqlCommand.substring(start, i)); - if (bi.compareTo(ValueBigint.MAX_BI) <= 0) { - // parse constants like "10000000L" - c = chars[i]; - if (c == 'L' || c == 'l') { - parseIndex++; - } - currentValue = ValueBigint.get(bi.longValue()); - currentTokenType = LITERAL; - return; - } - currentValue = ValueNumeric.get(bi); - } else { - BigDecimal bd; - try { - bd = new BigDecimal(sqlCommandChars, start, i - start); - } catch (NumberFormatException e) { - throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1, e, sqlCommand.substring(start, i)); - } - currentValue = approximate ? ValueDecfloat.get(bd) : ValueNumeric.get(bd); - } - currentTokenType = LITERAL; - } - - private void initialize(String sql) { + private void initialize(String sql, ArrayList tokens, boolean stopOnCloseParen) { if (sql == null) { sql = ""; } - originalSQL = sql; sqlCommand = sql; - int len = sql.length() + 1; - char[] command = new char[len]; - int[] types = new int[len]; - len--; - sql.getChars(0, len, command, 0); - boolean changed = false; - command[len] = ' '; - int startLoop = 0; - int lastType = 0; - for (int i = 0; i < len; i++) { - char c = command[i]; - int type = 0; - switch (c) { - case '/': - if (command[i + 1] == '*') { - // block comment - changed = true; - command[i] = ' '; - command[i + 1] = ' '; - startLoop = i; - i += 2; - for (int level = 1; level > 0;) { - for (;;) { - checkRunOver(i, len, startLoop); - char ch = command[i]; - command[i++] = ' '; - if (ch == '*') { - if (command[i] == '/') { - level--; - break; - } - } else if (ch == '/' && command[i] == '*') { - level++; - command[i++] = ' '; - } - } - command[i] = ' '; - } - } else if (command[i + 1] == '/') { - // single line comment - changed = true; - startLoop = i; - while ((c = command[i]) != '\n' && c != '\r' && i < len - 1) { - command[i++] = ' '; - checkRunOver(i, len, startLoop); - } - } else { - type = CHAR_SPECIAL_1; - } - break; - case '-': - if (command[i + 1] == '-') { - // single line comment - changed = true; - startLoop = i; - while ((c = command[i]) != '\n' && c != '\r' && i < len - 1) { - command[i++] = ' '; - checkRunOver(i, len, startLoop); - } - } else { - type = CHAR_SPECIAL_1; - } - break; - case '$': - if (command[i + 1] == '$' && (i == 0 || command[i - 1] <= ' ')) { - // dollar quoted string - changed = true; - command[i] = ' '; - command[i + 1] = ' '; - startLoop = i; - i += 2; - checkRunOver(i, len, startLoop); - while (command[i] != '$' || command[i + 1] != '$') { - types[i++] = CHAR_DOLLAR_QUOTED_STRING; - checkRunOver(i, len, startLoop); - } - command[i] = ' '; - command[i + 1] = ' '; - i++; - } else { - if (lastType == CHAR_NAME || lastType == CHAR_VALUE) { - // $ inside an identifier is supported - type = CHAR_NAME; - } else { - // but not at the start, to support PostgreSQL $1 - type = CHAR_SPECIAL_1; - } - } - break; - case '(': - case ')': - case '{': - case '}': - case '*': - case ',': - case ';': - case '+': - case '%': - case '@': - case ']': - type = CHAR_SPECIAL_1; - break; - case '!': - case '<': - case '>': - case '|': - case '=': - case ':': - case '&': - case '~': - type = CHAR_SPECIAL_2; - break; - case '.': - type = CHAR_DOT; - break; - case '\'': - type = types[i] = CHAR_STRING; - startLoop = i; - while (command[++i] != '\'') { - checkRunOver(i, len, startLoop); - } - break; - case '?': - type = CHAR_SPECIAL_1; - if (command[i + 1] == '?') { - char ch = command[i + 2]; - if (ch == '(') { - command[i + 1] = command[i] = ' '; - command[i += 2] = '['; - changed = true; - } else if (ch == ')') { - command[i + 1] = command[i] = ' '; - command[i += 2] = ']'; - changed = true; - } - } - break; - case '[': - if (database.getMode().squareBracketQuotedNames) { - // SQL Server alias for " - command[i] = '"'; - changed = true; - type = types[i] = CHAR_QUOTED; - startLoop = i; - while (command[++i] != ']') { - checkRunOver(i, len, startLoop); - } - command[i] = '"'; - } else { - type = CHAR_SPECIAL_1; - } - break; - case '`': - // MySQL alias for ", but not case sensitive - type = types[i] = CHAR_QUOTED; - startLoop = i; - while (command[++i] != '`') { - checkRunOver(i, len, startLoop); - c = command[i]; - if (identifiersToUpper || identifiersToLower) { - char u = identifiersToUpper ? Character.toUpperCase(c) : Character.toLowerCase(c); - if (u != c) { - command[i] = u; - changed = true; - } - } - } - break; - case '"': - type = types[i] = CHAR_QUOTED; - startLoop = i; - while (command[++i] != '"') { - checkRunOver(i, len, startLoop); - } - break; - case '_': - type = CHAR_NAME; - break; - case '#': - if (database.getMode().supportPoundSymbolForColumnNames) { - type = CHAR_NAME; - } else { - type = CHAR_SPECIAL_1; - } - break; - default: - if (c >= 'a' && c <= 'z') { - if (identifiersToUpper) { - command[i] = (char) (c - ('a' - 'A')); - changed = true; - } - type = CHAR_NAME; - } else if (c >= 'A' && c <= 'Z') { - if (identifiersToLower) { - command[i] = (char) (c + ('a' - 'A')); - changed = true; - } - type = CHAR_NAME; - } else if (c >= '0' && c <= '9') { - type = CHAR_VALUE; - } else { - if (c <= ' ' || Character.isSpaceChar(c)) { - // whitespace - } else if (Character.isJavaIdentifierPart(c)) { - type = CHAR_NAME; - if (identifiersToUpper || identifiersToLower) { - char u = identifiersToUpper ? Character.toUpperCase(c) : Character.toLowerCase(c); - if (u != c) { - command[i] = u; - changed = true; - } - } - } else { - type = CHAR_SPECIAL_1; - } - } - } - types[i] = type; - lastType = type; - } - sqlCommandChars = command; - types[len] = CHAR_END; - characterTypes = types; - if (changed) { - sqlCommand = new String(command, 0, len); - } - parseIndex = 0; + this.tokens = tokens == null ? new Tokenizer(database, identifiersToUpper, identifiersToLower, nonKeywords) + .tokenize(sql, stopOnCloseParen) : tokens; + resetTokenIndex(); } - private void checkRunOver(int i, int len, int startLoop) { - if (i >= len) { - parseIndex = startLoop; - throw getSyntaxError(); - } - } - - private int getSpecialType1(char c0) { - switch (c0) { - case '?': - case '$': - return PARAMETER; - case '@': - return AT; - case '+': - return PLUS_SIGN; - case '-': - return MINUS_SIGN; - case '*': - return ASTERISK; - case ',': - return COMMA; - case '{': - return OPEN_BRACE; - case '}': - return CLOSE_BRACE; - case '/': - return SLASH; - case '%': - return PERCENT; - case '&': - return AMPERSAND; - case ';': - return SEMICOLON; - case ':': - return COLON; - case '[': - return OPEN_BRACKET; - case ']': - return CLOSE_BRACKET; - case '~': - return TILDE; - case '(': - return OPEN_PAREN; - case ')': - return CLOSE_PAREN; - case '<': - return SMALLER; - case '>': - return BIGGER; - case '=': - return EQUAL; - default: - throw getSyntaxError(); - } + private void resetTokenIndex() { + tokenIndex = -1; + token = null; + currentTokenType = -1; + currentToken = null; } - private int getSpecialType2(char c0, char c1) { - switch (c0) { - case ':': - if (c1 == ':') { - return COLON_COLON; - } else if (c1 == '=') { - return COLON_EQ; - } - break; - case '>': - if (c1 == '=') { - return BIGGER_EQUAL; - } - break; - case '<': - if (c1 == '=') { - return SMALLER_EQUAL; - } else if (c1 == '>') { - return NOT_EQUAL; - } - break; - case '!': - if (c1 == '=') { - return NOT_EQUAL; - } else if (c1 == '~') { - return NOT_TILDE; - } - break; - case '|': - if (c1 == '|') { - return CONCATENATION; - } - break; - case '&': - if (c1 == '&') { - return SPATIAL_INTERSECTS; + void setTokenIndex(int index) { + if (index != tokenIndex) { + if (expectedList != null) { + expectedList.clear(); } - break; + token = tokens.get(index); + tokenIndex = index; + currentTokenType = token.tokenType(); + currentToken = token.asIdentifier(); } - throw getSyntaxError(); } private static boolean isKeyword(int tokenType) { @@ -7116,7 +6084,7 @@ private TypeInfo readIfDataType() { private TypeInfo readIfDataType1() { switch (currentTokenType) { case IDENTIFIER: - if (currentTokenQuoted) { + if (token.isQuoted()) { return null; } break; @@ -7149,11 +6117,11 @@ private TypeInfo readIfDataType1() { addExpected("data type"); throw getSyntaxError(); } - int index = lastParseIndex; + int index = tokenIndex; String originalCase = currentToken; read(); if (currentTokenType == DOT) { - reread(index); + setTokenIndex(index); return null; } String original = upperName(originalCase); @@ -7256,7 +6224,7 @@ private TypeInfo readIfDataType1() { if (originalCase.length() == original.length()) { Domain domain = database.getSchema(session.getCurrentSchemaName()).findDomain(originalCase); if (domain != null) { - reread(index); + setTokenIndex(index); return null; } } @@ -7655,14 +6623,14 @@ private TypeInfo parseGeometryType() { ExtTypeInfoGeometry extTypeInfo; if (readIf(OPEN_PAREN)) { int type = 0; - if (currentTokenType != IDENTIFIER || currentTokenQuoted) { + if (currentTokenType != IDENTIFIER || token.isQuoted()) { throw getSyntaxError(); } if (!readIf("GEOMETRY")) { try { type = EWKTUtils.parseGeometryType(currentToken); read(); - if (type / 1_000 == 0 && currentTokenType == IDENTIFIER && !currentTokenQuoted) { + if (type / 1_000 == 0 && currentTokenType == IDENTIFIER && !token.isQuoted()) { type += EWKTUtils.parseDimensionSystem(currentToken) * 1_000; read(); } @@ -7696,7 +6664,7 @@ private TypeInfo parseRowType() { private long readPrecision(int valueType) { long p = readPositiveLong(); - if (currentTokenType != IDENTIFIER || currentTokenQuoted) { + if (currentTokenType != IDENTIFIER || token.isQuoted()) { return p; } if ((valueType == Value.BLOB || valueType == Value.CLOB) && currentToken.length() == 1) { @@ -7729,7 +6697,7 @@ private long readPrecision(int valueType) { } p *= mul; read(); - if (currentTokenType != IDENTIFIER || currentTokenQuoted) { + if (currentTokenType != IDENTIFIER || token.isQuoted()) { return p; } } @@ -8000,7 +6968,7 @@ private ArrayList parseValuesRow(ArrayList row) { private Call parseCall() { Call command = new Call(session); currentPrepared = command; - int index = lastParseIndex; + int index = tokenIndex; boolean canBeFunction; switch (currentTokenType) { case IDENTIFIER: @@ -8018,7 +6986,7 @@ private Call parseCall() { command.setExpression(readExpression()); } catch (DbException e) { if (canBeFunction && e.getErrorCode() == ErrorCode.FUNCTION_NOT_FOUND_1) { - reread(index); + setTokenIndex(index); String schemaName = null, name = readIdentifier(); if (readIf(DOT)) { schemaName = name; @@ -8312,7 +7280,7 @@ private String readStringOrIdentifier() { } private boolean isReservedFunctionName(String name) { - int tokenType = ParserUtil.getTokenType(name, false, 0, name.length(), false); + int tokenType = ParserUtil.getTokenType(name, false, false); if (tokenType != ParserUtil.IDENTIFIER) { if (database.isAllowBuiltinAliasOverride()) { switch (tokenType) { @@ -8364,22 +7332,9 @@ private Prepared parseWith1(List viewsCreated) { // used in setCteCleanups. Collections.reverse(viewsCreated); - int parentheses = 0; - while (readIf(OPEN_PAREN)) { - parentheses++; - } - int start = lastParseIndex; - if (isToken(SELECT) || isToken(VALUES)) { + int start = tokenIndex; + if (isQueryQuick()) { p = parseWithQuery(); - } else if (isToken(TABLE)) { - int index = lastParseIndex; - read(); - if (!isToken(OPEN_PAREN)) { - reread(index); - p = parseWithQuery(); - } else { - throw DbException.get(ErrorCode.SYNTAX_ERROR_1, WITH_STATEMENT_SUPPORTS_LIMITED_SUB_STATEMENTS); - } } else if (readIf("INSERT")) { p = parseInsert(start); p.setPrepareAlways(true); @@ -8396,7 +7351,6 @@ private Prepared parseWith1(List viewsCreated) { if (!isToken(TABLE)) { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, WITH_STATEMENT_SUPPORTS_LIMITED_SUB_STATEMENTS); - } p = parseCreate(); p.setPrepareAlways(true); @@ -8404,9 +7358,6 @@ private Prepared parseWith1(List viewsCreated) { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, WITH_STATEMENT_SUPPORTS_LIMITED_SUB_STATEMENTS); } - for (; parentheses > 0; parentheses--) { - read(CLOSE_PAREN); - } // Clean up temporary views starting with last to first (in case of // dependencies) - but only if they are not persistent. @@ -8420,7 +7371,7 @@ private Prepared parseWith1(List viewsCreated) { } private Prepared parseWithQuery() { - Query query = parseSelectUnion(); + Query query = parseQueryExpressionBodyAndEndOfQuery(); query.setPrepareAlways(true); query.setNeverLazy(true); return query; @@ -8461,7 +7412,7 @@ private TableView parseSingleCommonTableExpression(boolean isTemporary) { cteViewName); } if (!isTemporary) { - oldViewFound.lock(session, true, true); + oldViewFound.lock(session, Table.EXCLUSIVE_LOCK); database.removeSchemaObject(session, oldViewFound); } else { @@ -8518,7 +7469,7 @@ private TableView createCTEView(String cteViewName, String querySQL, if (!view.isRecursiveQueryDetected() && allowRecursiveQueryDetection) { if (!isTemporary) { database.addSchemaObject(session, view); - view.lock(session, true, true); + view.lock(session, Table.EXCLUSIVE_LOCK); database.removeSchemaObject(session, view); } else { session.removeLocalTempTable(view); @@ -8563,9 +7514,8 @@ private CreateView parseCreateView(boolean force, boolean orReplace) { String[] cols = parseColumnList(); command.setColumnNames(cols); } - String select = StringUtils.cache(sqlCommand - .substring(parseIndex)); read(AS); + String select = StringUtils.cache(sqlCommand.substring(token.start())); try { Query query; session.setParsingCreateView(true); @@ -8823,10 +7773,10 @@ private boolean parseSequenceOptions(SequenceOptions options, CreateSequence com } else if (command != null && parseCreateSequenceOption(command)) { // } else if (forAlterColumn) { - int index = lastParseIndex; + int index = tokenIndex; if (readIf(SET)) { if (!parseBasicSequenceOption(options)) { - reread(index); + setTokenIndex(index); break; } } else { @@ -9538,7 +8488,7 @@ private Prepared parseAlterTable() { String tableName = readIdentifierWithSchema(); Schema schema = getSchema(); if (readIf("ADD")) { - Prepared command = parseAlterTableAddConstraintIf(tableName, schema, ifTableExists); + Prepared command = parseTableConstraintIf(tableName, schema, ifTableExists); if (command != null) { return command; } @@ -9652,7 +8602,7 @@ private Prepared getAlterTableAlterColumnDropDefaultExpression(Schema schema, St private Prepared parseAlterTableAlterColumnIdentity(Schema schema, String tableName, boolean ifTableExists, Column column) { - int index = lastParseIndex; + int index = tokenIndex; Boolean always = null; if (readIf(SET) && readIf("GENERATED")) { if (readIf("ALWAYS")) { @@ -9663,7 +8613,7 @@ private Prepared parseAlterTableAlterColumnIdentity(Schema schema, String tableN always = false; } } else { - reread(index); + setTokenIndex(index); } SequenceOptions options = new SequenceOptions(); if (!parseSequenceOptions(options, null, false, true) && always == null) { @@ -10118,7 +9068,7 @@ private ConstraintActionType parseCascadeOrRestrict() { } } - private DefineCommand parseAlterTableAddConstraintIf(String tableName, Schema schema, boolean ifTableExists) { + private DefineCommand parseTableConstraintIf(String tableName, Schema schema, boolean ifTableExists) { String constraintName = null, comment = null; boolean ifNotExists = false; if (readIf(CONSTRAINT)) { @@ -10159,7 +9109,12 @@ private DefineCommand parseAlterTableAddConstraintIf(String tableName, Schema sc read(OPEN_PAREN); command = new AlterTableAddConstraint(session, schema, CommandInterface.ALTER_TABLE_ADD_CONSTRAINT_UNIQUE, ifNotExists); - command.setIndexColumns(parseIndexColumnList()); + if (readIf(VALUE)) { + read(CLOSE_PAREN); + command.setIndexColumns(null); + } else { + command.setIndexColumns(parseIndexColumnList()); + } if (readIf("INDEX")) { String indexName = readIdentifierWithSchema(); command.setIndex(getSchema().findIndex(session, indexName)); @@ -10192,7 +9147,7 @@ private DefineCommand parseAlterTableAddConstraintIf(String tableName, Schema sc if (constraintName == null) { Mode mode = database.getMode(); if (mode.indexDefinitionInCreateTable) { - int start = lastParseIndex; + int start = tokenIndex; if (readIf(KEY) || readIf("INDEX")) { // MySQL // need to read ahead, as it could be a column name @@ -10213,7 +9168,7 @@ private DefineCommand parseAlterTableAddConstraintIf(String tableName, Schema sc return createIndex; } else { // known data type - reread(start); + setTokenIndex(start); } } } @@ -10392,7 +9347,7 @@ private CreateTable parseCreateTable(boolean temp, boolean globalTemp, private void parseTableColumnDefinition(CommandWithColumns command, Schema schema, String tableName, boolean forCreateTable) { - DefineCommand c = parseAlterTableAddConstraintIf(tableName, schema, false); + DefineCommand c = parseTableConstraintIf(tableName, schema, false); if (c != null) { command.addConstraintCommand(c); return; @@ -10683,8 +9638,8 @@ public void setRightsChecked(boolean rightsChecked) { this.rightsChecked = rightsChecked; } - public void setSuppliedParameterList(ArrayList suppliedParameterList) { - this.suppliedParameterList = suppliedParameterList; + public void setSuppliedParameters(ArrayList suppliedParameters) { + this.suppliedParameters = suppliedParameters; } /** @@ -10695,7 +9650,7 @@ public void setSuppliedParameterList(ArrayList suppliedParameterList) */ public Expression parseExpression(String sql) { parameters = Utils.newSmallArrayList(); - initialize(sql); + initialize(sql, null, false); read(); return readExpression(); } @@ -10708,7 +9663,7 @@ public Expression parseExpression(String sql) { */ public Expression parseDomainConstraintExpression(String sql) { parameters = Utils.newSmallArrayList(); - initialize(sql); + initialize(sql, null, false); read(); try { parseDomainConstraint = true; @@ -10726,7 +9681,7 @@ public Expression parseDomainConstraintExpression(String sql) { */ public Table parseTableName(String sql) { parameters = Utils.newSmallArrayList(); - initialize(sql); + initialize(sql, null, false); read(); return readTableOrView(); } @@ -10741,9 +9696,13 @@ public Table parseTableName(String sql) { * @throws DbException on syntax error */ public Object parseColumnList(String sql, int offset) { - initialize(sql); - parseIndex = offset; - read(); + initialize(sql, null, true); + for (int i = 0, l = tokens.size(); i < l; i++) { + if (tokens.get(i).start() >= offset) { + setTokenIndex(i); + break; + } + } read(OPEN_PAREN); if (readIf(CLOSE_PAREN)) { return Utils.EMPTY_INT_ARRAY; @@ -10780,11 +9739,11 @@ public Object parseColumnList(String sql, int offset) { * @return the last parse index */ public int getLastParseIndex() { - return lastParseIndex; + return token.start(); } @Override public String toString() { - return StringUtils.addAsterisk(sqlCommand, parseIndex); + return StringUtils.addAsterisk(sqlCommand, token.start()); } } diff --git a/h2/src/main/org/h2/command/Prepared.java b/h2/src/main/org/h2/command/Prepared.java index bea1473a11..f9a88835d9 100644 --- a/h2/src/main/org/h2/command/Prepared.java +++ b/h2/src/main/org/h2/command/Prepared.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -36,6 +36,11 @@ public abstract class Prepared { */ protected String sqlStatement; + /** + * The SQL tokens. + */ + protected ArrayList sqlTokens; + /** * Whether to create a new object (for indexes). */ @@ -234,9 +239,11 @@ public ResultInterface query(long maxrows) { * Set the SQL statement. * * @param sql the SQL statement + * @param sqlTokens the SQL tokens */ - public void setSQL(String sql) { + public final void setSQL(String sql, ArrayList sqlTokens) { this.sqlStatement = sql; + this.sqlTokens = sqlTokens; } /** @@ -244,10 +251,19 @@ public void setSQL(String sql) { * * @return the SQL statement */ - public String getSQL() { + public final String getSQL() { return sqlStatement; } + /** + * Get the SQL tokens. + * + * @return the SQL tokens + */ + public final ArrayList getSQLTokens() { + return sqlTokens; + } + /** * Get the object id to use for the database object that is created in this * statement. This id is only set when the object is already persisted. @@ -444,7 +460,7 @@ public void setCteCleanups(List cteCleanups) { this.cteCleanups = cteCleanups; } - public SessionLocal getSession() { + public final SessionLocal getSession() { return session; } diff --git a/h2/src/main/org/h2/command/Token.java b/h2/src/main/org/h2/command/Token.java new file mode 100644 index 0000000000..888a7e776a --- /dev/null +++ b/h2/src/main/org/h2/command/Token.java @@ -0,0 +1,757 @@ +/* + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, + * and the EPL 1.0 (https://h2database.com/html/license.html). + * Initial Developer: H2 Group + */ +package org.h2.command; + +import static org.h2.util.ParserUtil.IDENTIFIER; +import static org.h2.util.ParserUtil.LAST_KEYWORD; + +import org.h2.engine.CastDataProvider; +import org.h2.message.DbException; +import org.h2.util.StringUtils; +import org.h2.value.Value; +import org.h2.value.ValueBigint; +import org.h2.value.ValueInteger; +import org.h2.value.ValueVarbinary; +import org.h2.value.ValueVarchar; + +/** + * Token. + */ +public abstract class Token implements Cloneable { + + /** + * Token with parameter. + */ + static final int PARAMETER = LAST_KEYWORD + 1; + + /** + * End of input. + */ + static final int END_OF_INPUT = PARAMETER + 1; + + /** + * Token with literal. + */ + static final int LITERAL = END_OF_INPUT + 1; + + /** + * The token "=". + */ + static final int EQUAL = LITERAL + 1; + + /** + * The token ">=". + */ + static final int BIGGER_EQUAL = EQUAL + 1; + + /** + * The token ">". + */ + static final int BIGGER = BIGGER_EQUAL + 1; + + /** + * The token "<". + */ + static final int SMALLER = BIGGER + 1; + + /** + * The token "<=". + */ + static final int SMALLER_EQUAL = SMALLER + 1; + + /** + * The token "<>" or "!=". + */ + static final int NOT_EQUAL = SMALLER_EQUAL + 1; + + /** + * The token "@". + */ + static final int AT = NOT_EQUAL + 1; + + /** + * The token "-". + */ + static final int MINUS_SIGN = AT + 1; + + /** + * The token "+". + */ + static final int PLUS_SIGN = MINUS_SIGN + 1; + + /** + * The token "||". + */ + static final int CONCATENATION = PLUS_SIGN + 1; + + /** + * The token "(". + */ + static final int OPEN_PAREN = CONCATENATION + 1; + + /** + * The token ")". + */ + static final int CLOSE_PAREN = OPEN_PAREN + 1; + + /** + * The token "&&". + */ + static final int SPATIAL_INTERSECTS = CLOSE_PAREN + 1; + + /** + * The token "*". + */ + static final int ASTERISK = SPATIAL_INTERSECTS + 1; + + /** + * The token ",". + */ + static final int COMMA = ASTERISK + 1; + + /** + * The token ".". + */ + static final int DOT = COMMA + 1; + + /** + * The token "{". + */ + static final int OPEN_BRACE = DOT + 1; + + /** + * The token "}". + */ + static final int CLOSE_BRACE = OPEN_BRACE + 1; + + /** + * The token "/". + */ + static final int SLASH = CLOSE_BRACE + 1; + + /** + * The token "%". + */ + static final int PERCENT = SLASH + 1; + + /** + * The token ";". + */ + static final int SEMICOLON = PERCENT + 1; + + /** + * The token ":". + */ + static final int COLON = SEMICOLON + 1; + + /** + * The token "[". + */ + static final int OPEN_BRACKET = COLON + 1; + + /** + * The token "]". + */ + static final int CLOSE_BRACKET = OPEN_BRACKET + 1; + + /** + * The token "~". + */ + static final int TILDE = CLOSE_BRACKET + 1; + + /** + * The token "::". + */ + static final int COLON_COLON = TILDE + 1; + + /** + * The token ":=". + */ + static final int COLON_EQ = COLON_COLON + 1; + + /** + * The token "!~". + */ + static final int NOT_TILDE = COLON_EQ + 1; + + static final String[] TOKENS = { + // Unused + null, + // KEYWORD + null, + // IDENTIFIER + null, + // ALL + "ALL", + // AND + "AND", + // ANY + "ANY", + // ARRAY + "ARRAY", + // AS + "AS", + // ASYMMETRIC + "ASYMMETRIC", + // AUTHORIZATION + "AUTHORIZATION", + // BETWEEN + "BETWEEN", + // CASE + "CASE", + // CAST + "CAST", + // CHECK + "CHECK", + // CONSTRAINT + "CONSTRAINT", + // CROSS + "CROSS", + // CURRENT_CATALOG + "CURRENT_CATALOG", + // CURRENT_DATE + "CURRENT_DATE", + // CURRENT_PATH + "CURRENT_PATH", + // CURRENT_ROLE + "CURRENT_ROLE", + // CURRENT_SCHEMA + "CURRENT_SCHEMA", + // CURRENT_TIME + "CURRENT_TIME", + // CURRENT_TIMESTAMP + "CURRENT_TIMESTAMP", + // CURRENT_USER + "CURRENT_USER", + // DAY + "DAY", + // DEFAULT + "DEFAULT", + // DISTINCT + "DISTINCT", + // ELSE + "ELSE", + // END + "END", + // EXCEPT + "EXCEPT", + // EXISTS + "EXISTS", + // FALSE + "FALSE", + // FETCH + "FETCH", + // FOR + "FOR", + // FOREIGN + "FOREIGN", + // FROM + "FROM", + // FULL + "FULL", + // GROUP + "GROUP", + // HAVING + "HAVING", + // HOUR + "HOUR", + // IF + "IF", + // IN + "IN", + // INNER + "INNER", + // INTERSECT + "INTERSECT", + // INTERVAL + "INTERVAL", + // IS + "IS", + // JOIN + "JOIN", + // KEY + "KEY", + // LEFT + "LEFT", + // LIKE + "LIKE", + // LIMIT + "LIMIT", + // LOCALTIME + "LOCALTIME", + // LOCALTIMESTAMP + "LOCALTIMESTAMP", + // MINUS + "MINUS", + // MINUTE + "MINUTE", + // MONTH + "MONTH", + // NATURAL + "NATURAL", + // NOT + "NOT", + // NULL + "NULL", + // OFFSET + "OFFSET", + // ON + "ON", + // OR + "OR", + // ORDER + "ORDER", + // PRIMARY + "PRIMARY", + // QUALIFY + "QUALIFY", + // RIGHT + "RIGHT", + // ROW + "ROW", + // ROWNUM + "ROWNUM", + // SECOND + "SECOND", + // SELECT + "SELECT", + // SESSION_USER + "SESSION_USER", + // SET + "SET", + // SOME + "SOME", + // SYMMETRIC + "SYMMETRIC", + // SYSTEM_USER + "SYSTEM_USER", + // TABLE + "TABLE", + // TO + "TO", + // TRUE + "TRUE", + // UESCAPE + "UESCAPE", + // UNION + "UNION", + // UNIQUE + "UNIQUE", + // UNKNOWN + "UNKNOWN", + // USER + "USER", + // USING + "USING", + // VALUE + "VALUE", + // VALUES + "VALUES", + // WHEN + "WHEN", + // WHERE + "WHERE", + // WINDOW + "WINDOW", + // WITH + "WITH", + // YEAR + "YEAR", + // _ROWID_ + "_ROWID_", + // PARAMETER + "?", + // END_OF_INPUT + null, + // LITERAL + null, + // EQUAL + "=", + // BIGGER_EQUAL + ">=", + // BIGGER + ">", + // SMALLER + "<", + // SMALLER_EQUAL + "<=", + // NOT_EQUAL + "<>", + // AT + "@", + // MINUS_SIGN + "-", + // PLUS_SIGN + "+", + // CONCATENATION + "||", + // OPEN_PAREN + "(", + // CLOSE_PAREN + ")", + // SPATIAL_INTERSECTS + "&&", + // ASTERISK + "*", + // COMMA + ",", + // DOT + ".", + // OPEN_BRACE + "{", + // CLOSE_BRACE + "}", + // SLASH + "/", + // PERCENT + "%", + // SEMICOLON + ";", + // COLON + ":", + // OPEN_BRACKET + "[", + // CLOSE_BRACKET + "]", + // TILDE + "~", + // COLON_COLON + "::", + // COLON_EQ + ":=", + // NOT_TILDE + "!~", + // End + }; + + static class IdentifierToken extends Token { + + private String identifier; + + private final boolean quoted; + + private boolean unicode; + + IdentifierToken(int start, String identifier, boolean quoted, boolean unicode) { + super(start); + this.identifier = identifier; + this.quoted = quoted; + this.unicode = unicode; + } + + @Override + int tokenType() { + return IDENTIFIER; + } + + @Override + String asIdentifier() { + return identifier; + } + + @Override + boolean isQuoted() { + return quoted; + } + + @Override + boolean needsUnicodeConversion() { + return unicode; + } + + @Override + void convertUnicode(int uescape) { + if (unicode) { + identifier = StringUtils.decodeUnicodeStringSQL(identifier, uescape); + unicode = false; + } else { + throw DbException.getInternalError(); + } + } + + @Override + public String toString() { + return quoted ? StringUtils.quoteIdentifier(identifier) : identifier; + } + + } + + static final class KeywordToken extends Token { + + private final int type; + + KeywordToken(int start, int type) { + super(start); + this.type = type; + } + + @Override + int tokenType() { + return type; + } + + @Override + String asIdentifier() { + return TOKENS[type]; + } + + @Override + public String toString() { + return TOKENS[type]; + } + + } + + static final class KeywordOrIdentifierToken extends Token { + + private final int type; + + private final String identifier; + + KeywordOrIdentifierToken(int start, int type, String identifier) { + super(start); + this.type = type; + this.identifier = identifier; + } + + @Override + int tokenType() { + return type; + } + + @Override + String asIdentifier() { + return identifier; + } + + @Override + public String toString() { + return identifier; + } + + } + + static abstract class LiteralToken extends Token { + + Value value; + + LiteralToken(int start) { + super(start); + } + + @Override + final int tokenType() { + return LITERAL; + } + + @Override + public final String toString() { + return value(null).getTraceSQL(); + } + + } + + static final class BinaryStringToken extends LiteralToken { + + private final byte[] string; + + BinaryStringToken(int start, byte[] string) { + super(start); + this.string = string; + } + + @Override + Value value(CastDataProvider provider) { + if (value == null) { + value = ValueVarbinary.getNoCopy(string); + } + return value; + } + + } + + static final class CharacterStringToken extends LiteralToken { + + String string; + + private boolean unicode; + + CharacterStringToken(int start, String string, boolean unicode) { + super(start); + this.string = string; + this.unicode = unicode; + } + + @Override + Value value(CastDataProvider provider) { + if (value == null) { + value = ValueVarchar.get(string, provider); + } + return value; + } + + @Override + boolean needsUnicodeConversion() { + return unicode; + } + + @Override + void convertUnicode(int uescape) { + if (unicode) { + string = StringUtils.decodeUnicodeStringSQL(string, uescape); + unicode = false; + } else { + throw DbException.getInternalError(); + } + } + + } + + static final class IntegerToken extends LiteralToken { + + private final int number; + + IntegerToken(int start, int number) { + super(start); + this.number = number; + } + + @Override + Value value(CastDataProvider provider) { + if (value == null) { + value = ValueInteger.get(number); + } + return value; + } + + } + + static final class BigintToken extends LiteralToken { + + private final long number; + + BigintToken(int start, long number) { + super(start); + this.number = number; + } + + @Override + Value value(CastDataProvider provider) { + if (value == null) { + value = ValueBigint.get(number); + } + return value; + } + + } + + static final class ValueToken extends LiteralToken { + + ValueToken(int start, Value value) { + super(start); + this.value = value; + } + + @Override + Value value(CastDataProvider provider) { + return value; + } + + } + + static final class ParameterToken extends Token { + + int index; + + ParameterToken(int start, int index) { + super(start); + this.index = index; + } + + @Override + int tokenType() { + return PARAMETER; + } + + @Override + String asIdentifier() { + return "?"; + } + + int index() { + return index; + } + + @Override + public String toString() { + return index == 0 ? "?" : "?" + index; + } + + } + + static final class EndOfInputToken extends Token { + + EndOfInputToken(int start) { + super(start); + } + + @Override + int tokenType() { + return END_OF_INPUT; + } + + } + + private int start; + + Token(int start) { + this.start = start; + } + + final int start() { + return start; + } + + final void setStart(int offset) { + start = offset; + } + + final void subtractFromStart(int offset) { + start -= offset; + } + + abstract int tokenType(); + + String asIdentifier() { + return null; + } + + boolean isQuoted() { + return false; + } + + Value value(CastDataProvider provider) { + return null; + } + + boolean needsUnicodeConversion() { + return false; + } + + void convertUnicode(int uescape) { + throw DbException.getInternalError(); + } + + @Override + protected Token clone() { + try { + return (Token) super.clone(); + } catch (CloneNotSupportedException e) { + throw DbException.getInternalError(); + } + } + +} diff --git a/h2/src/main/org/h2/command/Tokenizer.java b/h2/src/main/org/h2/command/Tokenizer.java new file mode 100644 index 0000000000..f0c413e546 --- /dev/null +++ b/h2/src/main/org/h2/command/Tokenizer.java @@ -0,0 +1,1400 @@ +/* + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, + * and the EPL 1.0 (https://h2database.com/html/license.html). + * Initial Developer: H2 Group + */ +package org.h2.command; + +import static org.h2.command.Token.ASTERISK; +import static org.h2.command.Token.AT; +import static org.h2.command.Token.BIGGER; +import static org.h2.command.Token.BIGGER_EQUAL; +import static org.h2.command.Token.CLOSE_BRACE; +import static org.h2.command.Token.CLOSE_BRACKET; +import static org.h2.command.Token.CLOSE_PAREN; +import static org.h2.command.Token.COLON; +import static org.h2.command.Token.COLON_COLON; +import static org.h2.command.Token.COLON_EQ; +import static org.h2.command.Token.COMMA; +import static org.h2.command.Token.CONCATENATION; +import static org.h2.command.Token.DOT; +import static org.h2.command.Token.EQUAL; +import static org.h2.command.Token.MINUS_SIGN; +import static org.h2.command.Token.NOT_EQUAL; +import static org.h2.command.Token.NOT_TILDE; +import static org.h2.command.Token.OPEN_BRACE; +import static org.h2.command.Token.OPEN_BRACKET; +import static org.h2.command.Token.OPEN_PAREN; +import static org.h2.command.Token.PERCENT; +import static org.h2.command.Token.PLUS_SIGN; +import static org.h2.command.Token.SEMICOLON; +import static org.h2.command.Token.SLASH; +import static org.h2.command.Token.SMALLER; +import static org.h2.command.Token.SMALLER_EQUAL; +import static org.h2.command.Token.SPATIAL_INTERSECTS; +import static org.h2.command.Token.TILDE; +import static org.h2.util.ParserUtil.ALL; +import static org.h2.util.ParserUtil.AND; +import static org.h2.util.ParserUtil.ANY; +import static org.h2.util.ParserUtil.ARRAY; +import static org.h2.util.ParserUtil.AS; +import static org.h2.util.ParserUtil.ASYMMETRIC; +import static org.h2.util.ParserUtil.AUTHORIZATION; +import static org.h2.util.ParserUtil.BETWEEN; +import static org.h2.util.ParserUtil.CASE; +import static org.h2.util.ParserUtil.CAST; +import static org.h2.util.ParserUtil.CHECK; +import static org.h2.util.ParserUtil.CONSTRAINT; +import static org.h2.util.ParserUtil.CROSS; +import static org.h2.util.ParserUtil.CURRENT_CATALOG; +import static org.h2.util.ParserUtil.CURRENT_DATE; +import static org.h2.util.ParserUtil.CURRENT_PATH; +import static org.h2.util.ParserUtil.CURRENT_ROLE; +import static org.h2.util.ParserUtil.CURRENT_SCHEMA; +import static org.h2.util.ParserUtil.CURRENT_TIME; +import static org.h2.util.ParserUtil.CURRENT_TIMESTAMP; +import static org.h2.util.ParserUtil.CURRENT_USER; +import static org.h2.util.ParserUtil.DAY; +import static org.h2.util.ParserUtil.DEFAULT; +import static org.h2.util.ParserUtil.DISTINCT; +import static org.h2.util.ParserUtil.ELSE; +import static org.h2.util.ParserUtil.END; +import static org.h2.util.ParserUtil.EXCEPT; +import static org.h2.util.ParserUtil.EXISTS; +import static org.h2.util.ParserUtil.FALSE; +import static org.h2.util.ParserUtil.FETCH; +import static org.h2.util.ParserUtil.FOR; +import static org.h2.util.ParserUtil.FOREIGN; +import static org.h2.util.ParserUtil.FROM; +import static org.h2.util.ParserUtil.FULL; +import static org.h2.util.ParserUtil.GROUP; +import static org.h2.util.ParserUtil.HAVING; +import static org.h2.util.ParserUtil.HOUR; +import static org.h2.util.ParserUtil.IDENTIFIER; +import static org.h2.util.ParserUtil.IF; +import static org.h2.util.ParserUtil.IN; +import static org.h2.util.ParserUtil.INNER; +import static org.h2.util.ParserUtil.INTERSECT; +import static org.h2.util.ParserUtil.INTERVAL; +import static org.h2.util.ParserUtil.IS; +import static org.h2.util.ParserUtil.JOIN; +import static org.h2.util.ParserUtil.KEY; +import static org.h2.util.ParserUtil.LEFT; +import static org.h2.util.ParserUtil.LIKE; +import static org.h2.util.ParserUtil.LIMIT; +import static org.h2.util.ParserUtil.LOCALTIME; +import static org.h2.util.ParserUtil.LOCALTIMESTAMP; +import static org.h2.util.ParserUtil.MINUS; +import static org.h2.util.ParserUtil.MINUTE; +import static org.h2.util.ParserUtil.MONTH; +import static org.h2.util.ParserUtil.NATURAL; +import static org.h2.util.ParserUtil.NOT; +import static org.h2.util.ParserUtil.NULL; +import static org.h2.util.ParserUtil.OFFSET; +import static org.h2.util.ParserUtil.ON; +import static org.h2.util.ParserUtil.OR; +import static org.h2.util.ParserUtil.ORDER; +import static org.h2.util.ParserUtil.PRIMARY; +import static org.h2.util.ParserUtil.QUALIFY; +import static org.h2.util.ParserUtil.RIGHT; +import static org.h2.util.ParserUtil.ROW; +import static org.h2.util.ParserUtil.ROWNUM; +import static org.h2.util.ParserUtil.SECOND; +import static org.h2.util.ParserUtil.SELECT; +import static org.h2.util.ParserUtil.SESSION_USER; +import static org.h2.util.ParserUtil.SET; +import static org.h2.util.ParserUtil.SOME; +import static org.h2.util.ParserUtil.SYMMETRIC; +import static org.h2.util.ParserUtil.SYSTEM_USER; +import static org.h2.util.ParserUtil.TABLE; +import static org.h2.util.ParserUtil.TO; +import static org.h2.util.ParserUtil.TRUE; +import static org.h2.util.ParserUtil.UESCAPE; +import static org.h2.util.ParserUtil.UNION; +import static org.h2.util.ParserUtil.UNIQUE; +import static org.h2.util.ParserUtil.UNKNOWN; +import static org.h2.util.ParserUtil.USER; +import static org.h2.util.ParserUtil.USING; +import static org.h2.util.ParserUtil.VALUE; +import static org.h2.util.ParserUtil.VALUES; +import static org.h2.util.ParserUtil.WHEN; +import static org.h2.util.ParserUtil.WHERE; +import static org.h2.util.ParserUtil.WINDOW; +import static org.h2.util.ParserUtil.WITH; +import static org.h2.util.ParserUtil.YEAR; +import static org.h2.util.ParserUtil._ROWID_; + +import java.io.ByteArrayOutputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.ListIterator; + +import org.h2.api.ErrorCode; +import org.h2.engine.CastDataProvider; +import org.h2.message.DbException; +import org.h2.util.StringUtils; +import org.h2.value.ValueBigint; +import org.h2.value.ValueDecfloat; +import org.h2.value.ValueNumeric; + +/** + * Tokenizer. + */ +public final class Tokenizer { + + private final CastDataProvider provider; + + private final boolean identifiersToUpper; + + private final boolean identifiersToLower; + + private final BitSet nonKeywords; + + Tokenizer(CastDataProvider provider, boolean identifiersToUpper, boolean identifiersToLower, BitSet nonKeywords) { + this.provider = provider; + this.identifiersToUpper = identifiersToUpper; + this.identifiersToLower = identifiersToLower; + this.nonKeywords = nonKeywords; + } + + ArrayList tokenize(String sql, boolean stopOnCloseParen) { + ArrayList tokens = new ArrayList<>(); + int end = sql.length() - 1; + boolean foundUnicode = false; + int lastParameter = 0; + loop: for (int i = 0; i <= end;) { + int tokenStart = i; + char c = sql.charAt(i); + Token token; + switch (c) { + case '!': + if (i < end) { + char c2 = sql.charAt(++i); + if (c2 == '=') { + token = new Token.KeywordToken(tokenStart, NOT_EQUAL); + break; + } + if (c2 == '~') { + token = new Token.KeywordToken(tokenStart, NOT_TILDE); + break; + } + } + throw DbException.getSyntaxError(sql, tokenStart); + case '"': + case '`': + i = readQuotedIdentifier(sql, end, tokenStart, i, c, false, tokens); + continue loop; + case '#': + if (provider.getMode().supportPoundSymbolForColumnNames) { + i = readIdentifier(sql, end, tokenStart, i, c, tokens); + continue loop; + } + throw DbException.getSyntaxError(sql, tokenStart); + case '$': + if (i < end) { + char c2 = sql.charAt(i + 1); + if (c2 == '$') { + i += 2; + int stringEnd = sql.indexOf("$$", i); + if (stringEnd < 0) { + throw DbException.getSyntaxError(sql, tokenStart); + } + token = new Token.CharacterStringToken(tokenStart, sql.substring(i, stringEnd), false); + i = stringEnd + 1; + } else { + i = parseParameterIndex(sql, end, i, tokens); + lastParameter = assignParameterIndex(tokens, lastParameter); + continue loop; + } + } else { + token = new Token.ParameterToken(tokenStart, 0); + } + break; + case '%': + token = new Token.KeywordToken(tokenStart, PERCENT); + break; + case '&': + if (i < end && sql.charAt(i + 1) == '&') { + i++; + token = new Token.KeywordToken(tokenStart, SPATIAL_INTERSECTS); + break; + } + throw DbException.getSyntaxError(sql, tokenStart); + case '\'': + i = readCharacterString(sql, tokenStart, end, i, false, tokens); + continue loop; + case '(': + token = new Token.KeywordToken(tokenStart, OPEN_PAREN); + break; + case ')': + token = new Token.KeywordToken(tokenStart, CLOSE_PAREN); + if (stopOnCloseParen) { + tokens.add(token); + end = skipWhitespace(sql, end, i + 1) - 1; + break loop; + } + break; + case '*': + token = new Token.KeywordToken(tokenStart, ASTERISK); + break; + case '+': + token = new Token.KeywordToken(tokenStart, PLUS_SIGN); + break; + case ',': + token = new Token.KeywordToken(tokenStart, COMMA); + break; + case '-': + if (i < end && sql.charAt(i + 1) == '-') { + i = skipSimpleComment(sql, end, i); + continue loop; + } else { + token = new Token.KeywordToken(tokenStart, MINUS_SIGN); + } + break; + case '.': + if (i < end) { + char c2 = sql.charAt(i + 1); + if (c2 >= '0' && c2 <= '9') { + i = readNumeric(sql, tokenStart, end, i + 1, c2, false, false, tokens); + continue loop; + } + } + token = new Token.KeywordToken(tokenStart, DOT); + break; + case '/': + if (i < end) { + char c2 = sql.charAt(i + 1); + if (c2 == '*') { + i = skipBracketedComment(sql, tokenStart, end, i); + continue loop; + } else if (c2 == '/') { + i = skipSimpleComment(sql, end, i); + continue loop; + } + } + token = new Token.KeywordToken(tokenStart, SLASH); + break; + case '0': + if (i < end) { + char c2 = sql.charAt(i + 1); + if (c2 == 'X' || c2 == 'x') { + i = readHexNumber(sql, provider, tokenStart, end, i + 2, tokens); + continue loop; + } + } + //$FALL-THROUGH$ + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + i = readNumeric(sql, tokenStart, end, i + 1, c, tokens); + continue loop; + case ':': + if (i < end) { + char c2 = sql.charAt(i + 1); + if (c2 == ':') { + i++; + token = new Token.KeywordToken(tokenStart, COLON_COLON); + break; + } else if (c2 == '=') { + i++; + token = new Token.KeywordToken(tokenStart, COLON_EQ); + break; + } + } + token = new Token.KeywordToken(tokenStart, COLON); + break; + case ';': + token = new Token.KeywordToken(tokenStart, SEMICOLON); + break; + case '<': + if (i < end) { + char c2 = sql.charAt(i + 1); + if (c2 == '=') { + i++; + token = new Token.KeywordToken(tokenStart, SMALLER_EQUAL); + break; + } + if (c2 == '>') { + i++; + token = new Token.KeywordToken(tokenStart, NOT_EQUAL); + break; + } + } + token = new Token.KeywordToken(tokenStart, SMALLER); + break; + case '=': + token = new Token.KeywordToken(tokenStart, EQUAL); + break; + case '>': + if (i < end && sql.charAt(i + 1) == '=') { + i++; + token = new Token.KeywordToken(tokenStart, BIGGER_EQUAL); + break; + } + token = new Token.KeywordToken(tokenStart, BIGGER); + break; + case '?': { + if (i + 1 < end && sql.charAt(i + 1) == '?') { + char c3 = sql.charAt(i + 2); + if (c3 == '(') { + i += 2; + token = new Token.KeywordToken(tokenStart, OPEN_BRACKET); + break; + } + if (c3 == ')') { + i += 2; + token = new Token.KeywordToken(tokenStart, CLOSE_BRACKET); + break; + } + } + i = parseParameterIndex(sql, end, i, tokens); + lastParameter = assignParameterIndex(tokens, lastParameter); + continue loop; + } + case '@': + token = new Token.KeywordToken(tokenStart, AT); + break; + case 'A': + case 'a': + i = readA(sql, end, tokenStart, i, tokens); + continue loop; + case 'B': + case 'b': + i = readB(sql, end, tokenStart, i, tokens); + continue loop; + case 'C': + case 'c': + i = readC(sql, end, tokenStart, i, tokens); + continue loop; + case 'D': + case 'd': + i = readD(sql, end, tokenStart, i, tokens); + continue loop; + case 'E': + case 'e': + i = readE(sql, end, tokenStart, i, tokens); + continue loop; + case 'F': + case 'f': + i = readF(sql, end, tokenStart, i, tokens); + continue loop; + case 'G': + case 'g': + i = readG(sql, end, tokenStart, i, tokens); + continue loop; + case 'H': + case 'h': + i = readH(sql, end, tokenStart, i, tokens); + continue loop; + case 'I': + case 'i': + i = readI(sql, end, tokenStart, i, tokens); + continue loop; + case 'J': + case 'j': + i = readJ(sql, end, tokenStart, i, tokens); + continue loop; + case 'K': + case 'k': + i = readK(sql, end, tokenStart, i, tokens); + continue loop; + case 'L': + case 'l': + i = readL(sql, end, tokenStart, i, tokens); + continue loop; + case 'M': + case 'm': + i = readM(sql, end, tokenStart, i, tokens); + continue loop; + case 'N': + case 'n': + if (i < end && sql.charAt(i + 1) == '\'') { + i = readCharacterString(sql, tokenStart, end, i + 1, false, tokens); + } else { + i = readN(sql, end, tokenStart, i, tokens); + } + continue loop; + case 'O': + case 'o': + i = readO(sql, end, tokenStart, i, tokens); + continue loop; + case 'P': + case 'p': + i = readP(sql, end, tokenStart, i, tokens); + continue loop; + case 'Q': + case 'q': + i = readQ(sql, end, tokenStart, i, tokens); + continue loop; + case 'R': + case 'r': + i = readR(sql, end, tokenStart, i, tokens); + continue loop; + case 'S': + case 's': + i = readS(sql, end, tokenStart, i, tokens); + continue loop; + case 'T': + case 't': + i = readT(sql, end, tokenStart, i, tokens); + continue loop; + case 'U': + case 'u': + if (i + 1 < end && sql.charAt(i + 1) == '&') { + char c3 = sql.charAt(i + 2); + if (c3 == '"') { + i = readQuotedIdentifier(sql, end, tokenStart, i + 2, '"', true, tokens); + foundUnicode = true; + continue loop; + } else if (c3 == '\'') { + i = readCharacterString(sql, tokenStart, end, i + 2, true, tokens); + foundUnicode = true; + continue loop; + } + } + i = readU(sql, end, tokenStart, i, tokens); + continue loop; + case 'V': + case 'v': + i = readV(sql, end, tokenStart, i, tokens); + continue loop; + case 'W': + case 'w': + i = readW(sql, end, tokenStart, i, tokens); + continue loop; + case 'X': + case 'x': + if (i < end && sql.charAt(i + 1) == '\'') { + i = readBinaryString(sql, tokenStart, end, i + 1, tokens); + } else { + i = readIdentifier(sql, end, tokenStart, i, c, tokens); + } + continue loop; + case 'Y': + case 'y': + i = readY(sql, end, tokenStart, i, tokens); + continue loop; + case 'Z': + case 'z': + i = readIdentifier(sql, end, tokenStart, i, c, tokens); + continue loop; + case '[': + if (provider.getMode().squareBracketQuotedNames) { + int identifierEnd = sql.indexOf(']', ++i); + if (identifierEnd < 0) { + throw DbException.getSyntaxError(sql, tokenStart); + } + token = new Token.IdentifierToken(tokenStart, sql.substring(i, identifierEnd), true, false); + i = identifierEnd; + } else { + token = new Token.KeywordToken(tokenStart, OPEN_BRACKET); + } + break; + case ']': + token = new Token.KeywordToken(tokenStart, CLOSE_BRACKET); + break; + case '_': + i = read_(sql, end, tokenStart, i, tokens); + continue loop; + case '{': + token = new Token.KeywordToken(tokenStart, OPEN_BRACE); + break; + case '|': + if (i < end && sql.charAt(++i) == '|') { + token = new Token.KeywordToken(tokenStart, CONCATENATION); + break; + } + throw DbException.getSyntaxError(sql, tokenStart); + case '}': + token = new Token.KeywordToken(tokenStart, CLOSE_BRACE); + break; + case '~': + token = new Token.KeywordToken(tokenStart, TILDE); + break; + default: + if (c <= ' ') { + i++; + continue loop; + } else { + int cp = Character.isHighSurrogate(c) ? sql.codePointAt(i++) : c; + if (Character.isSpaceChar(cp)) { + continue loop; + } + if (Character.isJavaIdentifierStart(cp)) { + i = readIdentifier(sql, end, tokenStart, i, cp, tokens); + continue loop; + } + throw DbException.getSyntaxError(sql, tokenStart); + } + } + tokens.add(token); + i++; + } + if (foundUnicode) { + processUescape(sql, tokens); + } + tokens.add(new Token.EndOfInputToken(end + 1)); + return tokens; + } + + private int readIdentifier(String sql, int end, int tokenStart, int i, int cp, ArrayList tokens) { + if (cp >= Character.MIN_SUPPLEMENTARY_CODE_POINT) { + i++; + } + int endIndex = findIdentifierEnd(sql, end, i + Character.charCount(cp) - 1); + tokens.add(new Token.IdentifierToken(tokenStart, extractIdentifier(sql, tokenStart, endIndex), false, false)); + return endIndex; + } + + private int readA(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (length == 2) { + type = (sql.charAt(tokenStart + 1) & 0xffdf) == 'S' ? AS : IDENTIFIER; + } else { + if (eq("ALL", sql, tokenStart, length)) { + type = ALL; + } else if (eq("AND", sql, tokenStart, length)) { + type = AND; + } else if (eq("ANY", sql, tokenStart, length)) { + type = ANY; + } else if (eq("ARRAY", sql, tokenStart, length)) { + type = ARRAY; + } else if (eq("ASYMMETRIC", sql, tokenStart, length)) { + type = ASYMMETRIC; + } else if (eq("AUTHORIZATION", sql, tokenStart, length)) { + type = AUTHORIZATION; + } else { + type = IDENTIFIER; + } + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readB(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type = eq("BETWEEN", sql, tokenStart, length) ? BETWEEN : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readC(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("CASE", sql, tokenStart, length)) { + type = CASE; + } else if (eq("CAST", sql, tokenStart, length)) { + type = CAST; + } else if (eq("CHECK", sql, tokenStart, length)) { + type = CHECK; + } else if (eq("CONSTRAINT", sql, tokenStart, length)) { + type = CONSTRAINT; + } else if (eq("CROSS", sql, tokenStart, length)) { + type = CROSS; + } else if (length >= 12 && eq("CURRENT_", sql, tokenStart, 8)) { + type = getTokenTypeCurrent(sql, tokenStart, length); + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private static int getTokenTypeCurrent(String s, int tokenStart, int length) { + tokenStart += 8; + switch (length) { + case 12: + if (eqCurrent("CURRENT_DATE", s, tokenStart, length)) { + return CURRENT_DATE; + } else if (eqCurrent("CURRENT_PATH", s, tokenStart, length)) { + return CURRENT_PATH; + } else if (eqCurrent("CURRENT_ROLE", s, tokenStart, length)) { + return CURRENT_ROLE; + } else if (eqCurrent("CURRENT_TIME", s, tokenStart, length)) { + return CURRENT_TIME; + } else if (eqCurrent("CURRENT_USER", s, tokenStart, length)) { + return CURRENT_USER; + } + break; + case 14: + if (eqCurrent("CURRENT_SCHEMA", s, tokenStart, length)) { + return CURRENT_SCHEMA; + } + break; + case 15: + if (eqCurrent("CURRENT_CATALOG", s, tokenStart, length)) { + return CURRENT_CATALOG; + } + break; + case 17: + if (eqCurrent("CURRENT_TIMESTAMP", s, tokenStart, length)) { + return CURRENT_TIMESTAMP; + } + } + return IDENTIFIER; + } + + private static boolean eqCurrent(String expected, String s, int start, int length) { + for (int i = 8; i < length; i++) { + if (expected.charAt(i) != (s.charAt(start++) & 0xffdf)) { + return false; + } + } + return true; + } + + private int readD(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("DAY", sql, tokenStart, length)) { + type = DAY; + } else if (eq("DEFAULT", sql, tokenStart, length)) { + type = DEFAULT; + } else if (eq("DISTINCT", sql, tokenStart, length)) { + type = DISTINCT; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readE(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("ELSE", sql, tokenStart, length)) { + type = ELSE; + } else if (eq("END", sql, tokenStart, length)) { + type = END; + } else if (eq("EXCEPT", sql, tokenStart, length)) { + type = EXCEPT; + } else if (eq("EXISTS", sql, tokenStart, length)) { + type = EXISTS; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readF(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("FETCH", sql, tokenStart, length)) { + type = FETCH; + } else if (eq("FROM", sql, tokenStart, length)) { + type = FROM; + } else if (eq("FOR", sql, tokenStart, length)) { + type = FOR; + } else if (eq("FOREIGN", sql, tokenStart, length)) { + type = FOREIGN; + } else if (eq("FULL", sql, tokenStart, length)) { + type = FULL; + } else if (eq("FALSE", sql, tokenStart, length)) { + type = FALSE; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readG(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type = eq("GROUP", sql, tokenStart, length) ? GROUP : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readH(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("HAVING", sql, tokenStart, length)) { + type = HAVING; + } else if (eq("HOUR", sql, tokenStart, length)) { + type = HOUR; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readI(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (length == 2) { + switch ((sql.charAt(tokenStart + 1) & 0xffdf)) { + case 'F': + type = IF; + break; + case 'N': + type = IN; + break; + case 'S': + type = IS; + break; + default: + type = IDENTIFIER; + } + } else { + if (eq("INNER", sql, tokenStart, length)) { + type = INNER; + } else if (eq("INTERSECT", sql, tokenStart, length)) { + type = INTERSECT; + } else if (eq("INTERVAL", sql, tokenStart, length)) { + type = INTERVAL; + } else { + type = IDENTIFIER; + } + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readJ(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type = eq("JOIN", sql, tokenStart, length) ? JOIN : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readK(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type = eq("KEY", sql, tokenStart, length) ? KEY : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readL(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("LEFT", sql, tokenStart, length)) { + type = LEFT; + } else if (eq("LIMIT", sql, tokenStart, length)) { + type = provider.getMode().limit ? LIMIT : IDENTIFIER; + } else if (eq("LIKE", sql, tokenStart, length)) { + type = LIKE; + } else if (eq("LOCALTIME", sql, tokenStart, length)) { + type = LOCALTIME; + } else if (eq("LOCALTIMESTAMP", sql, tokenStart, length)) { + type = LOCALTIMESTAMP; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readM(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("MINUS", sql, tokenStart, length)) { + type = provider.getMode().minusIsExcept ? MINUS : IDENTIFIER; + } else if (eq("MINUTE", sql, tokenStart, length)) { + type = MINUTE; + } else if (eq("MONTH", sql, tokenStart, length)) { + type = MONTH; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readN(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("NOT", sql, tokenStart, length)) { + type = NOT; + } else if (eq("NATURAL", sql, tokenStart, length)) { + type = NATURAL; + } else if (eq("NULL", sql, tokenStart, length)) { + type = NULL; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readO(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (length == 2) { + switch ((sql.charAt(tokenStart + 1) & 0xffdf)) { + case 'N': + type = ON; + break; + case 'R': + type = OR; + break; + default: + type = IDENTIFIER; + } + } else { + if (eq("OFFSET", sql, tokenStart, length)) { + type = OFFSET; + } else if (eq("ORDER", sql, tokenStart, length)) { + type = ORDER; + } else { + type = IDENTIFIER; + } + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readP(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type = eq("PRIMARY", sql, tokenStart, length) ? PRIMARY : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readQ(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type = eq("QUALIFY", sql, tokenStart, length) ? QUALIFY : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readR(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("RIGHT", sql, tokenStart, length)) { + type = RIGHT; + } else if (eq("ROW", sql, tokenStart, length)) { + type = ROW; + } else if (eq("ROWNUM", sql, tokenStart, length)) { + type = ROWNUM; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readS(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("SECOND", sql, tokenStart, length)) { + type = SECOND; + } else if (eq("SELECT", sql, tokenStart, length)) { + type = SELECT; + } else if (eq("SESSION_USER", sql, tokenStart, length)) { + type = SESSION_USER; + } else if (eq("SET", sql, tokenStart, length)) { + type = SET; + } else if (eq("SOME", sql, tokenStart, length)) { + type = SOME; + } else if (eq("SYMMETRIC", sql, tokenStart, length)) { + type = SYMMETRIC; + } else if (eq("SYSTEM_USER", sql, tokenStart, length)) { + type = SYSTEM_USER; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readT(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (length == 2) { + type = (sql.charAt(tokenStart + 1) & 0xffdf) == 'O' ? TO : IDENTIFIER; + } else { + if (eq("TABLE", sql, tokenStart, length)) { + type = TABLE; + } else if (eq("TRUE", sql, tokenStart, length)) { + type = TRUE; + } else { + type = IDENTIFIER; + } + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readU(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("UESCAPE", sql, tokenStart, length)) { + type = UESCAPE; + } else if (eq("UNION", sql, tokenStart, length)) { + type = UNION; + } else if (eq("UNIQUE", sql, tokenStart, length)) { + type = UNIQUE; + } else if (eq("UNKNOWN", sql, tokenStart, length)) { + type = UNKNOWN; + } else if (eq("USER", sql, tokenStart, length)) { + type = USER; + } else if (eq("USING", sql, tokenStart, length)) { + type = USING; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readV(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("VALUE", sql, tokenStart, length)) { + type = VALUE; + } else if (eq("VALUES", sql, tokenStart, length)) { + type = VALUES; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readW(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type; + if (eq("WHEN", sql, tokenStart, length)) { + type = WHEN; + } else if (eq("WHERE", sql, tokenStart, length)) { + type = WHERE; + } else if (eq("WINDOW", sql, tokenStart, length)) { + type = WINDOW; + } else if (eq("WITH", sql, tokenStart, length)) { + type = WITH; + } else { + type = IDENTIFIER; + } + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readY(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int length = endIndex - tokenStart; + int type = eq("YEAR", sql, tokenStart, length) ? YEAR : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int read_(String sql, int end, int tokenStart, int i, ArrayList tokens) { + int endIndex = findIdentifierEnd(sql, end, i); + int type = endIndex - tokenStart == 7 && "_ROWID_".regionMatches(true, 1, sql, tokenStart + 1, 6) ? _ROWID_ + : IDENTIFIER; + return readIdentifierOrKeyword(sql, tokenStart, tokens, endIndex, type); + } + + private int readIdentifierOrKeyword(String sql, int tokenStart, ArrayList tokens, int endIndex, int type) { + Token token; + if (type == IDENTIFIER) { + token = new Token.IdentifierToken(tokenStart, extractIdentifier(sql, tokenStart, endIndex), false, false); + } else if (nonKeywords != null && nonKeywords.get(type)) { + token = new Token.KeywordOrIdentifierToken(tokenStart, type, extractIdentifier(sql, tokenStart, endIndex)); + } else { + token = new Token.KeywordToken(tokenStart, type); + } + tokens.add(token); + return endIndex; + } + + private static boolean eq(String expected, String s, int start, int length) { + if (length != expected.length()) { + return false; + } + for (int i = 1; i < length; i++) { + if (expected.charAt(i) != (s.charAt(++start) & 0xffdf)) { + return false; + } + } + return true; + } + + private int findIdentifierEnd(String sql, int end, int i) { + i++; + for (;;) { + int cp; + if (i > end || (!Character.isJavaIdentifierPart(cp = sql.codePointAt(i)) + && (cp != '#' || !provider.getMode().supportPoundSymbolForColumnNames))) { + break; + } + i += Character.charCount(cp); + } + return i; + } + + private String extractIdentifier(String sql, int beginIndex, int endIndex) { + return convertCase(sql.substring(beginIndex, endIndex)); + } + + private int readQuotedIdentifier(String sql, int end, int tokenStart, int i, char c, boolean unicode, + ArrayList tokens) { + int identifierEnd = sql.indexOf(c, ++i); + if (identifierEnd < 0) { + throw DbException.getSyntaxError(sql, tokenStart); + } + String s = sql.substring(i, identifierEnd); + i = identifierEnd + 1; + if (i <= end && sql.charAt(i) == c) { + StringBuilder builder = new StringBuilder(s); + do { + identifierEnd = sql.indexOf(c, i + 1); + if (identifierEnd < 0) { + throw DbException.getSyntaxError(sql, tokenStart); + } + builder.append(sql, i, identifierEnd); + i = identifierEnd + 1; + } while (i <= end && sql.charAt(i) == c); + s = builder.toString(); + } + if (c == '`') { + s = convertCase(s); + } + tokens.add(new Token.IdentifierToken(tokenStart, s, true, unicode)); + return i; + } + + private String convertCase(String s) { + if (identifiersToUpper) { + s = StringUtils.toUpperEnglish(s); + } else if (identifiersToLower) { + s = StringUtils.toLowerEnglish(s); + } + return s; + } + + private static int readBinaryString(String sql, int tokenStart, int end, int i, ArrayList tokens) { + ByteArrayOutputStream result = new ByteArrayOutputStream(); + int stringEnd; + do { + stringEnd = sql.indexOf('\'', ++i); + if (stringEnd < 0 || stringEnd < end && sql.charAt(stringEnd + 1) == '\'') { + throw DbException.getSyntaxError(sql, tokenStart); + } + StringUtils.convertHexWithSpacesToBytes(result, sql, i, stringEnd); + i = skipWhitespace(sql, end, stringEnd + 1); + } while (i <= end && sql.charAt(i) == '\''); + tokens.add(new Token.BinaryStringToken(tokenStart, result.toByteArray())); + return i; + } + + private static int readCharacterString(String sql, int tokenStart, int end, int i, boolean unicode, + ArrayList tokens) { + String s = null; + StringBuilder builder = null; + int stringEnd; + do { + stringEnd = sql.indexOf('\'', ++i); + if (stringEnd < 0) { + throw DbException.getSyntaxError(sql, tokenStart); + } + if (s == null) { + s = sql.substring(i, stringEnd); + } else { + if (builder == null) { + builder = new StringBuilder(s); + } + builder.append(sql, i, stringEnd); + } + i = stringEnd + 1; + if (i <= end && sql.charAt(i) == '\'') { + if (builder == null) { + builder = new StringBuilder(s); + } + do { + stringEnd = sql.indexOf('\'', i + 1); + if (stringEnd < 0) { + throw DbException.getSyntaxError(sql, tokenStart); + } + builder.append(sql, i, stringEnd); + i = stringEnd + 1; + } while (i <= end && sql.charAt(i) == '\''); + } + i = skipWhitespace(sql, end, i); + } while (i <= end && sql.charAt(i) == '\''); + if (builder != null) { + s = builder.toString(); + } + tokens.add(new Token.CharacterStringToken(tokenStart, s, unicode)); + return i; + } + + private static int skipWhitespace(String sql, int end, int i) { + while (i <= end) { + int cp = sql.codePointAt(i); + if (!Character.isWhitespace(cp)) { + if (cp == '/' && i < end) { + char c2 = sql.charAt(i + 1); + if (c2 == '*') { + i = skipBracketedComment(sql, i, end, i); + continue; + } else if (c2 == '/') { + i = skipSimpleComment(sql, end, i); + continue; + } + } + break; + } + i += Character.charCount(cp); + } + return i; + } + + private static int readHexNumber(String sql, CastDataProvider provider, int tokenStart, int end, int i, + ArrayList tokens) { + if (provider.getMode().zeroExLiteralsAreBinaryStrings) { + int start = i; + for (char c; i <= end + && (((c = sql.charAt(i)) >= '0' && c <= '9') || ((c &= 0xffdf) >= 'A' && c <= 'F'));) { + i++; + } + if (i <= end && Character.isJavaIdentifierPart(sql.codePointAt(i))) { + throw DbException.get(ErrorCode.HEX_STRING_WRONG_1, sql.substring(start, i + 1)); + } + tokens.add(new Token.BinaryStringToken(start, StringUtils.convertHexToBytes(sql.substring(start, i)))); + return i; + } else { + if (i > end) { + throw DbException.getSyntaxError(sql, tokenStart, "Hex number"); + } + int start = i; + long number = 0; + char c; + do { + c = sql.charAt(i); + if (c >= '0' && c <= '9') { + number = (number << 4) + c - '0'; + // Convert a-z to A-Z + } else if ((c &= 0xffdf) >= 'A' && c <= 'F') { + number = (number << 4) + c - ('A' - 10); + } else if (i == start) { + throw DbException.getSyntaxError(sql, tokenStart, "Hex number"); + } else { + break; + } + if (number > Integer.MAX_VALUE) { + while (++i <= end + && (((c = sql.charAt(i)) >= '0' && c <= '9') || ((c &= 0xffdf) >= 'A' && c <= 'F'))) { + } + return finishBigInteger(sql, tokenStart, end, i, start, i <= end && c == 'L', 16, tokens); + } + } while (++i <= end); + + boolean bigint = i <= end && c == 'L'; + if (bigint) { + i++; + } + if (i <= end && Character.isJavaIdentifierPart(sql.codePointAt(i))) { + throw DbException.getSyntaxError(sql, tokenStart, "Hex number"); + } + tokens.add(bigint ? new Token.BigintToken(start, number) : new Token.IntegerToken(start, (int) number)); + return i; + } + } + + private static int readNumeric(String sql, int tokenStart, int end, int i, char c, ArrayList tokens) { + long number = c - '0'; + for (; i <= end; i++) { + c = sql.charAt(i); + if (c < '0' || c > '9') { + switch (c) { + case '.': + return readNumeric(sql, tokenStart, end, i, c, false, false, tokens); + case 'E': + case 'e': + return readNumeric(sql, tokenStart, end, i, c, false, true, tokens); + case 'L': + case 'l': + return finishBigInteger(sql, tokenStart, end, i, tokenStart, true, 10, tokens); + } + break; + } + number = number * 10 + (c - '0'); + if (number > Integer.MAX_VALUE) { + return readNumeric(sql, tokenStart, end, i, c, true, false, tokens); + } + } + tokens.add(new Token.IntegerToken(tokenStart, (int) number)); + return i; + } + + private static int readNumeric(String sql, int tokenStart, int end, int i, char c, boolean integer, + boolean approximate, ArrayList tokens) { + if (!approximate) { + while (++i <= end) { + c = sql.charAt(i); + if (c == '.') { + integer = false; + } else if (c < '0' || c > '9') { + break; + } + } + } + if (i <= end && (c == 'E' || c == 'e')) { + integer = false; + approximate = true; + if (i == end) { + throw DbException.getSyntaxError(sql, tokenStart); + } + c = sql.charAt(++i); + if (c == '+' || c == '-') { + if (i == end) { + throw DbException.getSyntaxError(sql, tokenStart); + } + c = sql.charAt(++i); + } + if (c < '0' || c > '9') { + throw DbException.getSyntaxError(sql, tokenStart); + } + while (++i <= end && (c = sql.charAt(i)) >= '0' && c <= '9') { + // go until the first non-number + } + } + if (integer) { + return finishBigInteger(sql, tokenStart, end, i, tokenStart, i < end && c == 'L' || c == 'l', 10, tokens); + } + BigDecimal bd; + String string = sql.substring(tokenStart, i); + try { + bd = new BigDecimal(string); + } catch (NumberFormatException e) { + throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1, e, string); + } + tokens.add(new Token.ValueToken(tokenStart, approximate ? ValueDecfloat.get(bd) : ValueNumeric.get(bd))); + return i; + } + + private static int finishBigInteger(String sql, int tokenStart, int end, int i, int start, boolean asBigint, + int radix, ArrayList tokens) { + int endIndex = i; + if (asBigint) { + i++; + } + if (radix == 16 && i <= end && Character.isJavaIdentifierPart(sql.codePointAt(i))) { + throw DbException.getSyntaxError(sql, tokenStart, "Hex number"); + } + BigInteger bigInteger = new BigInteger(sql.substring(start, endIndex), radix); + Token token; + if (bigInteger.compareTo(ValueBigint.MAX_BI) > 0) { + if (asBigint) { + throw DbException.getSyntaxError(sql, tokenStart); + } + token = new Token.ValueToken(tokenStart, ValueNumeric.get(bigInteger)); + } else { + token = new Token.BigintToken(start, bigInteger.longValue()); + } + tokens.add(token); + return i; + } + + private static int skipBracketedComment(String sql, int tokenStart, int end, int i) { + i += 2; + for (int level = 1; level > 0;) { + for (;;) { + if (i >= end) { + throw DbException.getSyntaxError(sql, tokenStart); + } + char c = sql.charAt(i++); + if (c == '*') { + if (sql.charAt(i) == '/') { + level--; + i++; + break; + } + } else if (c == '/' && sql.charAt(i) == '*') { + level++; + i++; + } + } + } + return i; + } + + private static int skipSimpleComment(String sql, int end, int i) { + i += 2; + for (char c; i <= end && (c = sql.charAt(i)) != '\n' && c != '\r'; i++) { + // + } + return i; + } + + private static int parseParameterIndex(String sql, int end, int i, ArrayList tokens) { + int tokenStart = i; + long number = 0; + for (char c; ++i <= end && (c = sql.charAt(i)) >= '0' && c <= '9';) { + number = number * 10 + (c - '0'); + if (number > Integer.MAX_VALUE) { + throw DbException.getInvalidValueException("parameter index", number); + } + } + if (i > tokenStart + 1 && number == 0) { + throw DbException.getInvalidValueException("parameter index", number); + } + tokens.add(new Token.ParameterToken(tokenStart, (int) number)); + return i; + } + + private static int assignParameterIndex(ArrayList tokens, int lastParameter) { + Token.ParameterToken parameter = (Token.ParameterToken) tokens.get(tokens.size() - 1); + if (parameter.index == 0) { + if (lastParameter < 0) { + throw DbException.get(ErrorCode.CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS); + } + parameter.index = ++lastParameter; + } else if (lastParameter > 0) { + throw DbException.get(ErrorCode.CANNOT_MIX_INDEXED_AND_UNINDEXED_PARAMS); + } else { + lastParameter = -1; + } + return lastParameter; + } + + private static void processUescape(String sql, ArrayList tokens) { + ListIterator i = tokens.listIterator(); + while (i.hasNext()) { + Token token = i.next(); + if (token.needsUnicodeConversion()) { + int uescape = '\\'; + condition: if (i.hasNext()) { + Token t2 = i.next(); + if (t2.tokenType() == UESCAPE) { + i.remove(); + if (i.hasNext()) { + Token t3 = i.next(); + i.remove(); + if (t3 instanceof Token.CharacterStringToken) { + String s = ((Token.CharacterStringToken) t3).string; + if (s.codePointCount(0, s.length()) == 1) { + int escape = s.codePointAt(0); + if (!Character.isWhitespace(escape) && (escape < '0' || escape > '9') + && (escape < 'A' || escape > 'F') && (escape < 'a' || escape > 'f')) { + switch (escape) { + default: + uescape = escape; + break condition; + case '"': + case '\'': + case '+': + } + } + } + } + } + throw DbException.getSyntaxError(sql, t2.start() + 7, "''"); + } + } + token.convertUnicode(uescape); + } + } + } + +} diff --git a/h2/src/main/org/h2/command/ddl/AlterDomain.java b/h2/src/main/org/h2/command/ddl/AlterDomain.java index 8fefc8677e..4b96f6828d 100644 --- a/h2/src/main/org/h2/command/ddl/AlterDomain.java +++ b/h2/src/main/org/h2/command/ddl/AlterDomain.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterDomainAddConstraint.java b/h2/src/main/org/h2/command/ddl/AlterDomainAddConstraint.java index e1646a1bc4..d8b8bcef52 100644 --- a/h2/src/main/org/h2/command/ddl/AlterDomainAddConstraint.java +++ b/h2/src/main/org/h2/command/ddl/AlterDomainAddConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterDomainDropConstraint.java b/h2/src/main/org/h2/command/ddl/AlterDomainDropConstraint.java index 78e69e365f..df9efaa5a8 100644 --- a/h2/src/main/org/h2/command/ddl/AlterDomainDropConstraint.java +++ b/h2/src/main/org/h2/command/ddl/AlterDomainDropConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterDomainExpressions.java b/h2/src/main/org/h2/command/ddl/AlterDomainExpressions.java index d62975f877..a5d519e379 100644 --- a/h2/src/main/org/h2/command/ddl/AlterDomainExpressions.java +++ b/h2/src/main/org/h2/command/ddl/AlterDomainExpressions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterDomainRename.java b/h2/src/main/org/h2/command/ddl/AlterDomainRename.java index 99ca5cd66c..f0b65e9705 100644 --- a/h2/src/main/org/h2/command/ddl/AlterDomainRename.java +++ b/h2/src/main/org/h2/command/ddl/AlterDomainRename.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterDomainRenameConstraint.java b/h2/src/main/org/h2/command/ddl/AlterDomainRenameConstraint.java index 6adbe6aa12..3f4cfbad23 100644 --- a/h2/src/main/org/h2/command/ddl/AlterDomainRenameConstraint.java +++ b/h2/src/main/org/h2/command/ddl/AlterDomainRenameConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterIndexRename.java b/h2/src/main/org/h2/command/ddl/AlterIndexRename.java index 07fdb101b6..a09d820ce2 100644 --- a/h2/src/main/org/h2/command/ddl/AlterIndexRename.java +++ b/h2/src/main/org/h2/command/ddl/AlterIndexRename.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterSchemaRename.java b/h2/src/main/org/h2/command/ddl/AlterSchemaRename.java index bd93ae9a53..3ce0b0fb3b 100644 --- a/h2/src/main/org/h2/command/ddl/AlterSchemaRename.java +++ b/h2/src/main/org/h2/command/ddl/AlterSchemaRename.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterSequence.java b/h2/src/main/org/h2/command/ddl/AlterSequence.java index 630b6760e0..706672a7c1 100644 --- a/h2/src/main/org/h2/command/ddl/AlterSequence.java +++ b/h2/src/main/org/h2/command/ddl/AlterSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterTable.java b/h2/src/main/org/h2/command/ddl/AlterTable.java index cd00ae84ba..2cfbd7ff85 100644 --- a/h2/src/main/org/h2/command/ddl/AlterTable.java +++ b/h2/src/main/org/h2/command/ddl/AlterTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java b/h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java index 760cfd810e..05c425b2e0 100644 --- a/h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java +++ b/h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -112,7 +112,7 @@ private int tryUpdate(Table table) { } Database db = session.getDatabase(); db.lockMeta(session); - table.lock(session, true, true); + table.lock(session, Table.EXCLUSIVE_LOCK); Constraint constraint; switch (type) { case CommandInterface.ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY: { @@ -161,7 +161,25 @@ private int tryUpdate(Table table) { break; } case CommandInterface.ALTER_TABLE_ADD_CONSTRAINT_UNIQUE: - IndexColumn.mapColumns(indexColumns, table); + if (indexColumns == null) { + Column[] columns = table.getColumns(); + int columnCount = columns.length; + ArrayList list = new ArrayList<>(columnCount); + for (int i = 0; i < columnCount; i++) { + Column c = columns[i]; + if (c.getVisible()) { + IndexColumn indexColumn = new IndexColumn(c.getName()); + indexColumn.column = c; + list.add(indexColumn); + } + } + if (list.isEmpty()) { + throw DbException.get(ErrorCode.SYNTAX_ERROR_1, "UNIQUE(VALUE) on table without columns"); + } + indexColumns = list.toArray(new IndexColumn[0]); + } else { + IndexColumn.mapColumns(indexColumns, table); + } constraint = createUniqueConstraint(table, index, indexColumns, false); break; case CommandInterface.ALTER_TABLE_ADD_CONSTRAINT_CHECK: { diff --git a/h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java b/h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java index ac37d64f27..ebb8baa2ef 100644 --- a/h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java +++ b/h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -117,7 +117,7 @@ public long update() { } session.getUser().checkTableRight(table, Right.SCHEMA_OWNER); table.checkSupportAlter(); - table.lock(session, true, true); + table.lock(session, Table.EXCLUSIVE_LOCK); if (newColumn != null) { checkDefaultReferencesTable(table, newColumn.getDefaultExpression()); checkClustering(newColumn); @@ -247,7 +247,7 @@ public long update() { throw DbException.get(ErrorCode.CANNOT_DROP_LAST_COLUMN, columnsToRemove.get(0).getTraceSQL()); } table.dropMultipleColumnsConstraintsAndIndexes(session, columnsToRemove); - copyData(table); + copyData(table, null, false); break; } case CommandInterface.ALTER_TABLE_ALTER_COLUMN_SELECTIVITY: { @@ -327,10 +327,6 @@ private void removeSequence(Table table, Sequence sequence) { } } - private void copyData(Table table) { - copyData(table, null, false); - } - private void copyData(Table table, ArrayList sequences, boolean createConstraints) { if (table.isTemporary()) { throw DbException.getUnsupportedException("TEMP TABLE"); @@ -458,34 +454,30 @@ private Table cloneTableStructure(Table table, Column[] columns, Database db, Table newTable = getSchema().createTable(data); newTable.setComment(table.getComment()); String newTableSQL = newTable.getCreateSQLForMeta(); - StringBuilder columnList = new StringBuilder(); + StringBuilder columnNames = new StringBuilder(); + StringBuilder columnValues = new StringBuilder(); for (Column nc : newColumns) { - if (columnList.length() > 0) { - columnList.append(", "); + if (nc.isGenerated()) { + continue; } switch (type) { case CommandInterface.ALTER_TABLE_ADD_COLUMN: if (columnsToAdd != null && columnsToAdd.contains(nc)) { if (usingExpression != null) { - usingExpression.getUnenclosedSQL(columnList, HasSQL.DEFAULT_SQL_FLAGS); - } else { - Expression def = nc.getDefaultExpression(); - if (def == null) { - columnList.append("NULL"); - } else { - def.getUnenclosedSQL(columnList, HasSQL.DEFAULT_SQL_FLAGS); - } + usingExpression.getUnenclosedSQL(addColumn(nc, columnNames, columnValues), + HasSQL.DEFAULT_SQL_FLAGS); } continue; } break; case CommandInterface.ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE: if (nc.equals(newColumn) && usingExpression != null) { - usingExpression.getUnenclosedSQL(columnList, HasSQL.DEFAULT_SQL_FLAGS); + usingExpression.getUnenclosedSQL(addColumn(nc, columnNames, columnValues), + HasSQL.DEFAULT_SQL_FLAGS); continue; } } - nc.getSQL(columnList, HasSQL.DEFAULT_SQL_FLAGS); + nc.getSQL(addColumn(nc, columnNames, columnValues), HasSQL.DEFAULT_SQL_FLAGS); } String newTableName = newTable.getName(); Schema newTableSchema = newTable.getSchema(); @@ -551,24 +543,22 @@ private Table cloneTableStructure(Table table, Column[] columns, Database db, } } } - StringBuilder buff = new StringBuilder(); - buff.append("INSERT INTO "); - newTable.getSQL(buff, HasSQL.DEFAULT_SQL_FLAGS); - buff.append(" SELECT "); - if (columnList.length() == 0) { + StringBuilder builder = newTable.getSQL(new StringBuilder(128).append("INSERT INTO "), // + HasSQL.DEFAULT_SQL_FLAGS) + .append('(').append(columnNames).append(") OVERRIDING SYSTEM VALUE SELECT "); + if (columnValues.length() == 0) { // special case: insert into test select * from - buff.append('*'); + builder.append('*'); } else { - buff.append(columnList); + builder.append(columnValues); } - buff.append(" FROM "); - table.getSQL(buff, HasSQL.DEFAULT_SQL_FLAGS); + table.getSQL(builder.append(" FROM "), HasSQL.DEFAULT_SQL_FLAGS); try { - execute(buff.toString()); + execute(builder.toString()); } catch (Throwable t) { // data was not inserted due to data conversion error or some // unexpected reason - StringBuilder builder = new StringBuilder("DROP TABLE "); + builder = new StringBuilder("DROP TABLE "); newTable.getSQL(builder, HasSQL.DEFAULT_SQL_FLAGS); execute(builder.toString()); throw t; @@ -592,6 +582,17 @@ private Table cloneTableStructure(Table table, Column[] columns, Database db, return newTable; } + private static StringBuilder addColumn(Column column, StringBuilder columnNames, StringBuilder columnValues) { + if (columnNames.length() > 0) { + columnNames.append(", "); + } + column.getSQL(columnNames, HasSQL.DEFAULT_SQL_FLAGS); + if (columnValues.length() > 0) { + columnValues.append(", "); + } + return columnValues; + } + /** * Check that all views and other dependent objects. */ diff --git a/h2/src/main/org/h2/command/ddl/AlterTableDropConstraint.java b/h2/src/main/org/h2/command/ddl/AlterTableDropConstraint.java index 91def0461e..32a7390e02 100644 --- a/h2/src/main/org/h2/command/ddl/AlterTableDropConstraint.java +++ b/h2/src/main/org/h2/command/ddl/AlterTableDropConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterTableRename.java b/h2/src/main/org/h2/command/ddl/AlterTableRename.java index 9870eda27d..948b4878d2 100644 --- a/h2/src/main/org/h2/command/ddl/AlterTableRename.java +++ b/h2/src/main/org/h2/command/ddl/AlterTableRename.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterTableRenameColumn.java b/h2/src/main/org/h2/command/ddl/AlterTableRenameColumn.java index 162dbe5c11..104d514108 100644 --- a/h2/src/main/org/h2/command/ddl/AlterTableRenameColumn.java +++ b/h2/src/main/org/h2/command/ddl/AlterTableRenameColumn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterTableRenameConstraint.java b/h2/src/main/org/h2/command/ddl/AlterTableRenameConstraint.java index f81c06d172..3dce7f3a6c 100644 --- a/h2/src/main/org/h2/command/ddl/AlterTableRenameConstraint.java +++ b/h2/src/main/org/h2/command/ddl/AlterTableRenameConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterUser.java b/h2/src/main/org/h2/command/ddl/AlterUser.java index cda3d1b388..adaf83ea64 100644 --- a/h2/src/main/org/h2/command/ddl/AlterUser.java +++ b/h2/src/main/org/h2/command/ddl/AlterUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/AlterView.java b/h2/src/main/org/h2/command/ddl/AlterView.java index f319e044d5..27360167c4 100644 --- a/h2/src/main/org/h2/command/ddl/AlterView.java +++ b/h2/src/main/org/h2/command/ddl/AlterView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/Analyze.java b/h2/src/main/org/h2/command/ddl/Analyze.java index 979516a5bd..166d319685 100644 --- a/h2/src/main/org/h2/command/ddl/Analyze.java +++ b/h2/src/main/org/h2/command/ddl/Analyze.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -181,7 +181,7 @@ public static void analyzeTable(SessionLocal session, Table table, int sample, b || session.getCancel() != 0) { return; } - table.lock(session, false, false); + table.lock(session, Table.READ_LOCK); Column[] columns = table.getColumns(); int columnCount = columns.length; if (columnCount == 0) { diff --git a/h2/src/main/org/h2/command/ddl/CommandWithColumns.java b/h2/src/main/org/h2/command/ddl/CommandWithColumns.java index 60359de798..b8cb76ec80 100644 --- a/h2/src/main/org/h2/command/ddl/CommandWithColumns.java +++ b/h2/src/main/org/h2/command/ddl/CommandWithColumns.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateAggregate.java b/h2/src/main/org/h2/command/ddl/CreateAggregate.java index 9b451ed9a6..000f09fe05 100644 --- a/h2/src/main/org/h2/command/ddl/CreateAggregate.java +++ b/h2/src/main/org/h2/command/ddl/CreateAggregate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateConstant.java b/h2/src/main/org/h2/command/ddl/CreateConstant.java index dff1c1cfdf..a66b8c3a23 100644 --- a/h2/src/main/org/h2/command/ddl/CreateConstant.java +++ b/h2/src/main/org/h2/command/ddl/CreateConstant.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateDomain.java b/h2/src/main/org/h2/command/ddl/CreateDomain.java index 9c8e8416c0..2af747f546 100644 --- a/h2/src/main/org/h2/command/ddl/CreateDomain.java +++ b/h2/src/main/org/h2/command/ddl/CreateDomain.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateFunctionAlias.java b/h2/src/main/org/h2/command/ddl/CreateFunctionAlias.java index 49e2fe9a1b..0641dbce33 100644 --- a/h2/src/main/org/h2/command/ddl/CreateFunctionAlias.java +++ b/h2/src/main/org/h2/command/ddl/CreateFunctionAlias.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateIndex.java b/h2/src/main/org/h2/command/ddl/CreateIndex.java index ae9e70c43a..cf00511c40 100644 --- a/h2/src/main/org/h2/command/ddl/CreateIndex.java +++ b/h2/src/main/org/h2/command/ddl/CreateIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -74,7 +74,7 @@ public long update() { throw DbException.get(ErrorCode.INDEX_ALREADY_EXISTS_1, indexName); } session.getUser().checkTableRight(table, Right.SCHEMA_OWNER); - table.lock(session, true, true); + table.lock(session, Table.EXCLUSIVE_LOCK); if (!table.isPersistIndexes()) { persistent = false; } diff --git a/h2/src/main/org/h2/command/ddl/CreateLinkedTable.java b/h2/src/main/org/h2/command/ddl/CreateLinkedTable.java index e5e226401d..d7ea31eaac 100644 --- a/h2/src/main/org/h2/command/ddl/CreateLinkedTable.java +++ b/h2/src/main/org/h2/command/ddl/CreateLinkedTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateRole.java b/h2/src/main/org/h2/command/ddl/CreateRole.java index ebeca311d7..3add534252 100644 --- a/h2/src/main/org/h2/command/ddl/CreateRole.java +++ b/h2/src/main/org/h2/command/ddl/CreateRole.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateSchema.java b/h2/src/main/org/h2/command/ddl/CreateSchema.java index e711a6c792..fbab006152 100644 --- a/h2/src/main/org/h2/command/ddl/CreateSchema.java +++ b/h2/src/main/org/h2/command/ddl/CreateSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateSequence.java b/h2/src/main/org/h2/command/ddl/CreateSequence.java index 3c51c1efb4..896a326337 100644 --- a/h2/src/main/org/h2/command/ddl/CreateSequence.java +++ b/h2/src/main/org/h2/command/ddl/CreateSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateSynonym.java b/h2/src/main/org/h2/command/ddl/CreateSynonym.java index 546729137d..5f94ad93b4 100644 --- a/h2/src/main/org/h2/command/ddl/CreateSynonym.java +++ b/h2/src/main/org/h2/command/ddl/CreateSynonym.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateSynonymData.java b/h2/src/main/org/h2/command/ddl/CreateSynonymData.java index 62abcf7769..6e1122d749 100644 --- a/h2/src/main/org/h2/command/ddl/CreateSynonymData.java +++ b/h2/src/main/org/h2/command/ddl/CreateSynonymData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateTable.java b/h2/src/main/org/h2/command/ddl/CreateTable.java index 3a7a680bcf..213b178702 100644 --- a/h2/src/main/org/h2/command/ddl/CreateTable.java +++ b/h2/src/main/org/h2/command/ddl/CreateTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateTableData.java b/h2/src/main/org/h2/command/ddl/CreateTableData.java index df0de1a83e..7549b15175 100644 --- a/h2/src/main/org/h2/command/ddl/CreateTableData.java +++ b/h2/src/main/org/h2/command/ddl/CreateTableData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateTrigger.java b/h2/src/main/org/h2/command/ddl/CreateTrigger.java index 8b2d82266b..9b098fe3e8 100644 --- a/h2/src/main/org/h2/command/ddl/CreateTrigger.java +++ b/h2/src/main/org/h2/command/ddl/CreateTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateUser.java b/h2/src/main/org/h2/command/ddl/CreateUser.java index 6c4b86bd3f..17983aad07 100644 --- a/h2/src/main/org/h2/command/ddl/CreateUser.java +++ b/h2/src/main/org/h2/command/ddl/CreateUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/CreateView.java b/h2/src/main/org/h2/command/ddl/CreateView.java index 56cb20db4b..dc397ae3da 100644 --- a/h2/src/main/org/h2/command/ddl/CreateView.java +++ b/h2/src/main/org/h2/command/ddl/CreateView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DeallocateProcedure.java b/h2/src/main/org/h2/command/ddl/DeallocateProcedure.java index 51d4f7f1a9..dad6d054cb 100644 --- a/h2/src/main/org/h2/command/ddl/DeallocateProcedure.java +++ b/h2/src/main/org/h2/command/ddl/DeallocateProcedure.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DefineCommand.java b/h2/src/main/org/h2/command/ddl/DefineCommand.java index a165f3b599..cf10794d56 100644 --- a/h2/src/main/org/h2/command/ddl/DefineCommand.java +++ b/h2/src/main/org/h2/command/ddl/DefineCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropAggregate.java b/h2/src/main/org/h2/command/ddl/DropAggregate.java index 6b2225cb64..08cd6d5741 100644 --- a/h2/src/main/org/h2/command/ddl/DropAggregate.java +++ b/h2/src/main/org/h2/command/ddl/DropAggregate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropConstant.java b/h2/src/main/org/h2/command/ddl/DropConstant.java index a6a12024b0..565031ee60 100644 --- a/h2/src/main/org/h2/command/ddl/DropConstant.java +++ b/h2/src/main/org/h2/command/ddl/DropConstant.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropDatabase.java b/h2/src/main/org/h2/command/ddl/DropDatabase.java index 8c2b0ac13a..a46fae9f6a 100644 --- a/h2/src/main/org/h2/command/ddl/DropDatabase.java +++ b/h2/src/main/org/h2/command/ddl/DropDatabase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropDomain.java b/h2/src/main/org/h2/command/ddl/DropDomain.java index 1e4e9505d0..8426dc2390 100644 --- a/h2/src/main/org/h2/command/ddl/DropDomain.java +++ b/h2/src/main/org/h2/command/ddl/DropDomain.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropFunctionAlias.java b/h2/src/main/org/h2/command/ddl/DropFunctionAlias.java index d6d56dffc9..2a9fb641de 100644 --- a/h2/src/main/org/h2/command/ddl/DropFunctionAlias.java +++ b/h2/src/main/org/h2/command/ddl/DropFunctionAlias.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropIndex.java b/h2/src/main/org/h2/command/ddl/DropIndex.java index 8ca9175698..37b66aa011 100644 --- a/h2/src/main/org/h2/command/ddl/DropIndex.java +++ b/h2/src/main/org/h2/command/ddl/DropIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropRole.java b/h2/src/main/org/h2/command/ddl/DropRole.java index 0dc49b12c8..5fdac3838c 100644 --- a/h2/src/main/org/h2/command/ddl/DropRole.java +++ b/h2/src/main/org/h2/command/ddl/DropRole.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropSchema.java b/h2/src/main/org/h2/command/ddl/DropSchema.java index eda135b4b5..3a8ea29ce1 100644 --- a/h2/src/main/org/h2/command/ddl/DropSchema.java +++ b/h2/src/main/org/h2/command/ddl/DropSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropSequence.java b/h2/src/main/org/h2/command/ddl/DropSequence.java index 60a1b03da2..451c628fee 100644 --- a/h2/src/main/org/h2/command/ddl/DropSequence.java +++ b/h2/src/main/org/h2/command/ddl/DropSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropSynonym.java b/h2/src/main/org/h2/command/ddl/DropSynonym.java index d24c5d5982..fcab524f5e 100644 --- a/h2/src/main/org/h2/command/ddl/DropSynonym.java +++ b/h2/src/main/org/h2/command/ddl/DropSynonym.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropTable.java b/h2/src/main/org/h2/command/ddl/DropTable.java index 884fbaf185..c907d56e2b 100644 --- a/h2/src/main/org/h2/command/ddl/DropTable.java +++ b/h2/src/main/org/h2/command/ddl/DropTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -20,7 +20,6 @@ import org.h2.schema.Schema; import org.h2.table.Table; import org.h2.table.TableView; -import org.h2.util.StringUtils; import org.h2.util.Utils; /** @@ -95,11 +94,10 @@ private boolean prepareDrop() { } } if (!dependencies.isEmpty()) { - throw DbException.get(ErrorCode.CANNOT_DROP_2, table.getName(), - StringUtils.join(new StringBuilder(), dependencies, ", ").toString()); + throw DbException.get(ErrorCode.CANNOT_DROP_2, table.getName(), String.join(", ", dependencies)); } } - table.lock(session, true, true); + table.lock(session, Table.EXCLUSIVE_LOCK); } return true; } diff --git a/h2/src/main/org/h2/command/ddl/DropTrigger.java b/h2/src/main/org/h2/command/ddl/DropTrigger.java index e6503c67ff..3e304bd5ce 100644 --- a/h2/src/main/org/h2/command/ddl/DropTrigger.java +++ b/h2/src/main/org/h2/command/ddl/DropTrigger.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropUser.java b/h2/src/main/org/h2/command/ddl/DropUser.java index 1c3659690d..3f72099e46 100644 --- a/h2/src/main/org/h2/command/ddl/DropUser.java +++ b/h2/src/main/org/h2/command/ddl/DropUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/DropView.java b/h2/src/main/org/h2/command/ddl/DropView.java index 9713649770..35c8462e4b 100644 --- a/h2/src/main/org/h2/command/ddl/DropView.java +++ b/h2/src/main/org/h2/command/ddl/DropView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -73,7 +73,7 @@ public long update() { TableView tableView = (TableView) view; ArrayList copyOfDependencies = new ArrayList<>(tableView.getTables()); - view.lock(session, true, true); + view.lock(session, Table.EXCLUSIVE_LOCK); session.getDatabase().removeSchemaObject(session, view); // remove dependent table expressions diff --git a/h2/src/main/org/h2/command/ddl/GrantRevoke.java b/h2/src/main/org/h2/command/ddl/GrantRevoke.java index 936eceff1d..3fc52cf5d0 100644 --- a/h2/src/main/org/h2/command/ddl/GrantRevoke.java +++ b/h2/src/main/org/h2/command/ddl/GrantRevoke.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/PrepareProcedure.java b/h2/src/main/org/h2/command/ddl/PrepareProcedure.java index fe51ee7fa4..028ab2fcae 100644 --- a/h2/src/main/org/h2/command/ddl/PrepareProcedure.java +++ b/h2/src/main/org/h2/command/ddl/PrepareProcedure.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/SchemaCommand.java b/h2/src/main/org/h2/command/ddl/SchemaCommand.java index abbbb4a711..14cf2c772c 100644 --- a/h2/src/main/org/h2/command/ddl/SchemaCommand.java +++ b/h2/src/main/org/h2/command/ddl/SchemaCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/SchemaOwnerCommand.java b/h2/src/main/org/h2/command/ddl/SchemaOwnerCommand.java index 2e11c25178..28d432e625 100644 --- a/h2/src/main/org/h2/command/ddl/SchemaOwnerCommand.java +++ b/h2/src/main/org/h2/command/ddl/SchemaOwnerCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/SequenceOptions.java b/h2/src/main/org/h2/command/ddl/SequenceOptions.java index 22abc7d343..801db6e1bd 100644 --- a/h2/src/main/org/h2/command/ddl/SequenceOptions.java +++ b/h2/src/main/org/h2/command/ddl/SequenceOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -280,6 +280,9 @@ public static long[] getBounds(TypeInfo dataType) { max = 0x20_0000_0000_0000L; break; case Value.NUMERIC: { + if (dataType.getScale() != 0) { + throw DbException.getUnsupportedException(dataType.getTraceSQL()); + } long p = (dataType.getPrecision() - dataType.getScale()); if (p <= 0) { throw DbException.getUnsupportedException(dataType.getTraceSQL()); diff --git a/h2/src/main/org/h2/command/ddl/SetComment.java b/h2/src/main/org/h2/command/ddl/SetComment.java index fbb881b37c..ba936cc766 100644 --- a/h2/src/main/org/h2/command/ddl/SetComment.java +++ b/h2/src/main/org/h2/command/ddl/SetComment.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/ddl/TruncateTable.java b/h2/src/main/org/h2/command/ddl/TruncateTable.java index 3e365066c6..6bb244f6b7 100644 --- a/h2/src/main/org/h2/command/ddl/TruncateTable.java +++ b/h2/src/main/org/h2/command/ddl/TruncateTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -42,7 +42,7 @@ public long update() { throw DbException.get(ErrorCode.CANNOT_TRUNCATE_1, table.getTraceSQL()); } session.getUser().checkTableRight(table, Right.DELETE); - table.lock(session, true, true); + table.lock(session, Table.EXCLUSIVE_LOCK); long result = table.truncate(session); if (restart) { for (Column column : table.getColumns()) { diff --git a/h2/src/main/org/h2/command/ddl/package.html b/h2/src/main/org/h2/command/ddl/package.html index d503173c8f..9862a68694 100644 --- a/h2/src/main/org/h2/command/ddl/package.html +++ b/h2/src/main/org/h2/command/ddl/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/command/dml/AlterTableSet.java b/h2/src/main/org/h2/command/dml/AlterTableSet.java index 8b80db0c32..9d3a3c1a14 100644 --- a/h2/src/main/org/h2/command/dml/AlterTableSet.java +++ b/h2/src/main/org/h2/command/dml/AlterTableSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -60,7 +60,7 @@ public long update() { throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, tableName); } session.getUser().checkTableRight(table, Right.SCHEMA_OWNER); - table.lock(session, true, true); + table.lock(session, Table.EXCLUSIVE_LOCK); switch (type) { case CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY: table.setCheckForeignKeyConstraints(session, value, value ? diff --git a/h2/src/main/org/h2/command/dml/BackupCommand.java b/h2/src/main/org/h2/command/dml/BackupCommand.java index a608121b4e..709147da4d 100644 --- a/h2/src/main/org/h2/command/dml/BackupCommand.java +++ b/h2/src/main/org/h2/command/dml/BackupCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/Call.java b/h2/src/main/org/h2/command/dml/Call.java index 18eef35fdc..7302298328 100644 --- a/h2/src/main/org/h2/command/dml/Call.java +++ b/h2/src/main/org/h2/command/dml/Call.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/CommandWithValues.java b/h2/src/main/org/h2/command/dml/CommandWithValues.java index 7985eaab97..592981ae33 100644 --- a/h2/src/main/org/h2/command/dml/CommandWithValues.java +++ b/h2/src/main/org/h2/command/dml/CommandWithValues.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/DataChangeStatement.java b/h2/src/main/org/h2/command/dml/DataChangeStatement.java index a51e96ccd0..a2b53970f4 100644 --- a/h2/src/main/org/h2/command/dml/DataChangeStatement.java +++ b/h2/src/main/org/h2/command/dml/DataChangeStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/Delete.java b/h2/src/main/org/h2/command/dml/Delete.java index fb40248f92..832ba22dc2 100644 --- a/h2/src/main/org/h2/command/dml/Delete.java +++ b/h2/src/main/org/h2/command/dml/Delete.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -44,7 +44,7 @@ public long update(ResultTarget deltaChangeCollector, ResultOption deltaChangeCo Table table = targetTableFilter.getTable(); session.getUser().checkTableRight(table, Right.DELETE); table.fire(session, Trigger.DELETE, true); - table.lock(session, true, false); + table.lock(session, Table.WRITE_LOCK); long limitRows = -1; if (fetchExpr != null) { Value v = fetchExpr.getValue(session); diff --git a/h2/src/main/org/h2/command/dml/ExecuteImmediate.java b/h2/src/main/org/h2/command/dml/ExecuteImmediate.java index c56d39cd99..b9e5cfe66e 100644 --- a/h2/src/main/org/h2/command/dml/ExecuteImmediate.java +++ b/h2/src/main/org/h2/command/dml/ExecuteImmediate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/ExecuteProcedure.java b/h2/src/main/org/h2/command/dml/ExecuteProcedure.java index 03694e2083..0313ea51fd 100644 --- a/h2/src/main/org/h2/command/dml/ExecuteProcedure.java +++ b/h2/src/main/org/h2/command/dml/ExecuteProcedure.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/Explain.java b/h2/src/main/org/h2/command/dml/Explain.java index 0a4a539f8a..ea677f528f 100644 --- a/h2/src/main/org/h2/command/dml/Explain.java +++ b/h2/src/main/org/h2/command/dml/Explain.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/FilteredDataChangeStatement.java b/h2/src/main/org/h2/command/dml/FilteredDataChangeStatement.java index 09ca2e20c5..81995ce801 100644 --- a/h2/src/main/org/h2/command/dml/FilteredDataChangeStatement.java +++ b/h2/src/main/org/h2/command/dml/FilteredDataChangeStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/Help.java b/h2/src/main/org/h2/command/dml/Help.java index acfc14c4eb..528909e31d 100644 --- a/h2/src/main/org/h2/command/dml/Help.java +++ b/h2/src/main/org/h2/command/dml/Help.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/Insert.java b/h2/src/main/org/h2/command/dml/Insert.java index 6ddced53e0..aa350cc3ee 100644 --- a/h2/src/main/org/h2/command/dml/Insert.java +++ b/h2/src/main/org/h2/command/dml/Insert.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -169,7 +169,7 @@ private long insertRows() { deltaChangeCollector.addRow(newRow.getValueList().clone()); } if (!table.fireBeforeRow(session, null, newRow)) { - table.lock(session, true, false); + table.lock(session, Table.WRITE_LOCK); try { table.addRow(session, newRow); } catch (DbException de) { @@ -192,7 +192,7 @@ private long insertRows() { } } } else { - table.lock(session, true, false); + table.lock(session, Table.WRITE_LOCK); if (insertFromSelect) { query.query(0, this); } else { diff --git a/h2/src/main/org/h2/command/dml/Merge.java b/h2/src/main/org/h2/command/dml/Merge.java index b76b211b67..7931be7085 100644 --- a/h2/src/main/org/h2/command/dml/Merge.java +++ b/h2/src/main/org/h2/command/dml/Merge.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -113,7 +113,7 @@ public long update(ResultTarget deltaChangeCollector, ResultOption deltaChangeCo query.setNeverLazy(true); ResultInterface rows = query.query(0); table.fire(session, Trigger.UPDATE | Trigger.INSERT, true); - table.lock(session, true, false); + table.lock(session, Table.WRITE_LOCK); while (rows.next()) { Value[] r = rows.currentRow(); Row newRow = table.getTemplateRow(); @@ -182,7 +182,7 @@ private int merge(Row row, Expression[] expressions, ResultTarget deltaChangeCol deltaChangeCollector.addRow(row.getValueList().clone()); } if (!table.fireBeforeRow(session, null, row)) { - table.lock(session, true, false); + table.lock(session, Table.WRITE_LOCK); table.addRow(session, row); DataChangeDeltaTable.collectInsertedFinalRow(session, table, deltaChangeCollector, deltaChangeCollectionMode, row); diff --git a/h2/src/main/org/h2/command/dml/MergeUsing.java b/h2/src/main/org/h2/command/dml/MergeUsing.java index d3b3e8a030..0dab851782 100644 --- a/h2/src/main/org/h2/command/dml/MergeUsing.java +++ b/h2/src/main/org/h2/command/dml/MergeUsing.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -79,7 +79,7 @@ public long update(ResultTarget deltaChangeCollector, ResultOption deltaChangeCo sourceTableFilter.reset(); Table table = targetTableFilter.getTable(); table.fire(session, evaluateTriggerMasks(), true); - table.lock(session, true, false); + table.lock(session, Table.WRITE_LOCK); setCurrentRowNumber(0); long count = 0; Row previousSource = null, missedSource = null; diff --git a/h2/src/main/org/h2/command/dml/NoOperation.java b/h2/src/main/org/h2/command/dml/NoOperation.java index 142bc0b30c..803c52003d 100644 --- a/h2/src/main/org/h2/command/dml/NoOperation.java +++ b/h2/src/main/org/h2/command/dml/NoOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/RunScriptCommand.java b/h2/src/main/org/h2/command/dml/RunScriptCommand.java index c4c0635ac9..1040e3d6e2 100644 --- a/h2/src/main/org/h2/command/dml/RunScriptCommand.java +++ b/h2/src/main/org/h2/command/dml/RunScriptCommand.java @@ -1,13 +1,11 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.command.dml; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -51,8 +49,7 @@ public long update() { boolean oldQuirksMode = session.isQuirksMode(); boolean oldVariableBinary = session.isVariableBinary(); try { - openInput(); - BufferedReader reader = new BufferedReader(new InputStreamReader(in, charset)); + openInput(charset); // if necessary, strip the BOM from the front of the file reader.mark(1); if (reader.read() != UTF8_BOM) { diff --git a/h2/src/main/org/h2/command/dml/ScriptBase.java b/h2/src/main/org/h2/command/dml/ScriptBase.java index 9af5c86be6..e1b99c039f 100644 --- a/h2/src/main/org/h2/command/dml/ScriptBase.java +++ b/h2/src/main/org/h2/command/dml/ScriptBase.java @@ -1,15 +1,17 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.command.dml; -import java.io.BufferedInputStream; import java.io.BufferedOutputStream; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.OutputStream; +import java.nio.charset.Charset; import org.h2.api.ErrorCode; import org.h2.command.Prepared; import org.h2.engine.Constants; @@ -43,9 +45,9 @@ abstract class ScriptBase extends Prepared { protected OutputStream out; /** - * The input stream. + * The input reader. */ - protected InputStream in; + protected BufferedReader reader; /** * The file name (if set). @@ -147,28 +149,30 @@ void openOutput() { /** * Open the input stream. + * + * @param charset the charset to use */ - void openInput() { + void openInput(Charset charset) { String file = getFileName(); if (file == null) { return; } + InputStream in; if (isEncrypted()) { initStore(); in = new FileStoreInputStream(store, compressionAlgorithm != null, false); } else { - InputStream inStream; try { - inStream = FileUtils.newInputStream(file); + in = FileUtils.newInputStream(file); } catch (IOException e) { throw DbException.convertIOException(e, file); } - in = new BufferedInputStream(inStream, Constants.IO_BUFFER_SIZE); in = CompressTool.wrapInputStream(in, compressionAlgorithm, SCRIPT_SQL); if (in == null) { throw DbException.get(ErrorCode.FILE_NOT_FOUND_1, SCRIPT_SQL + " in " + file); } } + reader = new BufferedReader(new InputStreamReader(in, charset), Constants.IO_BUFFER_SIZE); } /** @@ -177,8 +181,8 @@ void openInput() { void closeIO() { IOUtils.closeSilently(out); out = null; - IOUtils.closeSilently(in); - in = null; + IOUtils.closeSilently(reader); + reader = null; if (store != null) { store.closeSilently(); store = null; diff --git a/h2/src/main/org/h2/command/dml/ScriptCommand.java b/h2/src/main/org/h2/command/dml/ScriptCommand.java index 13e480dbd6..d613e45079 100644 --- a/h2/src/main/org/h2/command/dml/ScriptCommand.java +++ b/h2/src/main/org/h2/command/dml/ScriptCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -247,7 +247,7 @@ public ResultInterface query(long maxrows) { if (table.isHidden()) { continue; } - table.lock(session, false, false); + table.lock(session, Table.READ_LOCK); String sql = table.getCreateSQL(); if (sql == null) { // null for metadata tables @@ -290,7 +290,7 @@ public ResultInterface query(long maxrows) { if (table.isHidden()) { continue; } - table.lock(session, false, false); + table.lock(session, Table.READ_LOCK); String createTableSql = table.getCreateSQL(); if (createTableSql == null) { // null for metadata tables @@ -573,7 +573,7 @@ private int generateInsertValues(int count, Table table) throws IOException { private int writeLobStream(Value v) throws IOException { if (!tempLobTableCreated) { - add("CREATE TABLE IF NOT EXISTS SYSTEM_LOB_STREAM" + + add("CREATE CACHED LOCAL TEMPORARY TABLE IF NOT EXISTS SYSTEM_LOB_STREAM" + "(ID INT NOT NULL, PART INT NOT NULL, " + "CDATA VARCHAR, BDATA VARBINARY)", true); diff --git a/h2/src/main/org/h2/command/dml/Set.java b/h2/src/main/org/h2/command/dml/Set.java index e7c9df3894..d0020a7307 100644 --- a/h2/src/main/org/h2/command/dml/Set.java +++ b/h2/src/main/org/h2/command/dml/Set.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -479,15 +479,6 @@ public long update() { } break; } - case SetTypes.FORCE_JOIN_ORDER: { - int value = getIntValue(); - if (value != 0 && value != 1) { - throw DbException.getInvalidValueException("FORCE_JOIN_ORDER", - value); - } - session.setForceJoinOrder(value == 1); - break; - } case SetTypes.LAZY_QUERY_EXECUTION: { int value = getIntValue(); if (value != 0 && value != 1) { diff --git a/h2/src/main/org/h2/command/dml/SetClauseList.java b/h2/src/main/org/h2/command/dml/SetClauseList.java index c941f5ca83..a17d38b825 100644 --- a/h2/src/main/org/h2/command/dml/SetClauseList.java +++ b/h2/src/main/org/h2/command/dml/SetClauseList.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/SetSessionCharacteristics.java b/h2/src/main/org/h2/command/dml/SetSessionCharacteristics.java index 5d04b2fab7..cb5efc62f7 100644 --- a/h2/src/main/org/h2/command/dml/SetSessionCharacteristics.java +++ b/h2/src/main/org/h2/command/dml/SetSessionCharacteristics.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/SetTypes.java b/h2/src/main/org/h2/command/dml/SetTypes.java index cc5df4dc44..464ffc8674 100644 --- a/h2/src/main/org/h2/command/dml/SetTypes.java +++ b/h2/src/main/org/h2/command/dml/SetTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -192,15 +192,10 @@ public class SetTypes { */ public static final int QUERY_STATISTICS_MAX_ENTRIES = QUERY_STATISTICS + 1; - /** - * The type of SET FORCE_JOIN_ORDER statement. - */ - public static final int FORCE_JOIN_ORDER = QUERY_STATISTICS_MAX_ENTRIES + 1; - /** * The type of SET LAZY_QUERY_EXECUTION statement. */ - public static final int LAZY_QUERY_EXECUTION = FORCE_JOIN_ORDER + 1; + public static final int LAZY_QUERY_EXECUTION = QUERY_STATISTICS_MAX_ENTRIES + 1; /** * The type of SET BUILTIN_ALIAS_OVERRIDE statement. @@ -293,7 +288,6 @@ private SetTypes() { list.add("RETENTION_TIME"); list.add("QUERY_STATISTICS"); list.add("QUERY_STATISTICS_MAX_ENTRIES"); - list.add("FORCE_JOIN_ORDER"); list.add("LAZY_QUERY_EXECUTION"); list.add("BUILTIN_ALIAS_OVERRIDE"); list.add("AUTHENTICATOR"); diff --git a/h2/src/main/org/h2/command/dml/TransactionCommand.java b/h2/src/main/org/h2/command/dml/TransactionCommand.java index 8bbbe8b260..c8fa171126 100644 --- a/h2/src/main/org/h2/command/dml/TransactionCommand.java +++ b/h2/src/main/org/h2/command/dml/TransactionCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/dml/Update.java b/h2/src/main/org/h2/command/dml/Update.java index 7f4ca82caf..26781c9594 100644 --- a/h2/src/main/org/h2/command/dml/Update.java +++ b/h2/src/main/org/h2/command/dml/Update.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -59,7 +59,7 @@ public long update(ResultTarget deltaChangeCollector, ResultOption deltaChangeCo try (LocalResult rows = LocalResult.forTable(session, table)) { session.getUser().checkTableRight(table, Right.UPDATE); table.fire(session, Trigger.UPDATE, true); - table.lock(session, true, false); + table.lock(session, Table.WRITE_LOCK); // get the old rows, compute the new rows setCurrentRowNumber(0); long count = 0; diff --git a/h2/src/main/org/h2/command/dml/package.html b/h2/src/main/org/h2/command/dml/package.html index 492fcc7745..077734e108 100644 --- a/h2/src/main/org/h2/command/dml/package.html +++ b/h2/src/main/org/h2/command/dml/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/command/package.html b/h2/src/main/org/h2/command/package.html index e9d4000314..6003e70e0d 100644 --- a/h2/src/main/org/h2/command/package.html +++ b/h2/src/main/org/h2/command/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/command/query/AllColumnsForPlan.java b/h2/src/main/org/h2/command/query/AllColumnsForPlan.java index 8af08eb382..b5b34e5290 100644 --- a/h2/src/main/org/h2/command/query/AllColumnsForPlan.java +++ b/h2/src/main/org/h2/command/query/AllColumnsForPlan.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/query/Optimizer.java b/h2/src/main/org/h2/command/query/Optimizer.java index d8e6f219f1..83bd58699f 100644 --- a/h2/src/main/org/h2/command/query/Optimizer.java +++ b/h2/src/main/org/h2/command/query/Optimizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -77,7 +77,7 @@ private static int getMaxBruteForceFilters(int filterCount) { private void calculateBestPlan() { cost = -1; - if (filters.length == 1 || session.isForceJoinOrder()) { + if (filters.length == 1) { testPlan(filters); } else { startNs = System.nanoTime(); diff --git a/h2/src/main/org/h2/command/query/Query.java b/h2/src/main/org/h2/command/query/Query.java index 154a968d58..227e15a472 100644 --- a/h2/src/main/org/h2/command/query/Query.java +++ b/h2/src/main/org/h2/command/query/Query.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/query/QueryOrderBy.java b/h2/src/main/org/h2/command/query/QueryOrderBy.java index ea1d6131b6..8606f30a69 100644 --- a/h2/src/main/org/h2/command/query/QueryOrderBy.java +++ b/h2/src/main/org/h2/command/query/QueryOrderBy.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/query/Select.java b/h2/src/main/org/h2/command/query/Select.java index 142b216c23..5b1b730dd1 100644 --- a/h2/src/main/org/h2/command/query/Select.java +++ b/h2/src/main/org/h2/command/query/Select.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -1884,9 +1884,10 @@ protected Value[] fetchNextRow() { setCurrentRowNumber(rowNumber + 1); if (isConditionMet()) { rowNumber++; - Value[] keyValues = new Value[groupIndex.length]; + int groupSize = groupIndex.length; + Value[] keyValues = new Value[groupSize]; // update group - for (int i = 0; i < groupIndex.length; i++) { + for (int i = 0; i < groupSize; i++) { int idx = groupIndex[i]; Expression expr = expressions.get(idx); keyValues[i] = expr.getValue(getSession()); @@ -1896,10 +1897,16 @@ protected Value[] fetchNextRow() { if (previousKeyValues == null) { previousKeyValues = keyValues; groupData.nextLazyGroup(); - } else if (!Arrays.equals(previousKeyValues, keyValues)) { - row = createGroupSortedRow(previousKeyValues, columnCount); - previousKeyValues = keyValues; - groupData.nextLazyGroup(); + } else { + SessionLocal session = getSession(); + for (int i = 0; i < groupSize; i++) { + if (session.compare(previousKeyValues[i], keyValues[i]) != 0) { + row = createGroupSortedRow(previousKeyValues, columnCount); + previousKeyValues = keyValues; + groupData.nextLazyGroup(); + break; + } + } } groupData.nextLazyRow(); updateAgg(columnCount, DataAnalysisOperation.STAGE_GROUP); diff --git a/h2/src/main/org/h2/command/query/SelectGroups.java b/h2/src/main/org/h2/command/query/SelectGroups.java index 56fb801e2a..ef5e1572ab 100644 --- a/h2/src/main/org/h2/command/query/SelectGroups.java +++ b/h2/src/main/org/h2/command/query/SelectGroups.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/query/SelectListColumnResolver.java b/h2/src/main/org/h2/command/query/SelectListColumnResolver.java index c8263ec239..ec62787f09 100644 --- a/h2/src/main/org/h2/command/query/SelectListColumnResolver.java +++ b/h2/src/main/org/h2/command/query/SelectListColumnResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/query/SelectUnion.java b/h2/src/main/org/h2/command/query/SelectUnion.java index 27ab6f8502..a1388eccfe 100644 --- a/h2/src/main/org/h2/command/query/SelectUnion.java +++ b/h2/src/main/org/h2/command/query/SelectUnion.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/query/TableValueConstructor.java b/h2/src/main/org/h2/command/query/TableValueConstructor.java index 4b3bbb5c38..82d171fa3c 100644 --- a/h2/src/main/org/h2/command/query/TableValueConstructor.java +++ b/h2/src/main/org/h2/command/query/TableValueConstructor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/command/query/package.html b/h2/src/main/org/h2/command/query/package.html index de6f569b61..80f0d16539 100644 --- a/h2/src/main/org/h2/command/query/package.html +++ b/h2/src/main/org/h2/command/query/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/compress/CompressDeflate.java b/h2/src/main/org/h2/compress/CompressDeflate.java index 8dcdda363a..0a1f722a05 100644 --- a/h2/src/main/org/h2/compress/CompressDeflate.java +++ b/h2/src/main/org/h2/compress/CompressDeflate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/compress/CompressLZF.java b/h2/src/main/org/h2/compress/CompressLZF.java index ad2555e994..952a4e53b8 100644 --- a/h2/src/main/org/h2/compress/CompressLZF.java +++ b/h2/src/main/org/h2/compress/CompressLZF.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * * This code is based on the LZF algorithm from Marc Lehmann. It is a diff --git a/h2/src/main/org/h2/compress/CompressNo.java b/h2/src/main/org/h2/compress/CompressNo.java index f9831bb600..df7c1fb4f9 100644 --- a/h2/src/main/org/h2/compress/CompressNo.java +++ b/h2/src/main/org/h2/compress/CompressNo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/compress/Compressor.java b/h2/src/main/org/h2/compress/Compressor.java index 35a3bfb32e..4970ff0b57 100644 --- a/h2/src/main/org/h2/compress/Compressor.java +++ b/h2/src/main/org/h2/compress/Compressor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/compress/LZFInputStream.java b/h2/src/main/org/h2/compress/LZFInputStream.java index 5be2a1d4b1..5586841b86 100644 --- a/h2/src/main/org/h2/compress/LZFInputStream.java +++ b/h2/src/main/org/h2/compress/LZFInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/compress/LZFOutputStream.java b/h2/src/main/org/h2/compress/LZFOutputStream.java index cd32b77602..e2b7aa2a04 100644 --- a/h2/src/main/org/h2/compress/LZFOutputStream.java +++ b/h2/src/main/org/h2/compress/LZFOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/compress/package.html b/h2/src/main/org/h2/compress/package.html index 22b39981fc..3c1c6d9b1f 100644 --- a/h2/src/main/org/h2/compress/package.html +++ b/h2/src/main/org/h2/compress/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/constraint/Constraint.java b/h2/src/main/org/h2/constraint/Constraint.java index 153d759feb..762b267643 100644 --- a/h2/src/main/org/h2/constraint/Constraint.java +++ b/h2/src/main/org/h2/constraint/Constraint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/constraint/ConstraintActionType.java b/h2/src/main/org/h2/constraint/ConstraintActionType.java index bc5e432a68..b5e3b8fc6c 100644 --- a/h2/src/main/org/h2/constraint/ConstraintActionType.java +++ b/h2/src/main/org/h2/constraint/ConstraintActionType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/constraint/ConstraintCheck.java b/h2/src/main/org/h2/constraint/ConstraintCheck.java index dc1675bc96..a453b23705 100644 --- a/h2/src/main/org/h2/constraint/ConstraintCheck.java +++ b/h2/src/main/org/h2/constraint/ConstraintCheck.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/constraint/ConstraintDomain.java b/h2/src/main/org/h2/constraint/ConstraintDomain.java index c619fe1421..c866c808bb 100644 --- a/h2/src/main/org/h2/constraint/ConstraintDomain.java +++ b/h2/src/main/org/h2/constraint/ConstraintDomain.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/constraint/ConstraintReferential.java b/h2/src/main/org/h2/constraint/ConstraintReferential.java index 7fa9a37c77..7bdde5c130 100644 --- a/h2/src/main/org/h2/constraint/ConstraintReferential.java +++ b/h2/src/main/org/h2/constraint/ConstraintReferential.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -316,7 +316,7 @@ private void checkRowOwnTable(SessionLocal session, Row oldRow, Row newRow) { private boolean existsRow(SessionLocal session, Index searchIndex, SearchRow check, Row excluding) { Table searchTable = searchIndex.getTable(); - searchTable.lock(session, false, false); + searchTable.lock(session, Table.READ_LOCK); Cursor cursor = searchIndex.find(session, check, check); while (cursor.next()) { SearchRow found; diff --git a/h2/src/main/org/h2/constraint/ConstraintUnique.java b/h2/src/main/org/h2/constraint/ConstraintUnique.java index 2638c92c2b..3da09e09e8 100644 --- a/h2/src/main/org/h2/constraint/ConstraintUnique.java +++ b/h2/src/main/org/h2/constraint/ConstraintUnique.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/constraint/DomainColumnResolver.java b/h2/src/main/org/h2/constraint/DomainColumnResolver.java index 0cd98e7eb7..1d01e1afe5 100644 --- a/h2/src/main/org/h2/constraint/DomainColumnResolver.java +++ b/h2/src/main/org/h2/constraint/DomainColumnResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/constraint/package.html b/h2/src/main/org/h2/constraint/package.html index f05d1c34ad..a7e1d88a70 100644 --- a/h2/src/main/org/h2/constraint/package.html +++ b/h2/src/main/org/h2/constraint/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/engine/CastDataProvider.java b/h2/src/main/org/h2/engine/CastDataProvider.java index c7e709d17e..9682dda61a 100644 --- a/h2/src/main/org/h2/engine/CastDataProvider.java +++ b/h2/src/main/org/h2/engine/CastDataProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Comment.java b/h2/src/main/org/h2/engine/Comment.java index bdd5aa87db..e3af80fb67 100644 --- a/h2/src/main/org/h2/engine/Comment.java +++ b/h2/src/main/org/h2/engine/Comment.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/ConnectionInfo.java b/h2/src/main/org/h2/engine/ConnectionInfo.java index 610e3899d6..fdd0ee260a 100644 --- a/h2/src/main/org/h2/engine/ConnectionInfo.java +++ b/h2/src/main/org/h2/engine/ConnectionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Constants.java b/h2/src/main/org/h2/engine/Constants.java index 23d1e8bde1..d71cf6b656 100644 --- a/h2/src/main/org/h2/engine/Constants.java +++ b/h2/src/main/org/h2/engine/Constants.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -15,23 +15,13 @@ public class Constants { /** * The build date is updated for each public release. */ - public static final String BUILD_DATE = "2021-12-21"; - - /** - * The build date of the last stable release. - */ - public static final String BUILD_DATE_STABLE = "2021-11-25"; + public static final String BUILD_DATE = "2022-01-17"; /** * Sequential version number. Even numbers are used for official releases, * odd numbers are used for development builds. */ - public static final int BUILD_ID = 204; - - /** - * The build id of the last stable release. - */ - public static final int BUILD_ID_STABLE = 202; + public static final int BUILD_ID = 210; /** * Whether this is a snapshot version. @@ -88,7 +78,7 @@ public class Constants { /** * The minor version of this database. */ - public static final int VERSION_MINOR = 0; + public static final int VERSION_MINOR = 1; /** * The lock mode that means no locking is used at all. @@ -490,11 +480,6 @@ public class Constants { */ public static final String VERSION; - /** - * The last stable version name. - */ - public static final String VERSION_STABLE = "1.4." + BUILD_ID_STABLE; - /** * The complete version number of this database, consisting of * the major version, the minor version, the build id, and the build date. diff --git a/h2/src/main/org/h2/engine/Database.java b/h2/src/main/org/h2/engine/Database.java index c2fbfc89aa..f7d6958c4e 100644 --- a/h2/src/main/org/h2/engine/Database.java +++ b/h2/src/main/org/h2/engine/Database.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -769,7 +769,7 @@ public boolean lockMeta(SessionLocal session) { if (ASSERT) { lockMetaAssertion(session); } - return meta.lock(session, true, true); + return meta.lock(session, Table.EXCLUSIVE_LOCK); } private void lockMetaAssertion(SessionLocal session) { @@ -2340,9 +2340,20 @@ private static boolean isUpperSysIdentifier(String upperName) { if (l == 0) { return false; } - for (int i = 0; i < l; i++) { - int ch = upperName.charAt(i); - if (ch < 'A' || ch > 'Z' && ch != '_') { + char c = upperName.charAt(0); + if (c < 'A' || c > 'Z') { + return false; + } + l--; + for (int i = 1; i < l; i++) { + c = upperName.charAt(i); + if ((c < 'A' || c > 'Z') && c != '_') { + return false; + } + } + if (l > 0) { + c = upperName.charAt(l); + if (c < 'A' || c > 'Z') { return false; } } diff --git a/h2/src/main/org/h2/engine/DbObject.java b/h2/src/main/org/h2/engine/DbObject.java index 734309605b..7464f97794 100644 --- a/h2/src/main/org/h2/engine/DbObject.java +++ b/h2/src/main/org/h2/engine/DbObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/DbSettings.java b/h2/src/main/org/h2/engine/DbSettings.java index a854df6b30..c4baedefe3 100644 --- a/h2/src/main/org/h2/engine/DbSettings.java +++ b/h2/src/main/org/h2/engine/DbSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/DelayedDatabaseCloser.java b/h2/src/main/org/h2/engine/DelayedDatabaseCloser.java index e7c3c9986f..2e6083f260 100644 --- a/h2/src/main/org/h2/engine/DelayedDatabaseCloser.java +++ b/h2/src/main/org/h2/engine/DelayedDatabaseCloser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Engine.java b/h2/src/main/org/h2/engine/Engine.java index 8ab43c3fcd..2ee7732178 100644 --- a/h2/src/main/org/h2/engine/Engine.java +++ b/h2/src/main/org/h2/engine/Engine.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/GeneratedKeysMode.java b/h2/src/main/org/h2/engine/GeneratedKeysMode.java index b2ead4577a..bf5f707b7c 100644 --- a/h2/src/main/org/h2/engine/GeneratedKeysMode.java +++ b/h2/src/main/org/h2/engine/GeneratedKeysMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/IsolationLevel.java b/h2/src/main/org/h2/engine/IsolationLevel.java index 7d39ce5daa..26309cbdca 100644 --- a/h2/src/main/org/h2/engine/IsolationLevel.java +++ b/h2/src/main/org/h2/engine/IsolationLevel.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/MetaRecord.java b/h2/src/main/org/h2/engine/MetaRecord.java index 1263a93f96..b0016e4202 100644 --- a/h2/src/main/org/h2/engine/MetaRecord.java +++ b/h2/src/main/org/h2/engine/MetaRecord.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Mode.java b/h2/src/main/org/h2/engine/Mode.java index 32da09db59..26f875b976 100644 --- a/h2/src/main/org/h2/engine/Mode.java +++ b/h2/src/main/org/h2/engine/Mode.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -398,6 +398,11 @@ public enum CharPadding { */ public boolean limit; + /** + * Whether MINUS can be used as EXCEPT. + */ + public boolean minusIsExcept; + /** * Whether IDENTITY pseudo data type is supported. */ @@ -450,6 +455,7 @@ public enum CharPadding { mode.dateTimeValueWithinTransaction = true; mode.topInSelect = true; mode.limit = true; + mode.minusIsExcept = true; mode.identityDataType = true; mode.serialDataTypes = true; mode.autoIncrementClause = true; @@ -465,12 +471,14 @@ public enum CharPadding { mode.dateTimeValueWithinTransaction = true; mode.topInSelect = true; mode.limit = true; + mode.minusIsExcept = true; mode.identityDataType = true; mode.serialDataTypes = true; mode.autoIncrementClause = true; // Legacy identity and sequence features mode.identityClause = true; mode.updateSequenceOnManualIdentityInsertion = true; + mode.takeInsertedIdentity = true; mode.identityColumnsHaveDefaultOnNull = true; mode.nextvalAndCurrvalPseudoColumns = true; // Legacy DML features @@ -498,6 +506,7 @@ public enum CharPadding { mode.expressionNames = ExpressionNames.NUMBER; mode.viewExpressionNames = ViewExpressionNames.EXCEPTION; mode.limit = true; + mode.minusIsExcept = true; mode.numericWithBooleanComparison = true; add(mode); @@ -523,6 +532,7 @@ public enum CharPadding { mode.expressionNames = ExpressionNames.C_NUMBER; mode.topInSelect = true; mode.limit = true; + mode.minusIsExcept = true; mode.numericWithBooleanComparison = true; add(mode); @@ -632,6 +642,7 @@ public enum CharPadding { mode.charAndByteLengthUnits = true; mode.nextvalAndCurrvalPseudoColumns = true; mode.mergeWhere = true; + mode.minusIsExcept = true; mode.expressionNames = ExpressionNames.ORIGINAL_SQL; mode.viewExpressionNames = ViewExpressionNames.EXCEPTION; mode.typeByNameMap.put("BINARY_FLOAT", DataType.getDataType(Value.REAL)); diff --git a/h2/src/main/org/h2/engine/OnExitDatabaseCloser.java b/h2/src/main/org/h2/engine/OnExitDatabaseCloser.java index d447a2a51b..d8022ac6e2 100644 --- a/h2/src/main/org/h2/engine/OnExitDatabaseCloser.java +++ b/h2/src/main/org/h2/engine/OnExitDatabaseCloser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Procedure.java b/h2/src/main/org/h2/engine/Procedure.java index 66b3e09bc0..899309b6f6 100644 --- a/h2/src/main/org/h2/engine/Procedure.java +++ b/h2/src/main/org/h2/engine/Procedure.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/QueryStatisticsData.java b/h2/src/main/org/h2/engine/QueryStatisticsData.java index a33e38e666..9d805e8a5f 100644 --- a/h2/src/main/org/h2/engine/QueryStatisticsData.java +++ b/h2/src/main/org/h2/engine/QueryStatisticsData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Right.java b/h2/src/main/org/h2/engine/Right.java index da8046a835..3f171b7559 100644 --- a/h2/src/main/org/h2/engine/Right.java +++ b/h2/src/main/org/h2/engine/Right.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/RightOwner.java b/h2/src/main/org/h2/engine/RightOwner.java index 63360fdb6b..bcd5e0ebfc 100644 --- a/h2/src/main/org/h2/engine/RightOwner.java +++ b/h2/src/main/org/h2/engine/RightOwner.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Role.java b/h2/src/main/org/h2/engine/Role.java index c4a75bd632..7fec06ca11 100644 --- a/h2/src/main/org/h2/engine/Role.java +++ b/h2/src/main/org/h2/engine/Role.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Session.java b/h2/src/main/org/h2/engine/Session.java index 2c62e8b086..654458ceee 100644 --- a/h2/src/main/org/h2/engine/Session.java +++ b/h2/src/main/org/h2/engine/Session.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/SessionLocal.java b/h2/src/main/org/h2/engine/SessionLocal.java index e449b4b527..8117c628da 100644 --- a/h2/src/main/org/h2/engine/SessionLocal.java +++ b/h2/src/main/org/h2/engine/SessionLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -185,7 +185,6 @@ static Session getThreadLocalSession() { private int createViewLevel; private volatile SmallLRUCache viewIndexCache; private HashMap subQueryIndexCache; - private boolean forceJoinOrder; private boolean lazyQueryExecution; private BitSet nonKeywords; @@ -278,14 +277,6 @@ public boolean isLazyQueryExecution() { return lazyQueryExecution; } - public void setForceJoinOrder(boolean forceJoinOrder) { - this.forceJoinOrder = forceJoinOrder; - } - - public boolean isForceJoinOrder() { - return forceJoinOrder; - } - /** * This method is called before and after parsing of view definition and may * be called recursively. diff --git a/h2/src/main/org/h2/engine/SessionRemote.java b/h2/src/main/org/h2/engine/SessionRemote.java index 1b406d668e..6045e111c1 100644 --- a/h2/src/main/org/h2/engine/SessionRemote.java +++ b/h2/src/main/org/h2/engine/SessionRemote.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/Setting.java b/h2/src/main/org/h2/engine/Setting.java index 5a2c74ed7b..3d8cc24576 100644 --- a/h2/src/main/org/h2/engine/Setting.java +++ b/h2/src/main/org/h2/engine/Setting.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/SettingsBase.java b/h2/src/main/org/h2/engine/SettingsBase.java index 7d5ed53aee..2059dfdbb6 100644 --- a/h2/src/main/org/h2/engine/SettingsBase.java +++ b/h2/src/main/org/h2/engine/SettingsBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/SysProperties.java b/h2/src/main/org/h2/engine/SysProperties.java index f206f5fecf..bf07188c88 100644 --- a/h2/src/main/org/h2/engine/SysProperties.java +++ b/h2/src/main/org/h2/engine/SysProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/User.java b/h2/src/main/org/h2/engine/User.java index d6e23821a1..312516a84f 100644 --- a/h2/src/main/org/h2/engine/User.java +++ b/h2/src/main/org/h2/engine/User.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/UserBuilder.java b/h2/src/main/org/h2/engine/UserBuilder.java index 4f721c34dc..658c80581d 100644 --- a/h2/src/main/org/h2/engine/UserBuilder.java +++ b/h2/src/main/org/h2/engine/UserBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/engine/package.html b/h2/src/main/org/h2/engine/package.html index 17880bbe3f..09d0a56fed 100644 --- a/h2/src/main/org/h2/engine/package.html +++ b/h2/src/main/org/h2/engine/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/expression/Alias.java b/h2/src/main/org/h2/expression/Alias.java index 382a22d68c..afae60cf28 100644 --- a/h2/src/main/org/h2/expression/Alias.java +++ b/h2/src/main/org/h2/expression/Alias.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ArrayConstructorByQuery.java b/h2/src/main/org/h2/expression/ArrayConstructorByQuery.java index c25b67e6d0..9ed16bd3e5 100644 --- a/h2/src/main/org/h2/expression/ArrayConstructorByQuery.java +++ b/h2/src/main/org/h2/expression/ArrayConstructorByQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ArrayElementReference.java b/h2/src/main/org/h2/expression/ArrayElementReference.java index 94b0f86590..d02245e968 100644 --- a/h2/src/main/org/h2/expression/ArrayElementReference.java +++ b/h2/src/main/org/h2/expression/ArrayElementReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/BinaryOperation.java b/h2/src/main/org/h2/expression/BinaryOperation.java index 7f7e122f99..9c910515e6 100644 --- a/h2/src/main/org/h2/expression/BinaryOperation.java +++ b/h2/src/main/org/h2/expression/BinaryOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/CompatibilityDatePlusTimeOperation.java b/h2/src/main/org/h2/expression/CompatibilityDatePlusTimeOperation.java index c0ac80f0a8..f1f4132788 100644 --- a/h2/src/main/org/h2/expression/CompatibilityDatePlusTimeOperation.java +++ b/h2/src/main/org/h2/expression/CompatibilityDatePlusTimeOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ConcatenationOperation.java b/h2/src/main/org/h2/expression/ConcatenationOperation.java index 30120e8ea5..18baaceb53 100644 --- a/h2/src/main/org/h2/expression/ConcatenationOperation.java +++ b/h2/src/main/org/h2/expression/ConcatenationOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/DomainValueExpression.java b/h2/src/main/org/h2/expression/DomainValueExpression.java index a548d98a1d..e1831203e0 100644 --- a/h2/src/main/org/h2/expression/DomainValueExpression.java +++ b/h2/src/main/org/h2/expression/DomainValueExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Expression.java b/h2/src/main/org/h2/expression/Expression.java index a019333335..7718e6e6f0 100644 --- a/h2/src/main/org/h2/expression/Expression.java +++ b/h2/src/main/org/h2/expression/Expression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -8,6 +8,7 @@ import java.util.List; import org.h2.api.ErrorCode; +import org.h2.engine.Constants; import org.h2.engine.SessionLocal; import org.h2.expression.function.NamedExpression; import org.h2.message.DbException; @@ -400,14 +401,19 @@ public String getTableAlias() { */ public String getAlias(SessionLocal session, int columnIndex) { switch (session.getMode().expressionNames) { - default: - return getSQL(QUOTE_ONLY_WHEN_REQUIRED | NO_CASTS, WITHOUT_PARENTHESES); + default: { + String sql = getSQL(QUOTE_ONLY_WHEN_REQUIRED | NO_CASTS, WITHOUT_PARENTHESES); + if (sql.length() <= Constants.MAX_IDENTIFIER_LENGTH) { + return sql; + } + } + //$FALL-THROUGH$ + case C_NUMBER: + return "C" + (columnIndex + 1); case EMPTY: return ""; case NUMBER: return Integer.toString(columnIndex + 1); - case C_NUMBER: - return "C" + (columnIndex + 1); case POSTGRESQL_STYLE: if (this instanceof NamedExpression) { return StringUtils.toLowerEnglish(((NamedExpression) this).getName()); diff --git a/h2/src/main/org/h2/expression/ExpressionColumn.java b/h2/src/main/org/h2/expression/ExpressionColumn.java index 1c335cb229..6a207b29cf 100644 --- a/h2/src/main/org/h2/expression/ExpressionColumn.java +++ b/h2/src/main/org/h2/expression/ExpressionColumn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ExpressionList.java b/h2/src/main/org/h2/expression/ExpressionList.java index ce568f43f7..25c38c160b 100644 --- a/h2/src/main/org/h2/expression/ExpressionList.java +++ b/h2/src/main/org/h2/expression/ExpressionList.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ExpressionVisitor.java b/h2/src/main/org/h2/expression/ExpressionVisitor.java index dd53a1bf24..7f2660fd7b 100644 --- a/h2/src/main/org/h2/expression/ExpressionVisitor.java +++ b/h2/src/main/org/h2/expression/ExpressionVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ExpressionWithFlags.java b/h2/src/main/org/h2/expression/ExpressionWithFlags.java index 54439ed4e3..6100d5d550 100644 --- a/h2/src/main/org/h2/expression/ExpressionWithFlags.java +++ b/h2/src/main/org/h2/expression/ExpressionWithFlags.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ExpressionWithVariableParameters.java b/h2/src/main/org/h2/expression/ExpressionWithVariableParameters.java index ecc97ff992..a7c0d54e02 100644 --- a/h2/src/main/org/h2/expression/ExpressionWithVariableParameters.java +++ b/h2/src/main/org/h2/expression/ExpressionWithVariableParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/FieldReference.java b/h2/src/main/org/h2/expression/FieldReference.java index b9205232e6..248b937a55 100644 --- a/h2/src/main/org/h2/expression/FieldReference.java +++ b/h2/src/main/org/h2/expression/FieldReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Format.java b/h2/src/main/org/h2/expression/Format.java index 70e99961f0..6ba27eadd5 100644 --- a/h2/src/main/org/h2/expression/Format.java +++ b/h2/src/main/org/h2/expression/Format.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/IntervalOperation.java b/h2/src/main/org/h2/expression/IntervalOperation.java index 43fcef1aed..8182b9c8e3 100644 --- a/h2/src/main/org/h2/expression/IntervalOperation.java +++ b/h2/src/main/org/h2/expression/IntervalOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Operation0.java b/h2/src/main/org/h2/expression/Operation0.java index 95e96eeb44..23349d23a1 100644 --- a/h2/src/main/org/h2/expression/Operation0.java +++ b/h2/src/main/org/h2/expression/Operation0.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Operation1.java b/h2/src/main/org/h2/expression/Operation1.java index f035da42d6..a4ff48cca5 100644 --- a/h2/src/main/org/h2/expression/Operation1.java +++ b/h2/src/main/org/h2/expression/Operation1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Operation1_2.java b/h2/src/main/org/h2/expression/Operation1_2.java index 2336208ec9..78bed3190a 100644 --- a/h2/src/main/org/h2/expression/Operation1_2.java +++ b/h2/src/main/org/h2/expression/Operation1_2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Operation2.java b/h2/src/main/org/h2/expression/Operation2.java index 123a3353ca..d729157712 100644 --- a/h2/src/main/org/h2/expression/Operation2.java +++ b/h2/src/main/org/h2/expression/Operation2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/OperationN.java b/h2/src/main/org/h2/expression/OperationN.java index 7c6b0fa1e3..ff964ea697 100644 --- a/h2/src/main/org/h2/expression/OperationN.java +++ b/h2/src/main/org/h2/expression/OperationN.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Parameter.java b/h2/src/main/org/h2/expression/Parameter.java index 110348e833..5c30d6facc 100644 --- a/h2/src/main/org/h2/expression/Parameter.java +++ b/h2/src/main/org/h2/expression/Parameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ParameterInterface.java b/h2/src/main/org/h2/expression/ParameterInterface.java index f06d3a33da..2f8405213d 100644 --- a/h2/src/main/org/h2/expression/ParameterInterface.java +++ b/h2/src/main/org/h2/expression/ParameterInterface.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ParameterRemote.java b/h2/src/main/org/h2/expression/ParameterRemote.java index 7ddc338486..fe6a46b9e5 100644 --- a/h2/src/main/org/h2/expression/ParameterRemote.java +++ b/h2/src/main/org/h2/expression/ParameterRemote.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Rownum.java b/h2/src/main/org/h2/expression/Rownum.java index bf47e8f171..0b7db71504 100644 --- a/h2/src/main/org/h2/expression/Rownum.java +++ b/h2/src/main/org/h2/expression/Rownum.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/SearchedCase.java b/h2/src/main/org/h2/expression/SearchedCase.java index e5a730ed94..05ba3454a8 100644 --- a/h2/src/main/org/h2/expression/SearchedCase.java +++ b/h2/src/main/org/h2/expression/SearchedCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/SequenceValue.java b/h2/src/main/org/h2/expression/SequenceValue.java index 24e38ffdf8..96a4410d4e 100644 --- a/h2/src/main/org/h2/expression/SequenceValue.java +++ b/h2/src/main/org/h2/expression/SequenceValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/SimpleCase.java b/h2/src/main/org/h2/expression/SimpleCase.java index 85617b723f..1fc46fa57e 100644 --- a/h2/src/main/org/h2/expression/SimpleCase.java +++ b/h2/src/main/org/h2/expression/SimpleCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Subquery.java b/h2/src/main/org/h2/expression/Subquery.java index 0464294623..236a538b25 100644 --- a/h2/src/main/org/h2/expression/Subquery.java +++ b/h2/src/main/org/h2/expression/Subquery.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/TimeZoneOperation.java b/h2/src/main/org/h2/expression/TimeZoneOperation.java index 6133ac8e6d..3c7de63b63 100644 --- a/h2/src/main/org/h2/expression/TimeZoneOperation.java +++ b/h2/src/main/org/h2/expression/TimeZoneOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/TypedValueExpression.java b/h2/src/main/org/h2/expression/TypedValueExpression.java index a0098435ac..dd16296665 100644 --- a/h2/src/main/org/h2/expression/TypedValueExpression.java +++ b/h2/src/main/org/h2/expression/TypedValueExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/UnaryOperation.java b/h2/src/main/org/h2/expression/UnaryOperation.java index 1049a85b46..6860d7ebdc 100644 --- a/h2/src/main/org/h2/expression/UnaryOperation.java +++ b/h2/src/main/org/h2/expression/UnaryOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/ValueExpression.java b/h2/src/main/org/h2/expression/ValueExpression.java index d16d097e82..d0515e76aa 100644 --- a/h2/src/main/org/h2/expression/ValueExpression.java +++ b/h2/src/main/org/h2/expression/ValueExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Variable.java b/h2/src/main/org/h2/expression/Variable.java index 9182083d31..b1d8da2823 100644 --- a/h2/src/main/org/h2/expression/Variable.java +++ b/h2/src/main/org/h2/expression/Variable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/Wildcard.java b/h2/src/main/org/h2/expression/Wildcard.java index b715ad03a9..17d8cc9997 100644 --- a/h2/src/main/org/h2/expression/Wildcard.java +++ b/h2/src/main/org/h2/expression/Wildcard.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AbstractAggregate.java b/h2/src/main/org/h2/expression/aggregate/AbstractAggregate.java index a71aa1950c..09dbf84f8c 100644 --- a/h2/src/main/org/h2/expression/aggregate/AbstractAggregate.java +++ b/h2/src/main/org/h2/expression/aggregate/AbstractAggregate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/Aggregate.java b/h2/src/main/org/h2/expression/aggregate/Aggregate.java index d99b1bd971..ac8082c354 100644 --- a/h2/src/main/org/h2/expression/aggregate/Aggregate.java +++ b/h2/src/main/org/h2/expression/aggregate/Aggregate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateData.java b/h2/src/main/org/h2/expression/aggregate/AggregateData.java index 8170b54239..97986b4838 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateData.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataAvg.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataAvg.java index fd00da6f90..283ad625d8 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataAvg.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataAvg.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataBinarySet.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataBinarySet.java index 3ab8c8cb01..fc788db76d 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataBinarySet.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataBinarySet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataCollecting.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataCollecting.java index fa1dba99b6..af1e267fcf 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataCollecting.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataCollecting.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataCorr.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataCorr.java index 462e1a19c1..28b6160b6f 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataCorr.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataCorr.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataCount.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataCount.java index 4f03c0c880..b0841b1551 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataCount.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataCovar.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataCovar.java index 7c5e8ebb01..acd0031054 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataCovar.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataCovar.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataDefault.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataDefault.java index d6b92531f8..0ff71f2270 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataDefault.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataDefault.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataDistinctWithCounts.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataDistinctWithCounts.java index d95d34c152..60bd31ef3f 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataDistinctWithCounts.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataDistinctWithCounts.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataEnvelope.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataEnvelope.java index a4dab46e4c..a2215249d7 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataEnvelope.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataEnvelope.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateDataStdVar.java b/h2/src/main/org/h2/expression/aggregate/AggregateDataStdVar.java index 7d1c6d95a4..2c64503025 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateDataStdVar.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateDataStdVar.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/AggregateType.java b/h2/src/main/org/h2/expression/aggregate/AggregateType.java index b6f1842b08..23df562bf1 100644 --- a/h2/src/main/org/h2/expression/aggregate/AggregateType.java +++ b/h2/src/main/org/h2/expression/aggregate/AggregateType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/JavaAggregate.java b/h2/src/main/org/h2/expression/aggregate/JavaAggregate.java index a48d1ed75b..d4ce36570c 100644 --- a/h2/src/main/org/h2/expression/aggregate/JavaAggregate.java +++ b/h2/src/main/org/h2/expression/aggregate/JavaAggregate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/ListaggArguments.java b/h2/src/main/org/h2/expression/aggregate/ListaggArguments.java index 82104cad11..ee134f7a8c 100644 --- a/h2/src/main/org/h2/expression/aggregate/ListaggArguments.java +++ b/h2/src/main/org/h2/expression/aggregate/ListaggArguments.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/LongDataCounter.java b/h2/src/main/org/h2/expression/aggregate/LongDataCounter.java index a3a582fba4..2bd5086f19 100644 --- a/h2/src/main/org/h2/expression/aggregate/LongDataCounter.java +++ b/h2/src/main/org/h2/expression/aggregate/LongDataCounter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/Percentile.java b/h2/src/main/org/h2/expression/aggregate/Percentile.java index 22d82fa8e9..39bae3ca73 100644 --- a/h2/src/main/org/h2/expression/aggregate/Percentile.java +++ b/h2/src/main/org/h2/expression/aggregate/Percentile.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/aggregate/package.html b/h2/src/main/org/h2/expression/aggregate/package.html index 315ec43028..e20a45ac82 100644 --- a/h2/src/main/org/h2/expression/aggregate/package.html +++ b/h2/src/main/org/h2/expression/aggregate/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/expression/analysis/DataAnalysisOperation.java b/h2/src/main/org/h2/expression/analysis/DataAnalysisOperation.java index 7512ac34bb..8cb6ebda12 100644 --- a/h2/src/main/org/h2/expression/analysis/DataAnalysisOperation.java +++ b/h2/src/main/org/h2/expression/analysis/DataAnalysisOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/PartitionData.java b/h2/src/main/org/h2/expression/analysis/PartitionData.java index 8371c3aafc..afa7494f9f 100644 --- a/h2/src/main/org/h2/expression/analysis/PartitionData.java +++ b/h2/src/main/org/h2/expression/analysis/PartitionData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/Window.java b/h2/src/main/org/h2/expression/analysis/Window.java index 423a2ae3b8..7a26d1f18f 100644 --- a/h2/src/main/org/h2/expression/analysis/Window.java +++ b/h2/src/main/org/h2/expression/analysis/Window.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/WindowFrame.java b/h2/src/main/org/h2/expression/analysis/WindowFrame.java index a7350285a3..a5b40722d9 100644 --- a/h2/src/main/org/h2/expression/analysis/WindowFrame.java +++ b/h2/src/main/org/h2/expression/analysis/WindowFrame.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/WindowFrameBound.java b/h2/src/main/org/h2/expression/analysis/WindowFrameBound.java index 896198d4ad..ca520458d3 100644 --- a/h2/src/main/org/h2/expression/analysis/WindowFrameBound.java +++ b/h2/src/main/org/h2/expression/analysis/WindowFrameBound.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/WindowFrameBoundType.java b/h2/src/main/org/h2/expression/analysis/WindowFrameBoundType.java index 40e572f927..27b2e3a274 100644 --- a/h2/src/main/org/h2/expression/analysis/WindowFrameBoundType.java +++ b/h2/src/main/org/h2/expression/analysis/WindowFrameBoundType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/WindowFrameExclusion.java b/h2/src/main/org/h2/expression/analysis/WindowFrameExclusion.java index a8ef468688..e587732c50 100644 --- a/h2/src/main/org/h2/expression/analysis/WindowFrameExclusion.java +++ b/h2/src/main/org/h2/expression/analysis/WindowFrameExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/WindowFrameUnits.java b/h2/src/main/org/h2/expression/analysis/WindowFrameUnits.java index 5e80c9b053..081438ea90 100644 --- a/h2/src/main/org/h2/expression/analysis/WindowFrameUnits.java +++ b/h2/src/main/org/h2/expression/analysis/WindowFrameUnits.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/WindowFunction.java b/h2/src/main/org/h2/expression/analysis/WindowFunction.java index 3e1e9ab341..c3ddc40e63 100644 --- a/h2/src/main/org/h2/expression/analysis/WindowFunction.java +++ b/h2/src/main/org/h2/expression/analysis/WindowFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/WindowFunctionType.java b/h2/src/main/org/h2/expression/analysis/WindowFunctionType.java index 1876ff6f49..cc468157b5 100644 --- a/h2/src/main/org/h2/expression/analysis/WindowFunctionType.java +++ b/h2/src/main/org/h2/expression/analysis/WindowFunctionType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/analysis/package.html b/h2/src/main/org/h2/expression/analysis/package.html index c035053ece..5cc4ba03b0 100644 --- a/h2/src/main/org/h2/expression/analysis/package.html +++ b/h2/src/main/org/h2/expression/analysis/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/expression/condition/BetweenPredicate.java b/h2/src/main/org/h2/expression/condition/BetweenPredicate.java index a7792bdaa9..b5b7b11f4d 100644 --- a/h2/src/main/org/h2/expression/condition/BetweenPredicate.java +++ b/h2/src/main/org/h2/expression/condition/BetweenPredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/BooleanTest.java b/h2/src/main/org/h2/expression/condition/BooleanTest.java index 32ddf2d287..47a07743f0 100644 --- a/h2/src/main/org/h2/expression/condition/BooleanTest.java +++ b/h2/src/main/org/h2/expression/condition/BooleanTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/CompareLike.java b/h2/src/main/org/h2/expression/condition/CompareLike.java index c0da622e2c..e62dbaaa24 100644 --- a/h2/src/main/org/h2/expression/condition/CompareLike.java +++ b/h2/src/main/org/h2/expression/condition/CompareLike.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/Comparison.java b/h2/src/main/org/h2/expression/condition/Comparison.java index cae449742c..666f4063d7 100644 --- a/h2/src/main/org/h2/expression/condition/Comparison.java +++ b/h2/src/main/org/h2/expression/condition/Comparison.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/Condition.java b/h2/src/main/org/h2/expression/condition/Condition.java index ffc2b6479e..ba3d50991a 100644 --- a/h2/src/main/org/h2/expression/condition/Condition.java +++ b/h2/src/main/org/h2/expression/condition/Condition.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionAndOr.java b/h2/src/main/org/h2/expression/condition/ConditionAndOr.java index 83fad65db7..82dc4fbcb3 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionAndOr.java +++ b/h2/src/main/org/h2/expression/condition/ConditionAndOr.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionAndOrN.java b/h2/src/main/org/h2/expression/condition/ConditionAndOrN.java index 99131bbba3..51ed2b1216 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionAndOrN.java +++ b/h2/src/main/org/h2/expression/condition/ConditionAndOrN.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, and the + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, and the * EPL 1.0 (https://h2database.com/html/license.html). Initial Developer: H2 * Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionIn.java b/h2/src/main/org/h2/expression/condition/ConditionIn.java index 74bab97aa9..663f6fc24a 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionIn.java +++ b/h2/src/main/org/h2/expression/condition/ConditionIn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionInConstantSet.java b/h2/src/main/org/h2/expression/condition/ConditionInConstantSet.java index 577af77dc8..4174e8bd15 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionInConstantSet.java +++ b/h2/src/main/org/h2/expression/condition/ConditionInConstantSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionInParameter.java b/h2/src/main/org/h2/expression/condition/ConditionInParameter.java index 3bec969897..6bbf2f82be 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionInParameter.java +++ b/h2/src/main/org/h2/expression/condition/ConditionInParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionInQuery.java b/h2/src/main/org/h2/expression/condition/ConditionInQuery.java index dd8d0970e5..700aea1917 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionInQuery.java +++ b/h2/src/main/org/h2/expression/condition/ConditionInQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionLocalAndGlobal.java b/h2/src/main/org/h2/expression/condition/ConditionLocalAndGlobal.java index a045c952ca..032604b6bb 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionLocalAndGlobal.java +++ b/h2/src/main/org/h2/expression/condition/ConditionLocalAndGlobal.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ConditionNot.java b/h2/src/main/org/h2/expression/condition/ConditionNot.java index 206d97c40d..215926c059 100644 --- a/h2/src/main/org/h2/expression/condition/ConditionNot.java +++ b/h2/src/main/org/h2/expression/condition/ConditionNot.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/ExistsPredicate.java b/h2/src/main/org/h2/expression/condition/ExistsPredicate.java index f0b7e0cea6..be487b4342 100644 --- a/h2/src/main/org/h2/expression/condition/ExistsPredicate.java +++ b/h2/src/main/org/h2/expression/condition/ExistsPredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/IsJsonPredicate.java b/h2/src/main/org/h2/expression/condition/IsJsonPredicate.java index 1237e5d936..67b56ea0a3 100644 --- a/h2/src/main/org/h2/expression/condition/IsJsonPredicate.java +++ b/h2/src/main/org/h2/expression/condition/IsJsonPredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/NullPredicate.java b/h2/src/main/org/h2/expression/condition/NullPredicate.java index e8ddb87df0..46ae3bfcd8 100644 --- a/h2/src/main/org/h2/expression/condition/NullPredicate.java +++ b/h2/src/main/org/h2/expression/condition/NullPredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/PredicateWithSubquery.java b/h2/src/main/org/h2/expression/condition/PredicateWithSubquery.java index 0d4927e065..8065315a72 100644 --- a/h2/src/main/org/h2/expression/condition/PredicateWithSubquery.java +++ b/h2/src/main/org/h2/expression/condition/PredicateWithSubquery.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/SimplePredicate.java b/h2/src/main/org/h2/expression/condition/SimplePredicate.java index 39446c18a8..6a23513a85 100644 --- a/h2/src/main/org/h2/expression/condition/SimplePredicate.java +++ b/h2/src/main/org/h2/expression/condition/SimplePredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/TypePredicate.java b/h2/src/main/org/h2/expression/condition/TypePredicate.java index 4adbcf2a79..74ce12ee23 100644 --- a/h2/src/main/org/h2/expression/condition/TypePredicate.java +++ b/h2/src/main/org/h2/expression/condition/TypePredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/UniquePredicate.java b/h2/src/main/org/h2/expression/condition/UniquePredicate.java index 3642749176..745e242fe9 100644 --- a/h2/src/main/org/h2/expression/condition/UniquePredicate.java +++ b/h2/src/main/org/h2/expression/condition/UniquePredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/condition/package.html b/h2/src/main/org/h2/expression/condition/package.html index 7a3f981305..b8c56e2158 100644 --- a/h2/src/main/org/h2/expression/condition/package.html +++ b/h2/src/main/org/h2/expression/condition/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/expression/function/ArrayFunction.java b/h2/src/main/org/h2/expression/function/ArrayFunction.java index 334c01fb34..ff9798d0a4 100644 --- a/h2/src/main/org/h2/expression/function/ArrayFunction.java +++ b/h2/src/main/org/h2/expression/function/ArrayFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/BitFunction.java b/h2/src/main/org/h2/expression/function/BitFunction.java index 7a1e63b8f6..7172ff8b66 100644 --- a/h2/src/main/org/h2/expression/function/BitFunction.java +++ b/h2/src/main/org/h2/expression/function/BitFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/BuiltinFunctions.java b/h2/src/main/org/h2/expression/function/BuiltinFunctions.java index f16c3264d6..efb1187842 100644 --- a/h2/src/main/org/h2/expression/function/BuiltinFunctions.java +++ b/h2/src/main/org/h2/expression/function/BuiltinFunctions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CSVWriteFunction.java b/h2/src/main/org/h2/expression/function/CSVWriteFunction.java index 7e2366d420..ce1e379559 100644 --- a/h2/src/main/org/h2/expression/function/CSVWriteFunction.java +++ b/h2/src/main/org/h2/expression/function/CSVWriteFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CardinalityExpression.java b/h2/src/main/org/h2/expression/function/CardinalityExpression.java index f976dd1c07..f565a809e6 100644 --- a/h2/src/main/org/h2/expression/function/CardinalityExpression.java +++ b/h2/src/main/org/h2/expression/function/CardinalityExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CastSpecification.java b/h2/src/main/org/h2/expression/function/CastSpecification.java index d938785732..d0a54bfc0e 100644 --- a/h2/src/main/org/h2/expression/function/CastSpecification.java +++ b/h2/src/main/org/h2/expression/function/CastSpecification.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CoalesceFunction.java b/h2/src/main/org/h2/expression/function/CoalesceFunction.java index cd21dcbee0..3d5377feb1 100644 --- a/h2/src/main/org/h2/expression/function/CoalesceFunction.java +++ b/h2/src/main/org/h2/expression/function/CoalesceFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CompatibilitySequenceValueFunction.java b/h2/src/main/org/h2/expression/function/CompatibilitySequenceValueFunction.java index 715331c377..2d9fd62f69 100644 --- a/h2/src/main/org/h2/expression/function/CompatibilitySequenceValueFunction.java +++ b/h2/src/main/org/h2/expression/function/CompatibilitySequenceValueFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CompressFunction.java b/h2/src/main/org/h2/expression/function/CompressFunction.java index 1311474dd8..348c87297e 100644 --- a/h2/src/main/org/h2/expression/function/CompressFunction.java +++ b/h2/src/main/org/h2/expression/function/CompressFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/ConcatFunction.java b/h2/src/main/org/h2/expression/function/ConcatFunction.java index 8e150179ef..14f5646c97 100644 --- a/h2/src/main/org/h2/expression/function/ConcatFunction.java +++ b/h2/src/main/org/h2/expression/function/ConcatFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CryptFunction.java b/h2/src/main/org/h2/expression/function/CryptFunction.java index eae1653ad7..47fbb966b6 100644 --- a/h2/src/main/org/h2/expression/function/CryptFunction.java +++ b/h2/src/main/org/h2/expression/function/CryptFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CurrentDateTimeValueFunction.java b/h2/src/main/org/h2/expression/function/CurrentDateTimeValueFunction.java index 16afd02d37..de11882bc9 100644 --- a/h2/src/main/org/h2/expression/function/CurrentDateTimeValueFunction.java +++ b/h2/src/main/org/h2/expression/function/CurrentDateTimeValueFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/CurrentGeneralValueSpecification.java b/h2/src/main/org/h2/expression/function/CurrentGeneralValueSpecification.java index 0b28c8e2f4..ca76fa7e4c 100644 --- a/h2/src/main/org/h2/expression/function/CurrentGeneralValueSpecification.java +++ b/h2/src/main/org/h2/expression/function/CurrentGeneralValueSpecification.java @@ -1,16 +1,18 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.expression.function; +import org.h2.engine.Database; import org.h2.engine.SessionLocal; import org.h2.expression.ExpressionVisitor; import org.h2.expression.Operation0; import org.h2.message.DbException; import org.h2.util.HasSQL; import org.h2.util.ParserUtil; +import org.h2.util.StringUtils; import org.h2.value.TypeInfo; import org.h2.value.Value; import org.h2.value.ValueNull; @@ -88,16 +90,24 @@ public Value getValue(SessionLocal session) { } break; } - case CURRENT_ROLE: - s = session.getDatabase().sysIdentifier(session.getDatabase().getPublicRole().getName()); + case CURRENT_ROLE: { + Database db = session.getDatabase(); + s = db.getPublicRole().getName(); + if (db.getSettings().databaseToLower) { + s = StringUtils.toLowerEnglish(s); + } break; + } case CURRENT_SCHEMA: s = session.getCurrentSchemaName(); break; case CURRENT_USER: case SESSION_USER: case SYSTEM_USER: - s = session.getDatabase().sysIdentifier(session.getUser().getName()); + s = session.getUser().getName(); + if (session.getDatabase().getSettings().databaseToLower) { + s = StringUtils.toLowerEnglish(s); + } break; default: throw DbException.getInternalError("specification=" + specification); diff --git a/h2/src/main/org/h2/expression/function/DBObjectFunction.java b/h2/src/main/org/h2/expression/function/DBObjectFunction.java index 4eb2aa7010..55441dc51e 100644 --- a/h2/src/main/org/h2/expression/function/DBObjectFunction.java +++ b/h2/src/main/org/h2/expression/function/DBObjectFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/DataTypeSQLFunction.java b/h2/src/main/org/h2/expression/function/DataTypeSQLFunction.java index e00ec4b05f..39c77512e4 100644 --- a/h2/src/main/org/h2/expression/function/DataTypeSQLFunction.java +++ b/h2/src/main/org/h2/expression/function/DataTypeSQLFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/DateTimeFormatFunction.java b/h2/src/main/org/h2/expression/function/DateTimeFormatFunction.java index a0331619c8..e426807e91 100644 --- a/h2/src/main/org/h2/expression/function/DateTimeFormatFunction.java +++ b/h2/src/main/org/h2/expression/function/DateTimeFormatFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/DateTimeFunction.java b/h2/src/main/org/h2/expression/function/DateTimeFunction.java index bff0e2c7e4..9f9c2add21 100644 --- a/h2/src/main/org/h2/expression/function/DateTimeFunction.java +++ b/h2/src/main/org/h2/expression/function/DateTimeFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -373,7 +373,7 @@ public Value getValue(SessionLocal session, Value v1, Value v2) { * @param date * the date value * @param field - * the field type, see {@link Function} for constants + * the field type * @return the value */ private static int extractInteger(SessionLocal session, Value date, int field) { diff --git a/h2/src/main/org/h2/expression/function/DayMonthNameFunction.java b/h2/src/main/org/h2/expression/function/DayMonthNameFunction.java index a4e55d7b29..a6d521a1e7 100644 --- a/h2/src/main/org/h2/expression/function/DayMonthNameFunction.java +++ b/h2/src/main/org/h2/expression/function/DayMonthNameFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/FileFunction.java b/h2/src/main/org/h2/expression/function/FileFunction.java index 805f9d5507..123582d851 100644 --- a/h2/src/main/org/h2/expression/function/FileFunction.java +++ b/h2/src/main/org/h2/expression/function/FileFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/Function0_1.java b/h2/src/main/org/h2/expression/function/Function0_1.java index 210afcf3da..a255c6984b 100644 --- a/h2/src/main/org/h2/expression/function/Function0_1.java +++ b/h2/src/main/org/h2/expression/function/Function0_1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/Function1.java b/h2/src/main/org/h2/expression/function/Function1.java index 1df54bd5cf..190113a876 100644 --- a/h2/src/main/org/h2/expression/function/Function1.java +++ b/h2/src/main/org/h2/expression/function/Function1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/Function1_2.java b/h2/src/main/org/h2/expression/function/Function1_2.java index 9740cf1077..75b0d0ec51 100644 --- a/h2/src/main/org/h2/expression/function/Function1_2.java +++ b/h2/src/main/org/h2/expression/function/Function1_2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/Function2.java b/h2/src/main/org/h2/expression/function/Function2.java index 059ad7186c..cfb340f7b6 100644 --- a/h2/src/main/org/h2/expression/function/Function2.java +++ b/h2/src/main/org/h2/expression/function/Function2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/FunctionN.java b/h2/src/main/org/h2/expression/function/FunctionN.java index 1b02efe584..079191a15e 100644 --- a/h2/src/main/org/h2/expression/function/FunctionN.java +++ b/h2/src/main/org/h2/expression/function/FunctionN.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/HashFunction.java b/h2/src/main/org/h2/expression/function/HashFunction.java index f6607432f6..5ea0057992 100644 --- a/h2/src/main/org/h2/expression/function/HashFunction.java +++ b/h2/src/main/org/h2/expression/function/HashFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/JavaFunction.java b/h2/src/main/org/h2/expression/function/JavaFunction.java index e699a7b4d8..afc617cbdd 100644 --- a/h2/src/main/org/h2/expression/function/JavaFunction.java +++ b/h2/src/main/org/h2/expression/function/JavaFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/JsonConstructorFunction.java b/h2/src/main/org/h2/expression/function/JsonConstructorFunction.java index 2ae382eb00..87ab74037c 100644 --- a/h2/src/main/org/h2/expression/function/JsonConstructorFunction.java +++ b/h2/src/main/org/h2/expression/function/JsonConstructorFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/LengthFunction.java b/h2/src/main/org/h2/expression/function/LengthFunction.java index 295eef914f..199837ddbb 100644 --- a/h2/src/main/org/h2/expression/function/LengthFunction.java +++ b/h2/src/main/org/h2/expression/function/LengthFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/MathFunction.java b/h2/src/main/org/h2/expression/function/MathFunction.java index d55c3b92a7..cfae2b4a9e 100644 --- a/h2/src/main/org/h2/expression/function/MathFunction.java +++ b/h2/src/main/org/h2/expression/function/MathFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/MathFunction1.java b/h2/src/main/org/h2/expression/function/MathFunction1.java index 27edabcb6c..416b093165 100644 --- a/h2/src/main/org/h2/expression/function/MathFunction1.java +++ b/h2/src/main/org/h2/expression/function/MathFunction1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/MathFunction2.java b/h2/src/main/org/h2/expression/function/MathFunction2.java index d37a00780e..52dff56652 100644 --- a/h2/src/main/org/h2/expression/function/MathFunction2.java +++ b/h2/src/main/org/h2/expression/function/MathFunction2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/NamedExpression.java b/h2/src/main/org/h2/expression/function/NamedExpression.java index 9a76e28a04..021c87ec13 100644 --- a/h2/src/main/org/h2/expression/function/NamedExpression.java +++ b/h2/src/main/org/h2/expression/function/NamedExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/NullIfFunction.java b/h2/src/main/org/h2/expression/function/NullIfFunction.java index 41c1d154a7..b4b32d67be 100644 --- a/h2/src/main/org/h2/expression/function/NullIfFunction.java +++ b/h2/src/main/org/h2/expression/function/NullIfFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/RandFunction.java b/h2/src/main/org/h2/expression/function/RandFunction.java index 9be2f62e0c..9b4c3afd08 100644 --- a/h2/src/main/org/h2/expression/function/RandFunction.java +++ b/h2/src/main/org/h2/expression/function/RandFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/RegexpFunction.java b/h2/src/main/org/h2/expression/function/RegexpFunction.java index f9ffd00892..a3c1928ab0 100644 --- a/h2/src/main/org/h2/expression/function/RegexpFunction.java +++ b/h2/src/main/org/h2/expression/function/RegexpFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/SessionControlFunction.java b/h2/src/main/org/h2/expression/function/SessionControlFunction.java index 2ed7fef646..c8d3024ff1 100644 --- a/h2/src/main/org/h2/expression/function/SessionControlFunction.java +++ b/h2/src/main/org/h2/expression/function/SessionControlFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/SetFunction.java b/h2/src/main/org/h2/expression/function/SetFunction.java index 1dc1573b9d..6b85efccee 100644 --- a/h2/src/main/org/h2/expression/function/SetFunction.java +++ b/h2/src/main/org/h2/expression/function/SetFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/SignalFunction.java b/h2/src/main/org/h2/expression/function/SignalFunction.java index 1eed610055..b8f42d2563 100644 --- a/h2/src/main/org/h2/expression/function/SignalFunction.java +++ b/h2/src/main/org/h2/expression/function/SignalFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/SoundexFunction.java b/h2/src/main/org/h2/expression/function/SoundexFunction.java index c72242ca4c..b7165c341f 100644 --- a/h2/src/main/org/h2/expression/function/SoundexFunction.java +++ b/h2/src/main/org/h2/expression/function/SoundexFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/StringFunction.java b/h2/src/main/org/h2/expression/function/StringFunction.java index 5fa96675b7..d34cfada92 100644 --- a/h2/src/main/org/h2/expression/function/StringFunction.java +++ b/h2/src/main/org/h2/expression/function/StringFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/StringFunction1.java b/h2/src/main/org/h2/expression/function/StringFunction1.java index 01107bffb6..9b24996541 100644 --- a/h2/src/main/org/h2/expression/function/StringFunction1.java +++ b/h2/src/main/org/h2/expression/function/StringFunction1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/StringFunction2.java b/h2/src/main/org/h2/expression/function/StringFunction2.java index 14c65f2ae9..6b7395cb02 100644 --- a/h2/src/main/org/h2/expression/function/StringFunction2.java +++ b/h2/src/main/org/h2/expression/function/StringFunction2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/SubstringFunction.java b/h2/src/main/org/h2/expression/function/SubstringFunction.java index a1c61882ee..b93e464e54 100644 --- a/h2/src/main/org/h2/expression/function/SubstringFunction.java +++ b/h2/src/main/org/h2/expression/function/SubstringFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/SysInfoFunction.java b/h2/src/main/org/h2/expression/function/SysInfoFunction.java index a0ea5fe690..dd02010060 100644 --- a/h2/src/main/org/h2/expression/function/SysInfoFunction.java +++ b/h2/src/main/org/h2/expression/function/SysInfoFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/TableInfoFunction.java b/h2/src/main/org/h2/expression/function/TableInfoFunction.java index 49246570b2..c447033f88 100644 --- a/h2/src/main/org/h2/expression/function/TableInfoFunction.java +++ b/h2/src/main/org/h2/expression/function/TableInfoFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/ToCharFunction.java b/h2/src/main/org/h2/expression/function/ToCharFunction.java index 4ed26ac9b6..9eb178060c 100644 --- a/h2/src/main/org/h2/expression/function/ToCharFunction.java +++ b/h2/src/main/org/h2/expression/function/ToCharFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Daniel Gredler */ diff --git a/h2/src/main/org/h2/expression/function/TrimFunction.java b/h2/src/main/org/h2/expression/function/TrimFunction.java index 548206ea12..21f56a6d31 100644 --- a/h2/src/main/org/h2/expression/function/TrimFunction.java +++ b/h2/src/main/org/h2/expression/function/TrimFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/TruncateValueFunction.java b/h2/src/main/org/h2/expression/function/TruncateValueFunction.java index fee8aef8a7..4bbedf930d 100644 --- a/h2/src/main/org/h2/expression/function/TruncateValueFunction.java +++ b/h2/src/main/org/h2/expression/function/TruncateValueFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/XMLFunction.java b/h2/src/main/org/h2/expression/function/XMLFunction.java index 314ab68198..fb4491b40f 100644 --- a/h2/src/main/org/h2/expression/function/XMLFunction.java +++ b/h2/src/main/org/h2/expression/function/XMLFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/package.html b/h2/src/main/org/h2/expression/function/package.html index 6b759aa633..934f342526 100644 --- a/h2/src/main/org/h2/expression/function/package.html +++ b/h2/src/main/org/h2/expression/function/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/expression/function/table/ArrayTableFunction.java b/h2/src/main/org/h2/expression/function/table/ArrayTableFunction.java index fcf12c5ce2..eb5b5c7fa4 100644 --- a/h2/src/main/org/h2/expression/function/table/ArrayTableFunction.java +++ b/h2/src/main/org/h2/expression/function/table/ArrayTableFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/table/CSVReadFunction.java b/h2/src/main/org/h2/expression/function/table/CSVReadFunction.java index ed259eb79e..f03ad1c8b2 100644 --- a/h2/src/main/org/h2/expression/function/table/CSVReadFunction.java +++ b/h2/src/main/org/h2/expression/function/table/CSVReadFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/table/JavaTableFunction.java b/h2/src/main/org/h2/expression/function/table/JavaTableFunction.java index 73fd02d097..dc74497c2f 100644 --- a/h2/src/main/org/h2/expression/function/table/JavaTableFunction.java +++ b/h2/src/main/org/h2/expression/function/table/JavaTableFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/table/LinkSchemaFunction.java b/h2/src/main/org/h2/expression/function/table/LinkSchemaFunction.java index 5aba55e0fc..2a17b973ef 100644 --- a/h2/src/main/org/h2/expression/function/table/LinkSchemaFunction.java +++ b/h2/src/main/org/h2/expression/function/table/LinkSchemaFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/table/TableFunction.java b/h2/src/main/org/h2/expression/function/table/TableFunction.java index 13263fa3a9..729421f883 100644 --- a/h2/src/main/org/h2/expression/function/table/TableFunction.java +++ b/h2/src/main/org/h2/expression/function/table/TableFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/expression/function/table/package.html b/h2/src/main/org/h2/expression/function/table/package.html index a83546b664..8dd9d74c78 100644 --- a/h2/src/main/org/h2/expression/function/table/package.html +++ b/h2/src/main/org/h2/expression/function/table/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/expression/package.html b/h2/src/main/org/h2/expression/package.html index e6aaca3f99..7bf9c9620d 100644 --- a/h2/src/main/org/h2/expression/package.html +++ b/h2/src/main/org/h2/expression/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/fulltext/FullText.java b/h2/src/main/org/h2/fulltext/FullText.java index d83f99bcdf..8d7dd71b34 100644 --- a/h2/src/main/org/h2/fulltext/FullText.java +++ b/h2/src/main/org/h2/fulltext/FullText.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -109,14 +109,14 @@ public static void init(Connection conn) throws SQLException { Statement stat = conn.createStatement(); stat.execute("CREATE SCHEMA IF NOT EXISTS " + SCHEMA); stat.execute("CREATE TABLE IF NOT EXISTS " + SCHEMA + - ".INDEXES(ID INT AUTO_INCREMENT PRIMARY KEY, " + + ".INDEXES(ID INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, " + "SCHEMA VARCHAR, `TABLE` VARCHAR, COLUMNS VARCHAR, " + "UNIQUE(SCHEMA, `TABLE`))"); stat.execute("CREATE TABLE IF NOT EXISTS " + SCHEMA + - ".WORDS(ID INT AUTO_INCREMENT PRIMARY KEY, " + + ".WORDS(ID INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, " + "NAME VARCHAR, UNIQUE(NAME))"); stat.execute("CREATE TABLE IF NOT EXISTS " + SCHEMA + - ".ROWS(ID IDENTITY, HASH INT, INDEXID INT, " + + ".ROWS(ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, HASH INT, INDEXID INT, " + "`KEY` VARCHAR, UNIQUE(HASH, INDEXID, `KEY`))"); stat.execute("CREATE TABLE IF NOT EXISTS " + SCHEMA + ".MAP(ROWID INT, WORDID INT, PRIMARY KEY(WORDID, ROWID))"); diff --git a/h2/src/main/org/h2/fulltext/FullTextLucene.java b/h2/src/main/org/h2/fulltext/FullTextLucene.java index ffd51be0bf..802563cff3 100644 --- a/h2/src/main/org/h2/fulltext/FullTextLucene.java +++ b/h2/src/main/org/h2/fulltext/FullTextLucene.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -596,6 +596,7 @@ public void close() throws SQLException { /** * Commit all changes to the Lucene index. + * @throws SQLException on failure */ void commitIndex() throws SQLException { try { diff --git a/h2/src/main/org/h2/fulltext/FullTextSettings.java b/h2/src/main/org/h2/fulltext/FullTextSettings.java index 77c0899377..7cdfc2841c 100644 --- a/h2/src/main/org/h2/fulltext/FullTextSettings.java +++ b/h2/src/main/org/h2/fulltext/FullTextSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -123,7 +123,7 @@ public void addWord(String word, Integer id) { * @param indexId the index id * @return the index info */ - protected IndexInfo getIndexInfo(int indexId) { + IndexInfo getIndexInfo(int indexId) { return indexes.get(indexId); } @@ -132,7 +132,7 @@ protected IndexInfo getIndexInfo(int indexId) { * * @param index the index */ - protected void addIndexInfo(IndexInfo index) { + void addIndexInfo(IndexInfo index) { indexes.put(index.id, index); } @@ -143,7 +143,7 @@ protected void addIndexInfo(IndexInfo index) { * @param word the word to convert and check * @return the uppercase version of the word or null */ - protected String convertWord(String word) { + String convertWord(String word) { word = normalizeWord(word); synchronized (ignoreList) { if (ignoreList.contains(word)) { @@ -158,8 +158,9 @@ protected String convertWord(String word) { * * @param conn the connection * @return the settings + * @throws SQLException on failure */ - protected static FullTextSettings getInstance(Connection conn) + static FullTextSettings getInstance(Connection conn) throws SQLException { String path = getIndexPath(conn); FullTextSettings setting; @@ -200,8 +201,9 @@ private static String getIndexPath(Connection conn) throws SQLException { * @param conn the connection * @param sql the statement * @return the prepared statement + * @throws SQLException on failure */ - protected synchronized PreparedStatement prepare(Connection conn, String sql) + synchronized PreparedStatement prepare(Connection conn, String sql) throws SQLException { SoftValuesHashMap c = cache.get(conn); if (c == null) { diff --git a/h2/src/main/org/h2/fulltext/IndexInfo.java b/h2/src/main/org/h2/fulltext/IndexInfo.java index 34a41a4474..22c5498afc 100644 --- a/h2/src/main/org/h2/fulltext/IndexInfo.java +++ b/h2/src/main/org/h2/fulltext/IndexInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/fulltext/package.html b/h2/src/main/org/h2/fulltext/package.html index c0bdcf2ec9..d3c046257f 100644 --- a/h2/src/main/org/h2/fulltext/package.html +++ b/h2/src/main/org/h2/fulltext/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/index/Cursor.java b/h2/src/main/org/h2/index/Cursor.java index 1069b12220..a8e768ae2c 100644 --- a/h2/src/main/org/h2/index/Cursor.java +++ b/h2/src/main/org/h2/index/Cursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/DualCursor.java b/h2/src/main/org/h2/index/DualCursor.java index ca0ec9b83a..e49a8bc1fe 100644 --- a/h2/src/main/org/h2/index/DualCursor.java +++ b/h2/src/main/org/h2/index/DualCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/DualIndex.java b/h2/src/main/org/h2/index/DualIndex.java index c0617c39a6..74539c41b5 100644 --- a/h2/src/main/org/h2/index/DualIndex.java +++ b/h2/src/main/org/h2/index/DualIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/Index.java b/h2/src/main/org/h2/index/Index.java index ef0b9a1a1e..b0104db1b3 100644 --- a/h2/src/main/org/h2/index/Index.java +++ b/h2/src/main/org/h2/index/Index.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/IndexCondition.java b/h2/src/main/org/h2/index/IndexCondition.java index 4967f43796..d4b32d0590 100644 --- a/h2/src/main/org/h2/index/IndexCondition.java +++ b/h2/src/main/org/h2/index/IndexCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/IndexCursor.java b/h2/src/main/org/h2/index/IndexCursor.java index 4137c2ed02..2fe8d6fd73 100644 --- a/h2/src/main/org/h2/index/IndexCursor.java +++ b/h2/src/main/org/h2/index/IndexCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/IndexType.java b/h2/src/main/org/h2/index/IndexType.java index c347ecca60..6949b61585 100644 --- a/h2/src/main/org/h2/index/IndexType.java +++ b/h2/src/main/org/h2/index/IndexType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/LinkedCursor.java b/h2/src/main/org/h2/index/LinkedCursor.java index 28b37490de..75fb1e3b82 100644 --- a/h2/src/main/org/h2/index/LinkedCursor.java +++ b/h2/src/main/org/h2/index/LinkedCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/LinkedIndex.java b/h2/src/main/org/h2/index/LinkedIndex.java index 0e45fb1199..b5b9a00914 100644 --- a/h2/src/main/org/h2/index/LinkedIndex.java +++ b/h2/src/main/org/h2/index/LinkedIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/MetaCursor.java b/h2/src/main/org/h2/index/MetaCursor.java index 1acbc8a713..8932d016ca 100644 --- a/h2/src/main/org/h2/index/MetaCursor.java +++ b/h2/src/main/org/h2/index/MetaCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/MetaIndex.java b/h2/src/main/org/h2/index/MetaIndex.java index b5c81ca130..86ee869899 100644 --- a/h2/src/main/org/h2/index/MetaIndex.java +++ b/h2/src/main/org/h2/index/MetaIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/RangeCursor.java b/h2/src/main/org/h2/index/RangeCursor.java index dd4ec5dd68..e51e1d0406 100644 --- a/h2/src/main/org/h2/index/RangeCursor.java +++ b/h2/src/main/org/h2/index/RangeCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/RangeIndex.java b/h2/src/main/org/h2/index/RangeIndex.java index 17df8ce1ff..30f3bab70b 100644 --- a/h2/src/main/org/h2/index/RangeIndex.java +++ b/h2/src/main/org/h2/index/RangeIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/SingleRowCursor.java b/h2/src/main/org/h2/index/SingleRowCursor.java index d150bd5d9a..1ef602b207 100644 --- a/h2/src/main/org/h2/index/SingleRowCursor.java +++ b/h2/src/main/org/h2/index/SingleRowCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/SpatialIndex.java b/h2/src/main/org/h2/index/SpatialIndex.java index 9d7422ef77..1494d36cbe 100644 --- a/h2/src/main/org/h2/index/SpatialIndex.java +++ b/h2/src/main/org/h2/index/SpatialIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/ViewCursor.java b/h2/src/main/org/h2/index/ViewCursor.java index 6d300cbc04..53ac2a72ab 100644 --- a/h2/src/main/org/h2/index/ViewCursor.java +++ b/h2/src/main/org/h2/index/ViewCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/ViewIndex.java b/h2/src/main/org/h2/index/ViewIndex.java index 96356c135d..173fe9a9b8 100644 --- a/h2/src/main/org/h2/index/ViewIndex.java +++ b/h2/src/main/org/h2/index/ViewIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -168,7 +168,7 @@ private Cursor findRecursive(SearchRow first, SearchRow last) { if (query == null) { Parser parser = new Parser(createSession); parser.setRightsChecked(true); - parser.setSuppliedParameterList(originalParameters); + parser.setSuppliedParameters(originalParameters); query = (Query) parser.prepare(querySQL); query.setNeverLazy(true); } @@ -226,9 +226,11 @@ public void setupQueryParameters(SessionLocal session, SearchRow first, SearchRo ArrayList paramList = query.getParameters(); if (originalParameters != null) { for (Parameter orig : originalParameters) { - int idx = orig.getIndex(); - Value value = orig.getValue(session); - setParameter(paramList, idx, value); + if (orig != null) { + int idx = orig.getIndex(); + Value value = orig.getValue(session); + setParameter(paramList, idx, value); + } } } int len; diff --git a/h2/src/main/org/h2/index/VirtualConstructedTableIndex.java b/h2/src/main/org/h2/index/VirtualConstructedTableIndex.java index 42cab414b0..bde72c8df3 100644 --- a/h2/src/main/org/h2/index/VirtualConstructedTableIndex.java +++ b/h2/src/main/org/h2/index/VirtualConstructedTableIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/VirtualTableCursor.java b/h2/src/main/org/h2/index/VirtualTableCursor.java index f8b91e1e91..0831454efb 100644 --- a/h2/src/main/org/h2/index/VirtualTableCursor.java +++ b/h2/src/main/org/h2/index/VirtualTableCursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -37,8 +37,6 @@ class VirtualTableCursor implements Cursor { * first row * @param last * last row - * @param session - * session * @param result * the result */ diff --git a/h2/src/main/org/h2/index/VirtualTableIndex.java b/h2/src/main/org/h2/index/VirtualTableIndex.java index 3c9446c8b6..eee94df727 100644 --- a/h2/src/main/org/h2/index/VirtualTableIndex.java +++ b/h2/src/main/org/h2/index/VirtualTableIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/index/package.html b/h2/src/main/org/h2/index/package.html index c31a62d427..40a17031a5 100644 --- a/h2/src/main/org/h2/index/package.html +++ b/h2/src/main/org/h2/index/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/jdbc/JdbcArray.java b/h2/src/main/org/h2/jdbc/JdbcArray.java index 927ed11262..90c745d051 100644 --- a/h2/src/main/org/h2/jdbc/JdbcArray.java +++ b/h2/src/main/org/h2/jdbc/JdbcArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcBatchUpdateException.java b/h2/src/main/org/h2/jdbc/JdbcBatchUpdateException.java index 0109a70f08..e8040c8a82 100644 --- a/h2/src/main/org/h2/jdbc/JdbcBatchUpdateException.java +++ b/h2/src/main/org/h2/jdbc/JdbcBatchUpdateException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -19,6 +19,8 @@ public final class JdbcBatchUpdateException extends BatchUpdateException { /** * INTERNAL + * @param next exception + * @param updateCounts affected record counts */ JdbcBatchUpdateException(SQLException next, int[] updateCounts) { super(next.getMessage(), next.getSQLState(), next.getErrorCode(), updateCounts); @@ -27,6 +29,8 @@ public final class JdbcBatchUpdateException extends BatchUpdateException { /** * INTERNAL + * @param next exception + * @param updateCounts affected record counts */ JdbcBatchUpdateException(SQLException next, long[] updateCounts) { super(next.getMessage(), next.getSQLState(), next.getErrorCode(), updateCounts, null); diff --git a/h2/src/main/org/h2/jdbc/JdbcBlob.java b/h2/src/main/org/h2/jdbc/JdbcBlob.java index 77cf5014a0..b6a49b1e38 100644 --- a/h2/src/main/org/h2/jdbc/JdbcBlob.java +++ b/h2/src/main/org/h2/jdbc/JdbcBlob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcCallableStatement.java b/h2/src/main/org/h2/jdbc/JdbcCallableStatement.java index 8687f5dcf8..6541722bbb 100644 --- a/h2/src/main/org/h2/jdbc/JdbcCallableStatement.java +++ b/h2/src/main/org/h2/jdbc/JdbcCallableStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcClob.java b/h2/src/main/org/h2/jdbc/JdbcClob.java index 4ec251450d..d23dbfafc7 100644 --- a/h2/src/main/org/h2/jdbc/JdbcClob.java +++ b/h2/src/main/org/h2/jdbc/JdbcClob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcConnection.java b/h2/src/main/org/h2/jdbc/JdbcConnection.java index 5fb71cbe67..9834e7a03f 100644 --- a/h2/src/main/org/h2/jdbc/JdbcConnection.java +++ b/h2/src/main/org/h2/jdbc/JdbcConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, and the + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, and the * EPL 1.0 (https://h2database.com/html/license.html). Initial Developer: H2 * Group */ @@ -103,12 +103,17 @@ public class JdbcConnection extends TraceObject implements Connection, JdbcConne * @param info of this connection * @param user of this connection * @param password for the user + * @param forbidCreation whether database creation is forbidden * @throws SQLException on failure */ @SuppressWarnings("resource") - public JdbcConnection(String url, Properties info, String user, Object password) throws SQLException { + public JdbcConnection(String url, Properties info, String user, Object password, boolean forbidCreation) + throws SQLException { try { ConnectionInfo ci = new ConnectionInfo(url, info, user, password); + if (forbidCreation) { + ci.setProperty("FORBID_CREATION", "TRUE"); + } String baseDir = SysProperties.getBaseDir(); if (baseDir != null) { ci.setBaseDir(baseDir); diff --git a/h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java b/h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java index 57ac8728df..ba85d7d0f6 100644 --- a/h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java +++ b/h2/src/main/org/h2/jdbc/JdbcConnectionBackwardsCompat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java b/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java index 3a00ce4606..842f3aeff1 100644 --- a/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java +++ b/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -1007,9 +1007,13 @@ public String getIdentifierQuoteString() { /** * Gets the comma-separated list of all SQL keywords that are not supported - * as unquoted table/column/index name, in addition to the SQL:2003 keywords. + * as unquoted identifiers, in addition to the SQL:2003 reserved words. + *

    + * List of keywords in H2 may depend on compatibility mode and other + * settings. + *

    * - * @return a list of additional the keywords + * @return a list of additional keywords */ @Override public String getSQLKeywords() throws SQLException { diff --git a/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java b/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java index a7b1826fc7..9dafb7ab58 100644 --- a/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java +++ b/h2/src/main/org/h2/jdbc/JdbcDatabaseMetaDataBackwardsCompat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, and the + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, and the * EPL 1.0 (https://h2database.com/html/license.html). Initial Developer: H2 * Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcException.java b/h2/src/main/org/h2/jdbc/JdbcException.java index 8e195c8504..4578f57454 100644 --- a/h2/src/main/org/h2/jdbc/JdbcException.java +++ b/h2/src/main/org/h2/jdbc/JdbcException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcLob.java b/h2/src/main/org/h2/jdbc/JdbcLob.java index a59ce944a2..6862c1b984 100644 --- a/h2/src/main/org/h2/jdbc/JdbcLob.java +++ b/h2/src/main/org/h2/jdbc/JdbcLob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java b/h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java index b3efd655a3..febbe79dcf 100644 --- a/h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java +++ b/h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java b/h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java index fa7f6dc2c4..9533d97c3b 100644 --- a/h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java +++ b/h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcResultSet.java b/h2/src/main/org/h2/jdbc/JdbcResultSet.java index 5ee2459dcd..5984628827 100644 --- a/h2/src/main/org/h2/jdbc/JdbcResultSet.java +++ b/h2/src/main/org/h2/jdbc/JdbcResultSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -196,6 +196,7 @@ public void close() throws SQLException { /** * Close the result set. This method also closes the statement if required. + * @param fromStatement if true - close statement in the end */ void closeInternal(boolean fromStatement) { if (result != null) { @@ -4277,4 +4278,13 @@ public Value[] getUpdateRow() { return updateRow; } + /** + * INTERNAL + * + * @return result + */ + public ResultInterface getResult() { + return result; + } + } diff --git a/h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java b/h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java index 0c7f9ba6d3..e3658d6f23 100644 --- a/h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java +++ b/h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLDataException.java b/h2/src/main/org/h2/jdbc/JdbcSQLDataException.java index 7e57dc70ce..0016f23f3f 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLDataException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLDataException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLException.java b/h2/src/main/org/h2/jdbc/JdbcSQLException.java index 988ecc859a..de08d17dde 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLFeatureNotSupportedException.java b/h2/src/main/org/h2/jdbc/JdbcSQLFeatureNotSupportedException.java index 4ca9eb2d24..bf9416b842 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLFeatureNotSupportedException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLFeatureNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLIntegrityConstraintViolationException.java b/h2/src/main/org/h2/jdbc/JdbcSQLIntegrityConstraintViolationException.java index a39dba0885..6ce24217ae 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLIntegrityConstraintViolationException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLIntegrityConstraintViolationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLInvalidAuthorizationSpecException.java b/h2/src/main/org/h2/jdbc/JdbcSQLInvalidAuthorizationSpecException.java index 5cabd21c75..d06886c201 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLInvalidAuthorizationSpecException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLInvalidAuthorizationSpecException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientConnectionException.java b/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientConnectionException.java index 0ffebf6741..b76dd0d0c3 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientConnectionException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientConnectionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientException.java b/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientException.java index 020e428264..858a5647af 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLNonTransientException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLSyntaxErrorException.java b/h2/src/main/org/h2/jdbc/JdbcSQLSyntaxErrorException.java index 75e98331dd..97bb472f2a 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLSyntaxErrorException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLSyntaxErrorException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLTimeoutException.java b/h2/src/main/org/h2/jdbc/JdbcSQLTimeoutException.java index 6b9d2c922d..7e8ee1a2a9 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLTimeoutException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLTimeoutException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLTransactionRollbackException.java b/h2/src/main/org/h2/jdbc/JdbcSQLTransactionRollbackException.java index 9e7365dcc6..34e54b36b8 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLTransactionRollbackException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLTransactionRollbackException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLTransientException.java b/h2/src/main/org/h2/jdbc/JdbcSQLTransientException.java index c2e1aed83e..6566d1d9a3 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLTransientException.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLTransientException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSQLXML.java b/h2/src/main/org/h2/jdbc/JdbcSQLXML.java index fe7781689a..83a0a6a6b9 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSQLXML.java +++ b/h2/src/main/org/h2/jdbc/JdbcSQLXML.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcSavepoint.java b/h2/src/main/org/h2/jdbc/JdbcSavepoint.java index 68c8b48284..f08eabdbde 100644 --- a/h2/src/main/org/h2/jdbc/JdbcSavepoint.java +++ b/h2/src/main/org/h2/jdbc/JdbcSavepoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcStatement.java b/h2/src/main/org/h2/jdbc/JdbcStatement.java index be3bbe722c..80ce508023 100644 --- a/h2/src/main/org/h2/jdbc/JdbcStatement.java +++ b/h2/src/main/org/h2/jdbc/JdbcStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java b/h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java index dd9fa805a1..5406337da0 100644 --- a/h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java +++ b/h2/src/main/org/h2/jdbc/JdbcStatementBackwardsCompat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/meta/DatabaseMeta.java b/h2/src/main/org/h2/jdbc/meta/DatabaseMeta.java index 9b4c423d1b..0b7da247eb 100644 --- a/h2/src/main/org/h2/jdbc/meta/DatabaseMeta.java +++ b/h2/src/main/org/h2/jdbc/meta/DatabaseMeta.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLegacy.java b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLegacy.java index 3f9a3f157f..c33ff10c3c 100644 --- a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLegacy.java +++ b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLegacy.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocal.java b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocal.java index cf288d0f06..fa43376376 100644 --- a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocal.java +++ b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -21,6 +21,7 @@ import org.h2.constraint.ConstraintUnique; import org.h2.engine.Database; import org.h2.engine.DbObject; +import org.h2.engine.Mode; import org.h2.engine.Right; import org.h2.engine.SessionLocal; import org.h2.engine.User; @@ -105,8 +106,6 @@ public final class DatabaseMetaLocal extends DatabaseMetaLocalBase { private static final ValueSmallint PROCEDURE_RETURNS_RESULT = ValueSmallint .get((short) DatabaseMetaData.procedureReturnsResult); - private static final ValueSmallint TABLE_INDEX_STATISTIC = ValueSmallint.get(DatabaseMetaData.tableIndexStatistic); - private static final ValueSmallint TABLE_INDEX_HASHED = ValueSmallint.get(DatabaseMetaData.tableIndexHashed); private static final ValueSmallint TABLE_INDEX_OTHER = ValueSmallint.get(DatabaseMetaData.tableIndexOther); @@ -134,18 +133,28 @@ public final DefaultNullOrdering defaultNullOrdering() { @Override public String getSQLKeywords() { - return "CURRENT_CATALOG," // - + "CURRENT_SCHEMA," // - + "GROUPS," // - + "IF,ILIKE,INTERSECTS," // - + "KEY," // - + "LIMIT," // - + "MINUS," // - + "OFFSET," // - + "QUALIFY," // - + "REGEXP,ROWNUM," // - + "TOP,"// - + "_ROWID_"; + StringBuilder builder = new StringBuilder(103).append( // + "CURRENT_CATALOG," // + + "CURRENT_SCHEMA," // + + "GROUPS," // + + "IF,ILIKE," // + + "KEY,"); + Mode mode = session.getMode(); + if (mode.limit) { + builder.append("LIMIT,"); + } + if (mode.minusIsExcept) { + builder.append("MINUS,"); + } + builder.append( // + "OFFSET," // + + "QUALIFY," // + + "REGEXP,ROWNUM,"); + if (mode.topInSelect || mode.topInDML) { + builder.append("TOP,"); + } + return builder.append("_ROWID_") // + .toString(); } @Override @@ -1258,15 +1267,7 @@ private void getIndexInfo(Value catalogValue, Value schemaValue, Table table, bo Value tableValue = getString(table.getName()); Value indexValue = getString(index.getName()); IndexColumn[] cols = index.getIndexColumns(); - ValueSmallint type = TABLE_INDEX_STATISTIC; - type: if (uniqueColumnCount == cols.length) { - for (IndexColumn c : cols) { - if (c.column.isNullable()) { - break type; - } - } - type = index.getIndexType().isHash() ? TABLE_INDEX_HASHED : TABLE_INDEX_OTHER; - } + ValueSmallint type = index.getIndexType().isHash() ? TABLE_INDEX_HASHED : TABLE_INDEX_OTHER; for (int i = 0, l = cols.length; i < l; i++) { IndexColumn c = cols[i]; boolean nonUnique = i >= uniqueColumnCount; diff --git a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocalBase.java b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocalBase.java index c1cffd99ef..70a96e669e 100644 --- a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocalBase.java +++ b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaLocalBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaRemote.java b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaRemote.java index c99c2cbe29..8c099838ae 100644 --- a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaRemote.java +++ b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaRemote.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaServer.java b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaServer.java index 4b2b634517..9559233526 100644 --- a/h2/src/main/org/h2/jdbc/meta/DatabaseMetaServer.java +++ b/h2/src/main/org/h2/jdbc/meta/DatabaseMetaServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbc/meta/package.html b/h2/src/main/org/h2/jdbc/meta/package.html index dd2fa9601f..68e717102e 100644 --- a/h2/src/main/org/h2/jdbc/meta/package.html +++ b/h2/src/main/org/h2/jdbc/meta/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/jdbc/package.html b/h2/src/main/org/h2/jdbc/package.html index 662b5fe4af..ffc7f90f3d 100644 --- a/h2/src/main/org/h2/jdbc/package.html +++ b/h2/src/main/org/h2/jdbc/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java b/h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java index cfafc1c891..0ff22cd22f 100644 --- a/h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java +++ b/h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Christian d'Heureuse, www.source-code.biz * diff --git a/h2/src/main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java b/h2/src/main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java index 6f0f1a6dfd..b901d49301 100644 --- a/h2/src/main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java +++ b/h2/src/main/org/h2/jdbcx/JdbcConnectionPoolBackwardsCompat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbcx/JdbcDataSource.java b/h2/src/main/org/h2/jdbcx/JdbcDataSource.java index a35765ff6c..4c0ab0cfad 100644 --- a/h2/src/main/org/h2/jdbcx/JdbcDataSource.java +++ b/h2/src/main/org/h2/jdbcx/JdbcDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -152,7 +152,7 @@ public void setLogWriter(PrintWriter out) { @Override public Connection getConnection() throws SQLException { debugCodeCall("getConnection"); - return new JdbcConnection(url, null, userName, StringUtils.cloneCharArray(passwordChars)); + return new JdbcConnection(url, null, userName, StringUtils.cloneCharArray(passwordChars), false); } /** @@ -169,7 +169,7 @@ public Connection getConnection(String user, String password) if (isDebugEnabled()) { debugCode("getConnection(" + quote(user) + ", \"\")"); } - return new JdbcConnection(url, null, user, password); + return new JdbcConnection(url, null, user, password, false); } /** @@ -319,7 +319,7 @@ public Reference getReference() { public XAConnection getXAConnection() throws SQLException { debugCodeCall("getXAConnection"); return new JdbcXAConnection(factory, getNextId(XA_DATA_SOURCE), - new JdbcConnection(url, null, userName, StringUtils.cloneCharArray(passwordChars))); + new JdbcConnection(url, null, userName, StringUtils.cloneCharArray(passwordChars), false)); } /** @@ -336,7 +336,8 @@ public XAConnection getXAConnection(String user, String password) if (isDebugEnabled()) { debugCode("getXAConnection(" + quote(user) + ", \"\")"); } - return new JdbcXAConnection(factory, getNextId(XA_DATA_SOURCE), new JdbcConnection(url, null, user, password)); + return new JdbcXAConnection(factory, getNextId(XA_DATA_SOURCE), + new JdbcConnection(url, null, user, password, false)); } /** diff --git a/h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java b/h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java index 41fdaba899..cf00ae6b82 100644 --- a/h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java +++ b/h2/src/main/org/h2/jdbcx/JdbcDataSourceBackwardsCompat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java b/h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java index e70617bcfc..07673fff43 100644 --- a/h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java +++ b/h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jdbcx/JdbcXAConnection.java b/h2/src/main/org/h2/jdbcx/JdbcXAConnection.java index 6c473ee1db..fe7cbe5953 100644 --- a/h2/src/main/org/h2/jdbcx/JdbcXAConnection.java +++ b/h2/src/main/org/h2/jdbcx/JdbcXAConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -426,7 +426,7 @@ private static String quoteFlags(int flags) { if (buff.length() == 0) { buff.append("|XAResource.TMNOFLAGS"); } - return buff.toString().substring(1); + return buff.substring(1); } private void checkOpen() throws XAException { diff --git a/h2/src/main/org/h2/jdbcx/JdbcXid.java b/h2/src/main/org/h2/jdbcx/JdbcXid.java index 31613c0c40..c31cc0f4ff 100644 --- a/h2/src/main/org/h2/jdbcx/JdbcXid.java +++ b/h2/src/main/org/h2/jdbcx/JdbcXid.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -43,6 +43,9 @@ public final class JdbcXid extends TraceObject implements Xid { /** * INTERNAL + * @param builder to put result into + * @param xid to provide string representation for + * @return provided StringBuilder */ static StringBuilder toString(StringBuilder builder, Xid xid) { return builder.append(PREFIX).append('|').append(xid.getFormatId()) // diff --git a/h2/src/main/org/h2/jdbcx/package.html b/h2/src/main/org/h2/jdbcx/package.html index 57d0a5ec6a..aae3de2eb6 100644 --- a/h2/src/main/org/h2/jdbcx/package.html +++ b/h2/src/main/org/h2/jdbcx/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/jmx/DatabaseInfo.java b/h2/src/main/org/h2/jmx/DatabaseInfo.java index c9096118fa..9e14dfdde4 100644 --- a/h2/src/main/org/h2/jmx/DatabaseInfo.java +++ b/h2/src/main/org/h2/jmx/DatabaseInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jmx/DatabaseInfoMBean.java b/h2/src/main/org/h2/jmx/DatabaseInfoMBean.java index 6ca52efcf0..15f994d296 100644 --- a/h2/src/main/org/h2/jmx/DatabaseInfoMBean.java +++ b/h2/src/main/org/h2/jmx/DatabaseInfoMBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -7,7 +7,6 @@ /** * Information and management operations for the given database. - * @h2.resource * * @author Eric Dong * @author Thomas Mueller @@ -16,7 +15,6 @@ public interface DatabaseInfoMBean { /** * Is the database open in exclusive mode? - * @h2.resource * * @return true if the database is open in exclusive mode, false otherwise */ @@ -24,7 +22,6 @@ public interface DatabaseInfoMBean { /** * Is the database read-only? - * @h2.resource * * @return true if the database is read-only, false otherwise */ @@ -33,7 +30,6 @@ public interface DatabaseInfoMBean { /** * The database compatibility mode (REGULAR if no compatibility mode is * used). - * @h2.resource * * @return the database mode */ @@ -41,7 +37,6 @@ public interface DatabaseInfoMBean { /** * The number of write operations since the database was opened. - * @h2.resource * * @return the write count */ @@ -49,7 +44,6 @@ public interface DatabaseInfoMBean { /** * The file read count since the database was opened. - * @h2.resource * * @return the read count */ @@ -57,7 +51,6 @@ public interface DatabaseInfoMBean { /** * The database file size in KB. - * @h2.resource * * @return the number of pages */ @@ -65,7 +58,6 @@ public interface DatabaseInfoMBean { /** * The maximum cache size in KB. - * @h2.resource * * @return the maximum size */ @@ -80,7 +72,6 @@ public interface DatabaseInfoMBean { /** * The current cache size in KB. - * @h2.resource * * @return the current size */ @@ -88,7 +79,6 @@ public interface DatabaseInfoMBean { /** * The database version. - * @h2.resource * * @return the version */ @@ -96,7 +86,6 @@ public interface DatabaseInfoMBean { /** * The trace level (0 disabled, 1 error, 2 info, 3 debug). - * @h2.resource * * @return the level */ @@ -111,7 +100,6 @@ public interface DatabaseInfoMBean { /** * List the database settings. - * @h2.resource * * @return the database settings */ @@ -120,7 +108,6 @@ public interface DatabaseInfoMBean { /** * List sessions, including the queries that are in * progress, and locked tables. - * @h2.resource * * @return information about the sessions */ diff --git a/h2/src/main/org/h2/jmx/DocumentedMBean.java b/h2/src/main/org/h2/jmx/DocumentedMBean.java index 841a350001..e36fd104ad 100644 --- a/h2/src/main/org/h2/jmx/DocumentedMBean.java +++ b/h2/src/main/org/h2/jmx/DocumentedMBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/jmx/package.html b/h2/src/main/org/h2/jmx/package.html index 5eb4c65cf5..01ab3555ce 100644 --- a/h2/src/main/org/h2/jmx/package.html +++ b/h2/src/main/org/h2/jmx/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/message/DbException.java b/h2/src/main/org/h2/message/DbException.java index e6d1e6fd3e..a2549073df 100644 --- a/h2/src/main/org/h2/message/DbException.java +++ b/h2/src/main/org/h2/message/DbException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/message/Trace.java b/h2/src/main/org/h2/message/Trace.java index ef73d0de4b..066d026cdd 100644 --- a/h2/src/main/org/h2/message/Trace.java +++ b/h2/src/main/org/h2/message/Trace.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/message/TraceObject.java b/h2/src/main/org/h2/message/TraceObject.java index 7c1a408603..58444781ea 100644 --- a/h2/src/main/org/h2/message/TraceObject.java +++ b/h2/src/main/org/h2/message/TraceObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/message/TraceSystem.java b/h2/src/main/org/h2/message/TraceSystem.java index db64906d92..96743a26c2 100644 --- a/h2/src/main/org/h2/message/TraceSystem.java +++ b/h2/src/main/org/h2/message/TraceSystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/message/TraceWriter.java b/h2/src/main/org/h2/message/TraceWriter.java index 9f69856040..368411e6bc 100644 --- a/h2/src/main/org/h2/message/TraceWriter.java +++ b/h2/src/main/org/h2/message/TraceWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/message/TraceWriterAdapter.java b/h2/src/main/org/h2/message/TraceWriterAdapter.java index d6e5f39c4e..2ec4867155 100644 --- a/h2/src/main/org/h2/message/TraceWriterAdapter.java +++ b/h2/src/main/org/h2/message/TraceWriterAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/message/package.html b/h2/src/main/org/h2/message/package.html index 7201fa8ce8..ccdcc35a66 100644 --- a/h2/src/main/org/h2/message/package.html +++ b/h2/src/main/org/h2/message/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/mode/DefaultNullOrdering.java b/h2/src/main/org/h2/mode/DefaultNullOrdering.java index f2624f2b99..32c4e4a297 100644 --- a/h2/src/main/org/h2/mode/DefaultNullOrdering.java +++ b/h2/src/main/org/h2/mode/DefaultNullOrdering.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/FunctionInfo.java b/h2/src/main/org/h2/mode/FunctionInfo.java index d00db1a125..ba47964407 100644 --- a/h2/src/main/org/h2/mode/FunctionInfo.java +++ b/h2/src/main/org/h2/mode/FunctionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/FunctionsDB2Derby.java b/h2/src/main/org/h2/mode/FunctionsDB2Derby.java index 902c2d90a7..bc61364705 100644 --- a/h2/src/main/org/h2/mode/FunctionsDB2Derby.java +++ b/h2/src/main/org/h2/mode/FunctionsDB2Derby.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/FunctionsLegacy.java b/h2/src/main/org/h2/mode/FunctionsLegacy.java new file mode 100644 index 0000000000..64df770078 --- /dev/null +++ b/h2/src/main/org/h2/mode/FunctionsLegacy.java @@ -0,0 +1,69 @@ +/* + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, + * and the EPL 1.0 (https://h2database.com/html/license.html). + * Initial Developer: H2 Group + */ +package org.h2.mode; + +import java.util.HashMap; + +import org.h2.engine.SessionLocal; +import org.h2.expression.Expression; +import org.h2.message.DbException; +import org.h2.value.TypeInfo; +import org.h2.value.Value; + +/** + * This class implements some legacy functions not available in Regular mode. + */ +public class FunctionsLegacy extends ModeFunction { + + private static final HashMap FUNCTIONS = new HashMap<>(); + + private static final int IDENTITY = 6001; + + private static final int SCOPE_IDENTITY = IDENTITY + 1; + + static { + FUNCTIONS.put("IDENTITY", new FunctionInfo("IDENTITY", IDENTITY, 0, Value.BIGINT, true, false)); + FUNCTIONS.put("SCOPE_IDENTITY", + new FunctionInfo("SCOPE_IDENTITY", SCOPE_IDENTITY, 0, Value.BIGINT, true, false)); + } + + /** + * Returns mode-specific function for a given name, or {@code null}. + * + * @param upperName + * the upper-case name of a function + * @return the function with specified name or {@code null} + */ + public static FunctionsLegacy getFunction(String upperName) { + FunctionInfo info = FUNCTIONS.get(upperName); + if (info != null) { + return new FunctionsLegacy(info); + } + return null; + } + + private FunctionsLegacy(FunctionInfo info) { + super(info); + } + + @Override + public Value getValue(SessionLocal session) { + switch (info.type) { + case IDENTITY: + case SCOPE_IDENTITY: + return session.getLastIdentity().convertTo(type); + default: + throw DbException.getInternalError("type=" + info.type); + } + } + + @Override + public Expression optimize(SessionLocal session) { + type = TypeInfo.getTypeInfo(info.returnDataType); + return this; + } + +} diff --git a/h2/src/main/org/h2/mode/FunctionsMSSQLServer.java b/h2/src/main/org/h2/mode/FunctionsMSSQLServer.java index 542723ab5e..92cfca0867 100644 --- a/h2/src/main/org/h2/mode/FunctionsMSSQLServer.java +++ b/h2/src/main/org/h2/mode/FunctionsMSSQLServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/FunctionsMySQL.java b/h2/src/main/org/h2/mode/FunctionsMySQL.java index 6ee16d1ba3..480100ee3a 100644 --- a/h2/src/main/org/h2/mode/FunctionsMySQL.java +++ b/h2/src/main/org/h2/mode/FunctionsMySQL.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Jason Brittain (jason.brittain at gmail.com) */ diff --git a/h2/src/main/org/h2/mode/FunctionsOracle.java b/h2/src/main/org/h2/mode/FunctionsOracle.java index 3c82b3f98c..d950752c6b 100644 --- a/h2/src/main/org/h2/mode/FunctionsOracle.java +++ b/h2/src/main/org/h2/mode/FunctionsOracle.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/FunctionsPostgreSQL.java b/h2/src/main/org/h2/mode/FunctionsPostgreSQL.java index 740cb59b0d..ad2be4d957 100644 --- a/h2/src/main/org/h2/mode/FunctionsPostgreSQL.java +++ b/h2/src/main/org/h2/mode/FunctionsPostgreSQL.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/ModeFunction.java b/h2/src/main/org/h2/mode/ModeFunction.java index c31946518f..59f212242e 100644 --- a/h2/src/main/org/h2/mode/ModeFunction.java +++ b/h2/src/main/org/h2/mode/ModeFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -49,6 +49,8 @@ public static ModeFunction getFunction(Database database, String name) { private static ModeFunction getCompatibilityModeFunction(String name, ModeEnum modeEnum) { switch (modeEnum) { + case LEGACY: + return FunctionsLegacy.getFunction(name); case DB2: case Derby: return FunctionsDB2Derby.getFunction(name); diff --git a/h2/src/main/org/h2/mode/OnDuplicateKeyValues.java b/h2/src/main/org/h2/mode/OnDuplicateKeyValues.java index 9826e6e37c..44c245682b 100644 --- a/h2/src/main/org/h2/mode/OnDuplicateKeyValues.java +++ b/h2/src/main/org/h2/mode/OnDuplicateKeyValues.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/PgCatalogSchema.java b/h2/src/main/org/h2/mode/PgCatalogSchema.java index af6a216495..e88f20ac54 100644 --- a/h2/src/main/org/h2/mode/PgCatalogSchema.java +++ b/h2/src/main/org/h2/mode/PgCatalogSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/PgCatalogTable.java b/h2/src/main/org/h2/mode/PgCatalogTable.java index 81a13debe4..161da669a1 100644 --- a/h2/src/main/org/h2/mode/PgCatalogTable.java +++ b/h2/src/main/org/h2/mode/PgCatalogTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/Regclass.java b/h2/src/main/org/h2/mode/Regclass.java index ce01eeb98a..e3fc92303b 100644 --- a/h2/src/main/org/h2/mode/Regclass.java +++ b/h2/src/main/org/h2/mode/Regclass.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mode/ToDateParser.java b/h2/src/main/org/h2/mode/ToDateParser.java index 6abc787e41..b789555175 100644 --- a/h2/src/main/org/h2/mode/ToDateParser.java +++ b/h2/src/main/org/h2/mode/ToDateParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Daniel Gredler */ diff --git a/h2/src/main/org/h2/mode/ToDateTokenizer.java b/h2/src/main/org/h2/mode/ToDateTokenizer.java index 63734b7ed9..1cf83463e5 100644 --- a/h2/src/main/org/h2/mode/ToDateTokenizer.java +++ b/h2/src/main/org/h2/mode/ToDateTokenizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Daniel Gredler */ diff --git a/h2/src/main/org/h2/mode/package.html b/h2/src/main/org/h2/mode/package.html index a9bd0b29a7..b1194fe11f 100644 --- a/h2/src/main/org/h2/mode/package.html +++ b/h2/src/main/org/h2/mode/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/mvstore/Chunk.java b/h2/src/main/org/h2/mvstore/Chunk.java index 7b5e9ac271..c6da22f2c0 100644 --- a/h2/src/main/org/h2/mvstore/Chunk.java +++ b/h2/src/main/org/h2/mvstore/Chunk.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -387,6 +387,7 @@ private boolean isEvacuatable() { * Read a page of data into a ByteBuffer. * * @param fileStore to use + * @param offset of the page data * @param pos page pos * @return ByteBuffer containing page data. */ diff --git a/h2/src/main/org/h2/mvstore/Cursor.java b/h2/src/main/org/h2/mvstore/Cursor.java index 36197cc860..d60ca8c29a 100644 --- a/h2/src/main/org/h2/mvstore/Cursor.java +++ b/h2/src/main/org/h2/mvstore/Cursor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -153,10 +153,17 @@ public void skip(long n) { /** * Fetch the next entry that is equal or larger than the given key, starting - * from the given page. This method retains the stack. + * from the given page. This method returns the path. + * + * @param key type + * @param value type * * @param page to start from as a root * @param key to search for, null means search for the first available key + * @param reverse true if traversal is in reverse direction, false otherwise + * @return CursorPos representing path from the entry found, + * or from insertion point if not, + * all the way up to to the root page provided */ static CursorPos traverseDown(Page page, K key, boolean reverse) { CursorPos cursorPos = key != null ? CursorPos.traverseDown(page, key) : diff --git a/h2/src/main/org/h2/mvstore/CursorPos.java b/h2/src/main/org/h2/mvstore/CursorPos.java index b64dbf61b5..15334bc9d4 100644 --- a/h2/src/main/org/h2/mvstore/CursorPos.java +++ b/h2/src/main/org/h2/mvstore/CursorPos.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -43,6 +43,9 @@ public CursorPos(Page page, int index, CursorPos parent) { * rooted at a given Page. Resulting path starts at "insertion point" for a * given key and goes back to the root. * + * @param key type + * @param value type + * * @param page root of the tree * @param key the key to search for * @return head of the CursorPos chain (insertion point) diff --git a/h2/src/main/org/h2/mvstore/DataUtils.java b/h2/src/main/org/h2/mvstore/DataUtils.java index 35ef3c4515..872e7b79e6 100644 --- a/h2/src/main/org/h2/mvstore/DataUtils.java +++ b/h2/src/main/org/h2/mvstore/DataUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/FileStore.java b/h2/src/main/org/h2/mvstore/FileStore.java index a656c8b6a7..dc1142fcac 100644 --- a/h2/src/main/org/h2/mvstore/FileStore.java +++ b/h2/src/main/org/h2/mvstore/FileStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/FreeSpaceBitSet.java b/h2/src/main/org/h2/mvstore/FreeSpaceBitSet.java index 914665bf38..f302283bec 100644 --- a/h2/src/main/org/h2/mvstore/FreeSpaceBitSet.java +++ b/h2/src/main/org/h2/mvstore/FreeSpaceBitSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/MVMap.java b/h2/src/main/org/h2/mvstore/MVMap.java index 8bf1c832b9..d1de1f181b 100644 --- a/h2/src/main/org/h2/mvstore/MVMap.java +++ b/h2/src/main/org/h2/mvstore/MVMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -546,6 +546,8 @@ public boolean remove(Object key, Object value) { /** * Check whether the two values are equal. * + * @param type of values to compare + * * @param a the first value * @param b the second value * @param datatype to use for comparison diff --git a/h2/src/main/org/h2/mvstore/MVStore.java b/h2/src/main/org/h2/mvstore/MVStore.java index 6efc8fc0f4..46daadd11e 100644 --- a/h2/src/main/org/h2/mvstore/MVStore.java +++ b/h2/src/main/org/h2/mvstore/MVStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -2016,6 +2016,7 @@ public void compactMoveChunks() { * @param targetFillRate do nothing if the file store fill rate is higher * than this * @param moveSize the number of bytes to move + * @return true if any chunks were moved as result of this operation, false otherwise */ boolean compactMoveChunks(int targetFillRate, long moveSize) { boolean res = false; @@ -2546,6 +2547,9 @@ private static HashSet createIdSet(Iterable toCompact) { /** * Read a page. * + * @param key type + * @param value type + * * @param map the map * @param pos the page position * @return the page @@ -3879,7 +3883,7 @@ public Builder autoCommitBufferSize(int kb) { * stops if the target fill rate is reached. *

    * The default value is 90 (90%). The value 0 disables auto-compacting. - *

    + *

    * * @param percent the target fill rate * @return this diff --git a/h2/src/main/org/h2/mvstore/MVStoreException.java b/h2/src/main/org/h2/mvstore/MVStoreException.java index 50c4755322..0cd1b95c7b 100644 --- a/h2/src/main/org/h2/mvstore/MVStoreException.java +++ b/h2/src/main/org/h2/mvstore/MVStoreException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/MVStoreTool.java b/h2/src/main/org/h2/mvstore/MVStoreTool.java index 87896e8f82..ae7f5e4f37 100644 --- a/h2/src/main/org/h2/mvstore/MVStoreTool.java +++ b/h2/src/main/org/h2/mvstore/MVStoreTool.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -37,7 +37,8 @@ public class MVStoreTool { /** * Runs this tool. * Options are case sensitive. Supported options are: - *
    + *
    + * * * * diff --git a/h2/src/main/org/h2/mvstore/OffHeapStore.java b/h2/src/main/org/h2/mvstore/OffHeapStore.java index d7aff7e2d7..6dc9d8764c 100644 --- a/h2/src/main/org/h2/mvstore/OffHeapStore.java +++ b/h2/src/main/org/h2/mvstore/OffHeapStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/Page.java b/h2/src/main/org/h2/mvstore/Page.java index 72c9d22058..5ff8b3477b 100644 --- a/h2/src/main/org/h2/mvstore/Page.java +++ b/h2/src/main/org/h2/mvstore/Page.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -145,6 +145,9 @@ public abstract class Page implements Cloneable { /** * Create a new, empty leaf page. * + * @param key type + * @param value type + * * @param map the map * @return the new page */ @@ -156,6 +159,9 @@ static Page createEmptyLeaf(MVMap map) { /** * Create a new, empty internal node page. * + * @param key type + * @param value type + * * @param map the map * @return the new page */ @@ -188,6 +194,9 @@ public static Page createNode(MVMap map, K[] keys, PageReference /** * Create a new leaf page. The arrays are not cloned. * + * @param key type + * @param value type + * * @param map the map * @param keys the keys * @param values the values @@ -216,6 +225,9 @@ private void initMemoryAccount(int memoryCount) { * Get the value for the given key, or null if not found. * Search is done in the tree rooted at given page. * + * @param key type + * @param value type + * * @param key the key * @param p the root page * @return the value, or null if not found @@ -235,6 +247,9 @@ static V get(Page p, K key) { /** * Read a page. * + * @param key type + * @param value type + * * @param buff ByteBuffer containing serialized page info * @param pos the position * @param map the map @@ -248,10 +263,6 @@ static Page read(ByteBuffer buff, long pos, MVMap map) { return p; } -// static int getMemory(DataType keyType, K key) { -// return keyType.getMemory(key); -// } - /** * Get the id of the page's owner map * @return id diff --git a/h2/src/main/org/h2/mvstore/RootReference.java b/h2/src/main/org/h2/mvstore/RootReference.java index f751e4c74d..dff79839c0 100644 --- a/h2/src/main/org/h2/mvstore/RootReference.java +++ b/h2/src/main/org/h2/mvstore/RootReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/StreamStore.java b/h2/src/main/org/h2/mvstore/StreamStore.java index 117e256a9c..82a3944d83 100644 --- a/h2/src/main/org/h2/mvstore/StreamStore.java +++ b/h2/src/main/org/h2/mvstore/StreamStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/WriteBuffer.java b/h2/src/main/org/h2/mvstore/WriteBuffer.java index 7b6690d12c..9dd2be2460 100644 --- a/h2/src/main/org/h2/mvstore/WriteBuffer.java +++ b/h2/src/main/org/h2/mvstore/WriteBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/cache/CacheLongKeyLIRS.java b/h2/src/main/org/h2/mvstore/cache/CacheLongKeyLIRS.java index b470122833..d75127e3a6 100644 --- a/h2/src/main/org/h2/mvstore/cache/CacheLongKeyLIRS.java +++ b/h2/src/main/org/h2/mvstore/cache/CacheLongKeyLIRS.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/cache/FilePathCache.java b/h2/src/main/org/h2/mvstore/cache/FilePathCache.java index 1b646700cd..fc04065198 100644 --- a/h2/src/main/org/h2/mvstore/cache/FilePathCache.java +++ b/h2/src/main/org/h2/mvstore/cache/FilePathCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/cache/package.html b/h2/src/main/org/h2/mvstore/cache/package.html index 6fb2940964..0821fb4922 100644 --- a/h2/src/main/org/h2/mvstore/cache/package.html +++ b/h2/src/main/org/h2/mvstore/cache/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/mvstore/db/LobStorageMap.java b/h2/src/main/org/h2/mvstore/db/LobStorageMap.java index cee7cdbf26..16d74229ae 100644 --- a/h2/src/main/org/h2/mvstore/db/LobStorageMap.java +++ b/h2/src/main/org/h2/mvstore/db/LobStorageMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java b/h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java index 112649958e..0cceba0c96 100644 --- a/h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java +++ b/h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVInDoubtTransaction.java b/h2/src/main/org/h2/mvstore/db/MVInDoubtTransaction.java index 591db9bfd7..e8e9c01dae 100644 --- a/h2/src/main/org/h2/mvstore/db/MVInDoubtTransaction.java +++ b/h2/src/main/org/h2/mvstore/db/MVInDoubtTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVIndex.java b/h2/src/main/org/h2/mvstore/db/MVIndex.java index f0efa24f23..a831e6d9c3 100644 --- a/h2/src/main/org/h2/mvstore/db/MVIndex.java +++ b/h2/src/main/org/h2/mvstore/db/MVIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVPlainTempResult.java b/h2/src/main/org/h2/mvstore/db/MVPlainTempResult.java index 19c5b9d0b5..e00e19e7ce 100644 --- a/h2/src/main/org/h2/mvstore/db/MVPlainTempResult.java +++ b/h2/src/main/org/h2/mvstore/db/MVPlainTempResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java b/h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java index b94a31c00b..bf1a576a7f 100644 --- a/h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java +++ b/h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java b/h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java index 67aa2c1ca1..0792c6a17c 100644 --- a/h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java +++ b/h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVSortedTempResult.java b/h2/src/main/org/h2/mvstore/db/MVSortedTempResult.java index a37679f790..17579c9479 100644 --- a/h2/src/main/org/h2/mvstore/db/MVSortedTempResult.java +++ b/h2/src/main/org/h2/mvstore/db/MVSortedTempResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java b/h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java index b91f3ccafd..5d07ec7607 100644 --- a/h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java +++ b/h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/MVTable.java b/h2/src/main/org/h2/mvstore/db/MVTable.java index f38604da78..65c611845e 100644 --- a/h2/src/main/org/h2/mvstore/db/MVTable.java +++ b/h2/src/main/org/h2/mvstore/db/MVTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -162,34 +162,22 @@ public String getMapName() { } @Override - public boolean lock(SessionLocal session, boolean exclusive, - boolean forceLockEvenInMvcc) { - int lockMode = database.getLockMode(); - if (lockMode == Constants.LOCK_MODE_OFF) { + public boolean lock(SessionLocal session, int lockType) { + if (database.getLockMode() == Constants.LOCK_MODE_OFF) { session.registerTableAsUpdated(this); return false; } - if (!forceLockEvenInMvcc) { - // MVCC: update, delete, and insert use a shared lock. - // Select doesn't lock except when using FOR UPDATE and - // the system property h2.selectForUpdateMvcc - // is not enabled - if (exclusive) { - exclusive = false; - } else { - if (lockExclusiveSession == null) { - return false; - } - } + if (lockType == Table.READ_LOCK && lockExclusiveSession == null) { + return false; } if (lockExclusiveSession == session) { return true; } - if (!exclusive && lockSharedSessions.containsKey(session)) { + if (lockType != Table.EXCLUSIVE_LOCK && lockSharedSessions.containsKey(session)) { return true; } synchronized (this) { - if (!exclusive && lockSharedSessions.containsKey(session)) { + if (lockType != Table.EXCLUSIVE_LOCK && lockSharedSessions.containsKey(session)) { return true; } session.setWaitForLock(this, Thread.currentThread()); @@ -198,7 +186,7 @@ public boolean lock(SessionLocal session, boolean exclusive, } waitingSessions.addLast(session); try { - doLock1(session, exclusive); + doLock1(session, lockType); } finally { session.setWaitForLock(null, null); if (SysProperties.THREAD_DEADLOCK_DETECTOR) { @@ -210,15 +198,15 @@ public boolean lock(SessionLocal session, boolean exclusive, return false; } - private void doLock1(SessionLocal session, boolean exclusive) { - traceLock(session, exclusive, TraceLockEvent.TRACE_LOCK_REQUESTING_FOR, NO_EXTRA_INFO); + private void doLock1(SessionLocal session, int lockType) { + traceLock(session, lockType, TraceLockEvent.TRACE_LOCK_REQUESTING_FOR, NO_EXTRA_INFO); // don't get the current time unless necessary long max = 0L; boolean checkDeadlock = false; while (true) { // if I'm the next one in the queue - if (waitingSessions.getFirst() == session) { - if (doLock2(session, exclusive)) { + if (waitingSessions.getFirst() == session && lockExclusiveSession == null) { + if (doLock2(session, lockType)) { return; } } @@ -226,7 +214,7 @@ private void doLock1(SessionLocal session, boolean exclusive) { ArrayList sessions = checkDeadlock(session, null, null); if (sessions != null) { throw DbException.get(ErrorCode.DEADLOCK_1, - getDeadlockDetails(sessions, exclusive)); + getDeadlockDetails(sessions, lockType)); } } else { // check for deadlocks from now on @@ -237,12 +225,12 @@ private void doLock1(SessionLocal session, boolean exclusive) { // try at least one more time max = Utils.nanoTimePlusMillis(now, session.getLockTimeout()); } else if (now - max >= 0L) { - traceLock(session, exclusive, - TraceLockEvent.TRACE_LOCK_TIMEOUT_AFTER, NO_EXTRA_INFO+session.getLockTimeout()); + traceLock(session, lockType, + TraceLockEvent.TRACE_LOCK_TIMEOUT_AFTER, Integer.toString(session.getLockTimeout())); throw DbException.get(ErrorCode.LOCK_TIMEOUT_1, getName()); } try { - traceLock(session, exclusive, TraceLockEvent.TRACE_LOCK_WAITING_FOR, NO_EXTRA_INFO); + traceLock(session, lockType, TraceLockEvent.TRACE_LOCK_WAITING_FOR, NO_EXTRA_INFO); // don't wait too long so that deadlocks are detected early long sleep = Math.min(Constants.DEADLOCK_CHECK, (max - now) / 1_000_000L); if (sleep == 0) { @@ -255,55 +243,48 @@ private void doLock1(SessionLocal session, boolean exclusive) { } } - private boolean doLock2(SessionLocal session, boolean exclusive) { - if (lockExclusiveSession == null) { - if (exclusive) { - if (lockSharedSessions.isEmpty()) { - traceLock(session, exclusive, TraceLockEvent.TRACE_LOCK_ADDED_FOR, NO_EXTRA_INFO); - session.registerTableAsLocked(this); - lockExclusiveSession = session; - if (SysProperties.THREAD_DEADLOCK_DETECTOR) { - if (EXCLUSIVE_LOCKS.get() == null) { - EXCLUSIVE_LOCKS.set(new ArrayList<>()); - } - EXCLUSIVE_LOCKS.get().add(getName()); - } - return true; - } else if (lockSharedSessions.size() == 1 && - lockSharedSessions.containsKey(session)) { - traceLock(session, exclusive, TraceLockEvent.TRACE_LOCK_ADD_UPGRADED_FOR, NO_EXTRA_INFO); - lockExclusiveSession = session; - if (SysProperties.THREAD_DEADLOCK_DETECTOR) { - if (EXCLUSIVE_LOCKS.get() == null) { - EXCLUSIVE_LOCKS.set(new ArrayList<>()); - } - EXCLUSIVE_LOCKS.get().add(getName()); - } - return true; - } + private boolean doLock2(SessionLocal session, int lockType) { + switch (lockType) { + case Table.EXCLUSIVE_LOCK: + int size = lockSharedSessions.size(); + if (size == 0) { + traceLock(session, lockType, TraceLockEvent.TRACE_LOCK_ADDED_FOR, NO_EXTRA_INFO); + session.registerTableAsLocked(this); + } else if (size == 1 && lockSharedSessions.containsKey(session)) { + traceLock(session, lockType, TraceLockEvent.TRACE_LOCK_ADD_UPGRADED_FOR, NO_EXTRA_INFO); } else { - if (lockSharedSessions.putIfAbsent(session, session) == null) { - traceLock(session, exclusive, TraceLockEvent.TRACE_LOCK_OK, NO_EXTRA_INFO); - session.registerTableAsLocked(this); - if (SysProperties.THREAD_DEADLOCK_DETECTOR) { - ArrayList list = SHARED_LOCKS.get(); - if (list == null) { - list = new ArrayList<>(); - SHARED_LOCKS.set(list); - } - list.add(getName()); - } + return false; + } + lockExclusiveSession = session; + if (SysProperties.THREAD_DEADLOCK_DETECTOR) { + addLockToDebugList(EXCLUSIVE_LOCKS); + } + break; + case Table.WRITE_LOCK: + if (lockSharedSessions.putIfAbsent(session, session) == null) { + traceLock(session, lockType, TraceLockEvent.TRACE_LOCK_OK, NO_EXTRA_INFO); + session.registerTableAsLocked(this); + if (SysProperties.THREAD_DEADLOCK_DETECTOR) { + addLockToDebugList(SHARED_LOCKS); } - return true; } } - return false; + return true; } - private void traceLock(SessionLocal session, boolean exclusive, TraceLockEvent eventEnum, String extraInfo) { + private void addLockToDebugList(DebuggingThreadLocal> locks) { + ArrayList list = locks.get(); + if (list == null) { + list = new ArrayList<>(); + locks.set(list); + } + list.add(getName()); + } + + private void traceLock(SessionLocal session, int lockType, TraceLockEvent eventEnum, String extraInfo) { if (traceLock.isDebugEnabled()) { traceLock.debug("{0} {1} {2} {3} {4}", session.getId(), - exclusive ? "exclusive write lock" : "shared read lock", eventEnum.getEventText(), + lockTypeToString(lockType), eventEnum.getEventText(), getName(), extraInfo); } } @@ -311,25 +292,28 @@ private void traceLock(SessionLocal session, boolean exclusive, TraceLockEvent e @Override public void unlock(SessionLocal s) { if (database != null) { - boolean wasLocked = lockExclusiveSession == s; - traceLock(s, wasLocked, TraceLockEvent.TRACE_LOCK_UNLOCK, NO_EXTRA_INFO); - if (wasLocked) { + int lockType; + if (lockExclusiveSession == s) { + lockType = Table.EXCLUSIVE_LOCK; lockSharedSessions.remove(s); lockExclusiveSession = null; if (SysProperties.THREAD_DEADLOCK_DETECTOR) { - if (EXCLUSIVE_LOCKS.get() != null) { - EXCLUSIVE_LOCKS.get().remove(getName()); + ArrayList exclusiveLocks = EXCLUSIVE_LOCKS.get(); + if (exclusiveLocks != null) { + exclusiveLocks.remove(getName()); } } } else { - wasLocked = lockSharedSessions.remove(s) != null; + lockType = lockSharedSessions.remove(s) != null ? Table.WRITE_LOCK : Table.READ_LOCK; if (SysProperties.THREAD_DEADLOCK_DETECTOR) { - if (SHARED_LOCKS.get() != null) { - SHARED_LOCKS.get().remove(getName()); + ArrayList sharedLocks = SHARED_LOCKS.get(); + if (sharedLocks != null) { + sharedLocks.remove(getName()); } } } - if (wasLocked && !waitingSessions.isEmpty()) { + traceLock(s, lockType, TraceLockEvent.TRACE_LOCK_UNLOCK, NO_EXTRA_INFO); + if (lockType != Table.READ_LOCK && !waitingSessions.isEmpty()) { synchronized (this) { notifyAll(); } @@ -732,11 +716,11 @@ private static void addRowsToIndex(SessionLocal session, ArrayList list, In * * @param sessions * the list of sessions - * @param exclusive - * true if waiting for exclusive lock, false otherwise + * @param lockType + * the type of lock * @return formatted details of a deadlock */ - private static String getDeadlockDetails(ArrayList sessions, boolean exclusive) { + private static String getDeadlockDetails(ArrayList sessions, int lockType) { // We add the thread details here to make it easier for customers to // match up these error messages with their own logs. StringBuilder builder = new StringBuilder(); @@ -745,7 +729,7 @@ private static String getDeadlockDetails(ArrayList sessions, boole Thread thread = s.getWaitForLockThread(); builder.append("\nSession ").append(s).append(" on thread ").append(thread.getName()) .append(" is waiting to lock ").append(lock.toString()) - .append(exclusive ? " (exclusive)" : " (shared)").append(" while locking "); + .append(" (").append(lockTypeToString(lockType)).append(") while locking "); boolean addComma = false; for (Table t : s.getLocks()) { if (addComma) { @@ -766,6 +750,11 @@ private static String getDeadlockDetails(ArrayList sessions, boole return builder.toString(); } + private static String lockTypeToString(int lockType) { + return lockType == Table.READ_LOCK ? "shared read" + : lockType == Table.WRITE_LOCK ? "shared write" : "exclusive"; + } + /** * Sorts the specified list of rows for a specified index. * diff --git a/h2/src/main/org/h2/mvstore/db/MVTempResult.java b/h2/src/main/org/h2/mvstore/db/MVTempResult.java index 046949fea8..97779cba55 100644 --- a/h2/src/main/org/h2/mvstore/db/MVTempResult.java +++ b/h2/src/main/org/h2/mvstore/db/MVTempResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/NullValueDataType.java b/h2/src/main/org/h2/mvstore/db/NullValueDataType.java index c976651eab..c9b4ff3035 100644 --- a/h2/src/main/org/h2/mvstore/db/NullValueDataType.java +++ b/h2/src/main/org/h2/mvstore/db/NullValueDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/RowDataType.java b/h2/src/main/org/h2/mvstore/db/RowDataType.java index 9603f7ce4d..3486203410 100644 --- a/h2/src/main/org/h2/mvstore/db/RowDataType.java +++ b/h2/src/main/org/h2/mvstore/db/RowDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/SpatialKey.java b/h2/src/main/org/h2/mvstore/db/SpatialKey.java index afe080b904..2a9438eb15 100644 --- a/h2/src/main/org/h2/mvstore/db/SpatialKey.java +++ b/h2/src/main/org/h2/mvstore/db/SpatialKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/Store.java b/h2/src/main/org/h2/mvstore/db/Store.java index ffd4942204..6f5b5befcf 100644 --- a/h2/src/main/org/h2/mvstore/db/Store.java +++ b/h2/src/main/org/h2/mvstore/db/Store.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/ValueDataType.java b/h2/src/main/org/h2/mvstore/db/ValueDataType.java index 65595edd72..36d4ccbe0f 100644 --- a/h2/src/main/org/h2/mvstore/db/ValueDataType.java +++ b/h2/src/main/org/h2/mvstore/db/ValueDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/db/package.html b/h2/src/main/org/h2/mvstore/db/package.html index 37a213550d..efa1e98076 100644 --- a/h2/src/main/org/h2/mvstore/db/package.html +++ b/h2/src/main/org/h2/mvstore/db/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/mvstore/package.html b/h2/src/main/org/h2/mvstore/package.html index 562ce8458a..9ebeb43f22 100644 --- a/h2/src/main/org/h2/mvstore/package.html +++ b/h2/src/main/org/h2/mvstore/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/mvstore/rtree/DefaultSpatial.java b/h2/src/main/org/h2/mvstore/rtree/DefaultSpatial.java index ede7d5fe03..e8b7a200f2 100644 --- a/h2/src/main/org/h2/mvstore/rtree/DefaultSpatial.java +++ b/h2/src/main/org/h2/mvstore/rtree/DefaultSpatial.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java b/h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java index 90ebeca89b..4b8a7a60c1 100644 --- a/h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java +++ b/h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/rtree/Spatial.java b/h2/src/main/org/h2/mvstore/rtree/Spatial.java index ded03b3f28..1b9682d354 100644 --- a/h2/src/main/org/h2/mvstore/rtree/Spatial.java +++ b/h2/src/main/org/h2/mvstore/rtree/Spatial.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java b/h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java index 4044a6ea82..6af8a5887e 100644 --- a/h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java +++ b/h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/rtree/package.html b/h2/src/main/org/h2/mvstore/rtree/package.html index 341dabb7f1..240224c617 100644 --- a/h2/src/main/org/h2/mvstore/rtree/package.html +++ b/h2/src/main/org/h2/mvstore/rtree/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/mvstore/tx/CommitDecisionMaker.java b/h2/src/main/org/h2/mvstore/tx/CommitDecisionMaker.java index 6a3408fa2b..f3867b3b86 100644 --- a/h2/src/main/org/h2/mvstore/tx/CommitDecisionMaker.java +++ b/h2/src/main/org/h2/mvstore/tx/CommitDecisionMaker.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/Record.java b/h2/src/main/org/h2/mvstore/tx/Record.java index 5a3403e9a0..4da15fdb44 100644 --- a/h2/src/main/org/h2/mvstore/tx/Record.java +++ b/h2/src/main/org/h2/mvstore/tx/Record.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/RollbackDecisionMaker.java b/h2/src/main/org/h2/mvstore/tx/RollbackDecisionMaker.java index 88fdb3aefd..923605ed56 100644 --- a/h2/src/main/org/h2/mvstore/tx/RollbackDecisionMaker.java +++ b/h2/src/main/org/h2/mvstore/tx/RollbackDecisionMaker.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/Snapshot.java b/h2/src/main/org/h2/mvstore/tx/Snapshot.java index a909f0e0c3..224d1ce1ff 100644 --- a/h2/src/main/org/h2/mvstore/tx/Snapshot.java +++ b/h2/src/main/org/h2/mvstore/tx/Snapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/Transaction.java b/h2/src/main/org/h2/mvstore/tx/Transaction.java index cced7d0506..892bf4ef79 100644 --- a/h2/src/main/org/h2/mvstore/tx/Transaction.java +++ b/h2/src/main/org/h2/mvstore/tx/Transaction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/TransactionMap.java b/h2/src/main/org/h2/mvstore/tx/TransactionMap.java index 72789af215..2c5d7f2a63 100644 --- a/h2/src/main/org/h2/mvstore/tx/TransactionMap.java +++ b/h2/src/main/org/h2/mvstore/tx/TransactionMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -526,10 +526,14 @@ Snapshot> createSnapshot() { } /** - * Create a new snapshot for this map. + * Gets a coherent picture of committing transactions and root reference, + * passes it to the specified function, and returns its result. * - * @param snapshotConsumer BiFunction>, BitSet, R> - * @return the snapshot + * @param type of the result + * + * @param snapshotConsumer + * function to invoke on a snapshot + * @return function's result */ R useSnapshot(BiFunction>, BitSet, R> snapshotConsumer) { // The purpose of the following loop is to get a coherent picture diff --git a/h2/src/main/org/h2/mvstore/tx/TransactionStore.java b/h2/src/main/org/h2/mvstore/tx/TransactionStore.java index 55b6b7d8f2..bd4d43cdd9 100644 --- a/h2/src/main/org/h2/mvstore/tx/TransactionStore.java +++ b/h2/src/main/org/h2/mvstore/tx/TransactionStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -450,6 +450,7 @@ void storeTransaction(Transaction t) { * @param transactionId id of the transaction * @param logId sequential number of the log record within transaction * @param record Record(mapId, key, previousValue) to add + * @return key for the added record */ long addUndoLogRecord(int transactionId, long logId, Record record) { MVMap> undoLog = undoLogs[transactionId]; @@ -567,6 +568,9 @@ public MVMap openMap(String name, DataType keyType, DataType v /** * Open the map with the given id. * + * @param key type + * @param value type + * * @param mapId the id * @return the map */ diff --git a/h2/src/main/org/h2/mvstore/tx/TxDecisionMaker.java b/h2/src/main/org/h2/mvstore/tx/TxDecisionMaker.java index a4c4e5e752..2ab6535b6d 100644 --- a/h2/src/main/org/h2/mvstore/tx/TxDecisionMaker.java +++ b/h2/src/main/org/h2/mvstore/tx/TxDecisionMaker.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/VersionedBitSet.java b/h2/src/main/org/h2/mvstore/tx/VersionedBitSet.java index d04bf7ae15..e0d8351195 100644 --- a/h2/src/main/org/h2/mvstore/tx/VersionedBitSet.java +++ b/h2/src/main/org/h2/mvstore/tx/VersionedBitSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/VersionedValueCommitted.java b/h2/src/main/org/h2/mvstore/tx/VersionedValueCommitted.java index b001a60c77..3d0df25758 100644 --- a/h2/src/main/org/h2/mvstore/tx/VersionedValueCommitted.java +++ b/h2/src/main/org/h2/mvstore/tx/VersionedValueCommitted.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -24,6 +24,9 @@ class VersionedValueCommitted extends VersionedValue { /** * Either cast to VersionedValue, or wrap in VersionedValueCommitted + * + * @param type of the value to get the VersionedValue for + * * @param value the object to cast/wrap * @return VersionedValue instance */ diff --git a/h2/src/main/org/h2/mvstore/tx/VersionedValueType.java b/h2/src/main/org/h2/mvstore/tx/VersionedValueType.java index a3ee915bb9..a088b70c41 100644 --- a/h2/src/main/org/h2/mvstore/tx/VersionedValueType.java +++ b/h2/src/main/org/h2/mvstore/tx/VersionedValueType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/tx/VersionedValueUncommitted.java b/h2/src/main/org/h2/mvstore/tx/VersionedValueUncommitted.java index 1ca7183060..dad0b330c3 100644 --- a/h2/src/main/org/h2/mvstore/tx/VersionedValueUncommitted.java +++ b/h2/src/main/org/h2/mvstore/tx/VersionedValueUncommitted.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -26,6 +26,8 @@ private VersionedValueUncommitted(long operationId, T value, T committedValue) { /** * Create new VersionedValueUncommitted. * + * @param type of the value to get the VersionedValue for + * * @param operationId combined log/transaction id * @param value value before commit * @param committedValue value after commit diff --git a/h2/src/main/org/h2/mvstore/tx/package.html b/h2/src/main/org/h2/mvstore/tx/package.html index 4691d4d9ee..08b0f02706 100644 --- a/h2/src/main/org/h2/mvstore/tx/package.html +++ b/h2/src/main/org/h2/mvstore/tx/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/mvstore/type/BasicDataType.java b/h2/src/main/org/h2/mvstore/type/BasicDataType.java index a20f4a2a4d..d9c79e6f08 100644 --- a/h2/src/main/org/h2/mvstore/type/BasicDataType.java +++ b/h2/src/main/org/h2/mvstore/type/BasicDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/ByteArrayDataType.java b/h2/src/main/org/h2/mvstore/type/ByteArrayDataType.java index d25ffeec6b..9fb8546268 100644 --- a/h2/src/main/org/h2/mvstore/type/ByteArrayDataType.java +++ b/h2/src/main/org/h2/mvstore/type/ByteArrayDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/DataType.java b/h2/src/main/org/h2/mvstore/type/DataType.java index ce495ab392..4066cbc057 100644 --- a/h2/src/main/org/h2/mvstore/type/DataType.java +++ b/h2/src/main/org/h2/mvstore/type/DataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/LongDataType.java b/h2/src/main/org/h2/mvstore/type/LongDataType.java index 59fa872f25..1fbca0eb7f 100644 --- a/h2/src/main/org/h2/mvstore/type/LongDataType.java +++ b/h2/src/main/org/h2/mvstore/type/LongDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/MetaType.java b/h2/src/main/org/h2/mvstore/type/MetaType.java index 142f7469e3..d522ca17c0 100644 --- a/h2/src/main/org/h2/mvstore/type/MetaType.java +++ b/h2/src/main/org/h2/mvstore/type/MetaType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/ObjectDataType.java b/h2/src/main/org/h2/mvstore/type/ObjectDataType.java index ce40871f9d..3b41c930d8 100644 --- a/h2/src/main/org/h2/mvstore/type/ObjectDataType.java +++ b/h2/src/main/org/h2/mvstore/type/ObjectDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/StatefulDataType.java b/h2/src/main/org/h2/mvstore/type/StatefulDataType.java index 7de82c7c68..9a53c2cdda 100644 --- a/h2/src/main/org/h2/mvstore/type/StatefulDataType.java +++ b/h2/src/main/org/h2/mvstore/type/StatefulDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/StringDataType.java b/h2/src/main/org/h2/mvstore/type/StringDataType.java index 95abb5ae55..63f907c90e 100644 --- a/h2/src/main/org/h2/mvstore/type/StringDataType.java +++ b/h2/src/main/org/h2/mvstore/type/StringDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/mvstore/type/package.html b/h2/src/main/org/h2/mvstore/type/package.html index 734ce4c9a0..110f3d7863 100644 --- a/h2/src/main/org/h2/mvstore/type/package.html +++ b/h2/src/main/org/h2/mvstore/type/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/package.html b/h2/src/main/org/h2/package.html index 931bbbecc3..77e208421c 100644 --- a/h2/src/main/org/h2/package.html +++ b/h2/src/main/org/h2/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/res/_messages_de.prop b/h2/src/main/org/h2/res/_messages_de.prop index 78e2e30cc6..f91951e045 100644 --- a/h2/src/main/org/h2/res/_messages_de.prop +++ b/h2/src/main/org/h2/res/_messages_de.prop @@ -63,7 +63,7 @@ 90020=Datenbank wird wahrscheinlich bereits benutzt: {0}. Mögliche Lösungen: alle Verbindungen schliessen; Server Modus verwenden 90021=Diese Kombination von Einstellungen wird nicht unterstützt {0} 90022=Funktion {0} nicht gefunden -90023=Feld {0} darf nicht NULL nicht erlauben +90023=Feld {0} darf nicht nullable sein 90024=Fehler beim Umbenennen der Datei {0} nach {1} 90025=Kann Datei {0} nicht löschen 90026=Serialisierung fehlgeschlagen, Grund: {0} diff --git a/h2/src/main/org/h2/res/help.csv b/h2/src/main/org/h2/res/help.csv index 755e2347e9..d783fa770a 100644 --- a/h2/src/main/org/h2/res/help.csv +++ b/h2/src/main/org/h2/res/help.csv @@ -1,4 +1,4 @@ -# Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +# Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, # and the EPL 1.0 (https://h2database.com/html/license.html). # Initial Developer: H2 Group @@ -12,7 +12,7 @@ selectExpression [,...] [ GROUP BY groupingElement [,...] ] [ HAVING expression ] [ WINDOW { { windowName AS windowSpecification } [,...] } ] @h2@ [ QUALIFY expression ] -[ { UNION [ ALL ] | EXCEPT | @c@ { MINUS } | INTERSECT } query ] +[ { UNION [ ALL ] | EXCEPT | INTERSECT } query ] [ ORDER BY selectOrder [,...] ] [ OFFSET expression { ROW | ROWS } ] [ FETCH { FIRST | NEXT } [ expression [ PERCENT ] ] { ROW | ROWS } @@ -48,9 +48,9 @@ ORDER BY clause, if any, is used to determine preserved rows. First row is each DISTINCT ON group is preserved. In absence of ORDER BY preserved rows are not determined, database may choose any row from each DISTINCT ON group. -9. UNION, EXCEPT (MINUS), and INTERSECT combine the result of this query with the results of another query. -Multiple set operators (UNION, INTERSECT, MINUS, EXCEPT) are evaluated from left to right. -For compatibility with other databases and future versions of H2 please use parentheses. +9. UNION, EXCEPT, and INTERSECT combine the result of this query with the results of another query. +INTERSECT has higher precedence than UNION and EXCEPT. +Operators with equal precedence are evaluated from left to right. 10. ORDER BY sorts the result by the given column(s) or expression(s). @@ -937,8 +937,9 @@ For TINYINT the allowed values are between -128 and 127. For SMALLINT the allowed values are between -32768 and 32767. For INTEGER the allowed values are between -2147483648 and 2147483647. For BIGINT the allowed values are between -9223372036854775808 and 9223372036854775807. -For NUMERIC the allowed values depend on precision and scale, -but cannot exceed the range of BIGINT data type (from -9223372036854775808 to 9223372036854775807). +For NUMERIC and DECFLOAT the allowed values depend on precision, +but cannot exceed the range of BIGINT data type (from -9223372036854775808 to 9223372036854775807); +the scale of NUMERIC must be 0. For REAL the allowed values are between -16777216 and 16777216. For DOUBLE PRECISION the allowed values are between -9007199254740992 and 9007199254740992. @@ -1834,10 +1835,10 @@ SET MAX_OPERATION_MEMORY 0 " "Commands (Other)","SET MODE"," -@h2@ SET MODE { REGULAR | DB2 | DERBY | HSQLDB | MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL } +@h2@ SET MODE { REGULAR | STRICT | LEGACY | DB2 | DERBY | HSQLDB | MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL } "," -Changes to another database compatibility mode. For details, see Compatibility -Modes in the feature section. +Changes to another database compatibility mode. For details, see +[Compatibility Modes](https://h2database.com/html/features.html#compatibility_modes). This setting is not persistent. Admin rights are required to execute this command, as it affects all connections. @@ -3150,18 +3151,21 @@ REGEXP '[a-z]' "Other Grammar","Table Constraint Definition"," [ constraintNameDefinition ] { PRIMARY KEY @h2@ [ HASH ] ( columnName [,...] ) } - | UNIQUE ( columnName [,...] ) + | UNIQUE ( { columnName [,...] | VALUE } ) | referentialConstraint | CHECK (condition) "," Defines a constraint. PRIMARY KEY and UNIQUE require unique values. -PRIMARY KEY also disallows NULL values and marks the column as a primary key. +PRIMARY KEY also disallows NULL values and marks the column as a primary key, a table can have only one primary key. +UNIQUE constraint supports NULL values and rows with NULL value in any column are considered as unique. +UNIQUE (VALUE) creates a unique constraint on entire row, excluding invisible columns; +but if new columns will be added to the table, they will not be included into this constraint. Referential constraint requires values that exist in other column(s) (usually in another table). -Check constraint require a specified condition to return TRUE or UNKNOWN (NULL). +Check constraint requires a specified condition to return TRUE or UNKNOWN (NULL). It can reference columns of the table, and can reference objects that exist while the statement is executed. Conditions are only checked when a row is added or modified in the table where the constraint exists. "," diff --git a/h2/src/main/org/h2/result/DefaultRow.java b/h2/src/main/org/h2/result/DefaultRow.java index 61b3c7876e..a9fe6c4063 100644 --- a/h2/src/main/org/h2/result/DefaultRow.java +++ b/h2/src/main/org/h2/result/DefaultRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/FetchedResult.java b/h2/src/main/org/h2/result/FetchedResult.java index 2b86b8c2c3..6882ede34c 100644 --- a/h2/src/main/org/h2/result/FetchedResult.java +++ b/h2/src/main/org/h2/result/FetchedResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/LazyResult.java b/h2/src/main/org/h2/result/LazyResult.java index be125a64ad..66c6187343 100644 --- a/h2/src/main/org/h2/result/LazyResult.java +++ b/h2/src/main/org/h2/result/LazyResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/LocalResult.java b/h2/src/main/org/h2/result/LocalResult.java index 18179b410a..fa630ed495 100644 --- a/h2/src/main/org/h2/result/LocalResult.java +++ b/h2/src/main/org/h2/result/LocalResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -62,6 +62,7 @@ public static LocalResult forTable(SessionLocal session, Table table) { private int visibleColumnCount; private int resultColumnCount; private Expression[] expressions; + private boolean forDataChangeDeltaTable; private long rowId, rowCount; private ArrayList rows; private SortOrder sort; @@ -140,6 +141,13 @@ public void setMaxMemoryRows(int maxValue) { this.maxMemoryRows = maxValue; } + /** + * Sets value collection mode for data change delta tables. + */ + public void setForDataChangeDeltaTable() { + forDataChangeDeltaTable = true; + } + /** * Create a shallow copy of the result set. The data and a temporary table * (if there is any) is not copied. @@ -343,10 +351,14 @@ private void cloneLobs(Value[] values) { for (int i = 0; i < values.length; i++) { Value v = values[i]; if (v instanceof ValueLob) { - ValueLob v2 = ((ValueLob) v).copyToResult(); - if (v2 != v) { + if (forDataChangeDeltaTable) { containsLobs = true; - values[i] = session.addTemporaryLob(v2); + } else { + ValueLob v2 = ((ValueLob) v).copyToResult(); + if (v2 != v) { + containsLobs = true; + values[i] = session.addTemporaryLob(v2); + } } } } diff --git a/h2/src/main/org/h2/result/MergedResult.java b/h2/src/main/org/h2/result/MergedResult.java index f14700f334..57545821e5 100644 --- a/h2/src/main/org/h2/result/MergedResult.java +++ b/h2/src/main/org/h2/result/MergedResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/ResultColumn.java b/h2/src/main/org/h2/result/ResultColumn.java index 6626752dcb..f8cc1a51f5 100644 --- a/h2/src/main/org/h2/result/ResultColumn.java +++ b/h2/src/main/org/h2/result/ResultColumn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/ResultExternal.java b/h2/src/main/org/h2/result/ResultExternal.java index 06e48f554c..c61b5a176b 100644 --- a/h2/src/main/org/h2/result/ResultExternal.java +++ b/h2/src/main/org/h2/result/ResultExternal.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/ResultInterface.java b/h2/src/main/org/h2/result/ResultInterface.java index 94913fb515..c9ac258198 100644 --- a/h2/src/main/org/h2/result/ResultInterface.java +++ b/h2/src/main/org/h2/result/ResultInterface.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/ResultRemote.java b/h2/src/main/org/h2/result/ResultRemote.java index fdc9a143a7..e3e5a532e6 100644 --- a/h2/src/main/org/h2/result/ResultRemote.java +++ b/h2/src/main/org/h2/result/ResultRemote.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/ResultTarget.java b/h2/src/main/org/h2/result/ResultTarget.java index 7e3a15b357..cca53de6cd 100644 --- a/h2/src/main/org/h2/result/ResultTarget.java +++ b/h2/src/main/org/h2/result/ResultTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/ResultWithGeneratedKeys.java b/h2/src/main/org/h2/result/ResultWithGeneratedKeys.java index e4694e0e74..62a8427285 100644 --- a/h2/src/main/org/h2/result/ResultWithGeneratedKeys.java +++ b/h2/src/main/org/h2/result/ResultWithGeneratedKeys.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/ResultWithPaddedStrings.java b/h2/src/main/org/h2/result/ResultWithPaddedStrings.java index 51b6b3655f..d195f91504 100644 --- a/h2/src/main/org/h2/result/ResultWithPaddedStrings.java +++ b/h2/src/main/org/h2/result/ResultWithPaddedStrings.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/Row.java b/h2/src/main/org/h2/result/Row.java index 4933d8557c..29dbc80417 100644 --- a/h2/src/main/org/h2/result/Row.java +++ b/h2/src/main/org/h2/result/Row.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/RowFactory.java b/h2/src/main/org/h2/result/RowFactory.java index c2f3c14b5a..0a257fd7c1 100644 --- a/h2/src/main/org/h2/result/RowFactory.java +++ b/h2/src/main/org/h2/result/RowFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/SearchRow.java b/h2/src/main/org/h2/result/SearchRow.java index 99d9836b16..80babceb2a 100644 --- a/h2/src/main/org/h2/result/SearchRow.java +++ b/h2/src/main/org/h2/result/SearchRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/SimpleResult.java b/h2/src/main/org/h2/result/SimpleResult.java index 9715bb7e84..c47a315d61 100644 --- a/h2/src/main/org/h2/result/SimpleResult.java +++ b/h2/src/main/org/h2/result/SimpleResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/SimpleRowValue.java b/h2/src/main/org/h2/result/SimpleRowValue.java index 57c8e1f815..84181cde70 100644 --- a/h2/src/main/org/h2/result/SimpleRowValue.java +++ b/h2/src/main/org/h2/result/SimpleRowValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/SortOrder.java b/h2/src/main/org/h2/result/SortOrder.java index 5adeb876dc..65b9782468 100644 --- a/h2/src/main/org/h2/result/SortOrder.java +++ b/h2/src/main/org/h2/result/SortOrder.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/Sparse.java b/h2/src/main/org/h2/result/Sparse.java index 0f0ef38b9b..828cd05197 100644 --- a/h2/src/main/org/h2/result/Sparse.java +++ b/h2/src/main/org/h2/result/Sparse.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/UpdatableRow.java b/h2/src/main/org/h2/result/UpdatableRow.java index c94552f645..fb3e7077de 100644 --- a/h2/src/main/org/h2/result/UpdatableRow.java +++ b/h2/src/main/org/h2/result/UpdatableRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/result/package.html b/h2/src/main/org/h2/result/package.html index 199f61fbaa..0629958272 100644 --- a/h2/src/main/org/h2/result/package.html +++ b/h2/src/main/org/h2/result/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/schema/Constant.java b/h2/src/main/org/h2/schema/Constant.java index 36cfd796b9..bcf523ab79 100644 --- a/h2/src/main/org/h2/schema/Constant.java +++ b/h2/src/main/org/h2/schema/Constant.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/Domain.java b/h2/src/main/org/h2/schema/Domain.java index d6696ddb02..1003a2105a 100644 --- a/h2/src/main/org/h2/schema/Domain.java +++ b/h2/src/main/org/h2/schema/Domain.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/FunctionAlias.java b/h2/src/main/org/h2/schema/FunctionAlias.java index 3b92414328..47caf1ecf9 100644 --- a/h2/src/main/org/h2/schema/FunctionAlias.java +++ b/h2/src/main/org/h2/schema/FunctionAlias.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/InformationSchema.java b/h2/src/main/org/h2/schema/InformationSchema.java index 385681d98b..a958166363 100644 --- a/h2/src/main/org/h2/schema/InformationSchema.java +++ b/h2/src/main/org/h2/schema/InformationSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/MetaSchema.java b/h2/src/main/org/h2/schema/MetaSchema.java index 4626223763..867421ddc1 100644 --- a/h2/src/main/org/h2/schema/MetaSchema.java +++ b/h2/src/main/org/h2/schema/MetaSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/Schema.java b/h2/src/main/org/h2/schema/Schema.java index bc44196d29..9002a5c8a9 100644 --- a/h2/src/main/org/h2/schema/Schema.java +++ b/h2/src/main/org/h2/schema/Schema.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/SchemaObject.java b/h2/src/main/org/h2/schema/SchemaObject.java index 3b4fe3cf3e..f777d038cf 100644 --- a/h2/src/main/org/h2/schema/SchemaObject.java +++ b/h2/src/main/org/h2/schema/SchemaObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/Sequence.java b/h2/src/main/org/h2/schema/Sequence.java index 0cd5f37487..f21b918132 100644 --- a/h2/src/main/org/h2/schema/Sequence.java +++ b/h2/src/main/org/h2/schema/Sequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/TriggerObject.java b/h2/src/main/org/h2/schema/TriggerObject.java index fabc5c4311..fbf2b462ea 100644 --- a/h2/src/main/org/h2/schema/TriggerObject.java +++ b/h2/src/main/org/h2/schema/TriggerObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/UserAggregate.java b/h2/src/main/org/h2/schema/UserAggregate.java index 0e369c48c8..45ee8b42df 100644 --- a/h2/src/main/org/h2/schema/UserAggregate.java +++ b/h2/src/main/org/h2/schema/UserAggregate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/UserDefinedFunction.java b/h2/src/main/org/h2/schema/UserDefinedFunction.java index 6dae191066..7a3c6c8954 100644 --- a/h2/src/main/org/h2/schema/UserDefinedFunction.java +++ b/h2/src/main/org/h2/schema/UserDefinedFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/schema/package.html b/h2/src/main/org/h2/schema/package.html index efe16f38d8..815a65a659 100644 --- a/h2/src/main/org/h2/schema/package.html +++ b/h2/src/main/org/h2/schema/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/security/AES.java b/h2/src/main/org/h2/security/AES.java index 9dcc5b6edd..24a73257f8 100644 --- a/h2/src/main/org/h2/security/AES.java +++ b/h2/src/main/org/h2/security/AES.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/BlockCipher.java b/h2/src/main/org/h2/security/BlockCipher.java index 60e6ee9e6d..6e4cca4fab 100644 --- a/h2/src/main/org/h2/security/BlockCipher.java +++ b/h2/src/main/org/h2/security/BlockCipher.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/CipherFactory.java b/h2/src/main/org/h2/security/CipherFactory.java index 4758736b63..0477e9afa7 100644 --- a/h2/src/main/org/h2/security/CipherFactory.java +++ b/h2/src/main/org/h2/security/CipherFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/Fog.java b/h2/src/main/org/h2/security/Fog.java index 6e274303e4..ab5d61fc1b 100644 --- a/h2/src/main/org/h2/security/Fog.java +++ b/h2/src/main/org/h2/security/Fog.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/SHA256.java b/h2/src/main/org/h2/security/SHA256.java index c2cd5458f9..1b372893c4 100644 --- a/h2/src/main/org/h2/security/SHA256.java +++ b/h2/src/main/org/h2/security/SHA256.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/SHA3.java b/h2/src/main/org/h2/security/SHA3.java index aa8600dab3..cc22b7bde5 100644 --- a/h2/src/main/org/h2/security/SHA3.java +++ b/h2/src/main/org/h2/security/SHA3.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/SecureFileStore.java b/h2/src/main/org/h2/security/SecureFileStore.java index d07d998d45..2e70aaa14a 100644 --- a/h2/src/main/org/h2/security/SecureFileStore.java +++ b/h2/src/main/org/h2/security/SecureFileStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/XTEA.java b/h2/src/main/org/h2/security/XTEA.java index c2e16a73cb..01f2192bf5 100644 --- a/h2/src/main/org/h2/security/XTEA.java +++ b/h2/src/main/org/h2/security/XTEA.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/security/auth/AuthConfigException.java b/h2/src/main/org/h2/security/auth/AuthConfigException.java index 2bbb6848da..6135f6d590 100644 --- a/h2/src/main/org/h2/security/auth/AuthConfigException.java +++ b/h2/src/main/org/h2/security/auth/AuthConfigException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/AuthenticationException.java b/h2/src/main/org/h2/security/auth/AuthenticationException.java index 78a435a95d..df054b2b56 100644 --- a/h2/src/main/org/h2/security/auth/AuthenticationException.java +++ b/h2/src/main/org/h2/security/auth/AuthenticationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/AuthenticationInfo.java b/h2/src/main/org/h2/security/auth/AuthenticationInfo.java index d3b441ae01..ab9ecfd9cf 100644 --- a/h2/src/main/org/h2/security/auth/AuthenticationInfo.java +++ b/h2/src/main/org/h2/security/auth/AuthenticationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/Authenticator.java b/h2/src/main/org/h2/security/auth/Authenticator.java index 829513e2ce..c5ea0b1b73 100644 --- a/h2/src/main/org/h2/security/auth/Authenticator.java +++ b/h2/src/main/org/h2/security/auth/Authenticator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/AuthenticatorFactory.java b/h2/src/main/org/h2/security/auth/AuthenticatorFactory.java index 28d174f46a..c099ac5a1d 100644 --- a/h2/src/main/org/h2/security/auth/AuthenticatorFactory.java +++ b/h2/src/main/org/h2/security/auth/AuthenticatorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/ConfigProperties.java b/h2/src/main/org/h2/security/auth/ConfigProperties.java index 068c5c90ea..0dc19bf20d 100644 --- a/h2/src/main/org/h2/security/auth/ConfigProperties.java +++ b/h2/src/main/org/h2/security/auth/ConfigProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/Configurable.java b/h2/src/main/org/h2/security/auth/Configurable.java index ba418a62b9..56191e1b65 100644 --- a/h2/src/main/org/h2/security/auth/Configurable.java +++ b/h2/src/main/org/h2/security/auth/Configurable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/DefaultAuthenticator.java b/h2/src/main/org/h2/security/auth/DefaultAuthenticator.java index 56380d67fa..052270ef17 100644 --- a/h2/src/main/org/h2/security/auth/DefaultAuthenticator.java +++ b/h2/src/main/org/h2/security/auth/DefaultAuthenticator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/H2AuthConfig.java b/h2/src/main/org/h2/security/auth/H2AuthConfig.java index d7116f5ee1..9fe168883d 100644 --- a/h2/src/main/org/h2/security/auth/H2AuthConfig.java +++ b/h2/src/main/org/h2/security/auth/H2AuthConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/H2AuthConfigXml.java b/h2/src/main/org/h2/security/auth/H2AuthConfigXml.java index 45ca148aed..b1f6888d59 100644 --- a/h2/src/main/org/h2/security/auth/H2AuthConfigXml.java +++ b/h2/src/main/org/h2/security/auth/H2AuthConfigXml.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/HasConfigProperties.java b/h2/src/main/org/h2/security/auth/HasConfigProperties.java index fdc3ca6785..93856bffc0 100644 --- a/h2/src/main/org/h2/security/auth/HasConfigProperties.java +++ b/h2/src/main/org/h2/security/auth/HasConfigProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/PropertyConfig.java b/h2/src/main/org/h2/security/auth/PropertyConfig.java index 0285f94952..2f049cf492 100644 --- a/h2/src/main/org/h2/security/auth/PropertyConfig.java +++ b/h2/src/main/org/h2/security/auth/PropertyConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/RealmConfig.java b/h2/src/main/org/h2/security/auth/RealmConfig.java index cb99a15266..f020fca229 100644 --- a/h2/src/main/org/h2/security/auth/RealmConfig.java +++ b/h2/src/main/org/h2/security/auth/RealmConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/UserToRolesMapperConfig.java b/h2/src/main/org/h2/security/auth/UserToRolesMapperConfig.java index 418b02db12..16df852a16 100644 --- a/h2/src/main/org/h2/security/auth/UserToRolesMapperConfig.java +++ b/h2/src/main/org/h2/security/auth/UserToRolesMapperConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/impl/AssignRealmNameRole.java b/h2/src/main/org/h2/security/auth/impl/AssignRealmNameRole.java index 96123d0b6c..825ce3928c 100644 --- a/h2/src/main/org/h2/security/auth/impl/AssignRealmNameRole.java +++ b/h2/src/main/org/h2/security/auth/impl/AssignRealmNameRole.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/impl/JaasCredentialsValidator.java b/h2/src/main/org/h2/security/auth/impl/JaasCredentialsValidator.java index b2754943a2..9b43a30f2b 100644 --- a/h2/src/main/org/h2/security/auth/impl/JaasCredentialsValidator.java +++ b/h2/src/main/org/h2/security/auth/impl/JaasCredentialsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/impl/LdapCredentialsValidator.java b/h2/src/main/org/h2/security/auth/impl/LdapCredentialsValidator.java index 35f1ed7f78..e1e85c8222 100644 --- a/h2/src/main/org/h2/security/auth/impl/LdapCredentialsValidator.java +++ b/h2/src/main/org/h2/security/auth/impl/LdapCredentialsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/impl/StaticRolesMapper.java b/h2/src/main/org/h2/security/auth/impl/StaticRolesMapper.java index 529637865c..adbed395ac 100644 --- a/h2/src/main/org/h2/security/auth/impl/StaticRolesMapper.java +++ b/h2/src/main/org/h2/security/auth/impl/StaticRolesMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/impl/StaticUserCredentialsValidator.java b/h2/src/main/org/h2/security/auth/impl/StaticUserCredentialsValidator.java index 6e6588addd..edee8de558 100644 --- a/h2/src/main/org/h2/security/auth/impl/StaticUserCredentialsValidator.java +++ b/h2/src/main/org/h2/security/auth/impl/StaticUserCredentialsValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/main/org/h2/security/auth/impl/package.html b/h2/src/main/org/h2/security/auth/impl/package.html index 43bf02e024..429db14800 100644 --- a/h2/src/main/org/h2/security/auth/impl/package.html +++ b/h2/src/main/org/h2/security/auth/impl/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/security/auth/package.html b/h2/src/main/org/h2/security/auth/package.html index 43bf02e024..429db14800 100644 --- a/h2/src/main/org/h2/security/auth/package.html +++ b/h2/src/main/org/h2/security/auth/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/security/package.html b/h2/src/main/org/h2/security/package.html index bd8bc0daea..44e27d75a6 100644 --- a/h2/src/main/org/h2/security/package.html +++ b/h2/src/main/org/h2/security/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/Service.java b/h2/src/main/org/h2/server/Service.java index 1c1b328e2f..dfcd8b0ceb 100644 --- a/h2/src/main/org/h2/server/Service.java +++ b/h2/src/main/org/h2/server/Service.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/ShutdownHandler.java b/h2/src/main/org/h2/server/ShutdownHandler.java index 3cd379eacf..49b24d3dbc 100644 --- a/h2/src/main/org/h2/server/ShutdownHandler.java +++ b/h2/src/main/org/h2/server/ShutdownHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/TcpServer.java b/h2/src/main/org/h2/server/TcpServer.java index 26425d3e48..fe90ba41ba 100644 --- a/h2/src/main/org/h2/server/TcpServer.java +++ b/h2/src/main/org/h2/server/TcpServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -86,7 +86,8 @@ private void initManagementDb() throws SQLException { managementPassword = StringUtils.convertBytesToHex(MathUtils.secureRandomBytes(32)); } // avoid using the driver manager - JdbcConnection conn = new JdbcConnection("jdbc:h2:" + getManagementDbName(port), null, "", managementPassword); + JdbcConnection conn = new JdbcConnection("jdbc:h2:" + getManagementDbName(port), null, "", managementPassword, + false); managementDb = conn; try (Statement stat = conn.createStatement()) { @@ -446,7 +447,7 @@ public static synchronized void shutdown(String url, String password, } String db = getManagementDbName(port); for (int i = 0; i < 2; i++) { - try (JdbcConnection conn = new JdbcConnection("jdbc:h2:" + url + '/' + db, null, "", password)) { + try (JdbcConnection conn = new JdbcConnection("jdbc:h2:" + url + '/' + db, null, "", password, true)) { PreparedStatement prep = conn.prepareStatement("CALL STOP_SERVER(?, ?, ?)"); prep.setInt(1, all ? 0 : port); prep.setString(2, password); diff --git a/h2/src/main/org/h2/server/TcpServerThread.java b/h2/src/main/org/h2/server/TcpServerThread.java index e54e880a67..82c210f441 100644 --- a/h2/src/main/org/h2/server/TcpServerThread.java +++ b/h2/src/main/org/h2/server/TcpServerThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/package.html b/h2/src/main/org/h2/server/package.html index 00a46a7327..05dde64b0c 100644 --- a/h2/src/main/org/h2/server/package.html +++ b/h2/src/main/org/h2/server/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/pg/PgServer.java b/h2/src/main/org/h2/server/pg/PgServer.java index bf30e90ee7..94a59dd41d 100644 --- a/h2/src/main/org/h2/server/pg/PgServer.java +++ b/h2/src/main/org/h2/server/pg/PgServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/pg/PgServerThread.java b/h2/src/main/org/h2/server/pg/PgServerThread.java index acd6fb841c..aba652af6a 100644 --- a/h2/src/main/org/h2/server/pg/PgServerThread.java +++ b/h2/src/main/org/h2/server/pg/PgServerThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/pg/package.html b/h2/src/main/org/h2/server/pg/package.html index ee5d01bd49..0a3346d9f6 100644 --- a/h2/src/main/org/h2/server/pg/package.html +++ b/h2/src/main/org/h2/server/pg/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/ConnectionInfo.java b/h2/src/main/org/h2/server/web/ConnectionInfo.java index 0e58f9e395..2b6fcdb9ab 100644 --- a/h2/src/main/org/h2/server/web/ConnectionInfo.java +++ b/h2/src/main/org/h2/server/web/ConnectionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/web/DbStarter.java b/h2/src/main/org/h2/server/web/DbStarter.java index 20e56b273f..3cbb46515b 100644 --- a/h2/src/main/org/h2/server/web/DbStarter.java +++ b/h2/src/main/org/h2/server/web/DbStarter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/web/JakartaDbStarter.java b/h2/src/main/org/h2/server/web/JakartaDbStarter.java new file mode 100644 index 0000000000..1547672b97 --- /dev/null +++ b/h2/src/main/org/h2/server/web/JakartaDbStarter.java @@ -0,0 +1,93 @@ +/* + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, + * and the EPL 1.0 (https://h2database.com/html/license.html). + * Initial Developer: H2 Group + */ +package org.h2.server.web; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.Statement; + +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; + +import org.h2.tools.Server; +import org.h2.util.StringUtils; + +/** + * This class can be used to start the H2 TCP server (or other H2 servers, for + * example the PG server) inside a Jakarta web application container such as + * Tomcat or Jetty. It can also open a database connection. + */ +public class JakartaDbStarter implements ServletContextListener { + + private Connection conn; + private Server server; + + @Override + public void contextInitialized(ServletContextEvent servletContextEvent) { + try { + org.h2.Driver.load(); + + // This will get the setting from a context-param in web.xml if + // defined: + ServletContext servletContext = servletContextEvent.getServletContext(); + String url = getParameter(servletContext, "db.url", "jdbc:h2:~/test"); + String user = getParameter(servletContext, "db.user", "sa"); + String password = getParameter(servletContext, "db.password", "sa"); + + // Start the server if configured to do so + String serverParams = getParameter(servletContext, "db.tcpServer", null); + if (serverParams != null) { + String[] params = StringUtils.arraySplit(serverParams, ' ', true); + server = Server.createTcpServer(params); + server.start(); + } + + // To access the database in server mode, use the database URL: + // jdbc:h2:tcp://localhost/~/test + conn = DriverManager.getConnection(url, user, password); + servletContext.setAttribute("connection", conn); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static String getParameter(ServletContext servletContext, + String key, String defaultValue) { + String value = servletContext.getInitParameter(key); + return value == null ? defaultValue : value; + } + + /** + * Get the connection. + * + * @return the connection + */ + public Connection getConnection() { + return conn; + } + + @Override + public void contextDestroyed(ServletContextEvent servletContextEvent) { + try { + Statement stat = conn.createStatement(); + stat.execute("SHUTDOWN"); + stat.close(); + } catch (Exception e) { + e.printStackTrace(); + } + try { + conn.close(); + } catch (Exception e) { + e.printStackTrace(); + } + if (server != null) { + server.stop(); + server = null; + } + } + +} diff --git a/h2/src/main/org/h2/server/web/JakartaWebServlet.java b/h2/src/main/org/h2/server/web/JakartaWebServlet.java new file mode 100644 index 0000000000..260266e0e1 --- /dev/null +++ b/h2/src/main/org/h2/server/web/JakartaWebServlet.java @@ -0,0 +1,169 @@ +/* + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, + * and the EPL 1.0 (https://h2database.com/html/license.html). + * Initial Developer: H2 Group + */ +package org.h2.server.web; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.Properties; + +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import org.h2.util.NetworkConnectionInfo; + +/** + * This servlet lets the H2 Console be used in a Jakarta servlet container + * such as Tomcat or Jetty. + */ +public class JakartaWebServlet extends HttpServlet { + + private static final long serialVersionUID = 1L; + private transient WebServer server; + + @Override + public void init() { + ServletConfig config = getServletConfig(); + Enumeration en = config.getInitParameterNames(); + ArrayList list = new ArrayList<>(); + while (en.hasMoreElements()) { + String name = en.nextElement().toString(); + String value = config.getInitParameter(name); + if (!name.startsWith("-")) { + name = "-" + name; + } + list.add(name); + if (value.length() > 0) { + list.add(value); + } + } + String[] args = list.toArray(new String[0]); + server = new WebServer(); + server.setAllowChunked(false); + server.init(args); + } + + @Override + public void destroy() { + server.stop(); + } + + private boolean allow(HttpServletRequest req) { + if (server.getAllowOthers()) { + return true; + } + String addr = req.getRemoteAddr(); + try { + InetAddress address = InetAddress.getByName(addr); + return address.isLoopbackAddress(); + } catch (UnknownHostException | NoClassDefFoundError e) { + // Google App Engine does not allow java.net.InetAddress + return false; + } + + } + + private String getAllowedFile(HttpServletRequest req, String requestedFile) { + if (!allow(req)) { + return "notAllowed.jsp"; + } + if (requestedFile.length() == 0) { + return "index.do"; + } + return requestedFile; + } + + @Override + public void doGet(HttpServletRequest req, HttpServletResponse resp) + throws IOException { + req.setCharacterEncoding("utf-8"); + String file = req.getPathInfo(); + if (file == null) { + resp.sendRedirect(req.getRequestURI() + "/"); + return; + } else if (file.startsWith("/")) { + file = file.substring(1); + } + file = getAllowedFile(req, file); + + // extract the request attributes + Properties attributes = new Properties(); + Enumeration en = req.getAttributeNames(); + while (en.hasMoreElements()) { + String name = en.nextElement().toString(); + String value = req.getAttribute(name).toString(); + attributes.put(name, value); + } + en = req.getParameterNames(); + while (en.hasMoreElements()) { + String name = en.nextElement().toString(); + String value = req.getParameter(name); + attributes.put(name, value); + } + + WebSession session = null; + String sessionId = attributes.getProperty("jsessionid"); + if (sessionId != null) { + session = server.getSession(sessionId); + } + WebApp app = new WebApp(server); + app.setSession(session, attributes); + String ifModifiedSince = req.getHeader("if-modified-since"); + + String scheme = req.getScheme(); + StringBuilder builder = new StringBuilder(scheme).append("://").append(req.getServerName()); + int serverPort = req.getServerPort(); + if (!(serverPort == 80 && scheme.equals("http") || serverPort == 443 && scheme.equals("https"))) { + builder.append(':').append(serverPort); + } + String path = builder.append(req.getContextPath()).toString(); + file = app.processRequest(file, new NetworkConnectionInfo(path, req.getRemoteAddr(), req.getRemotePort())); + session = app.getSession(); + + String mimeType = app.getMimeType(); + boolean cache = app.getCache(); + + if (cache && server.getStartDateTime().equals(ifModifiedSince)) { + resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED); + return; + } + byte[] bytes = server.getFile(file); + if (bytes == null) { + resp.sendError(HttpServletResponse.SC_NOT_FOUND); + bytes = ("File not found: " + file).getBytes(StandardCharsets.UTF_8); + } else { + if (session != null && file.endsWith(".jsp")) { + String page = new String(bytes, StandardCharsets.UTF_8); + page = PageParser.parse(page, session.map); + bytes = page.getBytes(StandardCharsets.UTF_8); + } + resp.setContentType(mimeType); + if (!cache) { + resp.setHeader("Cache-Control", "no-cache"); + } else { + resp.setHeader("Cache-Control", "max-age=10"); + resp.setHeader("Last-Modified", server.getStartDateTime()); + } + } + if (bytes != null) { + ServletOutputStream out = resp.getOutputStream(); + out.write(bytes); + } + } + + @Override + public void doPost(HttpServletRequest req, HttpServletResponse resp) + throws IOException { + doGet(req, resp); + } + +} diff --git a/h2/src/main/org/h2/server/web/PageParser.java b/h2/src/main/org/h2/server/web/PageParser.java index 006c4d5fb6..78f8036d99 100644 --- a/h2/src/main/org/h2/server/web/PageParser.java +++ b/h2/src/main/org/h2/server/web/PageParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/web/WebApp.java b/h2/src/main/org/h2/server/web/WebApp.java index 7a67d94b02..945403679c 100644 --- a/h2/src/main/org/h2/server/web/WebApp.java +++ b/h2/src/main/org/h2/server/web/WebApp.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -382,7 +382,7 @@ private String autoCompleteList() { if (query.endsWith("\n") || tQuery.endsWith(";")) { list.add(0, "1#(Newline)#\n"); } - result = StringUtils.join(new StringBuilder(), list, "|").toString(); + result = String.join("|", list); } session.put("autoCompleteList", result); } catch (Throwable e) { @@ -394,6 +394,7 @@ private String autoCompleteList() { private String admin() { session.put("port", Integer.toString(server.getPort())); session.put("allowOthers", Boolean.toString(server.getAllowOthers())); + session.put("webExternalNames", server.getExternalNames()); session.put("ssl", String.valueOf(server.getSSL())); session.put("sessions", server.getSessions()); return "admin.jsp"; @@ -408,6 +409,9 @@ private String adminSave() { boolean allowOthers = Utils.parseBoolean((String) attributes.get("allowOthers"), false, false); prop.setProperty("webAllowOthers", String.valueOf(allowOthers)); server.setAllowOthers(allowOthers); + String externalNames = (String) attributes.get("webExternalNames"); + prop.setProperty("webExternalNames", externalNames); + server.setExternalNames(externalNames); boolean ssl = Utils.parseBoolean((String) attributes.get("ssl"), false, false); prop.setProperty("webSSL", String.valueOf(ssl)); server.setSSL(ssl); diff --git a/h2/src/main/org/h2/server/web/WebServer.java b/h2/src/main/org/h2/server/web/WebServer.java index ffa2653bc5..73d17644da 100644 --- a/h2/src/main/org/h2/server/web/WebServer.java +++ b/h2/src/main/org/h2/server/web/WebServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -159,6 +159,7 @@ public class WebServer implements Service { // private URLClassLoader urlClassLoader; private int port; private boolean allowOthers; + private String externalNames; private boolean isDaemon; private final Set running = Collections.synchronizedSet(new HashSet()); @@ -171,6 +172,7 @@ public class WebServer implements Service { private final HashSet languages = new HashSet<>(); private String startDateTime; private ServerSocket serverSocket; + private String host; private String url; private ShutdownHandler shutdownHandler; private Thread listenerThread; @@ -189,6 +191,7 @@ public class WebServer implements Service { * * @param file the file name * @return the data + * @throws IOException on failure */ byte[] getFile(String file) throws IOException { trace("getFile <" + file + ">"); @@ -318,6 +321,7 @@ public void init(String... args) { "webSSL", false); allowOthers = SortedProperties.getBooleanProperty(prop, "webAllowOthers", false); + setExternalNames(SortedProperties.getStringProperty(prop, "webExternalNames", null)); setAdminPassword(SortedProperties.getStringProperty(prop, "webAdminPassword", null)); commandHistoryString = prop.getProperty(COMMAND_HISTORY); for (int i = 0; args != null && i < args.length; i++) { @@ -328,6 +332,8 @@ public void init(String... args) { ssl = true; } else if (Tool.isOption(a, "-webAllowOthers")) { allowOthers = true; + } else if (Tool.isOption(a, "-webExternalNames")) { + setExternalNames(args[++i]); } else if (Tool.isOption(a, "-webDaemon")) { isDaemon = true; } else if (Tool.isOption(a, "-baseDir")) { @@ -374,10 +380,21 @@ public String getURL() { return url; } + /** + * @return host name + */ + public String getHost() { + if (host == null) { + updateURL(); + } + return host; + } + private void updateURL() { try { + host = StringUtils.toLowerEnglish(NetUtils.getLocalAddress()); StringBuilder builder = new StringBuilder(ssl ? "https" : "http").append("://") - .append(NetUtils.getLocalAddress()).append(':').append(port); + .append(host).append(':').append(port); if (key != null && serverSocket != null) { builder.append("?key=").append(key); } @@ -550,6 +567,14 @@ public boolean getAllowOthers() { return allowOthers; } + void setExternalNames(String externalNames) { + this.externalNames = externalNames != null ? StringUtils.toLowerEnglish(externalNames) : null; + } + + String getExternalNames() { + return externalNames; + } + void setSSL(boolean b) { ssl = b; } @@ -730,6 +755,9 @@ synchronized void saveProperties(Properties prop) { Integer.toString(SortedProperties.getIntProperty(old, "webPort", port))); prop.setProperty("webAllowOthers", Boolean.toString(SortedProperties.getBooleanProperty(old, "webAllowOthers", allowOthers))); + if (externalNames != null) { + prop.setProperty("webExternalNames", externalNames); + } prop.setProperty("webSSL", Boolean.toString(SortedProperties.getBooleanProperty(old, "webSSL", ssl))); if (adminPassword != null) { @@ -768,21 +796,16 @@ synchronized void saveProperties(Properties prop) { * @param userKey the key of privileged user * @param networkConnectionInfo the network connection information * @return the database connection + * @throws SQLException on failure */ Connection getConnection(String driver, String databaseUrl, String user, String password, String userKey, NetworkConnectionInfo networkConnectionInfo) throws SQLException { driver = driver.trim(); databaseUrl = databaseUrl.trim(); - if (databaseUrl.startsWith("jdbc:h2:")) { - if (!allowSecureCreation || key == null || !key.equals(userKey)) { - if (ifExists) { - databaseUrl += ";FORBID_CREATION=TRUE"; - } - } - } // do not trim the password, otherwise an // encrypted H2 database with empty user password doesn't work - return JdbcUtils.getConnection(driver, databaseUrl, user.trim(), password, networkConnectionInfo); + return JdbcUtils.getConnection(driver, databaseUrl, user.trim(), password, networkConnectionInfo, + ifExists && (!allowSecureCreation || key == null || !key.equals(userKey))); } /** diff --git a/h2/src/main/org/h2/server/web/WebServlet.java b/h2/src/main/org/h2/server/web/WebServlet.java index f328b3969e..752cf6bbc6 100644 --- a/h2/src/main/org/h2/server/web/WebServlet.java +++ b/h2/src/main/org/h2/server/web/WebServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/web/WebSession.java b/h2/src/main/org/h2/server/web/WebSession.java index 1be01a6781..bda717d1a0 100644 --- a/h2/src/main/org/h2/server/web/WebSession.java +++ b/h2/src/main/org/h2/server/web/WebSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/web/WebThread.java b/h2/src/main/org/h2/server/web/WebThread.java index 60abc49402..2c6a7fd6b5 100644 --- a/h2/src/main/org/h2/server/web/WebThread.java +++ b/h2/src/main/org/h2/server/web/WebThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -9,6 +9,7 @@ import java.io.BufferedOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.InterruptedIOException; import java.io.OutputStream; import java.net.Socket; import java.net.UnknownHostException; @@ -32,10 +33,16 @@ */ class WebThread extends WebApp implements Runnable { + private static final byte[] RN = { '\r', '\n' }; + + private static final byte[] RNRN = { '\r', '\n', '\r', '\n' }; + protected OutputStream output; protected final Socket socket; private final Thread thread; private InputStream input; + private String host; + private int dataLength; private String ifModifiedSince; WebThread(Socket socket, WebServer server) { @@ -55,6 +62,7 @@ void start() { * Wait until the thread is stopped. * * @param millis the maximum number of milliseconds to wait + * @throws InterruptedException if interrupted */ void join(int millis) throws InterruptedException { thread.join(millis); @@ -111,112 +119,159 @@ public void run() { @SuppressWarnings("unchecked") private boolean process() throws IOException { - boolean keepAlive = false; String head = readHeaderLine(); - if (head.startsWith("GET ") || head.startsWith("POST ")) { - int begin = head.indexOf('/'), end = head.lastIndexOf(' '); - String file; - if (begin < 0 || end < begin) { - file = ""; - } else { - file = StringUtils.trimSubstring(head, begin + 1, end); - } - trace(head + ": " + file); - file = getAllowedFile(file); - attributes = new Properties(); - int paramIndex = file.indexOf('?'); - session = null; - String key = null; - if (paramIndex >= 0) { - String attrib = file.substring(paramIndex + 1); - parseAttributes(attrib); - String sessionId = attributes.getProperty("jsessionid"); - key = attributes.getProperty("key"); - file = file.substring(0, paramIndex); - session = server.getSession(sessionId); - } - keepAlive = parseHeader(); - file = processRequest(file, - new NetworkConnectionInfo( - NetUtils.ipToShortForm(new StringBuilder(server.getSSL() ? "https://" : "http://"), - socket.getLocalAddress().getAddress(), true) // - .append(':').append(socket.getLocalPort()).toString(), // - socket.getInetAddress().getAddress(), socket.getPort(), null)); - if (file.length() == 0) { - // asynchronous request - return true; + boolean get = head.startsWith("GET "); + if ((!get && !head.startsWith("POST ")) || !head.endsWith(" HTTP/1.1")) { + writeSimple("HTTP/1.1 400 Bad Request", "Bad request"); + return false; + } + String file = StringUtils.trimSubstring(head, get ? 4 : 5, head.length() - 9); + if (file.isEmpty() || file.charAt(0) != '/') { + writeSimple("HTTP/1.1 400 Bad Request", "Bad request"); + return false; + } + attributes = new Properties(); + boolean keepAlive = parseHeader(); + if (!checkHost(host)) { + return false; + } + file = file.substring(1); + trace(head + ": " + file); + file = getAllowedFile(file); + int paramIndex = file.indexOf('?'); + session = null; + String key = null; + if (paramIndex >= 0) { + String attrib = file.substring(paramIndex + 1); + parseAttributes(attrib); + String sessionId = attributes.getProperty("jsessionid"); + key = attributes.getProperty("key"); + file = file.substring(0, paramIndex); + session = server.getSession(sessionId); + } + parseBodyAttributes(); + file = processRequest(file, + new NetworkConnectionInfo( + NetUtils.ipToShortForm(new StringBuilder(server.getSSL() ? "https://" : "http://"), + socket.getLocalAddress().getAddress(), true) // + .append(':').append(socket.getLocalPort()).toString(), // + socket.getInetAddress().getAddress(), socket.getPort(), null)); + if (file.length() == 0) { + // asynchronous request + return true; + } + String message; + if (cache && ifModifiedSince != null && ifModifiedSince.equals(server.getStartDateTime())) { + writeSimple("HTTP/1.1 304 Not Modified", (byte[]) null); + return keepAlive; + } + byte[] bytes = server.getFile(file); + if (bytes == null) { + writeSimple("HTTP/1.1 404 Not Found", "File not found: " + file); + return keepAlive; + } + if (session != null && file.endsWith(".jsp")) { + if (key != null) { + session.put("key", key); } - String message; - byte[] bytes; - if (cache && ifModifiedSince != null && - ifModifiedSince.equals(server.getStartDateTime())) { - bytes = null; - message = "HTTP/1.1 304 Not Modified\r\n"; - } else { - bytes = server.getFile(file); - if (bytes == null) { - message = "HTTP/1.1 404 Not Found\r\n"; - bytes = ("File not found: " + file).getBytes(StandardCharsets.UTF_8); - message += "Content-Length: " + bytes.length + "\r\n"; - } else { - if (session != null && file.endsWith(".jsp")) { - if (key != null) { - session.put("key", key); - } - String page = new String(bytes, StandardCharsets.UTF_8); - if (SysProperties.CONSOLE_STREAM) { - Iterator it = (Iterator) session.map.remove("chunks"); - if (it != null) { - message = "HTTP/1.1 200 OK\r\n"; - message += "Content-Type: " + mimeType + "\r\n"; - message += "Cache-Control: no-cache\r\n"; - message += "Transfer-Encoding: chunked\r\n"; - message += "\r\n"; - trace(message); - output.write(message.getBytes()); - while (it.hasNext()) { - String s = it.next(); - s = PageParser.parse(s, session.map); - bytes = s.getBytes(StandardCharsets.UTF_8); - if (bytes.length == 0) { - continue; - } - output.write(Integer.toHexString(bytes.length).getBytes()); - output.write("\r\n".getBytes()); - output.write(bytes); - output.write("\r\n".getBytes()); - output.flush(); - } - output.write("0\r\n\r\n".getBytes()); - output.flush(); - return keepAlive; - } - } - page = PageParser.parse(page, session.map); - bytes = page.getBytes(StandardCharsets.UTF_8); - } + String page = new String(bytes, StandardCharsets.UTF_8); + if (SysProperties.CONSOLE_STREAM) { + Iterator it = (Iterator) session.map.remove("chunks"); + if (it != null) { message = "HTTP/1.1 200 OK\r\n"; message += "Content-Type: " + mimeType + "\r\n"; - if (!cache) { - message += "Cache-Control: no-cache\r\n"; - } else { - message += "Cache-Control: max-age=10\r\n"; - message += "Last-Modified: " + server.getStartDateTime() + "\r\n"; + message += "Cache-Control: no-cache\r\n"; + message += "Transfer-Encoding: chunked\r\n"; + message += "\r\n"; + trace(message); + output.write(message.getBytes(StandardCharsets.ISO_8859_1)); + while (it.hasNext()) { + String s = it.next(); + s = PageParser.parse(s, session.map); + bytes = s.getBytes(StandardCharsets.UTF_8); + if (bytes.length == 0) { + continue; + } + output.write(Integer.toHexString(bytes.length).getBytes(StandardCharsets.ISO_8859_1)); + output.write(RN); + output.write(bytes); + output.write(RN); + output.flush(); } - message += "Content-Length: " + bytes.length + "\r\n"; + output.write('0'); + output.write(RNRN); + output.flush(); + return keepAlive; } } - message += "\r\n"; - trace(message); - output.write(message.getBytes()); - if (bytes != null) { - output.write(bytes); - } - output.flush(); + page = PageParser.parse(page, session.map); + bytes = page.getBytes(StandardCharsets.UTF_8); + } + message = "HTTP/1.1 200 OK\r\n"; + message += "Content-Type: " + mimeType + "\r\n"; + if (!cache) { + message += "Cache-Control: no-cache\r\n"; + } else { + message += "Cache-Control: max-age=10\r\n"; + message += "Last-Modified: " + server.getStartDateTime() + "\r\n"; } + message += "Content-Length: " + bytes.length + "\r\n"; + message += "\r\n"; + trace(message); + output.write(message.getBytes(StandardCharsets.ISO_8859_1)); + output.write(bytes); + output.flush(); return keepAlive; } + private void writeSimple(String status, String text) throws IOException { + writeSimple(status, text != null ? text.getBytes(StandardCharsets.UTF_8) : null); + } + + private void writeSimple(String status, byte[] bytes) throws IOException { + trace(status); + output.write(status.getBytes(StandardCharsets.ISO_8859_1)); + if (bytes != null) { + output.write(RN); + String contentLength = "Content-Length: " + bytes.length; + trace(contentLength); + output.write(contentLength.getBytes(StandardCharsets.ISO_8859_1)); + output.write(RNRN); + output.write(bytes); + } else { + output.write(RNRN); + } + output.flush(); + } + + private boolean checkHost(String host) throws IOException { + if (host == null) { + writeSimple("HTTP/1.1 400 Bad Request", "Bad request"); + return false; + } + int index = host.indexOf(':'); + if (index >= 0) { + host = host.substring(0, index); + } + if (host.isEmpty()) { + return false; + } + host = StringUtils.toLowerEnglish(host); + if (host.equals(server.getHost()) || host.equals("localhost") || host.equals("127.0.0.1")) { + return true; + } + String externalNames = server.getExternalNames(); + if (externalNames != null && !externalNames.isEmpty()) { + for (String s : externalNames.split(",")) { + if (host.equals(s.trim())) { + return true; + } + } + } + writeSimple("HTTP/1.1 404 Not Found", "Host " + host + " not found"); + return false; + } + private String readHeaderLine() throws IOException { StringBuilder buff = new StringBuilder(); while (true) { @@ -235,6 +290,17 @@ private String readHeaderLine() throws IOException { } } + private void parseBodyAttributes() throws IOException { + if (dataLength > 0) { + byte[] bytes = Utils.newBytes(dataLength); + for (int pos = 0; pos < dataLength;) { + pos += input.read(bytes, pos, dataLength - pos); + } + String s = new String(bytes, StandardCharsets.UTF_8); + parseAttributes(s); + } + } + private void parseAttributes(String s) { trace("data=" + s); while (s != null) { @@ -263,16 +329,15 @@ private boolean parseHeader() throws IOException { boolean keepAlive = false; trace("parseHeader"); int len = 0; + host = null; ifModifiedSince = null; boolean multipart = false; - while (true) { - String line = readHeaderLine(); - if (line == null) { - break; - } + for (String line; (line = readHeaderLine()) != null;) { trace(" " + line); String lower = StringUtils.toLowerEnglish(line); - if (lower.startsWith("if-modified-since")) { + if (lower.startsWith("host")) { + host = getHeaderLineValue(line); + } else if (lower.startsWith("if-modified-since")) { ifModifiedSince = getHeaderLineValue(line); } else if (lower.startsWith("connection")) { String conn = getHeaderLineValue(line); @@ -327,15 +392,11 @@ private boolean parseHeader() throws IOException { break; } } + dataLength = 0; if (multipart) { // not supported - } else if (session != null && len > 0) { - byte[] bytes = Utils.newBytes(len); - for (int pos = 0; pos < len;) { - pos += input.read(bytes, pos, len - pos); - } - String s = new String(bytes); - parseAttributes(s); + } else if (len > 0) { + dataLength = len; } return keepAlive; } diff --git a/h2/src/main/org/h2/server/web/package.html b/h2/src/main/org/h2/server/web/package.html index f2a5b051f4..4eab3b2de8 100644 --- a/h2/src/main/org/h2/server/web/package.html +++ b/h2/src/main/org/h2/server/web/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/_text_cs.prop b/h2/src/main/org/h2/server/web/res/_text_cs.prop index 2126edefac..4e082236b1 100644 --- a/h2/src/main/org/h2/server/web/res/_text_cs.prop +++ b/h2/src/main/org/h2/server/web/res/_text_cs.prop @@ -25,6 +25,7 @@ adminLoginCancel=Zrušit adminLoginOk=OK adminLogout=Odhlásit adminOthers=Povolit připojení z jiných počítačů +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Číslo portu adminPortWeb=Číslo portu webového serveru adminRestart=Změny se projeví po restartu serveru. diff --git a/h2/src/main/org/h2/server/web/res/_text_de.prop b/h2/src/main/org/h2/server/web/res/_text_de.prop index ada6964e14..846bcbd3ff 100644 --- a/h2/src/main/org/h2/server/web/res/_text_de.prop +++ b/h2/src/main/org/h2/server/web/res/_text_de.prop @@ -25,6 +25,7 @@ adminLoginCancel=Abbrechen adminLoginOk=OK adminLogout=Beenden adminOthers=Verbindungen von anderen Computern erlauben +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Admin Port adminPortWeb=Web-Server Port adminRestart=Änderungen werden nach einem Neustart des Servers aktiv. diff --git a/h2/src/main/org/h2/server/web/res/_text_en.prop b/h2/src/main/org/h2/server/web/res/_text_en.prop index 23d49bb328..b6f0fb8a0c 100644 --- a/h2/src/main/org/h2/server/web/res/_text_en.prop +++ b/h2/src/main/org/h2/server/web/res/_text_en.prop @@ -25,6 +25,7 @@ adminLoginCancel=Cancel adminLoginOk=OK adminLogout=Logout adminOthers=Allow connections from other computers +adminWebExternalNames=External names or addresses of this server (comma-separated) adminPort=Port number adminPortWeb=Web server port number adminRestart=Changes take effect after restarting the server. diff --git a/h2/src/main/org/h2/server/web/res/_text_es.prop b/h2/src/main/org/h2/server/web/res/_text_es.prop index 8f1e1c576e..8e41b66ce5 100644 --- a/h2/src/main/org/h2/server/web/res/_text_es.prop +++ b/h2/src/main/org/h2/server/web/res/_text_es.prop @@ -25,6 +25,7 @@ adminLoginCancel=Cancelar adminLoginOk=Aceptar adminLogout=Desconectar adminOthers=Permitir conexiones desde otros ordenadores +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Puerto adminPortWeb=Puerto del servidor Web adminRestart=Los cambios tendrán efecto al reiniciar el servidor. diff --git a/h2/src/main/org/h2/server/web/res/_text_fr.prop b/h2/src/main/org/h2/server/web/res/_text_fr.prop index 8380c479c8..792f72ecf8 100644 --- a/h2/src/main/org/h2/server/web/res/_text_fr.prop +++ b/h2/src/main/org/h2/server/web/res/_text_fr.prop @@ -25,6 +25,7 @@ adminLoginCancel=Annuler adminLoginOk=OK adminLogout=Déconnexion adminOthers=Autoriser les connexions d'ordinateurs distants +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Numéro de port adminPortWeb=Numéro de port du serveur Web adminRestart=Modifications effectuées après redémarrage du serveur. diff --git a/h2/src/main/org/h2/server/web/res/_text_hi.prop b/h2/src/main/org/h2/server/web/res/_text_hi.prop index 553146ca06..a7d8a05293 100644 --- a/h2/src/main/org/h2/server/web/res/_text_hi.prop +++ b/h2/src/main/org/h2/server/web/res/_text_hi.prop @@ -25,6 +25,7 @@ adminLoginCancel=रद्द करना adminLoginOk=ठीक adminLogout=लोग आउट adminOthers=अन्य कंप्यूटर से कनेक्शन की अनुमति दें +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=पोर्ट नंबर adminPortWeb=वेब सर्वर पोर्ट नंबर adminRestart=सर्वर को पुनरारंभ करने के बाद परिवर्तन प्रभावी होते हैं। diff --git a/h2/src/main/org/h2/server/web/res/_text_hu.prop b/h2/src/main/org/h2/server/web/res/_text_hu.prop index 56aeddfbcc..1406ed0e2b 100644 --- a/h2/src/main/org/h2/server/web/res/_text_hu.prop +++ b/h2/src/main/org/h2/server/web/res/_text_hu.prop @@ -25,6 +25,7 @@ adminLoginCancel=Mégse adminLoginOk=OK adminLogout=Kilépés adminOthers=Más számítógépekről kezdeményezett kapcsolatok engedélyezése +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=#Port number adminPortWeb=Webkiszolgáló portszáma adminRestart=A változtatások a kiszolgáló újraindítása után lépnek érvénybe diff --git a/h2/src/main/org/h2/server/web/res/_text_in.prop b/h2/src/main/org/h2/server/web/res/_text_in.prop index 8a569cb42e..e954ac7a4d 100644 --- a/h2/src/main/org/h2/server/web/res/_text_in.prop +++ b/h2/src/main/org/h2/server/web/res/_text_in.prop @@ -25,6 +25,7 @@ adminLoginCancel=Batal adminLoginOk=OK adminLogout=Keluar adminOthers=Ijinkan koneksi dari komputer lain +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Nomor port adminPortWeb=Nomor port web server adminRestart=Perubahan akan efektif setelah server di-restart. diff --git a/h2/src/main/org/h2/server/web/res/_text_it.prop b/h2/src/main/org/h2/server/web/res/_text_it.prop index ac32ed9406..73fa39f5e5 100644 --- a/h2/src/main/org/h2/server/web/res/_text_it.prop +++ b/h2/src/main/org/h2/server/web/res/_text_it.prop @@ -25,6 +25,7 @@ adminLoginCancel=Annulla adminLoginOk=OK adminLogout=Disconnessione adminOthers=Abilita connessioni da altri computers +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Numero di porta adminPortWeb=Numero di porta del server Web adminRestart=Le modifiche saranno effettive dopo il riavvio del server. diff --git a/h2/src/main/org/h2/server/web/res/_text_ja.prop b/h2/src/main/org/h2/server/web/res/_text_ja.prop index e16f17ae4b..f998bfda46 100644 --- a/h2/src/main/org/h2/server/web/res/_text_ja.prop +++ b/h2/src/main/org/h2/server/web/res/_text_ja.prop @@ -25,6 +25,7 @@ adminLoginCancel=キャンセル adminLoginOk=OK adminLogout=ログアウト adminOthers=他のコンピュータからの接続を許可 +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=ポート番号 adminPortWeb=Webサーバポート番号 adminRestart=変更はサーバの再起動後に有効になります。 diff --git a/h2/src/main/org/h2/server/web/res/_text_ko.prop b/h2/src/main/org/h2/server/web/res/_text_ko.prop index 780072c65d..cfa58eb3bf 100644 --- a/h2/src/main/org/h2/server/web/res/_text_ko.prop +++ b/h2/src/main/org/h2/server/web/res/_text_ko.prop @@ -25,6 +25,7 @@ adminLoginCancel=취소 adminLoginOk=확인 adminLogout=로그아웃 adminOthers=다른 컴퓨터에서의 연결 허가 +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=포트 번호 adminPortWeb=웹 서버 포트 번호 adminRestart=변경 사항은 서버 재시작 후 반영됩니다. diff --git a/h2/src/main/org/h2/server/web/res/_text_nl.prop b/h2/src/main/org/h2/server/web/res/_text_nl.prop index ccea089d33..5c04618251 100644 --- a/h2/src/main/org/h2/server/web/res/_text_nl.prop +++ b/h2/src/main/org/h2/server/web/res/_text_nl.prop @@ -25,6 +25,7 @@ adminLoginCancel=Annuleren adminLoginOk=OK adminLogout=Uitloggen adminOthers=Sta verbindingen vanaf andere computers toe +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Poortnummer adminPortWeb=Webserver poortnummer adminRestart=Wijzigingen worden doorgevoerd na herstarten server diff --git a/h2/src/main/org/h2/server/web/res/_text_pl.prop b/h2/src/main/org/h2/server/web/res/_text_pl.prop index 0c10899fef..b13069bc0c 100644 --- a/h2/src/main/org/h2/server/web/res/_text_pl.prop +++ b/h2/src/main/org/h2/server/web/res/_text_pl.prop @@ -25,6 +25,7 @@ adminLoginCancel=Anuluj adminLoginOk=OK adminLogout=Wyloguj adminOthers=Pozwalaj na połączenia zdalne +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Numer portu adminPortWeb=Numer portu serwera Web adminRestart=Zmiany będą widoczne po zrestartowaniu serwera. diff --git a/h2/src/main/org/h2/server/web/res/_text_pt_br.prop b/h2/src/main/org/h2/server/web/res/_text_pt_br.prop index 64ef3d7d21..56516c98c8 100644 --- a/h2/src/main/org/h2/server/web/res/_text_pt_br.prop +++ b/h2/src/main/org/h2/server/web/res/_text_pt_br.prop @@ -25,6 +25,7 @@ adminLoginCancel=Cancelar adminLoginOk=Confirmar adminLogout=Sair adminOthers=Permitir conexões de outros computadores na rede +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Número da porta adminPortWeb=Número da porta do servidor adminRestart=As alterações serão aplicadas depois de reiniciar o servidor. diff --git a/h2/src/main/org/h2/server/web/res/_text_pt_pt.prop b/h2/src/main/org/h2/server/web/res/_text_pt_pt.prop index 205084a6ac..3323f3b3a1 100644 --- a/h2/src/main/org/h2/server/web/res/_text_pt_pt.prop +++ b/h2/src/main/org/h2/server/web/res/_text_pt_pt.prop @@ -25,6 +25,7 @@ adminLoginCancel=Cancelar adminLoginOk=Confirmar adminLogout=Sair adminOthers=Permitir conexões a partir de outro computador na rede +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Número do porto adminPortWeb=Número do porto do servidor adminRestart=As alterações apenas serão aplicadas após reiniciar o servidor. diff --git a/h2/src/main/org/h2/server/web/res/_text_ru.prop b/h2/src/main/org/h2/server/web/res/_text_ru.prop index 9e3c683b0d..4f23c8aa0d 100644 --- a/h2/src/main/org/h2/server/web/res/_text_ru.prop +++ b/h2/src/main/org/h2/server/web/res/_text_ru.prop @@ -25,6 +25,7 @@ adminLoginCancel=Отменить adminLoginOk=OK adminLogout=Выход adminOthers=Разрешить удаленные подключения +adminWebExternalNames=Внешние имена или адреса этого сервера (через запятую) adminPort=Номер порта adminPortWeb=Порт web-сервера adminRestart=Изменения вступят в силу после перезагрузки сервера. diff --git a/h2/src/main/org/h2/server/web/res/_text_sk.prop b/h2/src/main/org/h2/server/web/res/_text_sk.prop index 2d9c227666..a4f11dba77 100644 --- a/h2/src/main/org/h2/server/web/res/_text_sk.prop +++ b/h2/src/main/org/h2/server/web/res/_text_sk.prop @@ -25,6 +25,7 @@ adminLoginCancel=Zrušiť adminLoginOk=OK adminLogout=Odhlásiť adminOthers=Povoliť pripojenia z iných počítačov +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Číslo portu adminPortWeb=Číslo portu Web servera adminRestart=Zmeny sa vykonajú po reštarte servera diff --git a/h2/src/main/org/h2/server/web/res/_text_tr.prop b/h2/src/main/org/h2/server/web/res/_text_tr.prop index deac77695c..80aed9ffbc 100644 --- a/h2/src/main/org/h2/server/web/res/_text_tr.prop +++ b/h2/src/main/org/h2/server/web/res/_text_tr.prop @@ -25,6 +25,7 @@ adminLoginCancel=İptal et adminLoginOk=Tamam adminLogout=Bitir adminOthers=Başka bilgisayarlardan, veri tabanına bağlanma izni ver +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Port adminPortWeb=Web-Server Port adminRestart=Değişiklikler veri tabanı hizmetçisinin yeniden başlatılmasıyla etkinlik kazanacak. diff --git a/h2/src/main/org/h2/server/web/res/_text_uk.prop b/h2/src/main/org/h2/server/web/res/_text_uk.prop index 8b32ea913a..3c71e5d54c 100644 --- a/h2/src/main/org/h2/server/web/res/_text_uk.prop +++ b/h2/src/main/org/h2/server/web/res/_text_uk.prop @@ -25,6 +25,7 @@ adminLoginCancel=Відмінити adminLoginOk=OK adminLogout=Завершення сеансу adminOthers=Дозволити під'єднання з інших копм'ютерів +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=Номер порта adminPortWeb=Номер порта веб сервера adminRestart=Зміни вступлять в силу після перезавантаження сервера. diff --git a/h2/src/main/org/h2/server/web/res/_text_zh_cn.prop b/h2/src/main/org/h2/server/web/res/_text_zh_cn.prop index aac9fffdf9..5dabdcd54d 100644 --- a/h2/src/main/org/h2/server/web/res/_text_zh_cn.prop +++ b/h2/src/main/org/h2/server/web/res/_text_zh_cn.prop @@ -25,6 +25,7 @@ adminLoginCancel=取消 adminLoginOk=确认 adminLogout=注销 adminOthers=允许来自其他远程计算机的连接 +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=端口号 adminPortWeb=Web 服务器端口号 adminRestart=更新配置将在重启服务器后生效. diff --git a/h2/src/main/org/h2/server/web/res/_text_zh_tw.prop b/h2/src/main/org/h2/server/web/res/_text_zh_tw.prop index cd3f35eb38..6e726c8271 100644 --- a/h2/src/main/org/h2/server/web/res/_text_zh_tw.prop +++ b/h2/src/main/org/h2/server/web/res/_text_zh_tw.prop @@ -25,6 +25,7 @@ adminLoginCancel=取消 adminLoginOk=確定 adminLogout=登出 adminOthers=允許來自其他電腦的連接 +adminWebExternalNames=#External names or addresses of this server (comma-separated) adminPort=通訊埠 adminPortWeb=Web 伺服器的通訊埠 adminRestart=伺服器重新啟動後修改才會生效. diff --git a/h2/src/main/org/h2/server/web/res/admin.jsp b/h2/src/main/org/h2/server/web/res/admin.jsp index 452ab6d79a..f9b3ae2337 100644 --- a/h2/src/main/org/h2/server/web/res/admin.jsp +++ b/h2/src/main/org/h2/server/web/res/admin.jsp @@ -1,6 +1,6 @@ @@ -39,6 +39,10 @@ Initial Developer: H2 Group ${text.adminOthers}

    +

    + ${text.adminWebExternalNames}:
    + +

    ${text.adminConnection}

    diff --git a/h2/src/main/org/h2/server/web/res/adminLogin.jsp b/h2/src/main/org/h2/server/web/res/adminLogin.jsp index 51183bb0f7..4f13e87478 100644 --- a/h2/src/main/org/h2/server/web/res/adminLogin.jsp +++ b/h2/src/main/org/h2/server/web/res/adminLogin.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/error.jsp b/h2/src/main/org/h2/server/web/res/error.jsp index 9c66c09869..f0f26fe6b5 100644 --- a/h2/src/main/org/h2/server/web/res/error.jsp +++ b/h2/src/main/org/h2/server/web/res/error.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/frame.jsp b/h2/src/main/org/h2/server/web/res/frame.jsp index 09fe26445b..224b6a3f60 100644 --- a/h2/src/main/org/h2/server/web/res/frame.jsp +++ b/h2/src/main/org/h2/server/web/res/frame.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/header.jsp b/h2/src/main/org/h2/server/web/res/header.jsp index dbc29d91b6..5edb39866b 100644 --- a/h2/src/main/org/h2/server/web/res/header.jsp +++ b/h2/src/main/org/h2/server/web/res/header.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/help.jsp b/h2/src/main/org/h2/server/web/res/help.jsp index 973c868407..c5d9421bc7 100644 --- a/h2/src/main/org/h2/server/web/res/help.jsp +++ b/h2/src/main/org/h2/server/web/res/help.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/helpTranslate.jsp b/h2/src/main/org/h2/server/web/res/helpTranslate.jsp index 54c6dcafff..2df2f6b0af 100644 --- a/h2/src/main/org/h2/server/web/res/helpTranslate.jsp +++ b/h2/src/main/org/h2/server/web/res/helpTranslate.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/index.jsp b/h2/src/main/org/h2/server/web/res/index.jsp index 67ece316c2..d4577b3cd6 100644 --- a/h2/src/main/org/h2/server/web/res/index.jsp +++ b/h2/src/main/org/h2/server/web/res/index.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/login.jsp b/h2/src/main/org/h2/server/web/res/login.jsp index 4d74f4bad0..ab9483f83b 100644 --- a/h2/src/main/org/h2/server/web/res/login.jsp +++ b/h2/src/main/org/h2/server/web/res/login.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/notAllowed.jsp b/h2/src/main/org/h2/server/web/res/notAllowed.jsp index f7ec9dc2e4..bb4b34fb33 100644 --- a/h2/src/main/org/h2/server/web/res/notAllowed.jsp +++ b/h2/src/main/org/h2/server/web/res/notAllowed.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/query.jsp b/h2/src/main/org/h2/server/web/res/query.jsp index 04c6d0f5f4..a177c03448 100644 --- a/h2/src/main/org/h2/server/web/res/query.jsp +++ b/h2/src/main/org/h2/server/web/res/query.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/result.jsp b/h2/src/main/org/h2/server/web/res/result.jsp index b27be4d297..72a4ace4b3 100644 --- a/h2/src/main/org/h2/server/web/res/result.jsp +++ b/h2/src/main/org/h2/server/web/res/result.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/stylesheet.css b/h2/src/main/org/h2/server/web/res/stylesheet.css index f605ae51cc..8d217a060e 100644 --- a/h2/src/main/org/h2/server/web/res/stylesheet.css +++ b/h2/src/main/org/h2/server/web/res/stylesheet.css @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/web/res/table.js b/h2/src/main/org/h2/server/web/res/table.js index 21663cf09d..841b3dad9b 100644 --- a/h2/src/main/org/h2/server/web/res/table.js +++ b/h2/src/main/org/h2/server/web/res/table.js @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/server/web/res/tables.jsp b/h2/src/main/org/h2/server/web/res/tables.jsp index bf1964b064..229c0219d5 100644 --- a/h2/src/main/org/h2/server/web/res/tables.jsp +++ b/h2/src/main/org/h2/server/web/res/tables.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/tools.jsp b/h2/src/main/org/h2/server/web/res/tools.jsp index f8b9382491..110378c8d2 100644 --- a/h2/src/main/org/h2/server/web/res/tools.jsp +++ b/h2/src/main/org/h2/server/web/res/tools.jsp @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/server/web/res/tree.js b/h2/src/main/org/h2/server/web/res/tree.js index 7059bd0eb3..e4de5f3928 100644 --- a/h2/src/main/org/h2/server/web/res/tree.js +++ b/h2/src/main/org/h2/server/web/res/tree.js @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/CountingReaderInputStream.java b/h2/src/main/org/h2/store/CountingReaderInputStream.java index bc94787847..23f4e66389 100644 --- a/h2/src/main/org/h2/store/CountingReaderInputStream.java +++ b/h2/src/main/org/h2/store/CountingReaderInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/Data.java b/h2/src/main/org/h2/store/Data.java index 5f1b1bab4f..76136b935e 100644 --- a/h2/src/main/org/h2/store/Data.java +++ b/h2/src/main/org/h2/store/Data.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group * diff --git a/h2/src/main/org/h2/store/DataHandler.java b/h2/src/main/org/h2/store/DataHandler.java index ce09889493..6c115d42ac 100644 --- a/h2/src/main/org/h2/store/DataHandler.java +++ b/h2/src/main/org/h2/store/DataHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/DataReader.java b/h2/src/main/org/h2/store/DataReader.java index 45344d40f2..8c552f0461 100644 --- a/h2/src/main/org/h2/store/DataReader.java +++ b/h2/src/main/org/h2/store/DataReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/FileLister.java b/h2/src/main/org/h2/store/FileLister.java index 6b52d02552..2fc6f5a420 100644 --- a/h2/src/main/org/h2/store/FileLister.java +++ b/h2/src/main/org/h2/store/FileLister.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/FileLock.java b/h2/src/main/org/h2/store/FileLock.java index cd1ca77f0e..fbe3539b82 100644 --- a/h2/src/main/org/h2/store/FileLock.java +++ b/h2/src/main/org/h2/store/FileLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/FileLockMethod.java b/h2/src/main/org/h2/store/FileLockMethod.java index 7f41b509bc..c225f4a64b 100644 --- a/h2/src/main/org/h2/store/FileLockMethod.java +++ b/h2/src/main/org/h2/store/FileLockMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/FileStore.java b/h2/src/main/org/h2/store/FileStore.java index 88e1c5cdc2..adfd343173 100644 --- a/h2/src/main/org/h2/store/FileStore.java +++ b/h2/src/main/org/h2/store/FileStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/FileStoreInputStream.java b/h2/src/main/org/h2/store/FileStoreInputStream.java index d492919952..87b9fdb70a 100644 --- a/h2/src/main/org/h2/store/FileStoreInputStream.java +++ b/h2/src/main/org/h2/store/FileStoreInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/FileStoreOutputStream.java b/h2/src/main/org/h2/store/FileStoreOutputStream.java index a4e00db3a9..a414443f17 100644 --- a/h2/src/main/org/h2/store/FileStoreOutputStream.java +++ b/h2/src/main/org/h2/store/FileStoreOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/InDoubtTransaction.java b/h2/src/main/org/h2/store/InDoubtTransaction.java index 4c775c2581..33a1292a0d 100644 --- a/h2/src/main/org/h2/store/InDoubtTransaction.java +++ b/h2/src/main/org/h2/store/InDoubtTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/LobStorageFrontend.java b/h2/src/main/org/h2/store/LobStorageFrontend.java index 926a4809da..5c57acef4a 100644 --- a/h2/src/main/org/h2/store/LobStorageFrontend.java +++ b/h2/src/main/org/h2/store/LobStorageFrontend.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/LobStorageInterface.java b/h2/src/main/org/h2/store/LobStorageInterface.java index 9efd97b060..b750c5a83b 100644 --- a/h2/src/main/org/h2/store/LobStorageInterface.java +++ b/h2/src/main/org/h2/store/LobStorageInterface.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/LobStorageRemoteInputStream.java b/h2/src/main/org/h2/store/LobStorageRemoteInputStream.java index 3652273967..06e1d86adf 100644 --- a/h2/src/main/org/h2/store/LobStorageRemoteInputStream.java +++ b/h2/src/main/org/h2/store/LobStorageRemoteInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, and the + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, and the * EPL 1.0 (https://h2database.com/html/license.html). Initial Developer: H2 * Group */ diff --git a/h2/src/main/org/h2/store/RangeInputStream.java b/h2/src/main/org/h2/store/RangeInputStream.java index b00a0e0750..d4401d4428 100644 --- a/h2/src/main/org/h2/store/RangeInputStream.java +++ b/h2/src/main/org/h2/store/RangeInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/RangeReader.java b/h2/src/main/org/h2/store/RangeReader.java index c042da4e1d..d0a6e0dc41 100644 --- a/h2/src/main/org/h2/store/RangeReader.java +++ b/h2/src/main/org/h2/store/RangeReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/RecoverTester.java b/h2/src/main/org/h2/store/RecoverTester.java index 518ff86ddc..3c4c94e9de 100644 --- a/h2/src/main/org/h2/store/RecoverTester.java +++ b/h2/src/main/org/h2/store/RecoverTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/FakeFileChannel.java b/h2/src/main/org/h2/store/fs/FakeFileChannel.java index ae872c4206..62793ce317 100644 --- a/h2/src/main/org/h2/store/fs/FakeFileChannel.java +++ b/h2/src/main/org/h2/store/fs/FakeFileChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/FileBase.java b/h2/src/main/org/h2/store/fs/FileBase.java index 684c08da46..b8bf353535 100644 --- a/h2/src/main/org/h2/store/fs/FileBase.java +++ b/h2/src/main/org/h2/store/fs/FileBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/FileBaseDefault.java b/h2/src/main/org/h2/store/fs/FileBaseDefault.java index 70370df3f9..38a0bded77 100644 --- a/h2/src/main/org/h2/store/fs/FileBaseDefault.java +++ b/h2/src/main/org/h2/store/fs/FileBaseDefault.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/FileChannelInputStream.java b/h2/src/main/org/h2/store/fs/FileChannelInputStream.java index df8c29de12..5677a385e2 100644 --- a/h2/src/main/org/h2/store/fs/FileChannelInputStream.java +++ b/h2/src/main/org/h2/store/fs/FileChannelInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/FilePath.java b/h2/src/main/org/h2/store/fs/FilePath.java index 1cc8d0b9d0..1225165163 100644 --- a/h2/src/main/org/h2/store/fs/FilePath.java +++ b/h2/src/main/org/h2/store/fs/FilePath.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/FilePathWrapper.java b/h2/src/main/org/h2/store/fs/FilePathWrapper.java index b66c6aac1d..f3b14c00b8 100644 --- a/h2/src/main/org/h2/store/fs/FilePathWrapper.java +++ b/h2/src/main/org/h2/store/fs/FilePathWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/FileUtils.java b/h2/src/main/org/h2/store/fs/FileUtils.java index 8e45164e45..276114d780 100644 --- a/h2/src/main/org/h2/store/fs/FileUtils.java +++ b/h2/src/main/org/h2/store/fs/FileUtils.java @@ -1,17 +1,20 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.store.fs; +import java.io.BufferedReader; import java.io.EOFException; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.OutputStream; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; +import java.nio.charset.Charset; import java.nio.file.OpenOption; import java.nio.file.StandardOpenOption; import java.nio.file.attribute.FileAttribute; @@ -21,6 +24,8 @@ import java.util.List; import java.util.Set; +import org.h2.engine.Constants; + /** * This utility class contains utility functions that use the file system * abstraction. @@ -252,21 +257,34 @@ public static FileChannel open(String fileName, String mode) /** * Create an input stream to read from the file. * This method is similar to Java 7 - * java.nio.file.Path.newInputStream. + * java.nio.file.Files.newInputStream(). * * @param fileName the file name * @return the input stream * @throws IOException on failure */ - public static InputStream newInputStream(String fileName) - throws IOException { + public static InputStream newInputStream(String fileName) throws IOException { return FilePath.get(fileName).newInputStream(); } + /** + * Create a buffered reader to read from the file. + * This method is similar to + * java.nio.file.Files.newBufferedReader(). + * + * @param fileName the file name + * @param charset the charset + * @return the buffered reader + * @throws IOException on failure + */ + public static BufferedReader newBufferedReader(String fileName, Charset charset) throws IOException { + return new BufferedReader(new InputStreamReader(newInputStream(fileName), charset), Constants.IO_BUFFER_SIZE); + } + /** * Create an output stream to write into the file. - * This method is similar to Java 7 - * java.nio.file.Path.newOutputStream. + * This method is similar to + * java.nio.file.Files.newOutputStream(). * * @param fileName the file name * @param append if true, the file will grow, if false, the file will be @@ -274,8 +292,7 @@ public static InputStream newInputStream(String fileName) * @return the output stream * @throws IOException on failure */ - public static OutputStream newOutputStream(String fileName, boolean append) - throws IOException { + public static OutputStream newOutputStream(String fileName, boolean append) throws IOException { return FilePath.get(fileName).newOutputStream(append); } diff --git a/h2/src/main/org/h2/store/fs/Recorder.java b/h2/src/main/org/h2/store/fs/Recorder.java index c1eff2fe33..829be53177 100644 --- a/h2/src/main/org/h2/store/fs/Recorder.java +++ b/h2/src/main/org/h2/store/fs/Recorder.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/async/FileAsync.java b/h2/src/main/org/h2/store/fs/async/FileAsync.java index 3a7179c656..427d41542c 100644 --- a/h2/src/main/org/h2/store/fs/async/FileAsync.java +++ b/h2/src/main/org/h2/store/fs/async/FileAsync.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/async/FilePathAsync.java b/h2/src/main/org/h2/store/fs/async/FilePathAsync.java index d904fc8dca..b853fe884f 100644 --- a/h2/src/main/org/h2/store/fs/async/FilePathAsync.java +++ b/h2/src/main/org/h2/store/fs/async/FilePathAsync.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/async/package.html b/h2/src/main/org/h2/store/fs/async/package.html index 409cdeaab1..b4736bf6fd 100644 --- a/h2/src/main/org/h2/store/fs/async/package.html +++ b/h2/src/main/org/h2/store/fs/async/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/store/fs/disk/FilePathDisk.java b/h2/src/main/org/h2/store/fs/disk/FilePathDisk.java index a327aacfab..ba3395f694 100644 --- a/h2/src/main/org/h2/store/fs/disk/FilePathDisk.java +++ b/h2/src/main/org/h2/store/fs/disk/FilePathDisk.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/disk/package.html b/h2/src/main/org/h2/store/fs/disk/package.html index 38e0e8e4e7..7156f31e1f 100644 --- a/h2/src/main/org/h2/store/fs/disk/package.html +++ b/h2/src/main/org/h2/store/fs/disk/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/store/fs/encrypt/FileEncrypt.java b/h2/src/main/org/h2/store/fs/encrypt/FileEncrypt.java index fb7e1d31f6..38bc227b04 100644 --- a/h2/src/main/org/h2/store/fs/encrypt/FileEncrypt.java +++ b/h2/src/main/org/h2/store/fs/encrypt/FileEncrypt.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -10,6 +10,7 @@ import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import org.h2.security.AES; import org.h2.security.SHA256; @@ -37,7 +38,7 @@ public class FileEncrypt extends FileBaseDefault { */ static final int HEADER_LENGTH = BLOCK_SIZE; - private static final byte[] HEADER = "H2encrypt\n".getBytes(); + private static final byte[] HEADER = "H2encrypt\n".getBytes(StandardCharsets.ISO_8859_1); private static final int SALT_POS = HEADER.length; /** diff --git a/h2/src/main/org/h2/store/fs/encrypt/FilePathEncrypt.java b/h2/src/main/org/h2/store/fs/encrypt/FilePathEncrypt.java index 1cfb7b4651..40dffc5821 100644 --- a/h2/src/main/org/h2/store/fs/encrypt/FilePathEncrypt.java +++ b/h2/src/main/org/h2/store/fs/encrypt/FilePathEncrypt.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/encrypt/XTS.java b/h2/src/main/org/h2/store/fs/encrypt/XTS.java index 0dd7dd6ad5..570ec3f8b7 100644 --- a/h2/src/main/org/h2/store/fs/encrypt/XTS.java +++ b/h2/src/main/org/h2/store/fs/encrypt/XTS.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/encrypt/package.html b/h2/src/main/org/h2/store/fs/encrypt/package.html index 6768c28b88..84d70fcc39 100644 --- a/h2/src/main/org/h2/store/fs/encrypt/package.html +++ b/h2/src/main/org/h2/store/fs/encrypt/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/store/fs/mem/FileMem.java b/h2/src/main/org/h2/store/fs/mem/FileMem.java index e9a6ebdd3f..ecf21aed4e 100644 --- a/h2/src/main/org/h2/store/fs/mem/FileMem.java +++ b/h2/src/main/org/h2/store/fs/mem/FileMem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/mem/FileMemData.java b/h2/src/main/org/h2/store/fs/mem/FileMemData.java index fca818b442..3d15676f2c 100644 --- a/h2/src/main/org/h2/store/fs/mem/FileMemData.java +++ b/h2/src/main/org/h2/store/fs/mem/FileMemData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/mem/FilePathMem.java b/h2/src/main/org/h2/store/fs/mem/FilePathMem.java index 95e5764611..502f321f14 100644 --- a/h2/src/main/org/h2/store/fs/mem/FilePathMem.java +++ b/h2/src/main/org/h2/store/fs/mem/FilePathMem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/mem/FilePathMemLZF.java b/h2/src/main/org/h2/store/fs/mem/FilePathMemLZF.java index 238e15b01b..19c7abae56 100644 --- a/h2/src/main/org/h2/store/fs/mem/FilePathMemLZF.java +++ b/h2/src/main/org/h2/store/fs/mem/FilePathMemLZF.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/mem/package.html b/h2/src/main/org/h2/store/fs/mem/package.html index d677740145..3858793bf6 100644 --- a/h2/src/main/org/h2/store/fs/mem/package.html +++ b/h2/src/main/org/h2/store/fs/mem/package.html @@ -1,6 +1,6 @@ @@ -10,7 +10,6 @@

    This file system keeps files fully in memory. -
    There is an option to compress file blocks to save memory.

    \ No newline at end of file diff --git a/h2/src/main/org/h2/store/fs/niomapped/FileNioMapped.java b/h2/src/main/org/h2/store/fs/niomapped/FileNioMapped.java index c82c53e0a8..2ea73ddc09 100644 --- a/h2/src/main/org/h2/store/fs/niomapped/FileNioMapped.java +++ b/h2/src/main/org/h2/store/fs/niomapped/FileNioMapped.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/niomapped/FilePathNioMapped.java b/h2/src/main/org/h2/store/fs/niomapped/FilePathNioMapped.java index 7de47a6070..2479478f90 100644 --- a/h2/src/main/org/h2/store/fs/niomapped/FilePathNioMapped.java +++ b/h2/src/main/org/h2/store/fs/niomapped/FilePathNioMapped.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/niomapped/package.html b/h2/src/main/org/h2/store/fs/niomapped/package.html index b3c6989a47..ef22adf716 100644 --- a/h2/src/main/org/h2/store/fs/niomapped/package.html +++ b/h2/src/main/org/h2/store/fs/niomapped/package.html @@ -1,6 +1,6 @@ @@ -10,7 +10,6 @@

    This file system stores files on disk and uses java.nio to access the files. -
    This class used memory mapped files.

    \ No newline at end of file diff --git a/h2/src/main/org/h2/store/fs/niomem/FileNioMem.java b/h2/src/main/org/h2/store/fs/niomem/FileNioMem.java index 5b9e2717b0..5bc4ad22e6 100644 --- a/h2/src/main/org/h2/store/fs/niomem/FileNioMem.java +++ b/h2/src/main/org/h2/store/fs/niomem/FileNioMem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/niomem/FileNioMemData.java b/h2/src/main/org/h2/store/fs/niomem/FileNioMemData.java index 960dba36aa..e98f7d81cd 100644 --- a/h2/src/main/org/h2/store/fs/niomem/FileNioMemData.java +++ b/h2/src/main/org/h2/store/fs/niomem/FileNioMemData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/niomem/FilePathNioMem.java b/h2/src/main/org/h2/store/fs/niomem/FilePathNioMem.java index b91b38524e..ed23c6fb9f 100644 --- a/h2/src/main/org/h2/store/fs/niomem/FilePathNioMem.java +++ b/h2/src/main/org/h2/store/fs/niomem/FilePathNioMem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/niomem/FilePathNioMemLZF.java b/h2/src/main/org/h2/store/fs/niomem/FilePathNioMemLZF.java index 7e75fc1e37..7ef048fd9f 100644 --- a/h2/src/main/org/h2/store/fs/niomem/FilePathNioMemLZF.java +++ b/h2/src/main/org/h2/store/fs/niomem/FilePathNioMemLZF.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/niomem/package.html b/h2/src/main/org/h2/store/fs/niomem/package.html index b672fa5076..6197af1edc 100644 --- a/h2/src/main/org/h2/store/fs/niomem/package.html +++ b/h2/src/main/org/h2/store/fs/niomem/package.html @@ -1,6 +1,6 @@ @@ -10,7 +10,6 @@

    This file system keeps files fully in off-java-heap memory. -
    There is an option to compress file blocks to save memory.

    \ No newline at end of file diff --git a/h2/src/main/org/h2/store/fs/package.html b/h2/src/main/org/h2/store/fs/package.html index 5cb6705a8b..1797c0eb3f 100644 --- a/h2/src/main/org/h2/store/fs/package.html +++ b/h2/src/main/org/h2/store/fs/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/store/fs/rec/FilePathRec.java b/h2/src/main/org/h2/store/fs/rec/FilePathRec.java index 0b16afdba8..14c63bbfb0 100644 --- a/h2/src/main/org/h2/store/fs/rec/FilePathRec.java +++ b/h2/src/main/org/h2/store/fs/rec/FilePathRec.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/rec/FileRec.java b/h2/src/main/org/h2/store/fs/rec/FileRec.java index 1b34c96e1a..3bee02e3ab 100644 --- a/h2/src/main/org/h2/store/fs/rec/FileRec.java +++ b/h2/src/main/org/h2/store/fs/rec/FileRec.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/rec/package.html b/h2/src/main/org/h2/store/fs/rec/package.html index 43d920248f..23ddc8dcca 100644 --- a/h2/src/main/org/h2/store/fs/rec/package.html +++ b/h2/src/main/org/h2/store/fs/rec/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/store/fs/retry/FilePathRetryOnInterrupt.java b/h2/src/main/org/h2/store/fs/retry/FilePathRetryOnInterrupt.java index 5cc8a3f4a2..1279be117f 100644 --- a/h2/src/main/org/h2/store/fs/retry/FilePathRetryOnInterrupt.java +++ b/h2/src/main/org/h2/store/fs/retry/FilePathRetryOnInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/retry/FileRetryOnInterrupt.java b/h2/src/main/org/h2/store/fs/retry/FileRetryOnInterrupt.java index 29971cc73a..e3508b2efb 100644 --- a/h2/src/main/org/h2/store/fs/retry/FileRetryOnInterrupt.java +++ b/h2/src/main/org/h2/store/fs/retry/FileRetryOnInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/retry/package.html b/h2/src/main/org/h2/store/fs/retry/package.html index 4d9d7f16fc..6908e6a5f5 100644 --- a/h2/src/main/org/h2/store/fs/retry/package.html +++ b/h2/src/main/org/h2/store/fs/retry/package.html @@ -1,6 +1,6 @@ @@ -10,8 +10,7 @@

    A file system that re-opens and re-tries the operation if the file was closed, because a thread was interrupted. -
    -This will clear the interrupt flag.
    +This will clear the interrupt flag. It is mainly useful for applications that call Thread.interrupt by mistake.

    \ No newline at end of file diff --git a/h2/src/main/org/h2/store/fs/split/FilePathSplit.java b/h2/src/main/org/h2/store/fs/split/FilePathSplit.java index 02b9feef65..7f3abb4573 100644 --- a/h2/src/main/org/h2/store/fs/split/FilePathSplit.java +++ b/h2/src/main/org/h2/store/fs/split/FilePathSplit.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/split/FileSplit.java b/h2/src/main/org/h2/store/fs/split/FileSplit.java index 9396e669fe..2cb8e212b9 100644 --- a/h2/src/main/org/h2/store/fs/split/FileSplit.java +++ b/h2/src/main/org/h2/store/fs/split/FileSplit.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/split/package.html b/h2/src/main/org/h2/store/fs/split/package.html index 4c6000c08f..ef8d718c3c 100644 --- a/h2/src/main/org/h2/store/fs/split/package.html +++ b/h2/src/main/org/h2/store/fs/split/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/store/fs/zip/FilePathZip.java b/h2/src/main/org/h2/store/fs/zip/FilePathZip.java index 8bf5d87162..7262fd5e49 100644 --- a/h2/src/main/org/h2/store/fs/zip/FilePathZip.java +++ b/h2/src/main/org/h2/store/fs/zip/FilePathZip.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/zip/FileZip.java b/h2/src/main/org/h2/store/fs/zip/FileZip.java index 67f90cbe6c..1488cfc5ee 100644 --- a/h2/src/main/org/h2/store/fs/zip/FileZip.java +++ b/h2/src/main/org/h2/store/fs/zip/FileZip.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/store/fs/zip/package.html b/h2/src/main/org/h2/store/fs/zip/package.html index cdea123384..d314bc5695 100644 --- a/h2/src/main/org/h2/store/fs/zip/package.html +++ b/h2/src/main/org/h2/store/fs/zip/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/store/package.html b/h2/src/main/org/h2/store/package.html index c9722f4a30..157780ff65 100644 --- a/h2/src/main/org/h2/store/package.html +++ b/h2/src/main/org/h2/store/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/table/Column.java b/h2/src/main/org/h2/table/Column.java index 8c7dd42ba1..1dd1d56e57 100644 --- a/h2/src/main/org/h2/table/Column.java +++ b/h2/src/main/org/h2/table/Column.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/ColumnResolver.java b/h2/src/main/org/h2/table/ColumnResolver.java index b0bc2e50f5..6942d21b20 100644 --- a/h2/src/main/org/h2/table/ColumnResolver.java +++ b/h2/src/main/org/h2/table/ColumnResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/ColumnTemplate.java b/h2/src/main/org/h2/table/ColumnTemplate.java index ac2c7fe66e..44459cac22 100644 --- a/h2/src/main/org/h2/table/ColumnTemplate.java +++ b/h2/src/main/org/h2/table/ColumnTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/DataChangeDeltaTable.java b/h2/src/main/org/h2/table/DataChangeDeltaTable.java index 180e3a6a80..e9046a3130 100644 --- a/h2/src/main/org/h2/table/DataChangeDeltaTable.java +++ b/h2/src/main/org/h2/table/DataChangeDeltaTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -116,6 +116,7 @@ public ResultInterface getResult(SessionLocal session) { statement.prepare(); int columnCount = expressions.length; LocalResult result = new LocalResult(session, expressions, columnCount, columnCount); + result.setForDataChangeDeltaTable(); statement.update(result, resultOption); return result; } diff --git a/h2/src/main/org/h2/table/DualTable.java b/h2/src/main/org/h2/table/DualTable.java index 211508832e..5f9b5ed189 100644 --- a/h2/src/main/org/h2/table/DualTable.java +++ b/h2/src/main/org/h2/table/DualTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/FunctionTable.java b/h2/src/main/org/h2/table/FunctionTable.java index 71484f0bea..61ea951735 100644 --- a/h2/src/main/org/h2/table/FunctionTable.java +++ b/h2/src/main/org/h2/table/FunctionTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/GeneratedColumnResolver.java b/h2/src/main/org/h2/table/GeneratedColumnResolver.java index 02cfd3aa0e..a7883de6e4 100644 --- a/h2/src/main/org/h2/table/GeneratedColumnResolver.java +++ b/h2/src/main/org/h2/table/GeneratedColumnResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/IndexColumn.java b/h2/src/main/org/h2/table/IndexColumn.java index 4e1f765456..16cfbf8b45 100644 --- a/h2/src/main/org/h2/table/IndexColumn.java +++ b/h2/src/main/org/h2/table/IndexColumn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/IndexHints.java b/h2/src/main/org/h2/table/IndexHints.java index e2eed72d35..30a3e1b025 100644 --- a/h2/src/main/org/h2/table/IndexHints.java +++ b/h2/src/main/org/h2/table/IndexHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/InformationSchemaTable.java b/h2/src/main/org/h2/table/InformationSchemaTable.java index ac4e6ab0cc..f7957bbb63 100644 --- a/h2/src/main/org/h2/table/InformationSchemaTable.java +++ b/h2/src/main/org/h2/table/InformationSchemaTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/InformationSchemaTableLegacy.java b/h2/src/main/org/h2/table/InformationSchemaTableLegacy.java index 428204d7dd..e55ec11929 100644 --- a/h2/src/main/org/h2/table/InformationSchemaTableLegacy.java +++ b/h2/src/main/org/h2/table/InformationSchemaTableLegacy.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/MetaTable.java b/h2/src/main/org/h2/table/MetaTable.java index 2fcb31ab98..19f10fd30f 100644 --- a/h2/src/main/org/h2/table/MetaTable.java +++ b/h2/src/main/org/h2/table/MetaTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/Plan.java b/h2/src/main/org/h2/table/Plan.java index f44bf6f58e..635aa2aea1 100644 --- a/h2/src/main/org/h2/table/Plan.java +++ b/h2/src/main/org/h2/table/Plan.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/PlanItem.java b/h2/src/main/org/h2/table/PlanItem.java index f4c4c044a1..5d834eef65 100644 --- a/h2/src/main/org/h2/table/PlanItem.java +++ b/h2/src/main/org/h2/table/PlanItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/RangeTable.java b/h2/src/main/org/h2/table/RangeTable.java index 1b9f6c39a9..774e42974e 100644 --- a/h2/src/main/org/h2/table/RangeTable.java +++ b/h2/src/main/org/h2/table/RangeTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/Table.java b/h2/src/main/org/h2/table/Table.java index 5db5f418c2..c2b5b14fbc 100644 --- a/h2/src/main/org/h2/table/Table.java +++ b/h2/src/main/org/h2/table/Table.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -59,6 +59,21 @@ public abstract class Table extends SchemaObject { */ public static final int TYPE_MEMORY = 1; + /** + * Read lock. + */ + public static final int READ_LOCK = 0; + + /** + * Write lock. + */ + public static final int WRITE_LOCK = 1; + + /** + * Exclusive lock. + */ + public static final int EXCLUSIVE_LOCK = 2; + /** * The columns of this table. */ @@ -120,12 +135,11 @@ public boolean isView() { * This method waits until the lock is granted. * * @param session the session - * @param exclusive true for write locks, false for read locks - * @param forceLockEvenInMvcc lock even in the MVCC mode + * @param lockType the type of lock * @return true if the table was already exclusively locked by this session. * @throws DbException if a lock timeout occurred */ - public boolean lock(SessionLocal session, boolean exclusive, boolean forceLockEvenInMvcc) { + public boolean lock(SessionLocal session, int lockType) { return false; } diff --git a/h2/src/main/org/h2/table/TableBase.java b/h2/src/main/org/h2/table/TableBase.java index a52d53df4a..a2858ba570 100644 --- a/h2/src/main/org/h2/table/TableBase.java +++ b/h2/src/main/org/h2/table/TableBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/TableFilter.java b/h2/src/main/org/h2/table/TableFilter.java index a62abffcd3..990467a718 100644 --- a/h2/src/main/org/h2/table/TableFilter.java +++ b/h2/src/main/org/h2/table/TableFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -194,7 +194,7 @@ public Table getTable() { * @param s the session */ public void lock(SessionLocal s) { - table.lock(s, false, false); + table.lock(s, Table.READ_LOCK); if (join != null) { join.lock(s); } diff --git a/h2/src/main/org/h2/table/TableLink.java b/h2/src/main/org/h2/table/TableLink.java index 0dd71fb3a2..ca34042e66 100644 --- a/h2/src/main/org/h2/table/TableLink.java +++ b/h2/src/main/org/h2/table/TableLink.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -24,8 +24,10 @@ import org.h2.index.IndexType; import org.h2.index.LinkedIndex; import org.h2.jdbc.JdbcConnection; +import org.h2.jdbc.JdbcResultSet; import org.h2.message.DbException; import org.h2.result.LocalResult; +import org.h2.result.ResultInterface; import org.h2.result.Row; import org.h2.schema.Schema; import org.h2.util.JdbcUtils; @@ -177,10 +179,20 @@ private void readMetaData() throws SQLException { try (Statement stat = conn.getConnection().createStatement(); ResultSet rs = stat.executeQuery("SELECT * FROM " + qualifiedTableName + " T WHERE 1=0")) { - if (columnList.isEmpty()) { + if (rs instanceof JdbcResultSet) { + ResultInterface result = ((JdbcResultSet) rs).getResult(); + columnList.clear(); + columnMap.clear(); + for (int i = 0, l = result.getVisibleColumnCount(); i < l;) { + String n = result.getColumnName(i); + Column col = new Column(n, result.getColumnType(i), this, ++i); + columnList.add(col); + columnMap.put(n, col); + } + } else if (columnList.isEmpty()) { // alternative solution ResultSetMetaData rsMeta = rs.getMetaData(); - for (int i = 0; i < rsMeta.getColumnCount();) { + for (int i = 0, l = rsMeta.getColumnCount(); i < l;) { String n = rsMeta.getColumnName(i + 1); n = convertColumnName(n); int sqlType = rsMeta.getColumnType(i + 1); diff --git a/h2/src/main/org/h2/table/TableLinkConnection.java b/h2/src/main/org/h2/table/TableLinkConnection.java index 1090ae3bdf..2286e7de48 100644 --- a/h2/src/main/org/h2/table/TableLinkConnection.java +++ b/h2/src/main/org/h2/table/TableLinkConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/TableSynonym.java b/h2/src/main/org/h2/table/TableSynonym.java index b82e6f1cbf..cf35d038b7 100644 --- a/h2/src/main/org/h2/table/TableSynonym.java +++ b/h2/src/main/org/h2/table/TableSynonym.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/TableType.java b/h2/src/main/org/h2/table/TableType.java index a20ae62d80..0e406bd2ee 100644 --- a/h2/src/main/org/h2/table/TableType.java +++ b/h2/src/main/org/h2/table/TableType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/TableValueConstructorTable.java b/h2/src/main/org/h2/table/TableValueConstructorTable.java index d5a0ad035e..c532e44082 100644 --- a/h2/src/main/org/h2/table/TableValueConstructorTable.java +++ b/h2/src/main/org/h2/table/TableValueConstructorTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/TableView.java b/h2/src/main/org/h2/table/TableView.java index d9a3a37471..eba1b12fa6 100644 --- a/h2/src/main/org/h2/table/TableView.java +++ b/h2/src/main/org/h2/table/TableView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -541,7 +541,9 @@ public int getParameterOffset(ArrayList additionalParameters) { private static int getMaxParameterIndex(ArrayList parameters) { int result = -1; for (Parameter p : parameters) { - result = Math.max(result, p.getIndex()); + if (p != null) { + result = Math.max(result, p.getIndex()); + } } return result; } @@ -705,7 +707,7 @@ public static TableView createTableViewMaybeRecursive(Schema schema, int id, Str if (!view.isRecursiveQueryDetected()) { if (!isTemporary) { db.addSchemaObject(session, view); - view.lock(session, true, true); + view.lock(session, Table.EXCLUSIVE_LOCK); session.getDatabase().removeSchemaObject(session, view); // during database startup - this method does not normally get called - and it @@ -807,7 +809,7 @@ public static void destroyShadowTableForRecursiveExpression(boolean isTemporary, Table recursiveTable) { if (recursiveTable != null) { if (!isTemporary) { - recursiveTable.lock(targetSession, true, true); + recursiveTable.lock(targetSession, Table.EXCLUSIVE_LOCK); targetSession.getDatabase().removeSchemaObject(targetSession, recursiveTable); } else { diff --git a/h2/src/main/org/h2/table/VirtualConstructedTable.java b/h2/src/main/org/h2/table/VirtualConstructedTable.java index 3618a7b87e..77f6ec2f1f 100644 --- a/h2/src/main/org/h2/table/VirtualConstructedTable.java +++ b/h2/src/main/org/h2/table/VirtualConstructedTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/VirtualTable.java b/h2/src/main/org/h2/table/VirtualTable.java index b3b6b0a35b..a0dead3956 100644 --- a/h2/src/main/org/h2/table/VirtualTable.java +++ b/h2/src/main/org/h2/table/VirtualTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/table/package.html b/h2/src/main/org/h2/table/package.html index 5c491fbfe3..5ae6ac1b19 100644 --- a/h2/src/main/org/h2/table/package.html +++ b/h2/src/main/org/h2/table/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/tools/Backup.java b/h2/src/main/org/h2/tools/Backup.java index f531561eab..afb464b14f 100644 --- a/h2/src/main/org/h2/tools/Backup.java +++ b/h2/src/main/org/h2/tools/Backup.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -30,8 +30,6 @@ * responding, creating a backup using the Backup tool is possible by using the * quiet mode. However, if the database is changed while the backup is running * in quiet mode, the backup could be corrupt. - * - * @h2.resource */ public class Backup extends Tool { @@ -50,7 +48,6 @@ public class Backup extends Tool { *
    * *
    Command line options
    [-dump <fileName>]Dump the contends of the file
    [-info <fileName>]
    [-quiet]Do not print progress information
    - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/main/org/h2/tools/ChangeFileEncryption.java b/h2/src/main/org/h2/tools/ChangeFileEncryption.java index d3a7ee9fb1..e1f600f3f9 100644 --- a/h2/src/main/org/h2/tools/ChangeFileEncryption.java +++ b/h2/src/main/org/h2/tools/ChangeFileEncryption.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -28,7 +28,6 @@ * * This tool can not be used to change a password of a user. * The database must be closed before using this tool. - * @h2.resource */ public class ChangeFileEncryption extends Tool { @@ -56,7 +55,6 @@ public class ChangeFileEncryption extends Tool { * [-quiet] * Do not print progress information * - * @h2.resource * * @param args the command line arguments */ diff --git a/h2/src/main/org/h2/tools/CompressTool.java b/h2/src/main/org/h2/tools/CompressTool.java index 916dfafecd..7fa7d50702 100644 --- a/h2/src/main/org/h2/tools/CompressTool.java +++ b/h2/src/main/org/h2/tools/CompressTool.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/tools/Console.java b/h2/src/main/org/h2/tools/Console.java index a19a7d1af3..42624300f1 100644 --- a/h2/src/main/org/h2/tools/Console.java +++ b/h2/src/main/org/h2/tools/Console.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -16,7 +16,6 @@ /** * Starts the H2 Console (web-) server, as well as the TCP and PG server. - * @h2.resource * * @author Thomas Mueller, Ridvan Agar */ @@ -59,7 +58,6 @@ public class Console extends Tool implements ShutdownHandler { * for details, see the Server tool. * If a service can not be started, the program * terminates with an exit code of 1. - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure @@ -115,6 +113,8 @@ public void runTool(String... args) throws SQLException { } else if ("-webAllowOthers".equals(arg)) { // no parameters webAllowOthers = true; + } else if ("-webExternalNames".equals(arg)) { + i++; } else if ("-webDaemon".equals(arg)) { // no parameters } else if ("-webSSL".equals(arg)) { diff --git a/h2/src/main/org/h2/tools/ConvertTraceFile.java b/h2/src/main/org/h2/tools/ConvertTraceFile.java index 1a7600436a..c9de53f6c6 100644 --- a/h2/src/main/org/h2/tools/ConvertTraceFile.java +++ b/h2/src/main/org/h2/tools/ConvertTraceFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -22,7 +22,6 @@ * Converts a .trace.db file to a SQL script and Java source code. * * SQL statement statistics are listed as well. - * @h2.resource */ public class ConvertTraceFile extends Tool { @@ -67,7 +66,6 @@ public int compareTo(Stat other) { * [-javaClass <file>] * The Java directory and class file name (default: Test) * - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/main/org/h2/tools/CreateCluster.java b/h2/src/main/org/h2/tools/CreateCluster.java index 13a4e21d3c..04508c784e 100644 --- a/h2/src/main/org/h2/tools/CreateCluster.java +++ b/h2/src/main/org/h2/tools/CreateCluster.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -22,7 +22,6 @@ * Creates a cluster from a stand-alone database. * * Copies a database to another location if required. - * @h2.resource */ public class CreateCluster extends Tool { @@ -43,7 +42,6 @@ public class CreateCluster extends Tool { * [-serverList <list>] * The comma separated list of host names or IP addresses * - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure @@ -104,7 +102,7 @@ private static void process(String urlSource, String urlTarget, String user, String password, String serverList) throws SQLException { // use cluster='' so connecting is possible // even if the cluster is enabled - try (JdbcConnection connSource = new JdbcConnection(urlSource + ";CLUSTER=''", null, user, password); + try (JdbcConnection connSource = new JdbcConnection(urlSource + ";CLUSTER=''", null, user, password, false); Statement statSource = connSource.createStatement()) { // enable the exclusive mode and close other connections, // so that data can't change while restoring the second database @@ -122,7 +120,7 @@ private static void performTransfer(Statement statSource, String urlTarget, Stri String serverList) throws SQLException { // Delete the target database first. - try (JdbcConnection connTarget = new JdbcConnection(urlTarget + ";CLUSTER=''", null, user, password); + try (JdbcConnection connTarget = new JdbcConnection(urlTarget + ";CLUSTER=''", null, user, password, false); Statement statTarget = connTarget.createStatement()) { statTarget.execute("DROP ALL OBJECTS DELETE FILES"); } @@ -131,7 +129,7 @@ private static void performTransfer(Statement statSource, String urlTarget, Stri Future threadFuture = startWriter(pipeReader, statSource); // Read data from pipe reader, restore on target. - try (JdbcConnection connTarget = new JdbcConnection(urlTarget, null, user, password); + try (JdbcConnection connTarget = new JdbcConnection(urlTarget, null, user, password, false); Statement statTarget = connTarget.createStatement()) { RunScript.execute(connTarget, pipeReader); diff --git a/h2/src/main/org/h2/tools/Csv.java b/h2/src/main/org/h2/tools/Csv.java index dfcde5cc2f..60b9c3777f 100644 --- a/h2/src/main/org/h2/tools/Csv.java +++ b/h2/src/main/org/h2/tools/Csv.java @@ -1,21 +1,20 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.tools; -import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.sql.Connection; import java.sql.ResultSet; import java.sql.ResultSetMetaData; @@ -57,7 +56,7 @@ public class Csv implements SimpleRowSource { private String nullString = ""; private String fileName; - private Reader input; + private BufferedReader input; private char[] inputBuffer; private int inputBufferPos; private int inputBufferStart = -1; @@ -71,10 +70,8 @@ private int writeResultSet(ResultSet rs) throws SQLException { ResultSetMetaData meta = rs.getMetaData(); int columnCount = meta.getColumnCount(); String[] row = new String[columnCount]; - int[] sqlTypes = new int[columnCount]; for (int i = 0; i < columnCount; i++) { row[i] = meta.getColumnLabel(i + 1); - sqlTypes[i] = meta.getColumnType(i + 1); } if (writeColumnHeader) { writeRow(row); @@ -198,7 +195,8 @@ public ResultSet read(String inputFileName, String[] colNames, */ public ResultSet read(Reader reader, String[] colNames) throws IOException { init(null, null); - this.input = reader; + this.input = reader instanceof BufferedReader ? (BufferedReader) reader + : new BufferedReader(reader, Constants.IO_BUFFER_SIZE); return readResultSet(colNames); } @@ -300,17 +298,13 @@ private String escape(String data) { private void initRead() throws IOException { if (input == null) { try { - InputStream in = FileUtils.newInputStream(fileName); - in = new BufferedInputStream(in, Constants.IO_BUFFER_SIZE); - input = characterSet != null ? new InputStreamReader(in, characterSet) : new InputStreamReader(in); + input = FileUtils.newBufferedReader(fileName, + characterSet != null ? Charset.forName(characterSet) : StandardCharsets.UTF_8); } catch (IOException e) { close(); throw e; } } - if (!input.markSupported()) { - input = new BufferedReader(input); - } input.mark(1); int bom = input.read(); if (bom != 0xfeff) { diff --git a/h2/src/main/org/h2/tools/DeleteDbFiles.java b/h2/src/main/org/h2/tools/DeleteDbFiles.java index 3bcc4ca86b..45fe453fd9 100644 --- a/h2/src/main/org/h2/tools/DeleteDbFiles.java +++ b/h2/src/main/org/h2/tools/DeleteDbFiles.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -17,7 +17,6 @@ * Deletes all files belonging to a database. * * The database must be closed before calling this tool. - * @h2.resource */ public class DeleteDbFiles extends Tool { @@ -34,7 +33,6 @@ public class DeleteDbFiles extends Tool { * [-quiet] * Do not print progress information * - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/main/org/h2/tools/GUIConsole.java b/h2/src/main/org/h2/tools/GUIConsole.java index d029542c62..c2b9d1e8c3 100644 --- a/h2/src/main/org/h2/tools/GUIConsole.java +++ b/h2/src/main/org/h2/tools/GUIConsole.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -464,7 +464,7 @@ private void createDatabase() { } String url = "jdbc:h2:" + path; try { - new JdbcConnection(url, null, user, password).close(); + new JdbcConnection(url, null, user, password, false).close(); errorArea.setForeground(new Color(0, 0x99, 0)); errorArea.setText("Database was created successfully.\n\n" + "JDBC URL for H2 Console:\n" diff --git a/h2/src/main/org/h2/tools/MultiDimension.java b/h2/src/main/org/h2/tools/MultiDimension.java index 6cc4802ee3..7c694d576d 100644 --- a/h2/src/main/org/h2/tools/MultiDimension.java +++ b/h2/src/main/org/h2/tools/MultiDimension.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/tools/Recover.java b/h2/src/main/org/h2/tools/Recover.java index 5324451b84..ee267c10c3 100644 --- a/h2/src/main/org/h2/tools/Recover.java +++ b/h2/src/main/org/h2/tools/Recover.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -63,7 +63,6 @@ /** * Helps recovering a corrupted database. - * @h2.resource */ public class Recover extends Tool implements DataHandler { @@ -95,7 +94,6 @@ public class Recover extends Tool implements DataHandler { * Print the transaction log * * Encrypted databases need to be decrypted first. - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/main/org/h2/tools/Restore.java b/h2/src/main/org/h2/tools/Restore.java index 27f98cb475..426abca58b 100644 --- a/h2/src/main/org/h2/tools/Restore.java +++ b/h2/src/main/org/h2/tools/Restore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -20,7 +20,6 @@ /** * Restores a H2 database by extracting the database files from a .zip file. - * @h2.resource */ public class Restore extends Tool { @@ -39,7 +38,6 @@ public class Restore extends Tool { * [-quiet] * Do not print progress information * - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/main/org/h2/tools/RunScript.java b/h2/src/main/org/h2/tools/RunScript.java index 7553241d5f..fc0efbab3b 100644 --- a/h2/src/main/org/h2/tools/RunScript.java +++ b/h2/src/main/org/h2/tools/RunScript.java @@ -1,15 +1,13 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.tools; -import java.io.BufferedInputStream; +import java.io.BufferedReader; import java.io.File; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -19,7 +17,6 @@ import java.sql.Statement; import java.util.concurrent.TimeUnit; -import org.h2.engine.Constants; import org.h2.message.DbException; import org.h2.store.fs.FileUtils; import org.h2.util.IOUtils; @@ -30,7 +27,6 @@ /** * Runs a SQL script against a database. - * @h2.resource */ public class RunScript extends Tool { @@ -62,7 +58,6 @@ public class RunScript extends Tool { * [-options ...] * RUNSCRIPT options (embedded H2; -*Results not supported) * - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure @@ -186,14 +181,11 @@ public static ResultSet execute(Connection conn, Reader reader) private void process(Connection conn, String fileName, boolean continueOnError, Charset charset) throws SQLException, IOException { - InputStream in = FileUtils.newInputStream(fileName); - String path = FileUtils.getParent(fileName); + BufferedReader reader = FileUtils.newBufferedReader(fileName, charset); try { - in = new BufferedInputStream(in, Constants.IO_BUFFER_SIZE); - Reader reader = new InputStreamReader(in, charset); - process(conn, continueOnError, path, reader, charset); + process(conn, continueOnError, FileUtils.getParent(fileName), reader, charset); } finally { - IOUtils.closeSilently(in); + IOUtils.closeSilently(reader); } } diff --git a/h2/src/main/org/h2/tools/Script.java b/h2/src/main/org/h2/tools/Script.java index 2ae6573f75..8a2f5dae76 100644 --- a/h2/src/main/org/h2/tools/Script.java +++ b/h2/src/main/org/h2/tools/Script.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -14,7 +14,6 @@ /** * Creates a SQL script file by extracting the schema and data of a database. - * @h2.resource */ public class Script extends Tool { @@ -37,7 +36,6 @@ public class Script extends Tool { * [-quiet] * Do not print progress information * - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/main/org/h2/tools/Server.java b/h2/src/main/org/h2/tools/Server.java index 1f271e7eb8..c1956012ca 100644 --- a/h2/src/main/org/h2/tools/Server.java +++ b/h2/src/main/org/h2/tools/Server.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -23,7 +23,6 @@ /** * Starts the H2 Console (web-) server, TCP, and PG server. - * @h2.resource */ public class Server extends Tool implements Runnable, ShutdownHandler { @@ -66,6 +65,9 @@ public Server(Service service, String... args) throws SQLException { * Start the web server with the H2 Console * [-webAllowOthers] * Allow other computers to connect - see below + * [-webExternalNames <names>] + * The comma-separated list of external names and IP addresses of this server, + * used together with -webAllowOthers * [-webDaemon] * Use a daemon thread * [-webPort <port>] @@ -116,7 +118,6 @@ public Server(Service service, String... args) throws SQLException { * The options -xAllowOthers are potentially risky. * * For details, see Advanced Topics / Protection against Remote Access. - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure @@ -136,7 +137,9 @@ private void verifyArgs(String... args) throws SQLException { // ok } else if ("-webAllowOthers".equals(arg)) { // no parameters - } else if ("-webDaemon".equals(arg)) { + } else if ("-webExternalNames".equals(arg)) { + i++; + } else if ("-webDaemon".equals(arg)) { // no parameters } else if ("-webSSL".equals(arg)) { // no parameters diff --git a/h2/src/main/org/h2/tools/Shell.java b/h2/src/main/org/h2/tools/Shell.java index b13523c248..a85b84e91c 100644 --- a/h2/src/main/org/h2/tools/Shell.java +++ b/h2/src/main/org/h2/tools/Shell.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -32,7 +32,6 @@ /** * Interactive command line tool to access a database using JDBC. - * @h2.resource */ public class Shell extends Tool implements Runnable { @@ -73,7 +72,6 @@ public class Shell extends Tool implements Runnable { * * If special characters don't work as expected, you may need to use * -Dfile.encoding=UTF-8 (Mac OS X) or CP850 (Windows). - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/main/org/h2/tools/SimpleResultSet.java b/h2/src/main/org/h2/tools/SimpleResultSet.java index 48a22fca43..35d2964e10 100644 --- a/h2/src/main/org/h2/tools/SimpleResultSet.java +++ b/h2/src/main/org/h2/tools/SimpleResultSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/tools/SimpleRowSource.java b/h2/src/main/org/h2/tools/SimpleRowSource.java index 6724d8b2a7..c1a38f4463 100644 --- a/h2/src/main/org/h2/tools/SimpleRowSource.java +++ b/h2/src/main/org/h2/tools/SimpleRowSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/tools/TriggerAdapter.java b/h2/src/main/org/h2/tools/TriggerAdapter.java index ed02b99c4c..06b25ac9aa 100644 --- a/h2/src/main/org/h2/tools/TriggerAdapter.java +++ b/h2/src/main/org/h2/tools/TriggerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/tools/Upgrade.java b/h2/src/main/org/h2/tools/Upgrade.java index e4c7d2f5b8..ca77508028 100644 --- a/h2/src/main/org/h2/tools/Upgrade.java +++ b/h2/src/main/org/h2/tools/Upgrade.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -163,7 +163,7 @@ public static boolean upgrade(String url, Properties info, int version) throws E unloadH2(driver); } rename(name, false); - try (JdbcConnection conn = new JdbcConnection(url, info, null, null)) { + try (JdbcConnection conn = new JdbcConnection(url, info, null, null, false)) { StringBuilder builder = StringUtils.quoteStringSQL(new StringBuilder("RUNSCRIPT FROM "), script) .append(scriptCommandSuffix); if (version <= 200) { diff --git a/h2/src/main/org/h2/tools/package.html b/h2/src/main/org/h2/tools/package.html index dabbb7f312..806c13eddf 100644 --- a/h2/src/main/org/h2/tools/package.html +++ b/h2/src/main/org/h2/tools/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/util/AbbaDetector.java b/h2/src/main/org/h2/util/AbbaDetector.java index 4f200873c2..b4c41bc909 100644 --- a/h2/src/main/org/h2/util/AbbaDetector.java +++ b/h2/src/main/org/h2/util/AbbaDetector.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/AbbaLockingDetector.java b/h2/src/main/org/h2/util/AbbaLockingDetector.java index a67c042744..62b67f48b8 100644 --- a/h2/src/main/org/h2/util/AbbaLockingDetector.java +++ b/h2/src/main/org/h2/util/AbbaLockingDetector.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/Bits.java b/h2/src/main/org/h2/util/Bits.java index ff1ac0ac4e..f910c5a1e6 100644 --- a/h2/src/main/org/h2/util/Bits.java +++ b/h2/src/main/org/h2/util/Bits.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/ByteStack.java b/h2/src/main/org/h2/util/ByteStack.java index e3e979b5e5..f1764ad290 100644 --- a/h2/src/main/org/h2/util/ByteStack.java +++ b/h2/src/main/org/h2/util/ByteStack.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/Cache.java b/h2/src/main/org/h2/util/Cache.java index 335c7f5df3..9ea4857c4a 100644 --- a/h2/src/main/org/h2/util/Cache.java +++ b/h2/src/main/org/h2/util/Cache.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/CacheHead.java b/h2/src/main/org/h2/util/CacheHead.java index 40f53269cd..d18bb13b97 100644 --- a/h2/src/main/org/h2/util/CacheHead.java +++ b/h2/src/main/org/h2/util/CacheHead.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/CacheLRU.java b/h2/src/main/org/h2/util/CacheLRU.java index b83b3fd6cb..7dbd58193d 100644 --- a/h2/src/main/org/h2/util/CacheLRU.java +++ b/h2/src/main/org/h2/util/CacheLRU.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/CacheObject.java b/h2/src/main/org/h2/util/CacheObject.java index 390c3ba6ce..2cbf84db53 100644 --- a/h2/src/main/org/h2/util/CacheObject.java +++ b/h2/src/main/org/h2/util/CacheObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/CacheSecondLevel.java b/h2/src/main/org/h2/util/CacheSecondLevel.java index 39e7040e09..7d0469deba 100644 --- a/h2/src/main/org/h2/util/CacheSecondLevel.java +++ b/h2/src/main/org/h2/util/CacheSecondLevel.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Jan Kotek */ diff --git a/h2/src/main/org/h2/util/CacheTQ.java b/h2/src/main/org/h2/util/CacheTQ.java index 9aa7142453..b05c574696 100644 --- a/h2/src/main/org/h2/util/CacheTQ.java +++ b/h2/src/main/org/h2/util/CacheTQ.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/CacheWriter.java b/h2/src/main/org/h2/util/CacheWriter.java index e634c591bf..4277471384 100644 --- a/h2/src/main/org/h2/util/CacheWriter.java +++ b/h2/src/main/org/h2/util/CacheWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/CloseWatcher.java b/h2/src/main/org/h2/util/CloseWatcher.java index dd4ffd9c86..3a5911f8f8 100644 --- a/h2/src/main/org/h2/util/CloseWatcher.java +++ b/h2/src/main/org/h2/util/CloseWatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group * Iso8601: diff --git a/h2/src/main/org/h2/util/DateTimeUtils.java b/h2/src/main/org/h2/util/DateTimeUtils.java index 13785f0ca2..1ee7c9118e 100644 --- a/h2/src/main/org/h2/util/DateTimeUtils.java +++ b/h2/src/main/org/h2/util/DateTimeUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, and the + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, and the * EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group * Iso8601: Initial Developer: Robert Rathsack (firstName dot lastName at gmx diff --git a/h2/src/main/org/h2/util/DbDriverActivator.java b/h2/src/main/org/h2/util/DbDriverActivator.java index bdfe31fe4d..cf388f66b9 100644 --- a/h2/src/main/org/h2/util/DbDriverActivator.java +++ b/h2/src/main/org/h2/util/DbDriverActivator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/DebuggingThreadLocal.java b/h2/src/main/org/h2/util/DebuggingThreadLocal.java index dbe37834db..9413de4d28 100644 --- a/h2/src/main/org/h2/util/DebuggingThreadLocal.java +++ b/h2/src/main/org/h2/util/DebuggingThreadLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/HasSQL.java b/h2/src/main/org/h2/util/HasSQL.java index 91188715ef..a57716cc1a 100644 --- a/h2/src/main/org/h2/util/HasSQL.java +++ b/h2/src/main/org/h2/util/HasSQL.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/IOUtils.java b/h2/src/main/org/h2/util/IOUtils.java index 79899bf731..8a131a36a1 100644 --- a/h2/src/main/org/h2/util/IOUtils.java +++ b/h2/src/main/org/h2/util/IOUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/IntArray.java b/h2/src/main/org/h2/util/IntArray.java index 01e3c95141..50dce12545 100644 --- a/h2/src/main/org/h2/util/IntArray.java +++ b/h2/src/main/org/h2/util/IntArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/IntervalUtils.java b/h2/src/main/org/h2/util/IntervalUtils.java index b2a1651dcb..1761f91d12 100644 --- a/h2/src/main/org/h2/util/IntervalUtils.java +++ b/h2/src/main/org/h2/util/IntervalUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/JSR310Utils.java b/h2/src/main/org/h2/util/JSR310Utils.java index d6b4516fb4..c53bce3d53 100644 --- a/h2/src/main/org/h2/util/JSR310Utils.java +++ b/h2/src/main/org/h2/util/JSR310Utils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/JdbcUtils.java b/h2/src/main/org/h2/util/JdbcUtils.java index 45a2f2875c..03a126c0a1 100644 --- a/h2/src/main/org/h2/util/JdbcUtils.java +++ b/h2/src/main/org/h2/util/JdbcUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -267,7 +267,7 @@ public static void closeSilently(ResultSet rs) { */ public static Connection getConnection(String driver, String url, String user, String password) throws SQLException { - return getConnection(driver, url, user, password, null); + return getConnection(driver, url, user, password, null, false); } /** @@ -278,13 +278,14 @@ public static Connection getConnection(String driver, String url, * @param user the user name or {@code null} * @param password the password or {@code null} * @param networkConnectionInfo the network connection information, or {@code null} + * @param forbidCreation whether database creation is forbidden * @return the database connection * @throws SQLException on failure */ public static Connection getConnection(String driver, String url, String user, String password, - NetworkConnectionInfo networkConnectionInfo) throws SQLException { + NetworkConnectionInfo networkConnectionInfo, boolean forbidCreation) throws SQLException { if (url.startsWith(Constants.START_URL)) { - JdbcConnection connection = new JdbcConnection(url, null, user, password); + JdbcConnection connection = new JdbcConnection(url, null, user, password, forbidCreation); if (networkConnectionInfo != null) { connection.getSession().setNetworkConnectionInfo(networkConnectionInfo); } @@ -315,6 +316,9 @@ public static Connection getConnection(String driver, String url, String user, S } throw new SQLException("Driver " + driver + " is not suitable for " + url, "08001"); } else if (javax.naming.Context.class.isAssignableFrom(d)) { + if (!url.startsWith("java:")) { + throw new SQLException("Only java scheme is supported for JNDI lookups", "08001"); + } // JNDI context Context context = (Context) d.getDeclaredConstructor().newInstance(); DataSource ds = (DataSource) context.lookup(url); diff --git a/h2/src/main/org/h2/util/LegacyDateTimeUtils.java b/h2/src/main/org/h2/util/LegacyDateTimeUtils.java index b611819f27..254c7ffab4 100644 --- a/h2/src/main/org/h2/util/LegacyDateTimeUtils.java +++ b/h2/src/main/org/h2/util/LegacyDateTimeUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/MathUtils.java b/h2/src/main/org/h2/util/MathUtils.java index 9ade0a8a61..2a84beb7ff 100644 --- a/h2/src/main/org/h2/util/MathUtils.java +++ b/h2/src/main/org/h2/util/MathUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/MemoryEstimator.java b/h2/src/main/org/h2/util/MemoryEstimator.java index 754012fb44..ed662a6ce4 100644 --- a/h2/src/main/org/h2/util/MemoryEstimator.java +++ b/h2/src/main/org/h2/util/MemoryEstimator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -14,12 +14,12 @@ /** * Class MemoryEstimator. * - * Calculation of the amount of memory taken by keys, values and pages of the MVTable + * Calculation of the amount of memory occupied by keys, values and pages of the MVTable * may become expensive operation for complex data types like Row. * On the other hand, result of the calculation is used by page cache to limit it's size * and determine when eviction is needed. Another usage is to trigger auto commit, * based on amount of unsaved changes. In both cases reasonable (lets say ~30%) approximation - * would be good enough and do the job. + * would be good enough and will do the job. * This class replaces exact calculation with an estimate based on * a sliding window average of last 256 values. * If estimation gets close to the exact value, then next N calculations are skipped @@ -30,10 +30,10 @@ public final class MemoryEstimator { // Structure of statsData long value: - // 0 - 7 skip counter (how many more requests will skip calculation and use estimate instead) + // 0 - 7 skip counter (how many more requests will skip calculation and use an estimate instead) // 8 - 23 total number of skips between last 256 calculations // (used for sampling percentage calculation only) - // 24 bit is 0 when window is not completely filled yet, 1 when it become full + // 24 bit is 0 when window is not completely filled yet, 1 once it become full // 25 - 31 unused // 32 - 63 sliding window sum of estimated values @@ -63,7 +63,7 @@ public static int estimateMemory(AtomicLong stats, DataType dataType, T d int counter = getCounter(statsData); int skipSum = getSkipSum(statsData); long initialized = statsData & INIT_BIT; - long sum = statsData >> SUM_SHIFT; + long sum = statsData >>> SUM_SHIFT; int mem = 0; int cnt = 0; if (initialized == 0 || counter-- == 0) { @@ -103,7 +103,7 @@ public static int estimateMemory(AtomicLong stats, DataType dataType, T[] int counter = getCounter(statsData); int skipSum = getSkipSum(statsData); long initialized = statsData & INIT_BIT; - long sum = statsData >> SUM_SHIFT; + long sum = statsData >>> SUM_SHIFT; int index = 0; int memSum = 0; if (initialized != 0 && counter >= count) { @@ -172,7 +172,7 @@ private static long updateStatsData(AtomicLong stats, long statsData, long updat int itemsCount, int itemsMem) { while (!stats.compareAndSet(statsData, updatedStatsData)) { statsData = stats.get(); - long sum = statsData >> SUM_SHIFT; + long sum = statsData >>> SUM_SHIFT; if (itemsCount > 0) { sum += itemsMem - ((sum * itemsCount + WINDOW_HALF_SIZE) >> WINDOW_SHIFT); } @@ -190,6 +190,6 @@ private static int getSkipSum(long statsData) { } private static int getAverage(long updatedStatsData) { - return (int)(updatedStatsData >> (SUM_SHIFT + WINDOW_SHIFT)); + return (int)(updatedStatsData >>> (SUM_SHIFT + WINDOW_SHIFT)); } } diff --git a/h2/src/main/org/h2/util/MemoryUnmapper.java b/h2/src/main/org/h2/util/MemoryUnmapper.java index 36f4be44c8..4994263d3b 100644 --- a/h2/src/main/org/h2/util/MemoryUnmapper.java +++ b/h2/src/main/org/h2/util/MemoryUnmapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/NetUtils.java b/h2/src/main/org/h2/util/NetUtils.java index 421993be9e..972ff6f7e6 100644 --- a/h2/src/main/org/h2/util/NetUtils.java +++ b/h2/src/main/org/h2/util/NetUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -345,7 +345,7 @@ public static StringBuilder ipToShortForm(StringBuilder builder, byte[] address, .append(address[0] & 0xff).append('.') // .append(address[1] & 0xff).append('.') // .append(address[2] & 0xff).append('.') // - .append(address[3] & 0xff).toString(); + .append(address[3] & 0xff); break; case 16: short[] a = new short[8]; diff --git a/h2/src/main/org/h2/util/NetworkConnectionInfo.java b/h2/src/main/org/h2/util/NetworkConnectionInfo.java index d4f6d3183e..d562dc7864 100644 --- a/h2/src/main/org/h2/util/NetworkConnectionInfo.java +++ b/h2/src/main/org/h2/util/NetworkConnectionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/OsgiDataSourceFactory.java b/h2/src/main/org/h2/util/OsgiDataSourceFactory.java index 098192bc49..002f605db5 100644 --- a/h2/src/main/org/h2/util/OsgiDataSourceFactory.java +++ b/h2/src/main/org/h2/util/OsgiDataSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/ParserUtil.java b/h2/src/main/org/h2/util/ParserUtil.java index ede561989b..95498a4a26 100644 --- a/h2/src/main/org/h2/util/ParserUtil.java +++ b/h2/src/main/org/h2/util/ParserUtil.java @@ -1,10 +1,12 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.util; +import java.util.HashMap; + public class ParserUtil { /** @@ -224,15 +226,10 @@ public class ParserUtil { */ public static final int INTERSECT = INNER + 1; - /** - * The token "INTERSECTS". - */ - public static final int INTERSECTS = INTERSECT + 1; - /** * The token "INTERVAL". */ - public static final int INTERVAL = INTERSECTS + 1; + public static final int INTERVAL = INTERSECT + 1; /** * The token "IS". @@ -481,6 +478,115 @@ public class ParserUtil { */ public static final int LAST_KEYWORD = _ROWID_; + private static final HashMap KEYWORDS; + + static { + HashMap map = new HashMap<>(256); + map.put("ALL", ALL); + map.put("AND", AND); + map.put("ANY", ANY); + map.put("ARRAY", ARRAY); + map.put("AS", AS); + map.put("ASYMMETRIC", ASYMMETRIC); + map.put("AUTHORIZATION", AUTHORIZATION); + map.put("BETWEEN", BETWEEN); + map.put("CASE", CASE); + map.put("CAST", CAST); + map.put("CHECK", CHECK); + map.put("CONSTRAINT", CONSTRAINT); + map.put("CROSS", CROSS); + map.put("CURRENT_CATALOG", CURRENT_CATALOG); + map.put("CURRENT_DATE", CURRENT_DATE); + map.put("CURRENT_PATH", CURRENT_PATH); + map.put("CURRENT_ROLE", CURRENT_ROLE); + map.put("CURRENT_SCHEMA", CURRENT_SCHEMA); + map.put("CURRENT_TIME", CURRENT_TIME); + map.put("CURRENT_TIMESTAMP", CURRENT_TIMESTAMP); + map.put("CURRENT_USER", CURRENT_USER); + map.put("DAY", DAY); + map.put("DEFAULT", DEFAULT); + map.put("DISTINCT", DISTINCT); + map.put("ELSE", ELSE); + map.put("END", END); + map.put("EXCEPT", EXCEPT); + map.put("EXISTS", EXISTS); + map.put("FALSE", FALSE); + map.put("FETCH", FETCH); + map.put("FOR", FOR); + map.put("FOREIGN", FOREIGN); + map.put("FROM", FROM); + map.put("FULL", FULL); + map.put("GROUP", GROUP); + map.put("HAVING", HAVING); + map.put("HOUR", HOUR); + map.put("IF", IF); + map.put("IN", IN); + map.put("INNER", INNER); + map.put("INTERSECT", INTERSECT); + map.put("INTERVAL", INTERVAL); + map.put("IS", IS); + map.put("JOIN", JOIN); + map.put("KEY", KEY); + map.put("LEFT", LEFT); + map.put("LIKE", LIKE); + map.put("LIMIT", LIMIT); + map.put("LOCALTIME", LOCALTIME); + map.put("LOCALTIMESTAMP", LOCALTIMESTAMP); + map.put("MINUS", MINUS); + map.put("MINUTE", MINUTE); + map.put("MONTH", MONTH); + map.put("NATURAL", NATURAL); + map.put("NOT", NOT); + map.put("NULL", NULL); + map.put("OFFSET", OFFSET); + map.put("ON", ON); + map.put("OR", OR); + map.put("ORDER", ORDER); + map.put("PRIMARY", PRIMARY); + map.put("QUALIFY", QUALIFY); + map.put("RIGHT", RIGHT); + map.put("ROW", ROW); + map.put("ROWNUM", ROWNUM); + map.put("SECOND", SECOND); + map.put("SELECT", SELECT); + map.put("SESSION_USER", SESSION_USER); + map.put("SET", SET); + map.put("SOME", SOME); + map.put("SYMMETRIC", SYMMETRIC); + map.put("SYSTEM_USER", SYSTEM_USER); + map.put("TABLE", TABLE); + map.put("TO", TO); + map.put("TRUE", TRUE); + map.put("UESCAPE", UESCAPE); + map.put("UNION", UNION); + map.put("UNIQUE", UNIQUE); + map.put("UNKNOWN", UNKNOWN); + map.put("USER", USER); + map.put("USING", USING); + map.put("VALUE", VALUE); + map.put("VALUES", VALUES); + map.put("WHEN", WHEN); + map.put("WHERE", WHERE); + map.put("WINDOW", WINDOW); + map.put("WITH", WITH); + map.put("YEAR", YEAR); + map.put("_ROWID_", _ROWID_); + // Additional keywords + map.put("BOTH", KEYWORD); + map.put("FILTER", KEYWORD); + map.put("GROUPS", KEYWORD); + map.put("ILIKE", KEYWORD); + map.put("LEADING", KEYWORD); + map.put("OVER", KEYWORD); + map.put("PARTITION", KEYWORD); + map.put("RANGE", KEYWORD); + map.put("REGEXP", KEYWORD); + map.put("ROWS", KEYWORD); + map.put("TOP", KEYWORD); + map.put("TRAILING", KEYWORD); + KEYWORDS = map; + } + private ParserUtil() { // utility class } @@ -513,7 +619,7 @@ public static StringBuilder quoteIdentifier(StringBuilder builder, String s, int * @return true if it is a keyword */ public static boolean isKeyword(String s, boolean ignoreCase) { - return getTokenType(s, ignoreCase, 0, s.length(), false) != IDENTIFIER; + return getTokenType(s, ignoreCase, false) != IDENTIFIER; } /** @@ -539,7 +645,7 @@ public static boolean isSimpleIdentifier(String s, boolean databaseToUpper, bool return false; } } - return getTokenType(s, !databaseToUpper, 0, length, true) == IDENTIFIER; + return getTokenType(s, !databaseToUpper, true) == IDENTIFIER; } private static boolean checkLetter(boolean databaseToUpper, boolean databaseToLower, char c) { @@ -565,379 +671,25 @@ private static boolean checkLetter(boolean databaseToUpper, boolean databaseToLo * @param s the string with token * @param ignoreCase true if case should be ignored, false if only upper case * tokens are detected as keywords - * @param start start index of token - * @param length length of token; must be positive * @param additionalKeywords * whether context-sensitive keywords are returned as * {@link #KEYWORD} * @return the token type */ - public static int getTokenType(String s, boolean ignoreCase, int start, int length, boolean additionalKeywords) { + public static int getTokenType(String s, boolean ignoreCase, boolean additionalKeywords) { + int length = s.length(); if (length <= 1 || length > 17) { return IDENTIFIER; } - /* - * DatabaseMetaLocal.getSQLKeywords() and tests should be updated when new - * non-SQL:2003 keywords are introduced here. - */ - char c1 = s.charAt(start); if (ignoreCase) { - // Convert a-z to A-Z and 0x7f to _ (need special handling). - c1 &= 0xffdf; - } - if (length == 2) { - char c2 = s.charAt(start + 1); - if (ignoreCase) { - c2 &= 0xffdf; - } - switch (c1) { - case 'A': - if (c2 == 'S') { - return AS; - } - return IDENTIFIER; - case 'I': - if (c2 == 'F') { - return IF; - } else if (c2 == 'N') { - return IN; - } else if (c2 == 'S') { - return IS; - } - return IDENTIFIER; - case 'O': - if (c2 == 'N') { - return ON; - } else if (c2 == 'R') { - return OR; - } - return IDENTIFIER; - case 'T': - if (c2 == 'O') { - return TO; - } - //$FALL-THROUGH$ - default: - return IDENTIFIER; - } + s = StringUtils.toUpperEnglish(s); } - switch (c1) { - case 'A': - if (eq("ALL", s, ignoreCase, start, length)) { - return ALL; - } else if (eq("AND", s, ignoreCase, start, length)) { - return AND; - } else if (eq("ANY", s, ignoreCase, start, length)) { - return ANY; - } else if (eq("ARRAY", s, ignoreCase, start, length)) { - return ARRAY; - } else if (eq("ASYMMETRIC", s, ignoreCase, start, length)) { - return ASYMMETRIC; - } else if (eq("AUTHORIZATION", s, ignoreCase, start, length)) { - return AUTHORIZATION; - } - return IDENTIFIER; - case 'B': - if (eq("BETWEEN", s, ignoreCase, start, length)) { - return BETWEEN; - } - if (additionalKeywords) { - if (eq("BOTH", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'C': - if (eq("CASE", s, ignoreCase, start, length)) { - return CASE; - } else if (eq("CAST", s, ignoreCase, start, length)) { - return CAST; - } else if (eq("CHECK", s, ignoreCase, start, length)) { - return CHECK; - } else if (eq("CONSTRAINT", s, ignoreCase, start, length)) { - return CONSTRAINT; - } else if (eq("CROSS", s, ignoreCase, start, length)) { - return CROSS; - } else if (length >= 12 && "CURRENT_".regionMatches(ignoreCase, 1, s, start + 1, 7)) { - return getTokenTypeCurrent(s, ignoreCase, start, length); - } - return IDENTIFIER; - case 'D': - if (eq("DAY", s, ignoreCase, start, length)) { - return DAY; - } else if (eq("DEFAULT", s, ignoreCase, start, length)) { - return DEFAULT; - } else if (eq("DISTINCT", s, ignoreCase, start, length)) { - return DISTINCT; - } - return IDENTIFIER; - case 'E': - if (eq("ELSE", s, ignoreCase, start, length)) { - return ELSE; - } else if (eq("END", s, ignoreCase, start, length)) { - return END; - } else if (eq("EXCEPT", s, ignoreCase, start, length)) { - return EXCEPT; - } else if (eq("EXISTS", s, ignoreCase, start, length)) { - return EXISTS; - } + Integer type = KEYWORDS.get(s); + if (type == null) { return IDENTIFIER; - case 'F': - if (eq("FETCH", s, ignoreCase, start, length)) { - return FETCH; - } else if (eq("FROM", s, ignoreCase, start, length)) { - return FROM; - } else if (eq("FOR", s, ignoreCase, start, length)) { - return FOR; - } else if (eq("FOREIGN", s, ignoreCase, start, length)) { - return FOREIGN; - } else if (eq("FULL", s, ignoreCase, start, length)) { - return FULL; - } else if (eq("FALSE", s, ignoreCase, start, length)) { - return FALSE; - } - if (additionalKeywords) { - if (eq("FILTER", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'G': - if (eq("GROUP", s, ignoreCase, start, length)) { - return GROUP; - } - if (additionalKeywords) { - if (eq("GROUPS", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'H': - if (eq("HAVING", s, ignoreCase, start, length)) { - return HAVING; - } else if (eq("HOUR", s, ignoreCase, start, length)) { - return HOUR; - } - return IDENTIFIER; - case 'I': - if (eq("INNER", s, ignoreCase, start, length)) { - return INNER; - } else if (eq("INTERSECT", s, ignoreCase, start, length)) { - return INTERSECT; - } else if (eq("INTERSECTS", s, ignoreCase, start, length)) { - return INTERSECTS; - } else if (eq("INTERVAL", s, ignoreCase, start, length)) { - return INTERVAL; - } - if (additionalKeywords) { - if (eq("ILIKE", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'J': - if (eq("JOIN", s, ignoreCase, start, length)) { - return JOIN; - } - return IDENTIFIER; - case 'K': - if (eq("KEY", s, ignoreCase, start, length)) { - return KEY; - } - return IDENTIFIER; - case 'L': - if (eq("LEFT", s, ignoreCase, start, length)) { - return LEFT; - } else if (eq("LIMIT", s, ignoreCase, start, length)) { - return LIMIT; - } else if (eq("LIKE", s, ignoreCase, start, length)) { - return LIKE; - } else if (eq("LOCALTIME", s, ignoreCase, start, length)) { - return LOCALTIME; - } else if (eq("LOCALTIMESTAMP", s, ignoreCase, start, length)) { - return LOCALTIMESTAMP; - } - if (additionalKeywords) { - if (eq("LEADING", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'M': - if (eq("MINUS", s, ignoreCase, start, length)) { - return MINUS; - } else if (eq("MINUTE", s, ignoreCase, start, length)) { - return MINUTE; - } else if (eq("MONTH", s, ignoreCase, start, length)) { - return MONTH; - } - return IDENTIFIER; - case 'N': - if (eq("NOT", s, ignoreCase, start, length)) { - return NOT; - } else if (eq("NATURAL", s, ignoreCase, start, length)) { - return NATURAL; - } else if (eq("NULL", s, ignoreCase, start, length)) { - return NULL; - } - return IDENTIFIER; - case 'O': - if (eq("OFFSET", s, ignoreCase, start, length)) { - return OFFSET; - } else if (eq("ORDER", s, ignoreCase, start, length)) { - return ORDER; - } - if (additionalKeywords) { - if (eq("OVER", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'P': - if (eq("PRIMARY", s, ignoreCase, start, length)) { - return PRIMARY; - } - if (additionalKeywords) { - if (eq("PARTITION", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'Q': - if (eq("QUALIFY", s, ignoreCase, start, length)) { - return QUALIFY; - } - return IDENTIFIER; - case 'R': - if (eq("RIGHT", s, ignoreCase, start, length)) { - return RIGHT; - } else if (eq("ROW", s, ignoreCase, start, length)) { - return ROW; - } else if (eq("ROWNUM", s, ignoreCase, start, length)) { - return ROWNUM; - } - if (additionalKeywords) { - if (eq("RANGE", s, ignoreCase, start, length) || eq("REGEXP", s, ignoreCase, start, length) - || eq("ROWS", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'S': - if (eq("SECOND", s, ignoreCase, start, length)) { - return SECOND; - } else if (eq("SELECT", s, ignoreCase, start, length)) { - return SELECT; - } else if (eq("SESSION_USER", s, ignoreCase, start, length)) { - return SESSION_USER; - } else if (eq("SET", s, ignoreCase, start, length)) { - return SET; - } else if (eq("SOME", s, ignoreCase, start, length)) { - return SOME; - } else if (eq("SYMMETRIC", s, ignoreCase, start, length)) { - return SYMMETRIC; - } else if (eq("SYSTEM_USER", s, ignoreCase, start, length)) { - return SYSTEM_USER; - } - return IDENTIFIER; - case 'T': - if (eq("TABLE", s, ignoreCase, start, length)) { - return TABLE; - } else if (eq("TRUE", s, ignoreCase, start, length)) { - return TRUE; - } - if (additionalKeywords) { - if (eq("TOP", s, ignoreCase, start, length) || eq("TRAILING", s, ignoreCase, start, length)) { - return KEYWORD; - } - } - return IDENTIFIER; - case 'U': - if (eq("UESCAPE", s, ignoreCase, start, length)) { - return UESCAPE; - } else if (eq("UNION", s, ignoreCase, start, length)) { - return UNION; - } else if (eq("UNIQUE", s, ignoreCase, start, length)) { - return UNIQUE; - } else if (eq("UNKNOWN", s, ignoreCase, start, length)) { - return UNKNOWN; - } else if (eq("USER", s, ignoreCase, start, length)) { - return USER; - } else if (eq("USING", s, ignoreCase, start, length)) { - return USING; - } - return IDENTIFIER; - case 'V': - if (eq("VALUE", s, ignoreCase, start, length)) { - return VALUE; - } else if (eq("VALUES", s, ignoreCase, start, length)) { - return VALUES; - } - return IDENTIFIER; - case 'W': - if (eq("WHEN", s, ignoreCase, start, length)) { - return WHEN; - } else if (eq("WHERE", s, ignoreCase, start, length)) { - return WHERE; - } else if (eq("WINDOW", s, ignoreCase, start, length)) { - return WINDOW; - } else if (eq("WITH", s, ignoreCase, start, length)) { - return WITH; - } - return IDENTIFIER; - case 'Y': - if (eq("YEAR", s, ignoreCase, start, length)) { - return YEAR; - } - return IDENTIFIER; - case '_': - // Cannot use eq() because 0x7f can be converted to '_' (0x5f) - if (length == 7 && "_ROWID_".regionMatches(ignoreCase, 0, s, start, 7)) { - return _ROWID_; - } - //$FALL-THROUGH$ - default: - return IDENTIFIER; - } - } - - private static boolean eq(String expected, String s, boolean ignoreCase, int start, int length) { - // First letter was already checked - return length == expected.length() && expected.regionMatches(ignoreCase, 1, s, start + 1, length - 1); - } - - private static int getTokenTypeCurrent(String s, boolean ignoreCase, int start, int length) { - start += 8; - switch (length -= 8) { - case 4: - if ("CURRENT_DATE".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_DATE; - } else if ("CURRENT_PATH".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_PATH; - } else if ("CURRENT_ROLE".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_ROLE; - } else if ("CURRENT_TIME".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_TIME; - } else if ("CURRENT_USER".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_USER; - } - break; - case 6: - if ("CURRENT_SCHEMA".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_SCHEMA; - } - break; - case 7: - if ("CURRENT_CATALOG".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_CATALOG; - } - break; - case 9: - if ("CURRENT_TIMESTAMP".regionMatches(ignoreCase, 8, s, start, length)) { - return CURRENT_TIMESTAMP; - } } - return IDENTIFIER; + int t = type; + return t == KEYWORD && !additionalKeywords ? IDENTIFIER : t; } } diff --git a/h2/src/main/org/h2/util/Permutations.java b/h2/src/main/org/h2/util/Permutations.java index 90ec967002..08a3bf6fed 100644 --- a/h2/src/main/org/h2/util/Permutations.java +++ b/h2/src/main/org/h2/util/Permutations.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group * diff --git a/h2/src/main/org/h2/util/Profiler.java b/h2/src/main/org/h2/util/Profiler.java index 374939a1eb..4bcc28f993 100644 --- a/h2/src/main/org/h2/util/Profiler.java +++ b/h2/src/main/org/h2/util/Profiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/ScriptReader.java b/h2/src/main/org/h2/util/ScriptReader.java index 56ede3dd9f..8a930ca42c 100644 --- a/h2/src/main/org/h2/util/ScriptReader.java +++ b/h2/src/main/org/h2/util/ScriptReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/SimpleColumnInfo.java b/h2/src/main/org/h2/util/SimpleColumnInfo.java index 4299aced04..4e0672e607 100644 --- a/h2/src/main/org/h2/util/SimpleColumnInfo.java +++ b/h2/src/main/org/h2/util/SimpleColumnInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/SmallLRUCache.java b/h2/src/main/org/h2/util/SmallLRUCache.java index c90f5d243c..7b9d67f55b 100644 --- a/h2/src/main/org/h2/util/SmallLRUCache.java +++ b/h2/src/main/org/h2/util/SmallLRUCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/SmallMap.java b/h2/src/main/org/h2/util/SmallMap.java index 9306dcfc05..3dc55a0e7e 100644 --- a/h2/src/main/org/h2/util/SmallMap.java +++ b/h2/src/main/org/h2/util/SmallMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/SoftValuesHashMap.java b/h2/src/main/org/h2/util/SoftValuesHashMap.java index 359a41d1f6..ddade87f51 100644 --- a/h2/src/main/org/h2/util/SoftValuesHashMap.java +++ b/h2/src/main/org/h2/util/SoftValuesHashMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/SortedProperties.java b/h2/src/main/org/h2/util/SortedProperties.java index b6830d22e3..7989dd83ae 100644 --- a/h2/src/main/org/h2/util/SortedProperties.java +++ b/h2/src/main/org/h2/util/SortedProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/SourceCompiler.java b/h2/src/main/org/h2/util/SourceCompiler.java index 37d1fabfcf..38fed8f456 100644 --- a/h2/src/main/org/h2/util/SourceCompiler.java +++ b/h2/src/main/org/h2/util/SourceCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/StringUtils.java b/h2/src/main/org/h2/util/StringUtils.java index 1c0b8ef9ce..85bca6b51f 100644 --- a/h2/src/main/org/h2/util/StringUtils.java +++ b/h2/src/main/org/h2/util/StringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -541,24 +541,6 @@ public static String arrayCombine(String[] list, char separatorChar) { return builder.toString(); } - /** - * Join specified strings and add them to the specified string builder. - * - * @param builder string builder - * @param strings strings to join - * @param separator separator - * @return the specified string builder - */ - public static StringBuilder join(StringBuilder builder, ArrayList strings, String separator) { - for (int i = 0, l = strings.size(); i < l; i++) { - if (i > 0) { - builder.append(separator); - } - builder.append(strings.get(i)); - } - return builder; - } - /** * Creates an XML attribute of the form name="value". * A single space is prepended to the name, @@ -1125,7 +1107,7 @@ public static byte[] convertHexToBytes(String s) { * @param end the end index, exclusive * @return the specified output stream or a new output stream */ - public static ByteArrayOutputStream convertHexWithSpacesToBytes(ByteArrayOutputStream baos, char[] s, int start, + public static ByteArrayOutputStream convertHexWithSpacesToBytes(ByteArrayOutputStream baos, String s, int start, int end) { if (baos == null) { baos = new ByteArrayOutputStream((end - start) >>> 1); @@ -1139,7 +1121,7 @@ public static ByteArrayOutputStream convertHexWithSpacesToBytes(ByteArrayOutputS if (i >= end) { break loop; } - c1 = s[i++]; + c1 = s.charAt(i++); } while (c1 == ' '); do { if (i >= end) { @@ -1148,7 +1130,7 @@ public static ByteArrayOutputStream convertHexWithSpacesToBytes(ByteArrayOutputS } throw getHexStringException(ErrorCode.HEX_STRING_ODD_1, s, start, end); } - c2 = s[i++]; + c2 = s.charAt(i++); } while (c2 == ' '); int d = hex[c1] << 4 | hex[c2]; mask |= d; @@ -1163,8 +1145,8 @@ public static ByteArrayOutputStream convertHexWithSpacesToBytes(ByteArrayOutputS return baos; } - private static DbException getHexStringException(int code, char[] s, int start, int end) { - return DbException.get(code, new String(s, start, end - start)); + private static DbException getHexStringException(int code, String s, int start, int end) { + return DbException.get(code, s.substring(start, end)); } /** diff --git a/h2/src/main/org/h2/util/Task.java b/h2/src/main/org/h2/util/Task.java index 7e9ca54ca8..b238ee10c7 100644 --- a/h2/src/main/org/h2/util/Task.java +++ b/h2/src/main/org/h2/util/Task.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/TempFileDeleter.java b/h2/src/main/org/h2/util/TempFileDeleter.java index 5c2c7cc0c7..1afe2da7cb 100644 --- a/h2/src/main/org/h2/util/TempFileDeleter.java +++ b/h2/src/main/org/h2/util/TempFileDeleter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/ThreadDeadlockDetector.java b/h2/src/main/org/h2/util/ThreadDeadlockDetector.java index 856296129c..8acdb9c019 100644 --- a/h2/src/main/org/h2/util/ThreadDeadlockDetector.java +++ b/h2/src/main/org/h2/util/ThreadDeadlockDetector.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/TimeZoneProvider.java b/h2/src/main/org/h2/util/TimeZoneProvider.java index d1c59f4526..f5b7bc2f64 100644 --- a/h2/src/main/org/h2/util/TimeZoneProvider.java +++ b/h2/src/main/org/h2/util/TimeZoneProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/Tool.java b/h2/src/main/org/h2/util/Tool.java index f2f118cf84..1ad65d98d8 100644 --- a/h2/src/main/org/h2/util/Tool.java +++ b/h2/src/main/org/h2/util/Tool.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/Utils.java b/h2/src/main/org/h2/util/Utils.java index c56cbb5465..4594146fba 100644 --- a/h2/src/main/org/h2/util/Utils.java +++ b/h2/src/main/org/h2/util/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/Utils10.java b/h2/src/main/org/h2/util/Utils10.java index a97fb61525..a77dbac435 100644 --- a/h2/src/main/org/h2/util/Utils10.java +++ b/h2/src/main/org/h2/util/Utils10.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/geometry/EWKBUtils.java b/h2/src/main/org/h2/util/geometry/EWKBUtils.java index 61d9ea589f..8a598dc775 100644 --- a/h2/src/main/org/h2/util/geometry/EWKBUtils.java +++ b/h2/src/main/org/h2/util/geometry/EWKBUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -26,7 +26,6 @@ import org.h2.util.Bits; import org.h2.util.StringUtils; -import org.h2.util.geometry.GeometryUtils.DimensionSystemTarget; import org.h2.util.geometry.GeometryUtils.Target; /** @@ -155,9 +154,13 @@ protected void addCoordinate(double x, double y, double z, double m, int index, writeDouble(y); if ((dimensionSystem & DIMENSION_SYSTEM_XYZ) != 0) { writeDouble(check ? checkFinite(z) : z); + } else if (check && !Double.isNaN(z)) { + throw new IllegalArgumentException(); } if ((dimensionSystem & DIMENSION_SYSTEM_XYM) != 0) { writeDouble(check ? checkFinite(m) : m); + } else if (check && !Double.isNaN(m)) { + throw new IllegalArgumentException(); } } @@ -263,11 +266,7 @@ public String toString() { * @return canonical EWKB, may be the same as the source */ public static byte[] ewkb2ewkb(byte[] ewkb) { - // Determine dimension system first - DimensionSystemTarget dimensionTarget = new DimensionSystemTarget(); - parseEWKB(ewkb, dimensionTarget); - // Write an EWKB - return ewkb2ewkb(ewkb, dimensionTarget.getDimensionSystem()); + return ewkb2ewkb(ewkb, getDimensionSystem(ewkb)); } /** @@ -490,6 +489,29 @@ private static void addCoordinate(EWKBSource source, Target target, boolean useZ index, total); } + /** + * Reads the dimension system from EWKB. + * + * @param ewkb + * EWKB + * @return the dimension system + */ + public static int getDimensionSystem(byte[] ewkb) { + EWKBSource source = new EWKBSource(ewkb); + // Read byte order of a next geometry + switch (source.readByte()) { + case 0: + source.bigEndian = true; + break; + case 1: + source.bigEndian = false; + break; + default: + throw new IllegalArgumentException(); + } + return type2dimensionSystem(source.readInt()); + } + /** * Converts an envelope to a WKB. * diff --git a/h2/src/main/org/h2/util/geometry/EWKTUtils.java b/h2/src/main/org/h2/util/geometry/EWKTUtils.java index 04670c091b..ccf245d615 100644 --- a/h2/src/main/org/h2/util/geometry/EWKTUtils.java +++ b/h2/src/main/org/h2/util/geometry/EWKTUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -26,7 +26,6 @@ import org.h2.util.StringUtils; import org.h2.util.geometry.EWKBUtils.EWKBTarget; -import org.h2.util.geometry.GeometryUtils.DimensionSystemTarget; import org.h2.util.geometry.GeometryUtils.Target; /** @@ -522,11 +521,7 @@ public String toString() { * @return EWKT representation */ public static String ewkb2ewkt(byte[] ewkb) { - // Determine dimension system first - DimensionSystemTarget dimensionTarget = new DimensionSystemTarget(); - EWKBUtils.parseEWKB(ewkb, dimensionTarget); - // Write an EWKT - return ewkb2ewkt(ewkb, dimensionTarget.getDimensionSystem()); + return ewkb2ewkt(ewkb, EWKBUtils.getDimensionSystem(ewkb)); } /** @@ -552,11 +547,7 @@ public static String ewkb2ewkt(byte[] ewkb, int dimensionSystem) { * @return EWKB representation */ public static byte[] ewkt2ewkb(String ewkt) { - // Determine dimension system first - DimensionSystemTarget dimensionTarget = new DimensionSystemTarget(); - parseEWKT(ewkt, dimensionTarget); - // Write an EWKB - return ewkt2ewkb(ewkt, dimensionTarget.getDimensionSystem()); + return ewkt2ewkb(ewkt, getDimensionSystem(ewkt)); } /** @@ -576,7 +567,7 @@ public static byte[] ewkt2ewkb(String ewkt, int dimensionSystem) { } /** - * Parses a EWKB. + * Parses a EWKT. * * @param ewkt * source EWKT @@ -864,37 +855,33 @@ private static void addRing(ArrayList ring, Target target) { private static void addCoordinate(EWKTSource source, Target target, int dimensionSystem, int index, int total) { double x = source.readCoordinate(); double y = source.readCoordinate(); - double z = Double.NaN, m = Double.NaN; - if (source.hasCoordinate()) { - if (dimensionSystem == DIMENSION_SYSTEM_XYM) { - m = source.readCoordinate(); - } else { - z = source.readCoordinate(); - if (source.hasCoordinate()) { - m = source.readCoordinate(); - } - } - } + double z = (dimensionSystem & DIMENSION_SYSTEM_XYZ) != 0 ? source.readCoordinate() : Double.NaN; + double m = (dimensionSystem & DIMENSION_SYSTEM_XYM) != 0 ? source.readCoordinate() : Double.NaN; target.addCoordinate(x, y, z, m, index, total); } private static double[] readCoordinate(EWKTSource source, int dimensionSystem) { double x = source.readCoordinate(); double y = source.readCoordinate(); - double z = Double.NaN, m = Double.NaN; - if (source.hasCoordinate()) { - if (dimensionSystem == DIMENSION_SYSTEM_XYM) { - m = source.readCoordinate(); - } else { - z = source.readCoordinate(); - if (source.hasCoordinate()) { - m = source.readCoordinate(); - } - } - } + double z = (dimensionSystem & DIMENSION_SYSTEM_XYZ) != 0 ? source.readCoordinate() : Double.NaN; + double m = (dimensionSystem & DIMENSION_SYSTEM_XYM) != 0 ? source.readCoordinate() : Double.NaN; return new double[] { x, y, z, m }; } + /** + * Reads the dimension system from EWKT. + * + * @param ewkt + * EWKT source + * @return the dimension system + */ + public static int getDimensionSystem(String ewkt) { + EWKTSource source = new EWKTSource(ewkt); + source.readSRID(); + source.readType(); + return source.readDimensionSystem(); + } + private EWKTUtils() { } diff --git a/h2/src/main/org/h2/util/geometry/GeoJsonUtils.java b/h2/src/main/org/h2/util/geometry/GeoJsonUtils.java index 12efd4a922..1ba11df788 100644 --- a/h2/src/main/org/h2/util/geometry/GeoJsonUtils.java +++ b/h2/src/main/org/h2/util/geometry/GeoJsonUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/geometry/GeometryUtils.java b/h2/src/main/org/h2/util/geometry/GeometryUtils.java index fdd3fe6a4d..ef4bf8ea74 100644 --- a/h2/src/main/org/h2/util/geometry/GeometryUtils.java +++ b/h2/src/main/org/h2/util/geometry/GeometryUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -281,116 +281,6 @@ public int getDimensionSystem() { } - /** - * Converter output target that calculates an envelope and determines the - * minimal dimension system. - */ - public static final class EnvelopeAndDimensionSystemTarget extends Target { - - /** - * Enables or disables the envelope calculation. Inner rings of polygons - * are not counted. - */ - private boolean enabled; - - /** - * Whether envelope was set. - */ - private boolean set; - - private double minX, maxX, minY, maxY; - - private boolean hasZ; - - private boolean hasM; - - /** - * Creates a new envelope and dimension system calculation target. - */ - public EnvelopeAndDimensionSystemTarget() { - } - - @Override - protected void dimensionSystem(int dimensionSystem) { - if ((dimensionSystem & DIMENSION_SYSTEM_XYZ) != 0) { - hasZ = true; - } - if ((dimensionSystem & DIMENSION_SYSTEM_XYM) != 0) { - hasM = true; - } - } - - @Override - protected void startPoint() { - enabled = true; - } - - @Override - protected void startLineString(int numPoints) { - enabled = true; - } - - @Override - protected void startPolygon(int numInner, int numPoints) { - enabled = true; - } - - @Override - protected void startPolygonInner(int numInner) { - enabled = false; - } - - @Override - protected void addCoordinate(double x, double y, double z, double m, int index, int total) { - if (!hasZ && !Double.isNaN(z)) { - hasZ = true; - } - if (!hasM && !Double.isNaN(m)) { - hasM = true; - } - // POINT EMPTY has NaNs - if (enabled && !Double.isNaN(x) && !Double.isNaN(y)) { - if (!set) { - minX = maxX = x; - minY = maxY = y; - set = true; - } else { - if (minX > x) { - minX = x; - } - if (maxX < x) { - maxX = x; - } - if (minY > y) { - minY = y; - } - if (maxY < y) { - maxY = y; - } - } - } - } - - /** - * Returns the envelope. - * - * @return the envelope, or null - */ - public double[] getEnvelope() { - return set ? new double[] { minX, maxX, minY, maxY } : null; - } - - /** - * Returns the minimal dimension system. - * - * @return the minimal dimension system - */ - public int getDimensionSystem() { - return (hasZ ? DIMENSION_SYSTEM_XYZ : 0) | (hasM ? DIMENSION_SYSTEM_XYM : 0); - } - - } - /** * POINT geometry type. */ diff --git a/h2/src/main/org/h2/util/geometry/JTSUtils.java b/h2/src/main/org/h2/util/geometry/JTSUtils.java index 953e9e539e..40d1dc3b17 100644 --- a/h2/src/main/org/h2/util/geometry/JTSUtils.java +++ b/h2/src/main/org/h2/util/geometry/JTSUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -27,7 +27,6 @@ import org.h2.message.DbException; import org.h2.util.geometry.EWKBUtils.EWKBTarget; -import org.h2.util.geometry.GeometryUtils.DimensionSystemTarget; import org.h2.util.geometry.GeometryUtils.Target; import org.locationtech.jts.geom.CoordinateSequence; import org.locationtech.jts.geom.Geometry; @@ -236,11 +235,7 @@ Geometry getGeometry() { * @return JTS geometry object */ public static Geometry ewkb2geometry(byte[] ewkb) { - // Determine dimension system first - DimensionSystemTarget dimensionTarget = new DimensionSystemTarget(); - EWKBUtils.parseEWKB(ewkb, dimensionTarget); - // Generate a Geometry - return ewkb2geometry(ewkb, dimensionTarget.getDimensionSystem()); + return ewkb2geometry(ewkb, EWKBUtils.getDimensionSystem(ewkb)); } /** @@ -266,11 +261,7 @@ public static Geometry ewkb2geometry(byte[] ewkb, int dimensionSystem) { * @return EWKB representation */ public static byte[] geometry2ewkb(Geometry geometry) { - // Determine dimension system first - DimensionSystemTarget dimensionTarget = new DimensionSystemTarget(); - parseGeometry(geometry, dimensionTarget); - // Write an EWKB - return geometry2ewkb(geometry, dimensionTarget.getDimensionSystem()); + return geometry2ewkb(geometry, getDimensionSystem(geometry)); } /** @@ -325,8 +316,7 @@ private static void parseGeometry(Geometry geometry, Target target, int parentTy if (p.isEmpty()) { target.addCoordinate(Double.NaN, Double.NaN, Double.NaN, Double.NaN, 0, 1); } else { - CoordinateSequence sequence = p.getCoordinateSequence(); - addCoordinate(sequence, target, 0, 1); + addCoordinate(p.getCoordinateSequence(), target, 0, 1); } target.endObject(POINT); } else if (geometry instanceof LineString) { @@ -336,7 +326,7 @@ private static void parseGeometry(Geometry geometry, Target target, int parentTy LineString ls = (LineString) geometry; CoordinateSequence cs = ls.getCoordinateSequence(); int numPoints = cs.size(); - if (numPoints < 0 || numPoints == 1) { + if (numPoints == 1) { throw new IllegalArgumentException(); } target.startLineString(numPoints); @@ -350,13 +340,10 @@ private static void parseGeometry(Geometry geometry, Target target, int parentTy } Polygon p = (Polygon) geometry; int numInner = p.getNumInteriorRing(); - if (numInner < 0) { - throw new IllegalArgumentException(); - } CoordinateSequence cs = p.getExteriorRing().getCoordinateSequence(); int size = cs.size(); // Size may be 0 (EMPTY) or 4+ - if (size < 0 || size >= 1 && size <= 3) { + if (size >= 1 && size <= 3) { throw new IllegalArgumentException(); } if (size == 0 && numInner > 0) { @@ -369,7 +356,7 @@ private static void parseGeometry(Geometry geometry, Target target, int parentTy cs = p.getInteriorRingN(i).getCoordinateSequence(); size = cs.size(); // Size may be 0 (EMPTY) or 4+ - if (size < 0 || size >= 1 && size <= 3) { + if (size >= 1 && size <= 3) { throw new IllegalArgumentException(); } target.startPolygonInner(size); @@ -394,9 +381,6 @@ private static void parseGeometry(Geometry geometry, Target target, int parentTy type = GEOMETRY_COLLECTION; } int numItems = gc.getNumGeometries(); - if (numItems < 0) { - throw new IllegalArgumentException(); - } target.startCollection(type, numItems); for (int i = 0; i < numItems; i++) { Target innerTarget = target.startCollectionItem(i, numItems); @@ -442,6 +426,62 @@ private static void addCoordinate(CoordinateSequence sequence, Target target, in target.addCoordinate(x, y, z, m, index, total); } + /** + * Determines a dimension system of a JTS Geometry object. + * + * @param geometry + * geometry to parse + * @return the dimension system + */ + public static int getDimensionSystem(Geometry geometry) { + int d = getDimensionSystem1(geometry); + return d >= 0 ? d : 0; + } + + private static int getDimensionSystem1(Geometry geometry) { + int d; + if (geometry instanceof Point) { + d = getDimensionSystemFromSequence(((Point) geometry).getCoordinateSequence()); + } else if (geometry instanceof LineString) { + d = getDimensionSystemFromSequence(((LineString) geometry).getCoordinateSequence()); + } else if (geometry instanceof Polygon) { + d = getDimensionSystemFromSequence(((Polygon) geometry).getExteriorRing().getCoordinateSequence()); + } else if (geometry instanceof GeometryCollection) { + d = -1; + GeometryCollection gc = (GeometryCollection) geometry; + for (int i = 0, l = gc.getNumGeometries(); i < l; i++) { + d = getDimensionSystem1(gc.getGeometryN(i)); + if (d >= 0) { + break; + } + } + } else { + throw new IllegalArgumentException(); + } + return d; + } + + private static int getDimensionSystemFromSequence(CoordinateSequence sequence) { + int size = sequence.size(); + if (size > 0) { + for (int i = 0; i < size; i++) { + int d = getDimensionSystemFromCoordinate(sequence, i); + if (d >= 0) { + return d; + } + } + } + return (sequence.hasZ() ? DIMENSION_SYSTEM_XYZ : 0) | (sequence.hasM() ? DIMENSION_SYSTEM_XYM : 0); + } + + private static int getDimensionSystemFromCoordinate(CoordinateSequence sequence, int index) { + if (Double.isNaN(sequence.getX(index))) { + return -1; + } + return (!Double.isNaN(sequence.getZ(index)) ? DIMENSION_SYSTEM_XYZ : 0) + | (!Double.isNaN(sequence.getM(index)) ? DIMENSION_SYSTEM_XYM : 0); + } + private JTSUtils() { } diff --git a/h2/src/main/org/h2/util/geometry/package.html b/h2/src/main/org/h2/util/geometry/package.html index a608303834..b6d0df09ee 100644 --- a/h2/src/main/org/h2/util/geometry/package.html +++ b/h2/src/main/org/h2/util/geometry/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/util/json/JSONArray.java b/h2/src/main/org/h2/util/json/JSONArray.java index 615fe61643..69e3564fc2 100644 --- a/h2/src/main/org/h2/util/json/JSONArray.java +++ b/h2/src/main/org/h2/util/json/JSONArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONBoolean.java b/h2/src/main/org/h2/util/json/JSONBoolean.java index 6332c918b2..dd00c07876 100644 --- a/h2/src/main/org/h2/util/json/JSONBoolean.java +++ b/h2/src/main/org/h2/util/json/JSONBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONByteArrayTarget.java b/h2/src/main/org/h2/util/json/JSONByteArrayTarget.java index 54a4b9880c..9082b8a9d6 100644 --- a/h2/src/main/org/h2/util/json/JSONByteArrayTarget.java +++ b/h2/src/main/org/h2/util/json/JSONByteArrayTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONBytesSource.java b/h2/src/main/org/h2/util/json/JSONBytesSource.java index 9042c36284..bb42c32fcd 100644 --- a/h2/src/main/org/h2/util/json/JSONBytesSource.java +++ b/h2/src/main/org/h2/util/json/JSONBytesSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONItemType.java b/h2/src/main/org/h2/util/json/JSONItemType.java index 2102319da7..696e67ce6d 100644 --- a/h2/src/main/org/h2/util/json/JSONItemType.java +++ b/h2/src/main/org/h2/util/json/JSONItemType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONNull.java b/h2/src/main/org/h2/util/json/JSONNull.java index caab2a3c14..d5ea3ac93e 100644 --- a/h2/src/main/org/h2/util/json/JSONNull.java +++ b/h2/src/main/org/h2/util/json/JSONNull.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONNumber.java b/h2/src/main/org/h2/util/json/JSONNumber.java index b2fab289c9..de998d61fc 100644 --- a/h2/src/main/org/h2/util/json/JSONNumber.java +++ b/h2/src/main/org/h2/util/json/JSONNumber.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONObject.java b/h2/src/main/org/h2/util/json/JSONObject.java index 08aa3f4e35..2f3565d194 100644 --- a/h2/src/main/org/h2/util/json/JSONObject.java +++ b/h2/src/main/org/h2/util/json/JSONObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONString.java b/h2/src/main/org/h2/util/json/JSONString.java index 5cee103d9d..98659d16dc 100644 --- a/h2/src/main/org/h2/util/json/JSONString.java +++ b/h2/src/main/org/h2/util/json/JSONString.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONStringSource.java b/h2/src/main/org/h2/util/json/JSONStringSource.java index 6de81a9128..b6ff80edd9 100644 --- a/h2/src/main/org/h2/util/json/JSONStringSource.java +++ b/h2/src/main/org/h2/util/json/JSONStringSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONStringTarget.java b/h2/src/main/org/h2/util/json/JSONStringTarget.java index 852347da4e..5646dcbab5 100644 --- a/h2/src/main/org/h2/util/json/JSONStringTarget.java +++ b/h2/src/main/org/h2/util/json/JSONStringTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONTarget.java b/h2/src/main/org/h2/util/json/JSONTarget.java index 9bf955827b..921857f280 100644 --- a/h2/src/main/org/h2/util/json/JSONTarget.java +++ b/h2/src/main/org/h2/util/json/JSONTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONTextSource.java b/h2/src/main/org/h2/util/json/JSONTextSource.java index 489e69b53f..e50451447c 100644 --- a/h2/src/main/org/h2/util/json/JSONTextSource.java +++ b/h2/src/main/org/h2/util/json/JSONTextSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONValidationTarget.java b/h2/src/main/org/h2/util/json/JSONValidationTarget.java index 83bb276ae0..04b880afec 100644 --- a/h2/src/main/org/h2/util/json/JSONValidationTarget.java +++ b/h2/src/main/org/h2/util/json/JSONValidationTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONValidationTargetWithUniqueKeys.java b/h2/src/main/org/h2/util/json/JSONValidationTargetWithUniqueKeys.java index d2e52a99e8..1f5b9ad07b 100644 --- a/h2/src/main/org/h2/util/json/JSONValidationTargetWithUniqueKeys.java +++ b/h2/src/main/org/h2/util/json/JSONValidationTargetWithUniqueKeys.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONValidationTargetWithoutUniqueKeys.java b/h2/src/main/org/h2/util/json/JSONValidationTargetWithoutUniqueKeys.java index f4e5a1e808..85d03a8391 100644 --- a/h2/src/main/org/h2/util/json/JSONValidationTargetWithoutUniqueKeys.java +++ b/h2/src/main/org/h2/util/json/JSONValidationTargetWithoutUniqueKeys.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONValue.java b/h2/src/main/org/h2/util/json/JSONValue.java index 911ce1e4a7..89bfbf456c 100644 --- a/h2/src/main/org/h2/util/json/JSONValue.java +++ b/h2/src/main/org/h2/util/json/JSONValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JSONValueTarget.java b/h2/src/main/org/h2/util/json/JSONValueTarget.java index cfa881ff9b..2df696265f 100644 --- a/h2/src/main/org/h2/util/json/JSONValueTarget.java +++ b/h2/src/main/org/h2/util/json/JSONValueTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/JsonConstructorUtils.java b/h2/src/main/org/h2/util/json/JsonConstructorUtils.java index 1adb628085..b05f813ada 100644 --- a/h2/src/main/org/h2/util/json/JsonConstructorUtils.java +++ b/h2/src/main/org/h2/util/json/JsonConstructorUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/util/json/package.html b/h2/src/main/org/h2/util/json/package.html index fbe82687e4..c34f97e9b7 100644 --- a/h2/src/main/org/h2/util/json/package.html +++ b/h2/src/main/org/h2/util/json/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/util/package.html b/h2/src/main/org/h2/util/package.html index d8f8763c77..fc268b59a2 100644 --- a/h2/src/main/org/h2/util/package.html +++ b/h2/src/main/org/h2/util/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/value/CaseInsensitiveConcurrentMap.java b/h2/src/main/org/h2/value/CaseInsensitiveConcurrentMap.java index 121a8ccf6a..838366e30e 100644 --- a/h2/src/main/org/h2/value/CaseInsensitiveConcurrentMap.java +++ b/h2/src/main/org/h2/value/CaseInsensitiveConcurrentMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/CaseInsensitiveMap.java b/h2/src/main/org/h2/value/CaseInsensitiveMap.java index bfc855af21..230ac7dd71 100644 --- a/h2/src/main/org/h2/value/CaseInsensitiveMap.java +++ b/h2/src/main/org/h2/value/CaseInsensitiveMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/CharsetCollator.java b/h2/src/main/org/h2/value/CharsetCollator.java index 75f4f19e1a..a824924220 100644 --- a/h2/src/main/org/h2/value/CharsetCollator.java +++ b/h2/src/main/org/h2/value/CharsetCollator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/CompareMode.java b/h2/src/main/org/h2/value/CompareMode.java index 81d7824617..aeea652e1c 100644 --- a/h2/src/main/org/h2/value/CompareMode.java +++ b/h2/src/main/org/h2/value/CompareMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/CompareModeDefault.java b/h2/src/main/org/h2/value/CompareModeDefault.java index 77a7ff7079..fe4ac13396 100644 --- a/h2/src/main/org/h2/value/CompareModeDefault.java +++ b/h2/src/main/org/h2/value/CompareModeDefault.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/CompareModeIcu4J.java b/h2/src/main/org/h2/value/CompareModeIcu4J.java index ba10c5f2b7..19312f8f5c 100644 --- a/h2/src/main/org/h2/value/CompareModeIcu4J.java +++ b/h2/src/main/org/h2/value/CompareModeIcu4J.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/DataType.java b/h2/src/main/org/h2/value/DataType.java index 49fc6d08f4..29ec4fcb10 100644 --- a/h2/src/main/org/h2/value/DataType.java +++ b/h2/src/main/org/h2/value/DataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ExtTypeInfo.java b/h2/src/main/org/h2/value/ExtTypeInfo.java index acdeebea4d..98c5446062 100644 --- a/h2/src/main/org/h2/value/ExtTypeInfo.java +++ b/h2/src/main/org/h2/value/ExtTypeInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ExtTypeInfoEnum.java b/h2/src/main/org/h2/value/ExtTypeInfoEnum.java index 97a621d72b..3c3651f727 100644 --- a/h2/src/main/org/h2/value/ExtTypeInfoEnum.java +++ b/h2/src/main/org/h2/value/ExtTypeInfoEnum.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ExtTypeInfoGeometry.java b/h2/src/main/org/h2/value/ExtTypeInfoGeometry.java index 73fb952b29..6f5b086f34 100644 --- a/h2/src/main/org/h2/value/ExtTypeInfoGeometry.java +++ b/h2/src/main/org/h2/value/ExtTypeInfoGeometry.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ExtTypeInfoNumeric.java b/h2/src/main/org/h2/value/ExtTypeInfoNumeric.java index 4e56a7cac1..dafc52b4e6 100644 --- a/h2/src/main/org/h2/value/ExtTypeInfoNumeric.java +++ b/h2/src/main/org/h2/value/ExtTypeInfoNumeric.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ExtTypeInfoRow.java b/h2/src/main/org/h2/value/ExtTypeInfoRow.java index 4e206c9524..2fd2864393 100644 --- a/h2/src/main/org/h2/value/ExtTypeInfoRow.java +++ b/h2/src/main/org/h2/value/ExtTypeInfoRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/Transfer.java b/h2/src/main/org/h2/value/Transfer.java index 1ae70751ab..62496b00c7 100644 --- a/h2/src/main/org/h2/value/Transfer.java +++ b/h2/src/main/org/h2/value/Transfer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/TypeInfo.java b/h2/src/main/org/h2/value/TypeInfo.java index 31028e8148..cc607a239b 100644 --- a/h2/src/main/org/h2/value/TypeInfo.java +++ b/h2/src/main/org/h2/value/TypeInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/Typed.java b/h2/src/main/org/h2/value/Typed.java index d7def27f74..8ec898eeaa 100644 --- a/h2/src/main/org/h2/value/Typed.java +++ b/h2/src/main/org/h2/value/Typed.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/Value.java b/h2/src/main/org/h2/value/Value.java index e09801d74f..dfc57e3100 100644 --- a/h2/src/main/org/h2/value/Value.java +++ b/h2/src/main/org/h2/value/Value.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueArray.java b/h2/src/main/org/h2/value/ValueArray.java index 6cedbc9468..d6ec12b0bb 100644 --- a/h2/src/main/org/h2/value/ValueArray.java +++ b/h2/src/main/org/h2/value/ValueArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueBigDecimalBase.java b/h2/src/main/org/h2/value/ValueBigDecimalBase.java index 9e2ed36e63..5c027b0ad1 100644 --- a/h2/src/main/org/h2/value/ValueBigDecimalBase.java +++ b/h2/src/main/org/h2/value/ValueBigDecimalBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueBigint.java b/h2/src/main/org/h2/value/ValueBigint.java index 194f3edcd5..871aed45d8 100644 --- a/h2/src/main/org/h2/value/ValueBigint.java +++ b/h2/src/main/org/h2/value/ValueBigint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueBinary.java b/h2/src/main/org/h2/value/ValueBinary.java index aa0ea9e258..ef160e4665 100644 --- a/h2/src/main/org/h2/value/ValueBinary.java +++ b/h2/src/main/org/h2/value/ValueBinary.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueBlob.java b/h2/src/main/org/h2/value/ValueBlob.java index a2e11a6004..86879f5ee3 100644 --- a/h2/src/main/org/h2/value/ValueBlob.java +++ b/h2/src/main/org/h2/value/ValueBlob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueBoolean.java b/h2/src/main/org/h2/value/ValueBoolean.java index 31db2fb652..daac8730a0 100644 --- a/h2/src/main/org/h2/value/ValueBoolean.java +++ b/h2/src/main/org/h2/value/ValueBoolean.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueBytesBase.java b/h2/src/main/org/h2/value/ValueBytesBase.java index fa556eaac2..aac8da502b 100644 --- a/h2/src/main/org/h2/value/ValueBytesBase.java +++ b/h2/src/main/org/h2/value/ValueBytesBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueChar.java b/h2/src/main/org/h2/value/ValueChar.java index da0e16beee..be8aa22646 100644 --- a/h2/src/main/org/h2/value/ValueChar.java +++ b/h2/src/main/org/h2/value/ValueChar.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueClob.java b/h2/src/main/org/h2/value/ValueClob.java index 9b3a42c8ad..ce75880f95 100644 --- a/h2/src/main/org/h2/value/ValueClob.java +++ b/h2/src/main/org/h2/value/ValueClob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueCollectionBase.java b/h2/src/main/org/h2/value/ValueCollectionBase.java index aee9288519..1136537531 100644 --- a/h2/src/main/org/h2/value/ValueCollectionBase.java +++ b/h2/src/main/org/h2/value/ValueCollectionBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueDate.java b/h2/src/main/org/h2/value/ValueDate.java index e758d6a412..5c49e1d20c 100644 --- a/h2/src/main/org/h2/value/ValueDate.java +++ b/h2/src/main/org/h2/value/ValueDate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueDecfloat.java b/h2/src/main/org/h2/value/ValueDecfloat.java index 4f69968c6c..2c08d55f95 100644 --- a/h2/src/main/org/h2/value/ValueDecfloat.java +++ b/h2/src/main/org/h2/value/ValueDecfloat.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueDouble.java b/h2/src/main/org/h2/value/ValueDouble.java index 03f1fb3d21..9e3fc9753f 100644 --- a/h2/src/main/org/h2/value/ValueDouble.java +++ b/h2/src/main/org/h2/value/ValueDouble.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueEnum.java b/h2/src/main/org/h2/value/ValueEnum.java index 6e772116d4..2572e28be7 100644 --- a/h2/src/main/org/h2/value/ValueEnum.java +++ b/h2/src/main/org/h2/value/ValueEnum.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueEnumBase.java b/h2/src/main/org/h2/value/ValueEnumBase.java index 6574716ce5..5188fd581a 100644 --- a/h2/src/main/org/h2/value/ValueEnumBase.java +++ b/h2/src/main/org/h2/value/ValueEnumBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueGeometry.java b/h2/src/main/org/h2/value/ValueGeometry.java index fb0bf8bdbc..ca33eac03e 100644 --- a/h2/src/main/org/h2/value/ValueGeometry.java +++ b/h2/src/main/org/h2/value/ValueGeometry.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -14,7 +14,6 @@ import org.h2.util.geometry.EWKBUtils; import org.h2.util.geometry.EWKTUtils; import org.h2.util.geometry.GeometryUtils; -import org.h2.util.geometry.GeometryUtils.EnvelopeAndDimensionSystemTarget; import org.h2.util.geometry.GeometryUtils.EnvelopeTarget; import org.h2.util.geometry.JTSUtils; import org.h2.util.geometry.EWKTUtils.EWKTTarget; @@ -80,11 +79,8 @@ private ValueGeometry(byte[] bytes, double[] envelope) { */ public static ValueGeometry getFromGeometry(Object o) { try { - EnvelopeAndDimensionSystemTarget target = new EnvelopeAndDimensionSystemTarget(); Geometry g = (Geometry) o; - JTSUtils.parseGeometry(g, target); - return (ValueGeometry) Value.cache(new ValueGeometry( // - JTSUtils.geometry2ewkb(g, target.getDimensionSystem()), target.getEnvelope())); + return (ValueGeometry) Value.cache(new ValueGeometry(JTSUtils.geometry2ewkb(g), UNKNOWN_ENVELOPE)); } catch (RuntimeException ex) { throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1, String.valueOf(o)); } @@ -98,10 +94,7 @@ public static ValueGeometry getFromGeometry(Object o) { */ public static ValueGeometry get(String s) { try { - EnvelopeAndDimensionSystemTarget target = new EnvelopeAndDimensionSystemTarget(); - EWKTUtils.parseEWKT(s, target); - return (ValueGeometry) Value.cache(new ValueGeometry( // - EWKTUtils.ewkt2ewkb(s, target.getDimensionSystem()), target.getEnvelope())); + return (ValueGeometry) Value.cache(new ValueGeometry(EWKTUtils.ewkt2ewkb(s), UNKNOWN_ENVELOPE)); } catch (RuntimeException ex) { throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1, s); } @@ -125,10 +118,7 @@ public static ValueGeometry get(byte[] bytes) { */ public static ValueGeometry getFromEWKB(byte[] bytes) { try { - EnvelopeAndDimensionSystemTarget target = new EnvelopeAndDimensionSystemTarget(); - EWKBUtils.parseEWKB(bytes, target); - return (ValueGeometry) Value.cache(new ValueGeometry( // - EWKBUtils.ewkb2ewkb(bytes, target.getDimensionSystem()), target.getEnvelope())); + return (ValueGeometry) Value.cache(new ValueGeometry(EWKBUtils.ewkb2ewkb(bytes), UNKNOWN_ENVELOPE)); } catch (RuntimeException ex) { throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1, StringUtils.convertBytesToHex(bytes)); } diff --git a/h2/src/main/org/h2/value/ValueInteger.java b/h2/src/main/org/h2/value/ValueInteger.java index bdfa6bfd0d..13ba4cb91b 100644 --- a/h2/src/main/org/h2/value/ValueInteger.java +++ b/h2/src/main/org/h2/value/ValueInteger.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueInterval.java b/h2/src/main/org/h2/value/ValueInterval.java index 7363d16a12..542e94d517 100644 --- a/h2/src/main/org/h2/value/ValueInterval.java +++ b/h2/src/main/org/h2/value/ValueInterval.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueJavaObject.java b/h2/src/main/org/h2/value/ValueJavaObject.java index f1a1cad4d6..9eb3a75d29 100644 --- a/h2/src/main/org/h2/value/ValueJavaObject.java +++ b/h2/src/main/org/h2/value/ValueJavaObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueJson.java b/h2/src/main/org/h2/value/ValueJson.java index 7e615647f0..aa0011a7ec 100644 --- a/h2/src/main/org/h2/value/ValueJson.java +++ b/h2/src/main/org/h2/value/ValueJson.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Lazarev Nikita */ diff --git a/h2/src/main/org/h2/value/ValueLob.java b/h2/src/main/org/h2/value/ValueLob.java index 89b966181d..3e1f91ad0f 100644 --- a/h2/src/main/org/h2/value/ValueLob.java +++ b/h2/src/main/org/h2/value/ValueLob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, and the + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, and the * EPL 1.0 (https://h2database.com/html/license.html). Initial Developer: H2 * Group */ diff --git a/h2/src/main/org/h2/value/ValueNull.java b/h2/src/main/org/h2/value/ValueNull.java index eb221f7524..f6cda3bb68 100644 --- a/h2/src/main/org/h2/value/ValueNull.java +++ b/h2/src/main/org/h2/value/ValueNull.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueNumeric.java b/h2/src/main/org/h2/value/ValueNumeric.java index 55090f7dfa..8a7a164093 100644 --- a/h2/src/main/org/h2/value/ValueNumeric.java +++ b/h2/src/main/org/h2/value/ValueNumeric.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueReal.java b/h2/src/main/org/h2/value/ValueReal.java index c1eebaf515..3470fa7455 100644 --- a/h2/src/main/org/h2/value/ValueReal.java +++ b/h2/src/main/org/h2/value/ValueReal.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueRow.java b/h2/src/main/org/h2/value/ValueRow.java index 083c009efe..37095ee517 100644 --- a/h2/src/main/org/h2/value/ValueRow.java +++ b/h2/src/main/org/h2/value/ValueRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueSmallint.java b/h2/src/main/org/h2/value/ValueSmallint.java index 75bd54a518..f0608ad7c2 100644 --- a/h2/src/main/org/h2/value/ValueSmallint.java +++ b/h2/src/main/org/h2/value/ValueSmallint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueStringBase.java b/h2/src/main/org/h2/value/ValueStringBase.java index 28fed3829f..7607a4cd95 100644 --- a/h2/src/main/org/h2/value/ValueStringBase.java +++ b/h2/src/main/org/h2/value/ValueStringBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueTime.java b/h2/src/main/org/h2/value/ValueTime.java index ab8bed23c3..c4ac3a1881 100644 --- a/h2/src/main/org/h2/value/ValueTime.java +++ b/h2/src/main/org/h2/value/ValueTime.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueTimeTimeZone.java b/h2/src/main/org/h2/value/ValueTimeTimeZone.java index 643917ee10..57248487f2 100644 --- a/h2/src/main/org/h2/value/ValueTimeTimeZone.java +++ b/h2/src/main/org/h2/value/ValueTimeTimeZone.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueTimestamp.java b/h2/src/main/org/h2/value/ValueTimestamp.java index a82104ad6b..1f48d23092 100644 --- a/h2/src/main/org/h2/value/ValueTimestamp.java +++ b/h2/src/main/org/h2/value/ValueTimestamp.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueTimestampTimeZone.java b/h2/src/main/org/h2/value/ValueTimestampTimeZone.java index f325bfd123..f2670bbb09 100644 --- a/h2/src/main/org/h2/value/ValueTimestampTimeZone.java +++ b/h2/src/main/org/h2/value/ValueTimestampTimeZone.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueTinyint.java b/h2/src/main/org/h2/value/ValueTinyint.java index 97523bff5d..f80ee45b47 100644 --- a/h2/src/main/org/h2/value/ValueTinyint.java +++ b/h2/src/main/org/h2/value/ValueTinyint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueToObjectConverter.java b/h2/src/main/org/h2/value/ValueToObjectConverter.java index 3878ef37d4..84827b8e50 100644 --- a/h2/src/main/org/h2/value/ValueToObjectConverter.java +++ b/h2/src/main/org/h2/value/ValueToObjectConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueToObjectConverter2.java b/h2/src/main/org/h2/value/ValueToObjectConverter2.java index b2dfe95e10..c7cb4a95f5 100644 --- a/h2/src/main/org/h2/value/ValueToObjectConverter2.java +++ b/h2/src/main/org/h2/value/ValueToObjectConverter2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueUuid.java b/h2/src/main/org/h2/value/ValueUuid.java index 60d711b29c..ca5fa3d73e 100644 --- a/h2/src/main/org/h2/value/ValueUuid.java +++ b/h2/src/main/org/h2/value/ValueUuid.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueVarbinary.java b/h2/src/main/org/h2/value/ValueVarbinary.java index 77d6ee1aed..b0d5344432 100644 --- a/h2/src/main/org/h2/value/ValueVarbinary.java +++ b/h2/src/main/org/h2/value/ValueVarbinary.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueVarchar.java b/h2/src/main/org/h2/value/ValueVarchar.java index 9096ebdcab..381dfa7b24 100644 --- a/h2/src/main/org/h2/value/ValueVarchar.java +++ b/h2/src/main/org/h2/value/ValueVarchar.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/ValueVarcharIgnoreCase.java b/h2/src/main/org/h2/value/ValueVarcharIgnoreCase.java index 579e7cae86..7b8a032dc7 100644 --- a/h2/src/main/org/h2/value/ValueVarcharIgnoreCase.java +++ b/h2/src/main/org/h2/value/ValueVarcharIgnoreCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -37,8 +37,8 @@ public int compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider) @Override public boolean equals(Object other) { - return other instanceof ValueVarchar - && value.equalsIgnoreCase(((ValueVarchar) other).value); + return other instanceof ValueVarcharIgnoreCase + && value.equalsIgnoreCase(((ValueVarcharIgnoreCase) other).value); } @Override diff --git a/h2/src/main/org/h2/value/VersionedValue.java b/h2/src/main/org/h2/value/VersionedValue.java index eac4c8c87d..be9aceb92a 100644 --- a/h2/src/main/org/h2/value/VersionedValue.java +++ b/h2/src/main/org/h2/value/VersionedValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/lob/LobData.java b/h2/src/main/org/h2/value/lob/LobData.java index 916e56634c..c0fe51f59e 100644 --- a/h2/src/main/org/h2/value/lob/LobData.java +++ b/h2/src/main/org/h2/value/lob/LobData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/lob/LobDataDatabase.java b/h2/src/main/org/h2/value/lob/LobDataDatabase.java index 27149a9dd8..648fad12a3 100644 --- a/h2/src/main/org/h2/value/lob/LobDataDatabase.java +++ b/h2/src/main/org/h2/value/lob/LobDataDatabase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/lob/LobDataFetchOnDemand.java b/h2/src/main/org/h2/value/lob/LobDataFetchOnDemand.java index eff4858f8d..4b3f50c218 100644 --- a/h2/src/main/org/h2/value/lob/LobDataFetchOnDemand.java +++ b/h2/src/main/org/h2/value/lob/LobDataFetchOnDemand.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/lob/LobDataFile.java b/h2/src/main/org/h2/value/lob/LobDataFile.java index a3f3b7ae0b..2df7b30a5c 100644 --- a/h2/src/main/org/h2/value/lob/LobDataFile.java +++ b/h2/src/main/org/h2/value/lob/LobDataFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/lob/LobDataInMemory.java b/h2/src/main/org/h2/value/lob/LobDataInMemory.java index eb33f1a335..896c46932b 100644 --- a/h2/src/main/org/h2/value/lob/LobDataInMemory.java +++ b/h2/src/main/org/h2/value/lob/LobDataInMemory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/main/org/h2/value/lob/package.html b/h2/src/main/org/h2/value/lob/package.html index e1da16bb3b..6a43263746 100644 --- a/h2/src/main/org/h2/value/lob/package.html +++ b/h2/src/main/org/h2/value/lob/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/main/org/h2/value/package.html b/h2/src/main/org/h2/value/package.html index 05e5d3c357..00897ffe93 100644 --- a/h2/src/main/org/h2/value/package.html +++ b/h2/src/main/org/h2/value/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/samples/CachedPreparedStatements.java b/h2/src/test/org/h2/samples/CachedPreparedStatements.java index a782507e5c..0b9cec6727 100644 --- a/h2/src/test/org/h2/samples/CachedPreparedStatements.java +++ b/h2/src/test/org/h2/samples/CachedPreparedStatements.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/Compact.java b/h2/src/test/org/h2/samples/Compact.java index 3bd394a242..6ed07a3305 100644 --- a/h2/src/test/org/h2/samples/Compact.java +++ b/h2/src/test/org/h2/samples/Compact.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/CreateScriptFile.java b/h2/src/test/org/h2/samples/CreateScriptFile.java index e1546168d2..daef2e653d 100644 --- a/h2/src/test/org/h2/samples/CreateScriptFile.java +++ b/h2/src/test/org/h2/samples/CreateScriptFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/CsvSample.java b/h2/src/test/org/h2/samples/CsvSample.java index 3fd6da4442..2b73041007 100644 --- a/h2/src/test/org/h2/samples/CsvSample.java +++ b/h2/src/test/org/h2/samples/CsvSample.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/DirectInsert.java b/h2/src/test/org/h2/samples/DirectInsert.java index 5a5ce2bdbd..825356a2f5 100644 --- a/h2/src/test/org/h2/samples/DirectInsert.java +++ b/h2/src/test/org/h2/samples/DirectInsert.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/FileFunctions.java b/h2/src/test/org/h2/samples/FileFunctions.java index 6ff985d52c..985a3138a9 100644 --- a/h2/src/test/org/h2/samples/FileFunctions.java +++ b/h2/src/test/org/h2/samples/FileFunctions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/Function.java b/h2/src/test/org/h2/samples/Function.java index 34eb2de2f4..cf084b6f04 100644 --- a/h2/src/test/org/h2/samples/Function.java +++ b/h2/src/test/org/h2/samples/Function.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/FunctionMultiReturn.java b/h2/src/test/org/h2/samples/FunctionMultiReturn.java index 5f3d5c54e4..197341d996 100644 --- a/h2/src/test/org/h2/samples/FunctionMultiReturn.java +++ b/h2/src/test/org/h2/samples/FunctionMultiReturn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/HelloWorld.java b/h2/src/test/org/h2/samples/HelloWorld.java index 6458608436..8353d2bd87 100644 --- a/h2/src/test/org/h2/samples/HelloWorld.java +++ b/h2/src/test/org/h2/samples/HelloWorld.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/InitDatabaseFromJar.java b/h2/src/test/org/h2/samples/InitDatabaseFromJar.java index 9c4192d084..dccf2aabd2 100644 --- a/h2/src/test/org/h2/samples/InitDatabaseFromJar.java +++ b/h2/src/test/org/h2/samples/InitDatabaseFromJar.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/MixedMode.java b/h2/src/test/org/h2/samples/MixedMode.java index 5380ede514..a960191569 100644 --- a/h2/src/test/org/h2/samples/MixedMode.java +++ b/h2/src/test/org/h2/samples/MixedMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/Newsfeed.java b/h2/src/test/org/h2/samples/Newsfeed.java index 3d9ec8cf89..b7602cfe72 100644 --- a/h2/src/test/org/h2/samples/Newsfeed.java +++ b/h2/src/test/org/h2/samples/Newsfeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/ReadOnlyDatabaseInZip.java b/h2/src/test/org/h2/samples/ReadOnlyDatabaseInZip.java index 6b0de12aad..04b9a643da 100644 --- a/h2/src/test/org/h2/samples/ReadOnlyDatabaseInZip.java +++ b/h2/src/test/org/h2/samples/ReadOnlyDatabaseInZip.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/RowAccessRights.java b/h2/src/test/org/h2/samples/RowAccessRights.java index 449ce3b055..dc75457044 100644 --- a/h2/src/test/org/h2/samples/RowAccessRights.java +++ b/h2/src/test/org/h2/samples/RowAccessRights.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/SQLInjection.java b/h2/src/test/org/h2/samples/SQLInjection.java index 476522f4b3..6ad81ec4bf 100644 --- a/h2/src/test/org/h2/samples/SQLInjection.java +++ b/h2/src/test/org/h2/samples/SQLInjection.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/SecurePassword.java b/h2/src/test/org/h2/samples/SecurePassword.java index d880ac0fae..d33a2c39a0 100644 --- a/h2/src/test/org/h2/samples/SecurePassword.java +++ b/h2/src/test/org/h2/samples/SecurePassword.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/ShowProgress.java b/h2/src/test/org/h2/samples/ShowProgress.java index 6fe51b3d98..fe34df7269 100644 --- a/h2/src/test/org/h2/samples/ShowProgress.java +++ b/h2/src/test/org/h2/samples/ShowProgress.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/ShutdownServer.java b/h2/src/test/org/h2/samples/ShutdownServer.java index 89cc9cb3bd..3b84c3553b 100644 --- a/h2/src/test/org/h2/samples/ShutdownServer.java +++ b/h2/src/test/org/h2/samples/ShutdownServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/TriggerPassData.java b/h2/src/test/org/h2/samples/TriggerPassData.java index df667bfc25..0cd6f8a422 100644 --- a/h2/src/test/org/h2/samples/TriggerPassData.java +++ b/h2/src/test/org/h2/samples/TriggerPassData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/TriggerSample.java b/h2/src/test/org/h2/samples/TriggerSample.java index 51ecf838b7..27c07a8462 100644 --- a/h2/src/test/org/h2/samples/TriggerSample.java +++ b/h2/src/test/org/h2/samples/TriggerSample.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/UpdatableView.java b/h2/src/test/org/h2/samples/UpdatableView.java index e7cfe356c6..ec60d38461 100644 --- a/h2/src/test/org/h2/samples/UpdatableView.java +++ b/h2/src/test/org/h2/samples/UpdatableView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/fullTextSearch.sql b/h2/src/test/org/h2/samples/fullTextSearch.sql index d45837e579..a49cf049a6 100644 --- a/h2/src/test/org/h2/samples/fullTextSearch.sql +++ b/h2/src/test/org/h2/samples/fullTextSearch.sql @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/newsfeed.sql b/h2/src/test/org/h2/samples/newsfeed.sql index 20d061d3e0..82c483be5c 100644 --- a/h2/src/test/org/h2/samples/newsfeed.sql +++ b/h2/src/test/org/h2/samples/newsfeed.sql @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -7,6 +7,8 @@ CREATE TABLE VERSION(ID INT PRIMARY KEY, VERSION VARCHAR, CREATED VARCHAR); INSERT INTO VERSION VALUES +(154, '2.1.210', '2022-01-17'), +(153, '2.0.206', '2022-01-04'), (152, '2.0.204', '2021-12-21'), (151, '2.0.202', '2021-11-25'), (150, '1.4.200', '2019-10-14'), @@ -18,13 +20,7 @@ INSERT INTO VERSION VALUES (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'), -(140, '1.4.190', '2015-10-11'), -(139, '1.4.189', '2015-09-13'), -(138, '1.4.188', '2015-08-01'), -(137, '1.4.187', '2015-04-10'), -(136, '1.4.186', '2015-03-02'), -(135, '1.4.185', '2015-01-16'); +(141, '1.4.191', '2016-01-21'); CREATE TABLE CHANNEL(TITLE VARCHAR, LINK VARCHAR, DESC VARCHAR, LANGUAGE VARCHAR, PUB TIMESTAMP, LAST TIMESTAMP, AUTHOR VARCHAR); diff --git a/h2/src/test/org/h2/samples/optimizations.sql b/h2/src/test/org/h2/samples/optimizations.sql index e2c65aafcb..208224ae73 100644 --- a/h2/src/test/org/h2/samples/optimizations.sql +++ b/h2/src/test/org/h2/samples/optimizations.sql @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/samples/package.html b/h2/src/test/org/h2/samples/package.html index 26b85c154e..a65657aaaa 100644 --- a/h2/src/test/org/h2/samples/package.html +++ b/h2/src/test/org/h2/samples/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/TestAll.java b/h2/src/test/org/h2/test/TestAll.java index eb9a262ae0..4c5c3e5baf 100644 --- a/h2/src/test/org/h2/test/TestAll.java +++ b/h2/src/test/org/h2/test/TestAll.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -59,7 +59,6 @@ import org.h2.test.db.TestMultiThreadedKernel; import org.h2.test.db.TestOpenClose; import org.h2.test.db.TestOptimizations; -import org.h2.test.db.TestOptimizerHints; import org.h2.test.db.TestOutOfMemory; import org.h2.test.db.TestPersistentCommonTableExpressions; import org.h2.test.db.TestPowerOff; @@ -123,6 +122,7 @@ import org.h2.test.scripts.TestScript; import org.h2.test.server.TestAutoServer; import org.h2.test.server.TestInit; +import org.h2.test.server.TestJakartaWeb; import org.h2.test.server.TestNestedLoop; import org.h2.test.server.TestWeb; import org.h2.test.store.TestCacheConcurrentLIRS; @@ -739,7 +739,6 @@ private void test() throws SQLException { addTest(new TestMultiDimension()); addTest(new TestMultiThreadedKernel()); addTest(new TestOpenClose()); - addTest(new TestOptimizerHints()); addTest(new TestReadOnly()); addTest(new TestRecursiveQueries()); addTest(new TestGeneralCommonTableQueries()); @@ -837,6 +836,7 @@ private void test() throws SQLException { addTest(new TestQueryCache()); addTest(new TestUrlJavaObjectSerializer()); addTest(new TestWeb()); + addTest(new TestJakartaWeb()); // other unsafe addTest(new TestOptimizations()); @@ -874,6 +874,7 @@ private void testAdditional() { addTest(new TestRecovery()); addTest(new RecoverLobTest()); addTest(createTest("org.h2.test.unit.TestServlet")); + addTest(createTest("org.h2.test.unit.TestJakartaServlet")); addTest(new TestTimeStampWithTimeZone()); addTest(new TestValue()); diff --git a/h2/src/test/org/h2/test/TestAllJunit.java b/h2/src/test/org/h2/test/TestAllJunit.java index 3098977cde..2ebc55afdc 100644 --- a/h2/src/test/org/h2/test/TestAllJunit.java +++ b/h2/src/test/org/h2/test/TestAllJunit.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/TestBase.java b/h2/src/test/org/h2/test/TestBase.java index 76c5fd6a9d..c0fdffb937 100644 --- a/h2/src/test/org/h2/test/TestBase.java +++ b/h2/src/test/org/h2/test/TestBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/TestDb.java b/h2/src/test/org/h2/test/TestDb.java index 99ee0271be..5694a052a8 100644 --- a/h2/src/test/org/h2/test/TestDb.java +++ b/h2/src/test/org/h2/test/TestDb.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java b/h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java index ca4f255c9e..16a8b2adcb 100644 --- a/h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java +++ b/h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/ap/package.html b/h2/src/test/org/h2/test/ap/package.html index f6c6c7fe7e..588b02ba02 100644 --- a/h2/src/test/org/h2/test/ap/package.html +++ b/h2/src/test/org/h2/test/ap/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/auth/MyLoginModule.java b/h2/src/test/org/h2/test/auth/MyLoginModule.java index ca2185c095..0a899bbdbf 100644 --- a/h2/src/test/org/h2/test/auth/MyLoginModule.java +++ b/h2/src/test/org/h2/test/auth/MyLoginModule.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/test/org/h2/test/auth/TestAuthentication.java b/h2/src/test/org/h2/test/auth/TestAuthentication.java index 821da86ca8..68a581c22f 100644 --- a/h2/src/test/org/h2/test/auth/TestAuthentication.java +++ b/h2/src/test/org/h2/test/auth/TestAuthentication.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Alessandro Ventura */ diff --git a/h2/src/test/org/h2/test/auth/package.html b/h2/src/test/org/h2/test/auth/package.html index 9274d551fe..3a5a38abf5 100644 --- a/h2/src/test/org/h2/test/auth/package.html +++ b/h2/src/test/org/h2/test/auth/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/bench/Bench.java b/h2/src/test/org/h2/test/bench/Bench.java index 06adb9cc30..89c42a1525 100644 --- a/h2/src/test/org/h2/test/bench/Bench.java +++ b/h2/src/test/org/h2/test/bench/Bench.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/BenchA.java b/h2/src/test/org/h2/test/bench/BenchA.java index c084dcab9c..16818da381 100644 --- a/h2/src/test/org/h2/test/bench/BenchA.java +++ b/h2/src/test/org/h2/test/bench/BenchA.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/BenchB.java b/h2/src/test/org/h2/test/bench/BenchB.java index 6bf5c87f76..2aa5536ad4 100644 --- a/h2/src/test/org/h2/test/bench/BenchB.java +++ b/h2/src/test/org/h2/test/bench/BenchB.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/BenchC.java b/h2/src/test/org/h2/test/bench/BenchC.java index a14fb7e22a..ffe906df61 100644 --- a/h2/src/test/org/h2/test/bench/BenchC.java +++ b/h2/src/test/org/h2/test/bench/BenchC.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/BenchCRandom.java b/h2/src/test/org/h2/test/bench/BenchCRandom.java index 84fb610699..4e6e2bbbad 100644 --- a/h2/src/test/org/h2/test/bench/BenchCRandom.java +++ b/h2/src/test/org/h2/test/bench/BenchCRandom.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/BenchCThread.java b/h2/src/test/org/h2/test/bench/BenchCThread.java index 1cbd64b17f..eee6b846ed 100644 --- a/h2/src/test/org/h2/test/bench/BenchCThread.java +++ b/h2/src/test/org/h2/test/bench/BenchCThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/BenchSimple.java b/h2/src/test/org/h2/test/bench/BenchSimple.java index 24768eb72f..9caf5afa83 100644 --- a/h2/src/test/org/h2/test/bench/BenchSimple.java +++ b/h2/src/test/org/h2/test/bench/BenchSimple.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/Database.java b/h2/src/test/org/h2/test/bench/Database.java index 4ebe79b85e..000f30cd47 100644 --- a/h2/src/test/org/h2/test/bench/Database.java +++ b/h2/src/test/org/h2/test/bench/Database.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/TestPerformance.java b/h2/src/test/org/h2/test/bench/TestPerformance.java index ac0c7b0f6c..e8b8ee4280 100644 --- a/h2/src/test/org/h2/test/bench/TestPerformance.java +++ b/h2/src/test/org/h2/test/bench/TestPerformance.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/TestScalability.java b/h2/src/test/org/h2/test/bench/TestScalability.java index 6a0039bc14..998cde64a5 100644 --- a/h2/src/test/org/h2/test/bench/TestScalability.java +++ b/h2/src/test/org/h2/test/bench/TestScalability.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/bench/package.html b/h2/src/test/org/h2/test/bench/package.html index 202b657a69..e33caee6cf 100644 --- a/h2/src/test/org/h2/test/bench/package.html +++ b/h2/src/test/org/h2/test/bench/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/coverage/Coverage.java b/h2/src/test/org/h2/test/coverage/Coverage.java index 2682802e28..380baea54a 100644 --- a/h2/src/test/org/h2/test/coverage/Coverage.java +++ b/h2/src/test/org/h2/test/coverage/Coverage.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/coverage/Profile.java b/h2/src/test/org/h2/test/coverage/Profile.java index daa15610d2..06d57be0c5 100644 --- a/h2/src/test/org/h2/test/coverage/Profile.java +++ b/h2/src/test/org/h2/test/coverage/Profile.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/coverage/Tokenizer.java b/h2/src/test/org/h2/test/coverage/Tokenizer.java index 0f2ba1106c..611800f001 100644 --- a/h2/src/test/org/h2/test/coverage/Tokenizer.java +++ b/h2/src/test/org/h2/test/coverage/Tokenizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/coverage/package.html b/h2/src/test/org/h2/test/coverage/package.html index 57c25e6b4f..72a52ae6ed 100644 --- a/h2/src/test/org/h2/test/coverage/package.html +++ b/h2/src/test/org/h2/test/coverage/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/db/AbstractBaseForCommonTableExpressions.java b/h2/src/test/org/h2/test/db/AbstractBaseForCommonTableExpressions.java index 2c7b47474c..89a69297fe 100644 --- a/h2/src/test/org/h2/test/db/AbstractBaseForCommonTableExpressions.java +++ b/h2/src/test/org/h2/test/db/AbstractBaseForCommonTableExpressions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/Db.java b/h2/src/test/org/h2/test/db/Db.java index 7b3a6fb64b..4c0542d68d 100644 --- a/h2/src/test/org/h2/test/db/Db.java +++ b/h2/src/test/org/h2/test/db/Db.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TaskDef.java b/h2/src/test/org/h2/test/db/TaskDef.java index d4fe13df4b..46a2f15cf9 100644 --- a/h2/src/test/org/h2/test/db/TaskDef.java +++ b/h2/src/test/org/h2/test/db/TaskDef.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TaskProcess.java b/h2/src/test/org/h2/test/db/TaskProcess.java index 18415ade03..7fdd01d5c4 100644 --- a/h2/src/test/org/h2/test/db/TaskProcess.java +++ b/h2/src/test/org/h2/test/db/TaskProcess.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestAlter.java b/h2/src/test/org/h2/test/db/TestAlter.java index 0c79df3fd1..1d27fdd419 100644 --- a/h2/src/test/org/h2/test/db/TestAlter.java +++ b/h2/src/test/org/h2/test/db/TestAlter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestAlterSchemaRename.java b/h2/src/test/org/h2/test/db/TestAlterSchemaRename.java index 19efd0f74a..fa778daf0c 100644 --- a/h2/src/test/org/h2/test/db/TestAlterSchemaRename.java +++ b/h2/src/test/org/h2/test/db/TestAlterSchemaRename.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestAlterTableNotFound.java b/h2/src/test/org/h2/test/db/TestAlterTableNotFound.java index 58e9510fe4..568f3c95bd 100644 --- a/h2/src/test/org/h2/test/db/TestAlterTableNotFound.java +++ b/h2/src/test/org/h2/test/db/TestAlterTableNotFound.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java b/h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java index 73edf5474f..ca65c1470b 100644 --- a/h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java +++ b/h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestAutoRecompile.java b/h2/src/test/org/h2/test/db/TestAutoRecompile.java index efe0f5a813..e7fb639154 100644 --- a/h2/src/test/org/h2/test/db/TestAutoRecompile.java +++ b/h2/src/test/org/h2/test/db/TestAutoRecompile.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestBackup.java b/h2/src/test/org/h2/test/db/TestBackup.java index a89d0d3706..31801b20a6 100644 --- a/h2/src/test/org/h2/test/db/TestBackup.java +++ b/h2/src/test/org/h2/test/db/TestBackup.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestBigDb.java b/h2/src/test/org/h2/test/db/TestBigDb.java index a7bfae67c6..a4e35d0b0a 100644 --- a/h2/src/test/org/h2/test/db/TestBigDb.java +++ b/h2/src/test/org/h2/test/db/TestBigDb.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestBigResult.java b/h2/src/test/org/h2/test/db/TestBigResult.java index b96f6e183c..bb2e3fbba2 100644 --- a/h2/src/test/org/h2/test/db/TestBigResult.java +++ b/h2/src/test/org/h2/test/db/TestBigResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestCases.java b/h2/src/test/org/h2/test/db/TestCases.java index d8a35c5a33..d9512030bc 100644 --- a/h2/src/test/org/h2/test/db/TestCases.java +++ b/h2/src/test/org/h2/test/db/TestCases.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestCheckpoint.java b/h2/src/test/org/h2/test/db/TestCheckpoint.java index 5e73853ba9..6cfc1e793f 100644 --- a/h2/src/test/org/h2/test/db/TestCheckpoint.java +++ b/h2/src/test/org/h2/test/db/TestCheckpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestCluster.java b/h2/src/test/org/h2/test/db/TestCluster.java index 8df0a24cbe..6884892ff8 100644 --- a/h2/src/test/org/h2/test/db/TestCluster.java +++ b/h2/src/test/org/h2/test/db/TestCluster.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestCompatibility.java b/h2/src/test/org/h2/test/db/TestCompatibility.java index df9b58149d..b64cb97547 100644 --- a/h2/src/test/org/h2/test/db/TestCompatibility.java +++ b/h2/src/test/org/h2/test/db/TestCompatibility.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestCompatibilityOracle.java b/h2/src/test/org/h2/test/db/TestCompatibilityOracle.java index f99478ee5c..82ca638de7 100644 --- a/h2/src/test/org/h2/test/db/TestCompatibilityOracle.java +++ b/h2/src/test/org/h2/test/db/TestCompatibilityOracle.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestCompatibilitySQLServer.java b/h2/src/test/org/h2/test/db/TestCompatibilitySQLServer.java index 861325f849..5d1fa2486c 100644 --- a/h2/src/test/org/h2/test/db/TestCompatibilitySQLServer.java +++ b/h2/src/test/org/h2/test/db/TestCompatibilitySQLServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestCsv.java b/h2/src/test/org/h2/test/db/TestCsv.java index 7f63fcf14c..3dc6b1977a 100644 --- a/h2/src/test/org/h2/test/db/TestCsv.java +++ b/h2/src/test/org/h2/test/db/TestCsv.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestDateStorage.java b/h2/src/test/org/h2/test/db/TestDateStorage.java index 75898cfa6f..98a7f05b77 100644 --- a/h2/src/test/org/h2/test/db/TestDateStorage.java +++ b/h2/src/test/org/h2/test/db/TestDateStorage.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestDeadlock.java b/h2/src/test/org/h2/test/db/TestDeadlock.java index c6261e5e03..03d5b5ceaa 100644 --- a/h2/src/test/org/h2/test/db/TestDeadlock.java +++ b/h2/src/test/org/h2/test/db/TestDeadlock.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestDuplicateKeyUpdate.java b/h2/src/test/org/h2/test/db/TestDuplicateKeyUpdate.java index 2e2d651595..841579370e 100644 --- a/h2/src/test/org/h2/test/db/TestDuplicateKeyUpdate.java +++ b/h2/src/test/org/h2/test/db/TestDuplicateKeyUpdate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestEncryptedDb.java b/h2/src/test/org/h2/test/db/TestEncryptedDb.java index bf3bb72d3f..de2f8fa27f 100644 --- a/h2/src/test/org/h2/test/db/TestEncryptedDb.java +++ b/h2/src/test/org/h2/test/db/TestEncryptedDb.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestExclusive.java b/h2/src/test/org/h2/test/db/TestExclusive.java index 2b963eac23..0fb4c2ceab 100644 --- a/h2/src/test/org/h2/test/db/TestExclusive.java +++ b/h2/src/test/org/h2/test/db/TestExclusive.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestFullText.java b/h2/src/test/org/h2/test/db/TestFullText.java index 5eef1be6d6..0e7da44762 100644 --- a/h2/src/test/org/h2/test/db/TestFullText.java +++ b/h2/src/test/org/h2/test/db/TestFullText.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -93,7 +93,7 @@ private static void close(Collection list) { private Connection getConnection(String name, Collection list) throws SQLException { - Connection conn = getConnection(name); + Connection conn = getConnection(name + ";MODE=STRICT"); list.add(conn); return conn; } diff --git a/h2/src/test/org/h2/test/db/TestFunctionOverload.java b/h2/src/test/org/h2/test/db/TestFunctionOverload.java index f04882f186..fe598c665f 100644 --- a/h2/src/test/org/h2/test/db/TestFunctionOverload.java +++ b/h2/src/test/org/h2/test/db/TestFunctionOverload.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestFunctions.java b/h2/src/test/org/h2/test/db/TestFunctions.java index 73f136693e..dd601a5050 100644 --- a/h2/src/test/org/h2/test/db/TestFunctions.java +++ b/h2/src/test/org/h2/test/db/TestFunctions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -155,8 +155,16 @@ private void testFunctionTable() throws SQLException { Statement stat = conn.createStatement(); stat.execute("create alias simple_function_table for '" + TestFunctions.class.getName() + ".simpleFunctionTable'"); + stat.execute("create alias function_table_with_parameter for '" + + TestFunctions.class.getName() + ".functionTableWithParameter'"); stat.execute("select * from simple_function_table() " + "where a>0 and b in ('x', 'y')"); + PreparedStatement prep = conn.prepareStatement("call function_table_with_parameter(?)"); + prep.setInt(1, 10); + ResultSet rs = prep.executeQuery(); + assertTrue(rs.next()); + assertEquals(10, rs.getInt(1)); + assertEquals("X", rs.getString(2)); conn.close(); } @@ -188,6 +196,21 @@ public static ResultSet simpleFunctionTable(@SuppressWarnings("unused") Connecti return result; } + /** + * This method is called via reflection from the database. + * + * @param conn the connection + * @param p the parameter + * @return a result set + */ + public static ResultSet functionTableWithParameter(@SuppressWarnings("unused") Connection conn, int p) { + SimpleResultSet result = new SimpleResultSet(); + result.addColumn("A", Types.INTEGER, 0, 0); + result.addColumn("B", Types.CHAR, 0, 0); + result.addRow(p, 'X'); + return result; + } + /** * This method is called via reflection from the database. * diff --git a/h2/src/test/org/h2/test/db/TestGeneralCommonTableQueries.java b/h2/src/test/org/h2/test/db/TestGeneralCommonTableQueries.java index d3ec0e52f9..654da27f6e 100644 --- a/h2/src/test/org/h2/test/db/TestGeneralCommonTableQueries.java +++ b/h2/src/test/org/h2/test/db/TestGeneralCommonTableQueries.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestIgnoreCatalogs.java b/h2/src/test/org/h2/test/db/TestIgnoreCatalogs.java index c30ad6cd74..7e0712016a 100644 --- a/h2/src/test/org/h2/test/db/TestIgnoreCatalogs.java +++ b/h2/src/test/org/h2/test/db/TestIgnoreCatalogs.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestIndex.java b/h2/src/test/org/h2/test/db/TestIndex.java index e5da2bd018..1b2fa807d0 100644 --- a/h2/src/test/org/h2/test/db/TestIndex.java +++ b/h2/src/test/org/h2/test/db/TestIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestIndexHints.java b/h2/src/test/org/h2/test/db/TestIndexHints.java index 1c75428bba..a992869d9d 100644 --- a/h2/src/test/org/h2/test/db/TestIndexHints.java +++ b/h2/src/test/org/h2/test/db/TestIndexHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestLIRSMemoryConsumption.java b/h2/src/test/org/h2/test/db/TestLIRSMemoryConsumption.java index 88e6598c94..55d27c26c0 100644 --- a/h2/src/test/org/h2/test/db/TestLIRSMemoryConsumption.java +++ b/h2/src/test/org/h2/test/db/TestLIRSMemoryConsumption.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestLargeBlob.java b/h2/src/test/org/h2/test/db/TestLargeBlob.java index 3c583a39ec..56a94cd740 100644 --- a/h2/src/test/org/h2/test/db/TestLargeBlob.java +++ b/h2/src/test/org/h2/test/db/TestLargeBlob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestLinkedTable.java b/h2/src/test/org/h2/test/db/TestLinkedTable.java index d98899ff61..d33f137c67 100644 --- a/h2/src/test/org/h2/test/db/TestLinkedTable.java +++ b/h2/src/test/org/h2/test/db/TestLinkedTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -703,14 +703,17 @@ private void testGeometry() throws SQLException { Connection cb = DriverManager.getConnection("jdbc:h2:mem:two", "sa", "sa"); Statement sa = ca.createStatement(); Statement sb = cb.createStatement(); - sa.execute("CREATE TABLE TEST(ID SERIAL, the_geom geometry)"); - sa.execute("INSERT INTO TEST(THE_GEOM) VALUES('POINT (1 1)')"); + sa.execute("CREATE TABLE TEST(ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY," + + " THE_GEOM GEOMETRY, THE_GEOM_2 GEOMETRY(POINT, 4326))"); + sa.execute("INSERT INTO TEST(THE_GEOM, THE_GEOM_2) VALUES" + + " (GEOMETRY 'POINT (1 1)', GEOMETRY 'SRID=4326;POINT(2 2)')"); String sql = "CREATE LINKED TABLE T(NULL, " + "'jdbc:h2:mem:one', 'sa', 'sa', 'TEST') READONLY"; sb.execute(sql); try (ResultSet rs = sb.executeQuery("SELECT * FROM T")) { assertTrue(rs.next()); assertEquals("POINT (1 1)", rs.getString("THE_GEOM")); + assertEquals("SRID=4326;POINT (2 2)", rs.getString("THE_GEOM_2")); } sb.execute("DROP TABLE T"); ca.close(); diff --git a/h2/src/test/org/h2/test/db/TestListener.java b/h2/src/test/org/h2/test/db/TestListener.java index fc61f5b4ab..5e042743f9 100644 --- a/h2/src/test/org/h2/test/db/TestListener.java +++ b/h2/src/test/org/h2/test/db/TestListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestLob.java b/h2/src/test/org/h2/test/db/TestLob.java index 410fbb1acb..45203921a2 100644 --- a/h2/src/test/org/h2/test/db/TestLob.java +++ b/h2/src/test/org/h2/test/db/TestLob.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestLobObject.java b/h2/src/test/org/h2/test/db/TestLobObject.java index 2a7665069e..b150fc512b 100644 --- a/h2/src/test/org/h2/test/db/TestLobObject.java +++ b/h2/src/test/org/h2/test/db/TestLobObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestMemoryUsage.java b/h2/src/test/org/h2/test/db/TestMemoryUsage.java index 1e484856bb..dbf367d113 100644 --- a/h2/src/test/org/h2/test/db/TestMemoryUsage.java +++ b/h2/src/test/org/h2/test/db/TestMemoryUsage.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestMergeUsing.java b/h2/src/test/org/h2/test/db/TestMergeUsing.java index a2042f0577..f0328a5a7e 100644 --- a/h2/src/test/org/h2/test/db/TestMergeUsing.java +++ b/h2/src/test/org/h2/test/db/TestMergeUsing.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestMultiConn.java b/h2/src/test/org/h2/test/db/TestMultiConn.java index 907a86823e..891042cc72 100644 --- a/h2/src/test/org/h2/test/db/TestMultiConn.java +++ b/h2/src/test/org/h2/test/db/TestMultiConn.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestMultiDimension.java b/h2/src/test/org/h2/test/db/TestMultiDimension.java index 0b3dbc2e72..afd99bde92 100644 --- a/h2/src/test/org/h2/test/db/TestMultiDimension.java +++ b/h2/src/test/org/h2/test/db/TestMultiDimension.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestMultiThread.java b/h2/src/test/org/h2/test/db/TestMultiThread.java index 2060bb2239..ea6f060686 100644 --- a/h2/src/test/org/h2/test/db/TestMultiThread.java +++ b/h2/src/test/org/h2/test/db/TestMultiThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java b/h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java index 3171368dee..b700b2f8b0 100644 --- a/h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java +++ b/h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestOpenClose.java b/h2/src/test/org/h2/test/db/TestOpenClose.java index 8826e2d8e4..3a58f0d599 100644 --- a/h2/src/test/org/h2/test/db/TestOpenClose.java +++ b/h2/src/test/org/h2/test/db/TestOpenClose.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestOptimizations.java b/h2/src/test/org/h2/test/db/TestOptimizations.java index 03b3badb7f..2395824362 100644 --- a/h2/src/test/org/h2/test/db/TestOptimizations.java +++ b/h2/src/test/org/h2/test/db/TestOptimizations.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestOptimizerHints.java b/h2/src/test/org/h2/test/db/TestOptimizerHints.java deleted file mode 100644 index 846b080784..0000000000 --- a/h2/src/test/org/h2/test/db/TestOptimizerHints.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, - * and the EPL 1.0 (https://h2database.com/html/license.html). - * Initial Developer: H2 Group - */ -package org.h2.test.db; - -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Arrays; -import org.h2.test.TestBase; -import org.h2.test.TestDb; - -/** - * Test for optimizer hint SET FORCE_JOIN_ORDER. - * - * @author Sergi Vladykin - */ -public class TestOptimizerHints extends TestDb { - - /** - * Run just this test. - * - * @param a ignored - */ - public static void main(String[] a) throws Exception { - TestBase.createCaller().init().testFromMain(); - } - - @Override - public void test() throws Exception { - deleteDb("testOptimizerHints"); - Connection conn = getConnection("testOptimizerHints;FORCE_JOIN_ORDER=1"); - Statement s = conn.createStatement(); - - s.execute("create table t1(id int unique)"); - s.execute("create table t2(id int unique, t1_id int)"); - s.execute("create table t3(id int unique)"); - s.execute("create table t4(id int unique, t2_id int, t3_id int)"); - - String plan; - - plan = plan(s, "select * from t1, t2 where t1.id = t2.t1_id"); - assertContains(plan, "INNER JOIN \"PUBLIC\".\"T2\""); - - plan = plan(s, "select * from t2, t1 where t1.id = t2.t1_id"); - assertContains(plan, "INNER JOIN \"PUBLIC\".\"T1\""); - - plan = plan(s, "select * from t2, t1 where t1.id = 1"); - assertContains(plan, "INNER JOIN \"PUBLIC\".\"T1\""); - - plan = plan(s, "select * from t2, t1 where t1.id = t2.t1_id and t2.id = 1"); - assertContains(plan, "INNER JOIN \"PUBLIC\".\"T1\""); - - plan = plan(s, "select * from t1, t2 where t1.id = t2.t1_id and t2.id = 1"); - assertContains(plan, "INNER JOIN \"PUBLIC\".\"T2\""); - - checkPlanComma(s, "t1", "t2", "t3", "t4"); - checkPlanComma(s, "t4", "t2", "t3", "t1"); - checkPlanComma(s, "t2", "t1", "t3", "t4"); - checkPlanComma(s, "t1", "t4", "t3", "t2"); - checkPlanComma(s, "t2", "t1", "t4", "t3"); - checkPlanComma(s, "t4", "t3", "t2", "t1"); - - boolean on = false; - boolean left = false; - - checkPlanJoin(s, on, left, "t1", "t2", "t3", "t4"); - checkPlanJoin(s, on, left, "t4", "t2", "t3", "t1"); - checkPlanJoin(s, on, left, "t2", "t1", "t3", "t4"); - checkPlanJoin(s, on, left, "t1", "t4", "t3", "t2"); - checkPlanJoin(s, on, left, "t2", "t1", "t4", "t3"); - checkPlanJoin(s, on, left, "t4", "t3", "t2", "t1"); - - on = false; - left = true; - - checkPlanJoin(s, on, left, "t1", "t2", "t3", "t4"); - checkPlanJoin(s, on, left, "t4", "t2", "t3", "t1"); - checkPlanJoin(s, on, left, "t2", "t1", "t3", "t4"); - checkPlanJoin(s, on, left, "t1", "t4", "t3", "t2"); - checkPlanJoin(s, on, left, "t2", "t1", "t4", "t3"); - checkPlanJoin(s, on, left, "t4", "t3", "t2", "t1"); - - on = true; - left = false; - - checkPlanJoin(s, on, left, "t1", "t2", "t3", "t4"); - checkPlanJoin(s, on, left, "t4", "t2", "t3", "t1"); - checkPlanJoin(s, on, left, "t2", "t1", "t3", "t4"); - checkPlanJoin(s, on, left, "t1", "t4", "t3", "t2"); - checkPlanJoin(s, on, left, "t2", "t1", "t4", "t3"); - checkPlanJoin(s, on, left, "t4", "t3", "t2", "t1"); - - on = true; - left = true; - - checkPlanJoin(s, on, left, "t1", "t2", "t3", "t4"); - checkPlanJoin(s, on, left, "t4", "t2", "t3", "t1"); - checkPlanJoin(s, on, left, "t2", "t1", "t3", "t4"); - checkPlanJoin(s, on, left, "t1", "t4", "t3", "t2"); - checkPlanJoin(s, on, left, "t2", "t1", "t4", "t3"); - checkPlanJoin(s, on, left, "t4", "t3", "t2", "t1"); - - s.close(); - conn.close(); - deleteDb("testOptimizerHints"); - } - - private void checkPlanComma(Statement s, String ... t) throws SQLException { - StringBuilder builder = new StringBuilder("select 1 from "); - for (int i = 0, l = t.length; i < l; i++) { - if (i > 0) { - builder.append(", "); - } - builder.append(t[i]); - } - builder.append(" where t1.id = t2.t1_id and t2.id = t4.t2_id and t3.id = t4.t3_id"); - String plan = plan(s, builder.toString()); - int prev = plan.indexOf("FROM \"PUBLIC\".\"" + t[0].toUpperCase() + '"'); - for (int i = 1; i < t.length; i++) { - int next = plan.indexOf("INNER JOIN \"PUBLIC\".\"" + t[i].toUpperCase() + '"'); - assertTrue("Wrong plan for : " + Arrays.toString(t) + "\n" + plan, next > prev); - prev = next; - } - } - - private void checkPlanJoin(Statement s, boolean on, boolean left, - String... t) throws SQLException { - StringBuilder builder = new StringBuilder("select 1 from "); - for (int i = 0; i < t.length; i++) { - if (i != 0) { - if (left) { - builder.append(" left join "); - } else { - builder.append(" inner join "); - } - } - builder.append(t[i]); - if (on && i != 0) { - builder.append(" on 1=1 "); - } - } - builder.append(" where t1.id = t2.t1_id and t2.id = t4.t2_id and t3.id = t4.t3_id"); - String plan = plan(s, builder.toString()); - int prev = plan.indexOf("FROM \"PUBLIC\".\"" + t[0].toUpperCase() + '"'); - for (int i = 1; i < t.length; i++) { - int next = plan.indexOf( - (!left ? "INNER JOIN \"PUBLIC\".\"" : on ? "LEFT OUTER JOIN \"PUBLIC\".\"" : "\"PUBLIC\".\"") + - t[i].toUpperCase() + '"'); - if (prev > next) { - System.err.println(plan); - fail("Wrong plan for : " + Arrays.toString(t) + "\n" + plan); - } - prev = next; - } - } - - /** - * @param s Statement. - * @param query Query. - * @return Plan. - * @throws SQLException If failed. - */ - private String plan(Statement s, String query) throws SQLException { - ResultSet rs = s.executeQuery("explain " + query); - assertTrue(rs.next()); - String plan = rs.getString(1); - rs.close(); - return plan; - } -} diff --git a/h2/src/test/org/h2/test/db/TestOutOfMemory.java b/h2/src/test/org/h2/test/db/TestOutOfMemory.java index 49e41d4ab8..c93c5b83ab 100644 --- a/h2/src/test/org/h2/test/db/TestOutOfMemory.java +++ b/h2/src/test/org/h2/test/db/TestOutOfMemory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestPersistentCommonTableExpressions.java b/h2/src/test/org/h2/test/db/TestPersistentCommonTableExpressions.java index 9a3823580c..e020fbcea8 100644 --- a/h2/src/test/org/h2/test/db/TestPersistentCommonTableExpressions.java +++ b/h2/src/test/org/h2/test/db/TestPersistentCommonTableExpressions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestPowerOff.java b/h2/src/test/org/h2/test/db/TestPowerOff.java index e302b1caad..e1f5e67cac 100644 --- a/h2/src/test/org/h2/test/db/TestPowerOff.java +++ b/h2/src/test/org/h2/test/db/TestPowerOff.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestQueryCache.java b/h2/src/test/org/h2/test/db/TestQueryCache.java index ac3a0d59a9..476bc6519b 100644 --- a/h2/src/test/org/h2/test/db/TestQueryCache.java +++ b/h2/src/test/org/h2/test/db/TestQueryCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestReadOnly.java b/h2/src/test/org/h2/test/db/TestReadOnly.java index 86fcb13595..84bc97b178 100644 --- a/h2/src/test/org/h2/test/db/TestReadOnly.java +++ b/h2/src/test/org/h2/test/db/TestReadOnly.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestRecursiveQueries.java b/h2/src/test/org/h2/test/db/TestRecursiveQueries.java index 193d961ce7..2a8d27a360 100644 --- a/h2/src/test/org/h2/test/db/TestRecursiveQueries.java +++ b/h2/src/test/org/h2/test/db/TestRecursiveQueries.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestRights.java b/h2/src/test/org/h2/test/db/TestRights.java index 2e9a1de6ac..dc5656e06c 100644 --- a/h2/src/test/org/h2/test/db/TestRights.java +++ b/h2/src/test/org/h2/test/db/TestRights.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestRunscript.java b/h2/src/test/org/h2/test/db/TestRunscript.java index 0dd733c7ad..eeba97a95e 100644 --- a/h2/src/test/org/h2/test/db/TestRunscript.java +++ b/h2/src/test/org/h2/test/db/TestRunscript.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSQLInjection.java b/h2/src/test/org/h2/test/db/TestSQLInjection.java index b0f78044f4..8cb9dcaec6 100644 --- a/h2/src/test/org/h2/test/db/TestSQLInjection.java +++ b/h2/src/test/org/h2/test/db/TestSQLInjection.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSelectTableNotFound.java b/h2/src/test/org/h2/test/db/TestSelectTableNotFound.java index 256f93e42b..bed6108812 100644 --- a/h2/src/test/org/h2/test/db/TestSelectTableNotFound.java +++ b/h2/src/test/org/h2/test/db/TestSelectTableNotFound.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSequence.java b/h2/src/test/org/h2/test/db/TestSequence.java index fa7ddfc279..689ada2716 100644 --- a/h2/src/test/org/h2/test/db/TestSequence.java +++ b/h2/src/test/org/h2/test/db/TestSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSessionsLocks.java b/h2/src/test/org/h2/test/db/TestSessionsLocks.java index f62965a3ae..874cabe692 100644 --- a/h2/src/test/org/h2/test/db/TestSessionsLocks.java +++ b/h2/src/test/org/h2/test/db/TestSessionsLocks.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSetCollation.java b/h2/src/test/org/h2/test/db/TestSetCollation.java index 38a740aa73..7c0559f107 100644 --- a/h2/src/test/org/h2/test/db/TestSetCollation.java +++ b/h2/src/test/org/h2/test/db/TestSetCollation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSpaceReuse.java b/h2/src/test/org/h2/test/db/TestSpaceReuse.java index 4cd5514b0f..dd21cf549c 100644 --- a/h2/src/test/org/h2/test/db/TestSpaceReuse.java +++ b/h2/src/test/org/h2/test/db/TestSpaceReuse.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSpatial.java b/h2/src/test/org/h2/test/db/TestSpatial.java index d1a579b1ac..0de3de0f74 100644 --- a/h2/src/test/org/h2/test/db/TestSpatial.java +++ b/h2/src/test/org/h2/test/db/TestSpatial.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -13,6 +13,8 @@ import java.sql.Types; import java.util.Random; import org.h2.api.Aggregate; +import org.h2.api.ErrorCode; +import org.h2.message.DbException; import org.h2.test.TestBase; import org.h2.test.TestDb; import org.h2.tools.SimpleResultSet; @@ -24,11 +26,15 @@ import org.h2.value.ValueToObjectConverter; import org.h2.value.ValueToObjectConverter2; import org.locationtech.jts.geom.Coordinate; +import org.locationtech.jts.geom.CoordinateSequence; import org.locationtech.jts.geom.Envelope; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.MultiPoint; import org.locationtech.jts.geom.Point; import org.locationtech.jts.geom.Polygon; +import org.locationtech.jts.geom.PrecisionModel; +import org.locationtech.jts.geom.impl.CoordinateArraySequenceFactory; import org.locationtech.jts.geom.util.AffineTransformation; import org.locationtech.jts.io.ByteOrderValues; import org.locationtech.jts.io.ParseException; @@ -74,6 +80,7 @@ public void test() throws SQLException { } private void testSpatial() throws SQLException { + testNaNs(); testBug1(); testSpatialValues(); testOverlap(); @@ -105,6 +112,26 @@ private void testSpatial() throws SQLException { testSpatialIndexWithOrder(); } + private void testNaNs() { + GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 0, + CoordinateArraySequenceFactory.instance()); + CoordinateSequence c2 = factory.getCoordinateSequenceFactory().create(1, 2, 0); + c2.setOrdinate(0, 0, 1d); + c2.setOrdinate(0, 1, 1d); + CoordinateSequence c3 = factory.getCoordinateSequenceFactory().create(1, 3, 0); + c3.setOrdinate(0, 0, 1d); + c3.setOrdinate(0, 1, 2d); + c3.setOrdinate(0, 2, 3d); + Point p2 = factory.createPoint(c2); + Point p3 = factory.createPoint(c3); + try { + ValueGeometry.getFromGeometry(new MultiPoint(new Point[] { p2, p3 }, factory)); + fail("Expected exception"); + } catch (DbException e) { + assertEquals(ErrorCode.DATA_CONVERSION_ERROR_1, e.getErrorCode()); + } + } + private void testBug1() throws SQLException { deleteDb("spatial"); Connection conn = getConnection(URL); @@ -577,6 +604,7 @@ public void reset() throws SQLException { */ public static Geometry geomFromText(String text, int srid) throws SQLException { WKTReader wktReader = new WKTReader(); + wktReader.setIsOldJtsCoordinateSyntaxAllowed(false); try { Geometry geom = wktReader.read(text); geom.setSRID(srid); @@ -668,7 +696,7 @@ public static String getObjectString(Geometry object) { private void testEquals() { // 3d equality test ValueGeometry geom3d = ValueGeometry.get( - "POLYGON ((67 13 6, 67 18 5, 59 18 4, 59 13 6, 67 13 6))"); + "POLYGON Z((67 13 6, 67 18 5, 59 18 4, 59 13 6, 67 13 6))"); ValueGeometry geom2d = ValueGeometry.get( "POLYGON ((67 13, 67 18, 59 18, 59 13, 67 13))"); assertFalse(geom3d.equals(geom2d)); @@ -813,7 +841,7 @@ private void testTableViewSpatialPredicate() throws SQLException { * Check ValueGeometry conversion into SQL script */ private void testValueGeometryScript() throws SQLException { - ValueGeometry valueGeometry = ValueGeometry.get("POINT(1 1 5)"); + ValueGeometry valueGeometry = ValueGeometry.get("POINT Z(1 1 5)"); try (Connection conn = getConnection(URL)) { ResultSet rs = conn.createStatement().executeQuery( "SELECT " + valueGeometry.getSQL(HasSQL.DEFAULT_SQL_FLAGS)); diff --git a/h2/src/test/org/h2/test/db/TestSpeed.java b/h2/src/test/org/h2/test/db/TestSpeed.java index 49d09b59d2..3e4d6a80a7 100644 --- a/h2/src/test/org/h2/test/db/TestSpeed.java +++ b/h2/src/test/org/h2/test/db/TestSpeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSubqueryPerformanceOnLazyExecutionMode.java b/h2/src/test/org/h2/test/db/TestSubqueryPerformanceOnLazyExecutionMode.java index 53b8d7f10c..48361bcf1e 100644 --- a/h2/src/test/org/h2/test/db/TestSubqueryPerformanceOnLazyExecutionMode.java +++ b/h2/src/test/org/h2/test/db/TestSubqueryPerformanceOnLazyExecutionMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestSynonymForTable.java b/h2/src/test/org/h2/test/db/TestSynonymForTable.java index fd4c0d4f43..61c04084c1 100644 --- a/h2/src/test/org/h2/test/db/TestSynonymForTable.java +++ b/h2/src/test/org/h2/test/db/TestSynonymForTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestTableEngines.java b/h2/src/test/org/h2/test/db/TestTableEngines.java index 2250bd4fce..a87646f7e3 100644 --- a/h2/src/test/org/h2/test/db/TestTableEngines.java +++ b/h2/src/test/org/h2/test/db/TestTableEngines.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestTempTables.java b/h2/src/test/org/h2/test/db/TestTempTables.java index 7060df1fa9..416c7ae4ed 100644 --- a/h2/src/test/org/h2/test/db/TestTempTables.java +++ b/h2/src/test/org/h2/test/db/TestTempTables.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestTransaction.java b/h2/src/test/org/h2/test/db/TestTransaction.java index 0c6d897af3..22b8b9c014 100644 --- a/h2/src/test/org/h2/test/db/TestTransaction.java +++ b/h2/src/test/org/h2/test/db/TestTransaction.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestTriggersConstraints.java b/h2/src/test/org/h2/test/db/TestTriggersConstraints.java index 59e3c48d46..30c3d34bbc 100644 --- a/h2/src/test/org/h2/test/db/TestTriggersConstraints.java +++ b/h2/src/test/org/h2/test/db/TestTriggersConstraints.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java b/h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java index 296d485d5b..3f1380ba29 100644 --- a/h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java +++ b/h2/src/test/org/h2/test/db/TestTwoPhaseCommit.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestView.java b/h2/src/test/org/h2/test/db/TestView.java index c0b1705136..1dffd44bec 100644 --- a/h2/src/test/org/h2/test/db/TestView.java +++ b/h2/src/test/org/h2/test/db/TestView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestViewAlterTable.java b/h2/src/test/org/h2/test/db/TestViewAlterTable.java index 9160bb7ba1..6e8febc5e1 100644 --- a/h2/src/test/org/h2/test/db/TestViewAlterTable.java +++ b/h2/src/test/org/h2/test/db/TestViewAlterTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/TestViewDropView.java b/h2/src/test/org/h2/test/db/TestViewDropView.java index 7f8ae4d1c4..6361704af8 100644 --- a/h2/src/test/org/h2/test/db/TestViewDropView.java +++ b/h2/src/test/org/h2/test/db/TestViewDropView.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/db/package.html b/h2/src/test/org/h2/test/db/package.html index 8011be35bd..7b975d2567 100644 --- a/h2/src/test/org/h2/test/db/package.html +++ b/h2/src/test/org/h2/test/db/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java b/h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java index 50f1438e6e..1a153b9e16 100644 --- a/h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java +++ b/h2/src/test/org/h2/test/jdbc/TestBatchUpdates.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestCallableStatement.java b/h2/src/test/org/h2/test/jdbc/TestCallableStatement.java index def038c2d9..c1e758553b 100644 --- a/h2/src/test/org/h2/test/jdbc/TestCallableStatement.java +++ b/h2/src/test/org/h2/test/jdbc/TestCallableStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestCancel.java b/h2/src/test/org/h2/test/jdbc/TestCancel.java index caad6ea2d4..271fd71166 100644 --- a/h2/src/test/org/h2/test/jdbc/TestCancel.java +++ b/h2/src/test/org/h2/test/jdbc/TestCancel.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestConcurrentConnectionUsage.java b/h2/src/test/org/h2/test/jdbc/TestConcurrentConnectionUsage.java index 5270079c3e..e2f15bb8f1 100644 --- a/h2/src/test/org/h2/test/jdbc/TestConcurrentConnectionUsage.java +++ b/h2/src/test/org/h2/test/jdbc/TestConcurrentConnectionUsage.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestConnection.java b/h2/src/test/org/h2/test/jdbc/TestConnection.java index 00f914abfc..14206376ea 100644 --- a/h2/src/test/org/h2/test/jdbc/TestConnection.java +++ b/h2/src/test/org/h2/test/jdbc/TestConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java b/h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java index 29d4a09313..072fe14280 100644 --- a/h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java +++ b/h2/src/test/org/h2/test/jdbc/TestDatabaseEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestDriver.java b/h2/src/test/org/h2/test/jdbc/TestDriver.java index 84ca6297ed..64a7eb0fa9 100644 --- a/h2/src/test/org/h2/test/jdbc/TestDriver.java +++ b/h2/src/test/org/h2/test/jdbc/TestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestGetGeneratedKeys.java b/h2/src/test/org/h2/test/jdbc/TestGetGeneratedKeys.java index 0859ba3523..ebc356548c 100644 --- a/h2/src/test/org/h2/test/jdbc/TestGetGeneratedKeys.java +++ b/h2/src/test/org/h2/test/jdbc/TestGetGeneratedKeys.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestJavaObjectSerializer.java b/h2/src/test/org/h2/test/jdbc/TestJavaObjectSerializer.java index 52257004b0..bb145a23ee 100644 --- a/h2/src/test/org/h2/test/jdbc/TestJavaObjectSerializer.java +++ b/h2/src/test/org/h2/test/jdbc/TestJavaObjectSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestLobApi.java b/h2/src/test/org/h2/test/jdbc/TestLobApi.java index d751fdbfc3..cdb6f7d92f 100644 --- a/h2/src/test/org/h2/test/jdbc/TestLobApi.java +++ b/h2/src/test/org/h2/test/jdbc/TestLobApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestManyJdbcObjects.java b/h2/src/test/org/h2/test/jdbc/TestManyJdbcObjects.java index 8e6e15021a..d833c80977 100644 --- a/h2/src/test/org/h2/test/jdbc/TestManyJdbcObjects.java +++ b/h2/src/test/org/h2/test/jdbc/TestManyJdbcObjects.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestMetaData.java b/h2/src/test/org/h2/test/jdbc/TestMetaData.java index 17b18b3d11..ebf8879849 100644 --- a/h2/src/test/org/h2/test/jdbc/TestMetaData.java +++ b/h2/src/test/org/h2/test/jdbc/TestMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -893,16 +893,16 @@ private void testMore() throws SQLException { Types.VARCHAR }, null, null); assertResultSetOrdered(rs, new String[][] { { CATALOG, Constants.SCHEMA_MAIN, "TEST", "FALSE", CATALOG, - "IDX_DATE", "" + DatabaseMetaData.tableIndexStatistic, "1", + "IDX_DATE", "" + DatabaseMetaData.tableIndexOther, "1", "DATE_V", "A", "0", "0" }, { CATALOG, Constants.SCHEMA_MAIN, "TEST", "FALSE", CATALOG, "PRIMARY_KEY_2", "" + DatabaseMetaData.tableIndexOther, "1", "ID", "A", "0", "0" }, { CATALOG, Constants.SCHEMA_MAIN, "TEST", "TRUE", CATALOG, - "IDX_TEXT_DEC", "" + DatabaseMetaData.tableIndexStatistic, + "IDX_TEXT_DEC", "" + DatabaseMetaData.tableIndexOther, "1", "TEXT_V", "A", "0", "0" }, { CATALOG, Constants.SCHEMA_MAIN, "TEST", "TRUE", CATALOG, - "IDX_TEXT_DEC", "" + DatabaseMetaData.tableIndexStatistic, + "IDX_TEXT_DEC", "" + DatabaseMetaData.tableIndexOther, "2", "DEC_V", "A", "0", "0" }, }, new int[] { 11 }); stat.executeUpdate("DROP INDEX IDX_TEXT_DEC"); @@ -992,13 +992,13 @@ private void testMore() throws SQLException { "PRIMARY_KEY_14", "" + DatabaseMetaData.tableIndexOther, "3", "B", "A" }, { CATALOG, Constants.SCHEMA_MAIN, "TX2", "TRUE", CATALOG, - "B_INDEX", "" + DatabaseMetaData.tableIndexStatistic, "1", + "B_INDEX", "" + DatabaseMetaData.tableIndexOther, "1", "A", "A" }, { CATALOG, Constants.SCHEMA_MAIN, "TX2", "TRUE", CATALOG, - "B_INDEX", "" + DatabaseMetaData.tableIndexStatistic, "2", + "B_INDEX", "" + DatabaseMetaData.tableIndexOther, "2", "B", "A" }, { CATALOG, Constants.SCHEMA_MAIN, "TX2", "TRUE", CATALOG, - "B_INDEX", "" + DatabaseMetaData.tableIndexStatistic, "3", + "B_INDEX", "" + DatabaseMetaData.tableIndexOther, "3", "C", "A" }, }, new int[] { 11 }); trace("getPrimaryKeys"); diff --git a/h2/src/test/org/h2/test/jdbc/TestNativeSQL.java b/h2/src/test/org/h2/test/jdbc/TestNativeSQL.java index c07101379c..fd17319597 100644 --- a/h2/src/test/org/h2/test/jdbc/TestNativeSQL.java +++ b/h2/src/test/org/h2/test/jdbc/TestNativeSQL.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java b/h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java index bb583aaeca..7bbe4026b3 100644 --- a/h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java +++ b/h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestResultSet.java b/h2/src/test/org/h2/test/jdbc/TestResultSet.java index ba60ed9b04..0b0141a7f0 100644 --- a/h2/src/test/org/h2/test/jdbc/TestResultSet.java +++ b/h2/src/test/org/h2/test/jdbc/TestResultSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestSQLXML.java b/h2/src/test/org/h2/test/jdbc/TestSQLXML.java index 757d6f988c..940b803570 100644 --- a/h2/src/test/org/h2/test/jdbc/TestSQLXML.java +++ b/h2/src/test/org/h2/test/jdbc/TestSQLXML.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestStatement.java b/h2/src/test/org/h2/test/jdbc/TestStatement.java index f5cc341155..658b68fcb5 100644 --- a/h2/src/test/org/h2/test/jdbc/TestStatement.java +++ b/h2/src/test/org/h2/test/jdbc/TestStatement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java b/h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java index 2ed95256c4..234bad5c8f 100644 --- a/h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java +++ b/h2/src/test/org/h2/test/jdbc/TestTransactionIsolation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java b/h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java index 0e4d5bb1e3..217232db0c 100644 --- a/h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java +++ b/h2/src/test/org/h2/test/jdbc/TestUpdatableResultSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestUrlJavaObjectSerializer.java b/h2/src/test/org/h2/test/jdbc/TestUrlJavaObjectSerializer.java index 546588838a..b1e7634c3c 100644 --- a/h2/src/test/org/h2/test/jdbc/TestUrlJavaObjectSerializer.java +++ b/h2/src/test/org/h2/test/jdbc/TestUrlJavaObjectSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/TestZloty.java b/h2/src/test/org/h2/test/jdbc/TestZloty.java index 31bb4d130a..e915849826 100644 --- a/h2/src/test/org/h2/test/jdbc/TestZloty.java +++ b/h2/src/test/org/h2/test/jdbc/TestZloty.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbc/package.html b/h2/src/test/org/h2/test/jdbc/package.html index 8dddb4be01..bf78702576 100644 --- a/h2/src/test/org/h2/test/jdbc/package.html +++ b/h2/src/test/org/h2/test/jdbc/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/jdbcx/SimpleXid.java b/h2/src/test/org/h2/test/jdbcx/SimpleXid.java index 6029a50d7b..666239b426 100644 --- a/h2/src/test/org/h2/test/jdbcx/SimpleXid.java +++ b/h2/src/test/org/h2/test/jdbcx/SimpleXid.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java b/h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java index a1a35b32b8..dab7d296a7 100644 --- a/h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java +++ b/h2/src/test/org/h2/test/jdbcx/TestConnectionPool.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbcx/TestDataSource.java b/h2/src/test/org/h2/test/jdbcx/TestDataSource.java index cea43c9962..20c9213cbe 100644 --- a/h2/src/test/org/h2/test/jdbcx/TestDataSource.java +++ b/h2/src/test/org/h2/test/jdbcx/TestDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbcx/TestXA.java b/h2/src/test/org/h2/test/jdbcx/TestXA.java index 0d9f2c601a..2914518649 100644 --- a/h2/src/test/org/h2/test/jdbcx/TestXA.java +++ b/h2/src/test/org/h2/test/jdbcx/TestXA.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: James Devenish */ diff --git a/h2/src/test/org/h2/test/jdbcx/TestXASimple.java b/h2/src/test/org/h2/test/jdbcx/TestXASimple.java index 0cd56cc0c2..16f68cdf3e 100644 --- a/h2/src/test/org/h2/test/jdbcx/TestXASimple.java +++ b/h2/src/test/org/h2/test/jdbcx/TestXASimple.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/jdbcx/package.html b/h2/src/test/org/h2/test/jdbcx/package.html index ad2e7934d1..41fa5358b5 100644 --- a/h2/src/test/org/h2/test/jdbcx/package.html +++ b/h2/src/test/org/h2/test/jdbcx/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/mvcc/TestMvcc1.java b/h2/src/test/org/h2/test/mvcc/TestMvcc1.java index 09b74af8f6..954d27d159 100644 --- a/h2/src/test/org/h2/test/mvcc/TestMvcc1.java +++ b/h2/src/test/org/h2/test/mvcc/TestMvcc1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/mvcc/TestMvcc2.java b/h2/src/test/org/h2/test/mvcc/TestMvcc2.java index c33aa6480c..93ce063569 100644 --- a/h2/src/test/org/h2/test/mvcc/TestMvcc2.java +++ b/h2/src/test/org/h2/test/mvcc/TestMvcc2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/mvcc/TestMvcc3.java b/h2/src/test/org/h2/test/mvcc/TestMvcc3.java index a682861653..ebf6bfadbf 100644 --- a/h2/src/test/org/h2/test/mvcc/TestMvcc3.java +++ b/h2/src/test/org/h2/test/mvcc/TestMvcc3.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/mvcc/TestMvcc4.java b/h2/src/test/org/h2/test/mvcc/TestMvcc4.java index 2681b07fa5..b99637a2d0 100644 --- a/h2/src/test/org/h2/test/mvcc/TestMvcc4.java +++ b/h2/src/test/org/h2/test/mvcc/TestMvcc4.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java b/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java index 49634364da..26f3ab3e54 100644 --- a/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java +++ b/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java b/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java index 5f02b910b3..1f6231eed4 100644 --- a/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java +++ b/h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/mvcc/package.html b/h2/src/test/org/h2/test/mvcc/package.html index 694448fd9c..73ab19a52e 100644 --- a/h2/src/test/org/h2/test/mvcc/package.html +++ b/h2/src/test/org/h2/test/mvcc/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/package.html b/h2/src/test/org/h2/test/package.html index 0166adbaad..b2fcea6040 100644 --- a/h2/src/test/org/h2/test/package.html +++ b/h2/src/test/org/h2/test/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/poweroff/Listener.java b/h2/src/test/org/h2/test/poweroff/Listener.java index dc677e013e..2b49cac156 100644 --- a/h2/src/test/org/h2/test/poweroff/Listener.java +++ b/h2/src/test/org/h2/test/poweroff/Listener.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/poweroff/Test.java b/h2/src/test/org/h2/test/poweroff/Test.java index 8db020b32a..2875236632 100644 --- a/h2/src/test/org/h2/test/poweroff/Test.java +++ b/h2/src/test/org/h2/test/poweroff/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/poweroff/TestRecover.java b/h2/src/test/org/h2/test/poweroff/TestRecover.java index 4e7e69772a..922d43fbbb 100644 --- a/h2/src/test/org/h2/test/poweroff/TestRecover.java +++ b/h2/src/test/org/h2/test/poweroff/TestRecover.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/poweroff/TestRecoverKillLoop.java b/h2/src/test/org/h2/test/poweroff/TestRecoverKillLoop.java index 38aec82e0d..20c9a4db06 100644 --- a/h2/src/test/org/h2/test/poweroff/TestRecoverKillLoop.java +++ b/h2/src/test/org/h2/test/poweroff/TestRecoverKillLoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/poweroff/TestReorderWrites.java b/h2/src/test/org/h2/test/poweroff/TestReorderWrites.java index 9ab51b7701..a6bfba0b95 100644 --- a/h2/src/test/org/h2/test/poweroff/TestReorderWrites.java +++ b/h2/src/test/org/h2/test/poweroff/TestReorderWrites.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/poweroff/TestWrite.java b/h2/src/test/org/h2/test/poweroff/TestWrite.java index b3949b4872..b7d75a0037 100644 --- a/h2/src/test/org/h2/test/poweroff/TestWrite.java +++ b/h2/src/test/org/h2/test/poweroff/TestWrite.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/poweroff/package.html b/h2/src/test/org/h2/test/poweroff/package.html index 694448fd9c..73ab19a52e 100644 --- a/h2/src/test/org/h2/test/poweroff/package.html +++ b/h2/src/test/org/h2/test/poweroff/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/recover/RecoverLobTest.java b/h2/src/test/org/h2/test/recover/RecoverLobTest.java index 466a4590be..fb93f5b1b5 100644 --- a/h2/src/test/org/h2/test/recover/RecoverLobTest.java +++ b/h2/src/test/org/h2/test/recover/RecoverLobTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/recover/package.html b/h2/src/test/org/h2/test/recover/package.html index 5b4d64dcd3..05ddb3e212 100644 --- a/h2/src/test/org/h2/test/recover/package.html +++ b/h2/src/test/org/h2/test/recover/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/rowlock/TestRowLocks.java b/h2/src/test/org/h2/test/rowlock/TestRowLocks.java index 35f464d4de..3c481d4355 100644 --- a/h2/src/test/org/h2/test/rowlock/TestRowLocks.java +++ b/h2/src/test/org/h2/test/rowlock/TestRowLocks.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/rowlock/package.html b/h2/src/test/org/h2/test/rowlock/package.html index 696984eb0d..ce78426472 100644 --- a/h2/src/test/org/h2/test/rowlock/package.html +++ b/h2/src/test/org/h2/test/rowlock/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/scripts/Aggregate1.java b/h2/src/test/org/h2/test/scripts/Aggregate1.java index 1bfbf2682d..038a93794e 100644 --- a/h2/src/test/org/h2/test/scripts/Aggregate1.java +++ b/h2/src/test/org/h2/test/scripts/Aggregate1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/scripts/TestScript.java b/h2/src/test/org/h2/test/scripts/TestScript.java index 457d8a115e..0e7686b693 100644 --- a/h2/src/test/org/h2/test/scripts/TestScript.java +++ b/h2/src/test/org/h2/test/scripts/TestScript.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -206,7 +206,7 @@ public void test() throws Exception { "file-read", "file-write", "greatest", "h2version", "identity", "ifnull", "last-insert-id", "least", "link-schema", "lock-mode", "lock-timeout", "memory-free", "memory-used", "nextval", "nullif", "nvl2", - "readonly", "rownum", "scope-identity", "session-id", + "readonly", "rownum", "session-id", "table", "transaction-id", "trim_array", "truncate-value", "unnest" }) { testScript("functions/system/" + s + ".sql"); } diff --git a/h2/src/test/org/h2/test/scripts/Trigger1.java b/h2/src/test/org/h2/test/scripts/Trigger1.java index 5f74070acf..b110511299 100644 --- a/h2/src/test/org/h2/test/scripts/Trigger1.java +++ b/h2/src/test/org/h2/test/scripts/Trigger1.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/scripts/Trigger2.java b/h2/src/test/org/h2/test/scripts/Trigger2.java index ffa4ba044d..ff773336d1 100644 --- a/h2/src/test/org/h2/test/scripts/Trigger2.java +++ b/h2/src/test/org/h2/test/scripts/Trigger2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/scripts/altertable-fk.sql b/h2/src/test/org/h2/test/scripts/altertable-fk.sql index 04881f9b3e..73adb9d586 100644 --- a/h2/src/test/org/h2/test/scripts/altertable-fk.sql +++ b/h2/src/test/org/h2/test/scripts/altertable-fk.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/altertable-index-reuse.sql b/h2/src/test/org/h2/test/scripts/altertable-index-reuse.sql index dba0706b8d..f93f90e7e0 100644 --- a/h2/src/test/org/h2/test/scripts/altertable-index-reuse.sql +++ b/h2/src/test/org/h2/test/scripts/altertable-index-reuse.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/compatibility/add_months.sql b/h2/src/test/org/h2/test/scripts/compatibility/add_months.sql index a537a70603..69e7100854 100644 --- a/h2/src/test/org/h2/test/scripts/compatibility/add_months.sql +++ b/h2/src/test/org/h2/test/scripts/compatibility/add_months.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/compatibility/compatibility.sql b/h2/src/test/org/h2/test/scripts/compatibility/compatibility.sql index 6cc775cdc5..a05dec4eba 100644 --- a/h2/src/test/org/h2/test/scripts/compatibility/compatibility.sql +++ b/h2/src/test/org/h2/test/scripts/compatibility/compatibility.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/compatibility/group_by.sql b/h2/src/test/org/h2/test/scripts/compatibility/group_by.sql index 3bc39a42a8..f156ea5ebc 100644 --- a/h2/src/test/org/h2/test/scripts/compatibility/group_by.sql +++ b/h2/src/test/org/h2/test/scripts/compatibility/group_by.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/compatibility/strict_and_legacy.sql b/h2/src/test/org/h2/test/scripts/compatibility/strict_and_legacy.sql index 813ee6bef8..7fbc8317ce 100644 --- a/h2/src/test/org/h2/test/scripts/compatibility/strict_and_legacy.sql +++ b/h2/src/test/org/h2/test/scripts/compatibility/strict_and_legacy.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -88,5 +88,14 @@ DROP SEQUENCE SEQ; SELECT 1 = TRUE; >> TRUE +SET MODE STRICT; +> ok + +CREATE TABLE TEST(LIMIT INTEGER, MINUS INTEGER); +> ok + +DROP TABLE TEST; +> ok + SET MODE REGULAR; > ok diff --git a/h2/src/test/org/h2/test/scripts/datatypes/array.sql b/h2/src/test/org/h2/test/scripts/datatypes/array.sql index 6b6d9be01b..f083ce9947 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/array.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/array.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/bigint.sql b/h2/src/test/org/h2/test/scripts/datatypes/bigint.sql index 3c712a83e2..3b2bacf124 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/bigint.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/bigint.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/binary.sql b/h2/src/test/org/h2/test/scripts/datatypes/binary.sql index 2a9f8dbf7e..fadf19999c 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/binary.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/binary.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/blob.sql b/h2/src/test/org/h2/test/scripts/datatypes/blob.sql index 6683b53db5..05cc2eb5ea 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/blob.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/blob.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/boolean.sql b/h2/src/test/org/h2/test/scripts/datatypes/boolean.sql index 6d9ef6f73a..979a5e7385 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/boolean.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/boolean.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/char.sql b/h2/src/test/org/h2/test/scripts/datatypes/char.sql index b88a6f0790..c76241463a 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/char.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/char.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/clob.sql b/h2/src/test/org/h2/test/scripts/datatypes/clob.sql index eaee441a88..20cb6db086 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/clob.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/clob.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/date.sql b/h2/src/test/org/h2/test/scripts/datatypes/date.sql index 5467a64a03..9d48a4b87e 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/date.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/date.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/decfloat.sql b/h2/src/test/org/h2/test/scripts/datatypes/decfloat.sql index 407a0de748..f311f90115 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/decfloat.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/decfloat.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/double_precision.sql b/h2/src/test/org/h2/test/scripts/datatypes/double_precision.sql index c5d81941e4..3d86efdfb1 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/double_precision.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/double_precision.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/enum.sql b/h2/src/test/org/h2/test/scripts/datatypes/enum.sql index d37a8d28cc..cd10233159 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/enum.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/enum.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/geometry.sql b/h2/src/test/org/h2/test/scripts/datatypes/geometry.sql index 8b4a113eab..4b6675bf74 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/geometry.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/geometry.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -272,3 +272,6 @@ SELECT CAST(GEOMETRY 'POLYGON EMPTY' AS VARBINARY); SELECT CAST(GEOMETRY X'00000000030000000100000000' AS VARBINARY); >> X'000000000300000000' + +VALUES GEOMETRY 'POINT (1 2 3)'; +> exception DATA_CONVERSION_ERROR_1 diff --git a/h2/src/test/org/h2/test/scripts/datatypes/identity.sql b/h2/src/test/org/h2/test/scripts/datatypes/identity.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/identity.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/identity.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/int.sql b/h2/src/test/org/h2/test/scripts/datatypes/int.sql index 192f509f8a..266abcca4b 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/int.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/int.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/interval.sql b/h2/src/test/org/h2/test/scripts/datatypes/interval.sql index 3a107cad96..89b53900e5 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/interval.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/interval.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/java_object.sql b/h2/src/test/org/h2/test/scripts/datatypes/java_object.sql index ce9380fb74..bbe0f8ece9 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/java_object.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/java_object.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/json.sql b/h2/src/test/org/h2/test/scripts/datatypes/json.sql index af8b478edc..4bf8ece132 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/json.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/json.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/numeric.sql b/h2/src/test/org/h2/test/scripts/datatypes/numeric.sql index ad10f85784..43536cefb0 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/numeric.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/numeric.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/real.sql b/h2/src/test/org/h2/test/scripts/datatypes/real.sql index 7661e02d8d..d3e350eb0c 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/real.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/real.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/row.sql b/h2/src/test/org/h2/test/scripts/datatypes/row.sql index df2054d8dd..d1bd2443ee 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/row.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/row.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/smallint.sql b/h2/src/test/org/h2/test/scripts/datatypes/smallint.sql index 2226c704f5..53362fef48 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/smallint.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/smallint.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/time-with-time-zone.sql b/h2/src/test/org/h2/test/scripts/datatypes/time-with-time-zone.sql index 50d441325e..b400394075 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/time-with-time-zone.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/time-with-time-zone.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/time.sql b/h2/src/test/org/h2/test/scripts/datatypes/time.sql index f78ef1b874..a51b23425c 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/time.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/time.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/timestamp-with-time-zone.sql b/h2/src/test/org/h2/test/scripts/datatypes/timestamp-with-time-zone.sql index c42bfdc206..290d975fe9 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/timestamp-with-time-zone.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/timestamp-with-time-zone.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/timestamp.sql b/h2/src/test/org/h2/test/scripts/datatypes/timestamp.sql index e1e0c5bc64..b2bfa5f0d0 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/timestamp.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/timestamp.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/tinyint.sql b/h2/src/test/org/h2/test/scripts/datatypes/tinyint.sql index c97c983d54..c389b6e17f 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/tinyint.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/tinyint.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/uuid.sql b/h2/src/test/org/h2/test/scripts/datatypes/uuid.sql index 10dc92dc90..39686caa06 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/uuid.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/uuid.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/varbinary.sql b/h2/src/test/org/h2/test/scripts/datatypes/varbinary.sql index 044ae6b4b5..881b3a7923 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/varbinary.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/varbinary.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/varchar-ignorecase.sql b/h2/src/test/org/h2/test/scripts/datatypes/varchar-ignorecase.sql index 6d92078614..268b906706 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/varchar-ignorecase.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/varchar-ignorecase.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/datatypes/varchar.sql b/h2/src/test/org/h2/test/scripts/datatypes/varchar.sql index a216a26538..d7ebecfa0b 100644 --- a/h2/src/test/org/h2/test/scripts/datatypes/varchar.sql +++ b/h2/src/test/org/h2/test/scripts/datatypes/varchar.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/alterDomain.sql b/h2/src/test/org/h2/test/scripts/ddl/alterDomain.sql index 2647255a2f..94bc2ae007 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/alterDomain.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/alterDomain.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/alterTableAdd.sql b/h2/src/test/org/h2/test/scripts/ddl/alterTableAdd.sql index 651a16081f..9f00abb42f 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/alterTableAdd.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/alterTableAdd.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -336,3 +336,60 @@ SELECT INDEX_TYPE_NAME, IS_GENERATED FROM INFORMATION_SCHEMA.INDEXES WHERE TABLE DROP TABLE TEST; > ok + +CREATE TABLE TEST(A INT, B INT, C INT INVISIBLE, CONSTRAINT TEST_UNIQUE_2 UNIQUE(VALUE)); +> ok + +ALTER TABLE TEST ADD COLUMN D INT; +> ok + +ALTER TABLE TEST ADD CONSTRAINT TEST_UNIQUE_3 UNIQUE(VALUE); +> ok + +SELECT CONSTRAINT_NAME, COLUMN_NAME, ORDINAL_POSITION FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE + WHERE TABLE_NAME = 'TEST'; +> CONSTRAINT_NAME COLUMN_NAME ORDINAL_POSITION +> --------------- ----------- ---------------- +> TEST_UNIQUE_2 A 1 +> TEST_UNIQUE_2 B 2 +> TEST_UNIQUE_3 A 1 +> TEST_UNIQUE_3 B 2 +> TEST_UNIQUE_3 D 3 +> rows: 5 + +DROP TABLE TEST; +> ok + +CREATE TABLE TEST(); +> ok + +ALTER TABLE TEST ADD UNIQUE (VALUE); +> exception SYNTAX_ERROR_1 + +DROP TABLE TEST; +> ok + +CREATE TABLE TEST(A INT, B INT) AS VALUES (3, 4); +> ok + +ALTER TABLE TEST ADD G INT GENERATED ALWAYS AS (A + B); +> ok + +ALTER TABLE TEST ADD ID BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY FIRST; +> ok + +ALTER TABLE TEST ADD C INT AFTER B; +> ok + +INSERT INTO TEST(A, B) VALUES (5, 6); +> update count: 1 + +TABLE TEST; +> ID A B C G +> -- - - ---- -- +> 1 3 4 null 7 +> 2 5 6 null 11 +> rows: 2 + +DROP TABLE TEST; +> ok diff --git a/h2/src/test/org/h2/test/scripts/ddl/alterTableAlterColumn.sql b/h2/src/test/org/h2/test/scripts/ddl/alterTableAlterColumn.sql index 31a0746265..cda63ed105 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/alterTableAlterColumn.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/alterTableAlterColumn.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/alterTableDropColumn.sql b/h2/src/test/org/h2/test/scripts/ddl/alterTableDropColumn.sql index 56d14b5ff8..a7825a5e18 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/alterTableDropColumn.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/alterTableDropColumn.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/alterTableDropConstraint.sql b/h2/src/test/org/h2/test/scripts/ddl/alterTableDropConstraint.sql index 6c1786eaa1..2be6935581 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/alterTableDropConstraint.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/alterTableDropConstraint.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/alterTableRename.sql b/h2/src/test/org/h2/test/scripts/ddl/alterTableRename.sql index 7da50a922d..53683cb754 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/alterTableRename.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/alterTableRename.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/alterTableRenameConstraint.sql b/h2/src/test/org/h2/test/scripts/ddl/alterTableRenameConstraint.sql index a568b5b0d9..6c1dbdc4a1 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/alterTableRenameConstraint.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/alterTableRenameConstraint.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/analyze.sql b/h2/src/test/org/h2/test/scripts/ddl/analyze.sql index 6661047ea8..706fe121f9 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/analyze.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/analyze.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/commentOn.sql b/h2/src/test/org/h2/test/scripts/ddl/commentOn.sql index 81e2d5c627..ea9d89b0a8 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/commentOn.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/commentOn.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createAlias.sql b/h2/src/test/org/h2/test/scripts/ddl/createAlias.sql index 0f68a46c6a..3a4234e1f3 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createAlias.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createAlias.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createConstant.sql b/h2/src/test/org/h2/test/scripts/ddl/createConstant.sql index cfdf601f29..a2b941ae7a 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createConstant.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createConstant.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createDomain.sql b/h2/src/test/org/h2/test/scripts/ddl/createDomain.sql index 2f67334976..e0936e3b21 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createDomain.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createDomain.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createIndex.sql b/h2/src/test/org/h2/test/scripts/ddl/createIndex.sql index ffd8d125b6..4f99d98afe 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createIndex.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createIndex.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createSchema.sql b/h2/src/test/org/h2/test/scripts/ddl/createSchema.sql index 4e75a872a9..e48583182e 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createSchema.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createSchema.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createSequence.sql b/h2/src/test/org/h2/test/scripts/ddl/createSequence.sql index 83a9981ccd..e6f3cb8d29 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createSequence.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createSequence.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createSynonym.sql b/h2/src/test/org/h2/test/scripts/ddl/createSynonym.sql index 62b0384e4c..b359f386a7 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createSynonym.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createSynonym.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createTable.sql b/h2/src/test/org/h2/test/scripts/ddl/createTable.sql index 4b76d22271..01d94e367a 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createTable.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createTable.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -253,3 +253,15 @@ DROP TABLE TEST; EXECUTE IMMEDIATE 'CREATE TABLE TEST(' || (SELECT LISTAGG('C' || X || ' INT') FROM SYSTEM_RANGE(1, 16385)) || ')'; > exception TOO_MANY_COLUMNS_1 + +CREATE TABLE TEST AS (SELECT REPEAT('A', 300)); +> ok + +TABLE TEST; +> C1 +> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +> rows: 1 + +DROP TABLE TEST; +> ok diff --git a/h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql b/h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql index c61ec507fc..672263520a 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createTrigger.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/createView.sql b/h2/src/test/org/h2/test/scripts/ddl/createView.sql index d8cc159f73..b049555439 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/createView.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/createView.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/dropAllObjects.sql b/h2/src/test/org/h2/test/scripts/ddl/dropAllObjects.sql index e6a58d6ad4..2d570e5934 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/dropAllObjects.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/dropAllObjects.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/dropDomain.sql b/h2/src/test/org/h2/test/scripts/ddl/dropDomain.sql index 5cbae18f7b..2fc644b3c1 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/dropDomain.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/dropDomain.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/dropIndex.sql b/h2/src/test/org/h2/test/scripts/ddl/dropIndex.sql index 4cce83b3f9..a933bb56bf 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/dropIndex.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/dropIndex.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql b/h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql index 36c77e12c4..4285f88c5f 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/dropSchema.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/dropTable.sql b/h2/src/test/org/h2/test/scripts/ddl/dropTable.sql index 5a26fcff47..05a606a0a0 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/dropTable.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/dropTable.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/grant.sql b/h2/src/test/org/h2/test/scripts/ddl/grant.sql index 472aeb807a..e3b7e159e9 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/grant.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/grant.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/ddl/truncateTable.sql b/h2/src/test/org/h2/test/scripts/ddl/truncateTable.sql index 21e46bf4ee..0ac0093f66 100644 --- a/h2/src/test/org/h2/test/scripts/ddl/truncateTable.sql +++ b/h2/src/test/org/h2/test/scripts/ddl/truncateTable.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/default-and-on_update.sql b/h2/src/test/org/h2/test/scripts/default-and-on_update.sql index af2caa6228..aeb273792e 100644 --- a/h2/src/test/org/h2/test/scripts/default-and-on_update.sql +++ b/h2/src/test/org/h2/test/scripts/default-and-on_update.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/delete.sql b/h2/src/test/org/h2/test/scripts/dml/delete.sql index 65bea4765b..60a7f792f0 100644 --- a/h2/src/test/org/h2/test/scripts/dml/delete.sql +++ b/h2/src/test/org/h2/test/scripts/dml/delete.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/error_reporting.sql b/h2/src/test/org/h2/test/scripts/dml/error_reporting.sql index 481014d7f2..9da42977b0 100644 --- a/h2/src/test/org/h2/test/scripts/dml/error_reporting.sql +++ b/h2/src/test/org/h2/test/scripts/dml/error_reporting.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/execute_immediate.sql b/h2/src/test/org/h2/test/scripts/dml/execute_immediate.sql index 8140c87bd3..b3aa0057aa 100644 --- a/h2/src/test/org/h2/test/scripts/dml/execute_immediate.sql +++ b/h2/src/test/org/h2/test/scripts/dml/execute_immediate.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/insert.sql b/h2/src/test/org/h2/test/scripts/dml/insert.sql index 976feb8840..804fca813a 100644 --- a/h2/src/test/org/h2/test/scripts/dml/insert.sql +++ b/h2/src/test/org/h2/test/scripts/dml/insert.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/insertIgnore.sql b/h2/src/test/org/h2/test/scripts/dml/insertIgnore.sql index 7fac1283e5..bdbf726a69 100644 --- a/h2/src/test/org/h2/test/scripts/dml/insertIgnore.sql +++ b/h2/src/test/org/h2/test/scripts/dml/insertIgnore.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/merge.sql b/h2/src/test/org/h2/test/scripts/dml/merge.sql index b3a2bbdc6d..93509d46a4 100644 --- a/h2/src/test/org/h2/test/scripts/dml/merge.sql +++ b/h2/src/test/org/h2/test/scripts/dml/merge.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/mergeUsing.sql b/h2/src/test/org/h2/test/scripts/dml/mergeUsing.sql index 91fc4e03df..051241645c 100644 --- a/h2/src/test/org/h2/test/scripts/dml/mergeUsing.sql +++ b/h2/src/test/org/h2/test/scripts/dml/mergeUsing.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -479,12 +479,12 @@ EXPLAIN MERGE INTO T USING (VALUES (1, 2)) S(ID, V) ON T.ID = S.ID WHEN NOT MATCHED THEN INSERT VALUES (S.ID, S.V + 1) WHEN MATCHED AND T.ID = 2 THEN UPDATE SET V = S.ID + 2 WHEN MATCHED THEN UPDATE SET V = S.ID + 3; ->> MERGE INTO "PUBLIC"."T" /* PUBLIC.T.tableScan */ USING ( VALUES (1, 2) ) "S"("ID", "V") /* VALUES (1, 2) */ WHEN NOT MATCHED AND "T"."ID" = 1 THEN INSERT ("ID", "V") VALUES ("S"."ID", "S"."V") WHEN NOT MATCHED THEN INSERT ("ID", "V") VALUES ("S"."ID", "S"."V" + 1) WHEN MATCHED AND "T"."ID" = 2 THEN UPDATE SET "V" = "S"."ID" + 2 WHEN MATCHED THEN UPDATE SET "V" = "S"."ID" + 3 +>> MERGE INTO "PUBLIC"."T" /* PUBLIC.T.tableScan */ USING (VALUES (1, 2)) "S"("ID", "V") /* table scan */ WHEN NOT MATCHED AND "T"."ID" = 1 THEN INSERT ("ID", "V") VALUES ("S"."ID", "S"."V") WHEN NOT MATCHED THEN INSERT ("ID", "V") VALUES ("S"."ID", "S"."V" + 1) WHEN MATCHED AND "T"."ID" = 2 THEN UPDATE SET "V" = "S"."ID" + 2 WHEN MATCHED THEN UPDATE SET "V" = "S"."ID" + 3 EXPLAIN MERGE INTO T USING (VALUES (1, 2)) S(ID, V) ON T.ID = S.ID WHEN MATCHED AND T.ID = 1 THEN DELETE WHEN MATCHED THEN DELETE; ->> MERGE INTO "PUBLIC"."T" /* PUBLIC.T.tableScan */ USING ( VALUES (1, 2) ) "S"("ID", "V") /* VALUES (1, 2) */ WHEN MATCHED AND "T"."ID" = 1 THEN DELETE WHEN MATCHED THEN DELETE +>> MERGE INTO "PUBLIC"."T" /* PUBLIC.T.tableScan */ USING (VALUES (1, 2)) "S"("ID", "V") /* table scan */ WHEN MATCHED AND "T"."ID" = 1 THEN DELETE WHEN MATCHED THEN DELETE DROP TABLE T; > ok diff --git a/h2/src/test/org/h2/test/scripts/dml/replace.sql b/h2/src/test/org/h2/test/scripts/dml/replace.sql index 3fbcdce882..cad90d682b 100644 --- a/h2/src/test/org/h2/test/scripts/dml/replace.sql +++ b/h2/src/test/org/h2/test/scripts/dml/replace.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/script.sql b/h2/src/test/org/h2/test/scripts/dml/script.sql index 0676f597ff..b0289136d9 100644 --- a/h2/src/test/org/h2/test/scripts/dml/script.sql +++ b/h2/src/test/org/h2/test/scripts/dml/script.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/show.sql b/h2/src/test/org/h2/test/scripts/dml/show.sql index 2948d10992..a6c2c13ef3 100644 --- a/h2/src/test/org/h2/test/scripts/dml/show.sql +++ b/h2/src/test/org/h2/test/scripts/dml/show.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/update.sql b/h2/src/test/org/h2/test/scripts/dml/update.sql index 069c6306c4..7f67503625 100644 --- a/h2/src/test/org/h2/test/scripts/dml/update.sql +++ b/h2/src/test/org/h2/test/scripts/dml/update.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/dml/with.sql b/h2/src/test/org/h2/test/scripts/dml/with.sql index 7ab923a022..758127e770 100644 --- a/h2/src/test/org/h2/test/scripts/dml/with.sql +++ b/h2/src/test/org/h2/test/scripts/dml/with.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -234,3 +234,12 @@ TABLE T; DROP TABLE T; > ok + +WITH T(X) AS (SELECT 1) +(SELECT 2 Y) UNION (SELECT 3 Z) UNION (SELECT * FROM T); +> Y +> - +> 1 +> 2 +> 3 +> rows: 3 diff --git a/h2/src/test/org/h2/test/scripts/dual.sql b/h2/src/test/org/h2/test/scripts/dual.sql index 8dd27bc174..9df679a474 100644 --- a/h2/src/test/org/h2/test/scripts/dual.sql +++ b/h2/src/test/org/h2/test/scripts/dual.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/any.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/any.sql index b2d8caf7eb..41b27d5731 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/any.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/any.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/array_agg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/array_agg.sql index 0d5c897b0a..ab39ce4b3e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/array_agg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/array_agg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: Alex Nordlund -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/avg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/avg.sql index 9828ca56d0..1b70b6e58e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/avg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/avg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_and_agg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_and_agg.sql index 332dd541ba..52212634ed 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_and_agg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_and_agg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_or_agg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_or_agg.sql index 19275fb95e..ba91746c04 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_or_agg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_or_agg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_xor_agg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_xor_agg.sql index 98fe6a5e05..1092a4d00a 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_xor_agg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/bit_xor_agg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/corr.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/corr.sql index 27476033df..45a9fb38d0 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/corr.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/corr.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/count.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/count.sql index b74601d31c..1d151de2ba 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/count.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/count.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_pop.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_pop.sql index 6d8f4c4c60..2db80694cd 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_pop.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_pop.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_samp.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_samp.sql index 515da4624f..8b09c45d1d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_samp.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/covar_samp.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/envelope.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/envelope.sql index 800ecfa16e..9879b92ad8 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/envelope.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/envelope.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/every.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/every.sql index f5be338355..e603f5c624 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/every.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/every.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/histogram.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/histogram.sql index 761816499f..396daabd5b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/histogram.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/histogram.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/json_arrayagg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/json_arrayagg.sql index 60fedfd0b3..12429ec0af 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/json_arrayagg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/json_arrayagg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/json_objectagg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/json_objectagg.sql index fe0ddfc2d0..de61a64361 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/json_objectagg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/json_objectagg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/listagg.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/listagg.sql index bdbbe3cfb5..1a0d91f1a9 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/listagg.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/listagg.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/max.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/max.sql index 4186b872a0..dfdf0c99ba 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/max.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/max.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/min.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/min.sql index 288f80d174..e8b4b50504 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/min.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/min.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/mode.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/mode.sql index bf46285191..54b0dd7314 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/mode.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/mode.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/percentile.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/percentile.sql index ebb6f7952c..5ac0bed4ad 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/percentile.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/percentile.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/rank.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/rank.sql index 6487895439..739f1b0772 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/rank.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/rank.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgx.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgx.sql index 89ed9523f9..421136363b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgx.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgx.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgy.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgy.sql index ed41dc9072..377e441846 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgy.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_avgy.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_count.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_count.sql index 72e906ef9c..e8e72f1d46 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_count.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_count.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_intercept.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_intercept.sql index f78657d3b5..f1c22e3704 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_intercept.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_intercept.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_r2.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_r2.sql index b53b65ba9c..67517a2099 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_r2.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_r2.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_slope.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_slope.sql index 90e5635ab4..3f2c4688b0 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_slope.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_slope.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxx.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxx.sql index 5518ad8272..963dfa560f 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxx.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxx.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxy.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxy.sql index 4756949639..9d6aeca260 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxy.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_sxy.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_syy.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_syy.sql index a201447c71..9478b4f483 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_syy.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/regr_syy.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_pop.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_pop.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_pop.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_pop.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_samp.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_samp.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_samp.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/stddev_samp.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/sum.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/sum.sql index 44cc8e1529..f2d794076f 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/sum.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/sum.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/var_pop.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/var_pop.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/var_pop.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/var_pop.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/aggregate/var_samp.sql b/h2/src/test/org/h2/test/scripts/functions/aggregate/var_samp.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/aggregate/var_samp.sql +++ b/h2/src/test/org/h2/test/scripts/functions/aggregate/var_samp.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/json/json_array.sql b/h2/src/test/org/h2/test/scripts/functions/json/json_array.sql index 97d63b64de..58d0c52988 100644 --- a/h2/src/test/org/h2/test/scripts/functions/json/json_array.sql +++ b/h2/src/test/org/h2/test/scripts/functions/json/json_array.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/json/json_object.sql b/h2/src/test/org/h2/test/scripts/functions/json/json_object.sql index b62ffbc106..d295f37244 100644 --- a/h2/src/test/org/h2/test/scripts/functions/json/json_object.sql +++ b/h2/src/test/org/h2/test/scripts/functions/json/json_object.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/abs.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/abs.sql index 0cc6c46fb8..1e49b93f5a 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/abs.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/abs.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/acos.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/acos.sql index 275ac11073..d0f493db45 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/acos.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/acos.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/asin.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/asin.sql index aa65f07a57..d7fead3bf5 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/asin.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/asin.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/atan.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/atan.sql index 08adcf2601..e8612f1280 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/atan.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/atan.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/atan2.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/atan2.sql index 783077fed2..b0b117270c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/atan2.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/atan2.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/bitand.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/bitand.sql index 6102201174..da953e9f36 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/bitand.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/bitand.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/bitcount.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/bitcount.sql index 3c29e54b16..235b43338d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/bitcount.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/bitcount.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/bitget.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/bitget.sql index 9af5354227..acea82167c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/bitget.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/bitget.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/bitnot.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/bitnot.sql index a99031842a..d4c80c244d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/bitnot.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/bitnot.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: Joe Littlejohn -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/bitor.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/bitor.sql index 383fc57204..919484846b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/bitor.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/bitor.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/bitxor.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/bitxor.sql index 76e3b79da5..a26692f7a3 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/bitxor.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/bitxor.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/ceil.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/ceil.sql index 61e9df4fc6..7bcb48fa03 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/ceil.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/ceil.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/compress.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/compress.sql index f9d7b17b9d..7b0ef7bff1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/compress.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/compress.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/cos.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/cos.sql index 78665dc6ca..fe649580c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/cos.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/cos.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/cosh.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/cosh.sql index a18c9a83a3..0b7b614aab 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/cosh.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/cosh.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/cot.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/cot.sql index 05a6803609..74963e24b5 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/cot.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/cot.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/decrypt.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/decrypt.sql index c022777ec2..b9eeb8fef9 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/decrypt.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/decrypt.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/degrees.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/degrees.sql index 8b1d235df5..4b4a130769 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/degrees.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/degrees.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/encrypt.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/encrypt.sql index f322249800..00dff40c67 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/encrypt.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/encrypt.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/exp.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/exp.sql index 80abf99362..365c31828d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/exp.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/exp.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/expand.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/expand.sql index af340c9c6d..2b8416c2a6 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/expand.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/expand.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/floor.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/floor.sql index 3c59db2b8e..c9e17ef349 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/floor.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/floor.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/hash.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/hash.sql index 582ccd3a5c..466d38225e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/hash.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/hash.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/length.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/length.sql index 1641354d2f..67b65727dc 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/length.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/length.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/log.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/log.sql index 5313ad26ec..baf60a6c76 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/log.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/log.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/lshift.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/lshift.sql index 82f3a7d6a2..7bb7e44e06 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/lshift.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/lshift.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/mod.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/mod.sql index eb56143661..5d0b3e7312 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/mod.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/mod.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/ora-hash.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/ora-hash.sql index d2f7d2e4bf..6df772c987 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/ora-hash.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/ora-hash.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/pi.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/pi.sql index ab3bfd6325..0c283cbb3b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/pi.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/pi.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/power.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/power.sql index 01d5ae23f9..3dd455f940 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/power.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/power.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/radians.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/radians.sql index ad9c543f6c..f22f4933bd 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/radians.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/radians.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/rand.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/rand.sql index 0c3c06b780..1d6c29b6d6 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/rand.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/rand.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/random-uuid.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/random-uuid.sql index 4065c037d1..33a8bbe6aa 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/random-uuid.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/random-uuid.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/rotate.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/rotate.sql index 2467765a71..5a205870e5 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/rotate.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/rotate.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/round.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/round.sql index 6933566eda..e925aa307e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/round.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/round.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/roundmagic.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/roundmagic.sql index 9ddd23c78d..5e42f1852b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/roundmagic.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/roundmagic.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/rshift.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/rshift.sql index 838ec47a98..47acc0169b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/rshift.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/rshift.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/secure-rand.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/secure-rand.sql index cbdef06479..a083f92c9e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/secure-rand.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/secure-rand.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/sign.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/sign.sql index 1c3a3379eb..2138f8f2be 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/sign.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/sign.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/sin.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/sin.sql index 8b646e5f2a..f2f1146407 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/sin.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/sin.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/sinh.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/sinh.sql index 86a394d36a..2186ea8d20 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/sinh.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/sinh.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/sqrt.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/sqrt.sql index e5c3e60131..4a96f3a0a5 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/sqrt.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/sqrt.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/tan.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/tan.sql index 2a522d352b..13bcd44e32 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/tan.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/tan.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/tanh.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/tanh.sql index 767d81593d..b6765cc3dc 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/tanh.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/tanh.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/truncate.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/truncate.sql index 7fd11216e8..0dbe8c9d3c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/truncate.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/truncate.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/numeric/zero.sql b/h2/src/test/org/h2/test/scripts/functions/numeric/zero.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/numeric/zero.sql +++ b/h2/src/test/org/h2/test/scripts/functions/numeric/zero.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/array-to-string.sql b/h2/src/test/org/h2/test/scripts/functions/string/array-to-string.sql index a6e5dba91a..7ca0767798 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/array-to-string.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/array-to-string.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/ascii.sql b/h2/src/test/org/h2/test/scripts/functions/string/ascii.sql index e1e668ba3e..17fa38db98 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/ascii.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/ascii.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/bit-length.sql b/h2/src/test/org/h2/test/scripts/functions/string/bit-length.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/bit-length.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/bit-length.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/char.sql b/h2/src/test/org/h2/test/scripts/functions/string/char.sql index dc3c831cf0..53bb3c5e93 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/char.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/char.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/concat-ws.sql b/h2/src/test/org/h2/test/scripts/functions/string/concat-ws.sql index 1809c7eb76..ec647763a6 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/concat-ws.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/concat-ws.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/concat.sql b/h2/src/test/org/h2/test/scripts/functions/string/concat.sql index 8f4362e679..4b1b73562d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/concat.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/concat.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/difference.sql b/h2/src/test/org/h2/test/scripts/functions/string/difference.sql index 94865884a6..4853dfe1f0 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/difference.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/difference.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/hextoraw.sql b/h2/src/test/org/h2/test/scripts/functions/string/hextoraw.sql index b3c5a82d90..95ea6902d5 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/hextoraw.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/hextoraw.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/insert.sql b/h2/src/test/org/h2/test/scripts/functions/string/insert.sql index 1b1832fd1d..d24cb58e4e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/insert.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/insert.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/left.sql b/h2/src/test/org/h2/test/scripts/functions/string/left.sql index 1040161440..fcf92c16ac 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/left.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/left.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/length.sql b/h2/src/test/org/h2/test/scripts/functions/string/length.sql index 88f172fc29..ebf2bae84d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/length.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/length.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/locate.sql b/h2/src/test/org/h2/test/scripts/functions/string/locate.sql index 90e835735a..fe1bf6dd12 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/locate.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/locate.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/lower.sql b/h2/src/test/org/h2/test/scripts/functions/string/lower.sql index 26d69c0b9c..73138cf357 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/lower.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/lower.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/lpad.sql b/h2/src/test/org/h2/test/scripts/functions/string/lpad.sql index 4dc77e4284..41c69ebb20 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/lpad.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/lpad.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/ltrim.sql b/h2/src/test/org/h2/test/scripts/functions/string/ltrim.sql index 9e0a14ec1e..daf8e3e101 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/ltrim.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/ltrim.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/octet-length.sql b/h2/src/test/org/h2/test/scripts/functions/string/octet-length.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/octet-length.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/octet-length.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/quote_ident.sql b/h2/src/test/org/h2/test/scripts/functions/string/quote_ident.sql index eb0c2a51e7..8c8b946308 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/quote_ident.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/quote_ident.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/rawtohex.sql b/h2/src/test/org/h2/test/scripts/functions/string/rawtohex.sql index dfbb222fc9..05e418b045 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/rawtohex.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/rawtohex.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/regex-replace.sql b/h2/src/test/org/h2/test/scripts/functions/string/regex-replace.sql index 1ea14683f5..24a51ec6c7 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/regex-replace.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/regex-replace.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/regexp-like.sql b/h2/src/test/org/h2/test/scripts/functions/string/regexp-like.sql index 6b9cb1084b..5f86d7f67d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/regexp-like.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/regexp-like.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/regexp-substr.sql b/h2/src/test/org/h2/test/scripts/functions/string/regexp-substr.sql index 8209cac0e2..b7c984a423 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/regexp-substr.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/regexp-substr.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/repeat.sql b/h2/src/test/org/h2/test/scripts/functions/string/repeat.sql index afeb08ccce..68b06222e0 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/repeat.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/repeat.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/replace.sql b/h2/src/test/org/h2/test/scripts/functions/string/replace.sql index bb1e8ad6fa..19966c332c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/replace.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/replace.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/right.sql b/h2/src/test/org/h2/test/scripts/functions/string/right.sql index 8432b15cad..c56fdca00c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/right.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/right.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/rpad.sql b/h2/src/test/org/h2/test/scripts/functions/string/rpad.sql index 33f352186d..0d7e635657 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/rpad.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/rpad.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/rtrim.sql b/h2/src/test/org/h2/test/scripts/functions/string/rtrim.sql index 5985d88c4b..a216fd6805 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/rtrim.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/rtrim.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/soundex.sql b/h2/src/test/org/h2/test/scripts/functions/string/soundex.sql index 23277ca32e..fec64ae3c5 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/soundex.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/soundex.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/space.sql b/h2/src/test/org/h2/test/scripts/functions/string/space.sql index bf5f31517f..867bd74657 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/space.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/space.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/stringdecode.sql b/h2/src/test/org/h2/test/scripts/functions/string/stringdecode.sql index b144794506..3a2b439aec 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/stringdecode.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/stringdecode.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/stringencode.sql b/h2/src/test/org/h2/test/scripts/functions/string/stringencode.sql index 3f084723d5..72274a9474 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/stringencode.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/stringencode.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/stringtoutf8.sql b/h2/src/test/org/h2/test/scripts/functions/string/stringtoutf8.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/stringtoutf8.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/stringtoutf8.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/substring.sql b/h2/src/test/org/h2/test/scripts/functions/string/substring.sql index b98a753db4..624fc9643b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/substring.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/substring.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/to-char.sql b/h2/src/test/org/h2/test/scripts/functions/string/to-char.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/to-char.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/to-char.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/translate.sql b/h2/src/test/org/h2/test/scripts/functions/string/translate.sql index 17885ab9c2..4e9207a0fd 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/translate.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/translate.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/trim.sql b/h2/src/test/org/h2/test/scripts/functions/string/trim.sql index 9115ede54d..c4d1f535c0 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/trim.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/trim.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/upper.sql b/h2/src/test/org/h2/test/scripts/functions/string/upper.sql index ec817336f4..cbdaa1f69c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/upper.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/upper.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/utf8tostring.sql b/h2/src/test/org/h2/test/scripts/functions/string/utf8tostring.sql index 2fa1f1ff62..16a45622d8 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/utf8tostring.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/utf8tostring.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/xmlattr.sql b/h2/src/test/org/h2/test/scripts/functions/string/xmlattr.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/xmlattr.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/xmlattr.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/xmlcdata.sql b/h2/src/test/org/h2/test/scripts/functions/string/xmlcdata.sql index 4906742590..278816047c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/xmlcdata.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/xmlcdata.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/xmlcomment.sql b/h2/src/test/org/h2/test/scripts/functions/string/xmlcomment.sql index 9a29d2c430..9e7721a861 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/xmlcomment.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/xmlcomment.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/xmlnode.sql b/h2/src/test/org/h2/test/scripts/functions/string/xmlnode.sql index 8f10ce77cf..280b762d15 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/xmlnode.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/xmlnode.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/xmlstartdoc.sql b/h2/src/test/org/h2/test/scripts/functions/string/xmlstartdoc.sql index 332a57b14a..4f7d8df35f 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/xmlstartdoc.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/xmlstartdoc.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/string/xmltext.sql b/h2/src/test/org/h2/test/scripts/functions/string/xmltext.sql index 358c85f7ad..9e2b422849 100644 --- a/h2/src/test/org/h2/test/scripts/functions/string/xmltext.sql +++ b/h2/src/test/org/h2/test/scripts/functions/string/xmltext.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/array-cat.sql b/h2/src/test/org/h2/test/scripts/functions/system/array-cat.sql index 435176153e..b979da1343 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/array-cat.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/array-cat.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/array-contains.sql b/h2/src/test/org/h2/test/scripts/functions/system/array-contains.sql index 26e5f5c7ca..897c24290b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/array-contains.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/array-contains.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/array-get.sql b/h2/src/test/org/h2/test/scripts/functions/system/array-get.sql index 28f9be7e29..fe9e4b4e8a 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/array-get.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/array-get.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/array-slice.sql b/h2/src/test/org/h2/test/scripts/functions/system/array-slice.sql index d13c24c769..09e0d76d02 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/array-slice.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/array-slice.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/autocommit.sql b/h2/src/test/org/h2/test/scripts/functions/system/autocommit.sql index 17bef7d8e5..8065d08a50 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/autocommit.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/autocommit.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/cancel-session.sql b/h2/src/test/org/h2/test/scripts/functions/system/cancel-session.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/cancel-session.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/cancel-session.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/cardinality.sql b/h2/src/test/org/h2/test/scripts/functions/system/cardinality.sql index b0ae3507c1..1d73e7fa08 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/cardinality.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/cardinality.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/casewhen.sql b/h2/src/test/org/h2/test/scripts/functions/system/casewhen.sql index 6b247708a2..f56f2b1ccb 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/casewhen.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/casewhen.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/cast.sql b/h2/src/test/org/h2/test/scripts/functions/system/cast.sql index bc9d033b9f..4a343d320e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/cast.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/cast.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/coalesce.sql b/h2/src/test/org/h2/test/scripts/functions/system/coalesce.sql index fb8be63907..c5fabf149b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/coalesce.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/coalesce.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/convert.sql b/h2/src/test/org/h2/test/scripts/functions/system/convert.sql index d7a6fd2354..da1a5fa5c3 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/convert.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/convert.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/csvread.sql b/h2/src/test/org/h2/test/scripts/functions/system/csvread.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/csvread.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/csvread.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/csvwrite.sql b/h2/src/test/org/h2/test/scripts/functions/system/csvwrite.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/csvwrite.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/csvwrite.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/current_catalog.sql b/h2/src/test/org/h2/test/scripts/functions/system/current_catalog.sql index e460662dcf..fbbce1f79b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/current_catalog.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/current_catalog.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/current_schema.sql b/h2/src/test/org/h2/test/scripts/functions/system/current_schema.sql index aedec2ad33..d2f21bf1b2 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/current_schema.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/current_schema.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/current_user.sql b/h2/src/test/org/h2/test/scripts/functions/system/current_user.sql index b68607ed43..2881250ae8 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/current_user.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/current_user.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/currval.sql b/h2/src/test/org/h2/test/scripts/functions/system/currval.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/currval.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/currval.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/data_type_sql.sql b/h2/src/test/org/h2/test/scripts/functions/system/data_type_sql.sql index 633f106e98..0f24fa4586 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/data_type_sql.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/data_type_sql.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/database-path.sql b/h2/src/test/org/h2/test/scripts/functions/system/database-path.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/database-path.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/database-path.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/db_object.sql b/h2/src/test/org/h2/test/scripts/functions/system/db_object.sql index 4d20545f12..d44d0fa5ee 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/db_object.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/db_object.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/decode.sql b/h2/src/test/org/h2/test/scripts/functions/system/decode.sql index b6721c90de..7c7c3ec536 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/decode.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/decode.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/disk-space-used.sql b/h2/src/test/org/h2/test/scripts/functions/system/disk-space-used.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/disk-space-used.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/disk-space-used.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/file-read.sql b/h2/src/test/org/h2/test/scripts/functions/system/file-read.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/file-read.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/file-read.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/file-write.sql b/h2/src/test/org/h2/test/scripts/functions/system/file-write.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/file-write.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/file-write.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/greatest.sql b/h2/src/test/org/h2/test/scripts/functions/system/greatest.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/greatest.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/greatest.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/h2version.sql b/h2/src/test/org/h2/test/scripts/functions/system/h2version.sql index ed9a3b0059..ff8a311fd1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/h2version.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/h2version.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/identity.sql b/h2/src/test/org/h2/test/scripts/functions/system/identity.sql index 4fbf8b92a5..4d692e68d5 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/identity.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/identity.sql @@ -1,4 +1,34 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- + +CREATE TABLE TEST(ID BIGINT GENERATED BY DEFAULT AS IDENTITY, V INT); +> ok + +INSERT INTO TEST(V) VALUES 10; +> update count: 1 + +VALUES IDENTITY(); +> exception FUNCTION_NOT_FOUND_1 + +VALUES SCOPE_IDENTITY(); +> exception FUNCTION_NOT_FOUND_1 + +SET MODE LEGACY; +> ok + +INSERT INTO TEST(V) VALUES 20; +> update count: 1 + +VALUES IDENTITY(); +>> 2 + +VALUES SCOPE_IDENTITY(); +>> 2 + +SET MODE REGULAR; +> ok + +DROP TABLE TEST; +> ok diff --git a/h2/src/test/org/h2/test/scripts/functions/system/ifnull.sql b/h2/src/test/org/h2/test/scripts/functions/system/ifnull.sql index 3024a4b9f8..5aa7665740 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/ifnull.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/ifnull.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/last-insert-id.sql b/h2/src/test/org/h2/test/scripts/functions/system/last-insert-id.sql index a0b1a64f40..b51d5cf5d9 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/last-insert-id.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/last-insert-id.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/least.sql b/h2/src/test/org/h2/test/scripts/functions/system/least.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/least.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/least.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/link-schema.sql b/h2/src/test/org/h2/test/scripts/functions/system/link-schema.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/link-schema.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/link-schema.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/lock-mode.sql b/h2/src/test/org/h2/test/scripts/functions/system/lock-mode.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/lock-mode.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/lock-mode.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/lock-timeout.sql b/h2/src/test/org/h2/test/scripts/functions/system/lock-timeout.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/lock-timeout.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/lock-timeout.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/memory-free.sql b/h2/src/test/org/h2/test/scripts/functions/system/memory-free.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/memory-free.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/memory-free.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/memory-used.sql b/h2/src/test/org/h2/test/scripts/functions/system/memory-used.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/memory-used.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/memory-used.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/nextval.sql b/h2/src/test/org/h2/test/scripts/functions/system/nextval.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/nextval.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/nextval.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/nullif.sql b/h2/src/test/org/h2/test/scripts/functions/system/nullif.sql index 7c33cd52b8..6042a0bc00 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/nullif.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/nullif.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/nvl2.sql b/h2/src/test/org/h2/test/scripts/functions/system/nvl2.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/nvl2.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/nvl2.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/readonly.sql b/h2/src/test/org/h2/test/scripts/functions/system/readonly.sql index 13209677c4..14d9568289 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/readonly.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/readonly.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/rownum.sql b/h2/src/test/org/h2/test/scripts/functions/system/rownum.sql index 4f7c8e6b38..0893274095 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/rownum.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/rownum.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -13,6 +13,13 @@ select rownum() as rnum, str from test where str = 'A'; > 1 A > rows: 1 +----- Issue#3353 ----- +SELECT str FROM FINAL TABLE (UPDATE test SET str = char(rownum + 48) WHERE str = '0'); +> STR +> --- +> 1 +> rows: 1 + drop table test; > ok @@ -21,3 +28,4 @@ SELECT * FROM (VALUES 1, 2) AS T1(X), (VALUES 1, 2) AS T2(X) WHERE ROWNUM = 1; > - - > 1 1 > rows: 1 + diff --git a/h2/src/test/org/h2/test/scripts/functions/system/scope-identity.sql b/h2/src/test/org/h2/test/scripts/functions/system/scope-identity.sql deleted file mode 100644 index 4fbf8b92a5..0000000000 --- a/h2/src/test/org/h2/test/scripts/functions/system/scope-identity.sql +++ /dev/null @@ -1,4 +0,0 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, --- and the EPL 1.0 (https://h2database.com/html/license.html). --- Initial Developer: H2 Group --- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/session-id.sql b/h2/src/test/org/h2/test/scripts/functions/system/session-id.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/session-id.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/session-id.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/table.sql b/h2/src/test/org/h2/test/scripts/functions/system/table.sql index 33084b59c0..4df052af6a 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/table.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/table.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/transaction-id.sql b/h2/src/test/org/h2/test/scripts/functions/system/transaction-id.sql index 4fbf8b92a5..e04598e7c1 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/transaction-id.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/transaction-id.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/trim_array.sql b/h2/src/test/org/h2/test/scripts/functions/system/trim_array.sql index a75df139cc..ba5c743a21 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/trim_array.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/trim_array.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/truncate-value.sql b/h2/src/test/org/h2/test/scripts/functions/system/truncate-value.sql index 81ef25ccef..5bca7ee491 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/truncate-value.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/truncate-value.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/system/unnest.sql b/h2/src/test/org/h2/test/scripts/functions/system/unnest.sql index 20943d3cd9..a5a52b0197 100644 --- a/h2/src/test/org/h2/test/scripts/functions/system/unnest.sql +++ b/h2/src/test/org/h2/test/scripts/functions/system/unnest.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/current-time.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/current-time.sql index 4e8aaa7404..1d558baf58 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/current-time.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/current-time.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_date.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_date.sql index 89939c7168..c5fe931913 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_date.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_date.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_timestamp.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_timestamp.sql index 2674396228..38e6ef835b 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_timestamp.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/current_timestamp.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/date_trunc.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/date_trunc.sql index de9d11cb38..7d72d289d4 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/date_trunc.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/date_trunc.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/dateadd.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/dateadd.sql index c03a74585c..6ce6d4d43e 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/dateadd.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/dateadd.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/datediff.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/datediff.sql index 080fd5aaa0..15b60523ba 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/datediff.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/datediff.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-month.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-month.sql index 80a230009d..609770c248 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-month.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-month.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-week.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-week.sql index 763d048651..6e71c05740 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-week.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-week.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-year.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-year.sql index 229573b46f..3d7c68e3c9 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-year.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/day-of-year.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/dayname.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/dayname.sql index a11af24e38..743867d2dc 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/dayname.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/dayname.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/extract.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/extract.sql index cd6f8dfa8a..33918e95ea 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/extract.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/extract.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/formatdatetime.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/formatdatetime.sql index 653688e9b7..dd3e270714 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/formatdatetime.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/formatdatetime.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/hour.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/hour.sql index d950cfa22b..b00828275f 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/hour.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/hour.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/minute.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/minute.sql index a31b81fdd0..8cf533ce83 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/minute.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/minute.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/month.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/month.sql index 5120470ade..e85be36a08 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/month.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/month.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/monthname.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/monthname.sql index f1651ea4ea..a8e6637432 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/monthname.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/monthname.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/parsedatetime.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/parsedatetime.sql index aac5652e75..4c31dc58f0 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/parsedatetime.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/parsedatetime.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/quarter.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/quarter.sql index 58717d99e6..b19ae40a73 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/quarter.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/quarter.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/second.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/second.sql index 81d2a2ad1a..01243bae11 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/second.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/second.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/truncate.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/truncate.sql index 7b7c851743..3a28b9b174 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/truncate.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/truncate.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/week.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/week.sql index 7ea4468a95..3d902ea56d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/week.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/week.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/timeanddate/year.sql b/h2/src/test/org/h2/test/scripts/functions/timeanddate/year.sql index 2ba918f8e3..25dea91c9d 100644 --- a/h2/src/test/org/h2/test/scripts/functions/timeanddate/year.sql +++ b/h2/src/test/org/h2/test/scripts/functions/timeanddate/year.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/window/lead.sql b/h2/src/test/org/h2/test/scripts/functions/window/lead.sql index a74d0c3a50..947849a66c 100644 --- a/h2/src/test/org/h2/test/scripts/functions/window/lead.sql +++ b/h2/src/test/org/h2/test/scripts/functions/window/lead.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/window/nth_value.sql b/h2/src/test/org/h2/test/scripts/functions/window/nth_value.sql index 64fec0c8ed..57fea994cd 100644 --- a/h2/src/test/org/h2/test/scripts/functions/window/nth_value.sql +++ b/h2/src/test/org/h2/test/scripts/functions/window/nth_value.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/window/ntile.sql b/h2/src/test/org/h2/test/scripts/functions/window/ntile.sql index b8a51f517e..6367c2d5e2 100644 --- a/h2/src/test/org/h2/test/scripts/functions/window/ntile.sql +++ b/h2/src/test/org/h2/test/scripts/functions/window/ntile.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/window/ratio_to_report.sql b/h2/src/test/org/h2/test/scripts/functions/window/ratio_to_report.sql index a05107b535..6760ad7076 100644 --- a/h2/src/test/org/h2/test/scripts/functions/window/ratio_to_report.sql +++ b/h2/src/test/org/h2/test/scripts/functions/window/ratio_to_report.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/functions/window/row_number.sql b/h2/src/test/org/h2/test/scripts/functions/window/row_number.sql index 81bd6ecc0c..90b99c3628 100644 --- a/h2/src/test/org/h2/test/scripts/functions/window/row_number.sql +++ b/h2/src/test/org/h2/test/scripts/functions/window/row_number.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/indexes.sql b/h2/src/test/org/h2/test/scripts/indexes.sql index 139c0c865c..4400a63a76 100644 --- a/h2/src/test/org/h2/test/scripts/indexes.sql +++ b/h2/src/test/org/h2/test/scripts/indexes.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/information_schema.sql b/h2/src/test/org/h2/test/scripts/information_schema.sql index eda4931e3c..aca6341a63 100644 --- a/h2/src/test/org/h2/test/scripts/information_schema.sql +++ b/h2/src/test/org/h2/test/scripts/information_schema.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/at-time-zone.sql b/h2/src/test/org/h2/test/scripts/other/at-time-zone.sql index 5c3ceccd7d..c66ed8e378 100644 --- a/h2/src/test/org/h2/test/scripts/other/at-time-zone.sql +++ b/h2/src/test/org/h2/test/scripts/other/at-time-zone.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/boolean-test.sql b/h2/src/test/org/h2/test/scripts/other/boolean-test.sql index 9841a86a23..37383d30f0 100644 --- a/h2/src/test/org/h2/test/scripts/other/boolean-test.sql +++ b/h2/src/test/org/h2/test/scripts/other/boolean-test.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/case.sql b/h2/src/test/org/h2/test/scripts/other/case.sql index 795bc24551..f2fdc6c499 100644 --- a/h2/src/test/org/h2/test/scripts/other/case.sql +++ b/h2/src/test/org/h2/test/scripts/other/case.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -70,8 +70,8 @@ SELECT S, CASE S WHEN IS OF (VARCHAR) THEN 13 ELSE 13 END FROM (VALUES NULL, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm') T(S); -> S CASE S WHEN IS NULL THEN 1 WHEN 'a' THEN 2 WHEN LIKE '%b' THEN 3 WHEN ILIKE 'C' THEN 4 WHEN REGEXP '[dQ]' THEN 5 WHEN IS NOT DISTINCT FROM 'e' THEN 6 WHEN IN('x', 'f') THEN 7 WHEN IN( VALUES ('g'), ('z')) THEN 8 WHEN BETWEEN 'h' AND 'i' THEN 9 WHEN = 'j' THEN 10 WHEN < ANY( VALUES ('j'), ('l')) THEN 11 WHEN NOT LIKE '%m%' THEN 12 WHEN IS OF (CHARACTER VARYING) THEN 13 ELSE 13 END -> ---- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +> S C2 +> ---- -- > a 2 > b 3 > c 4 diff --git a/h2/src/test/org/h2/test/scripts/other/concatenation.sql b/h2/src/test/org/h2/test/scripts/other/concatenation.sql index fa3a4c3718..f61452a147 100644 --- a/h2/src/test/org/h2/test/scripts/other/concatenation.sql +++ b/h2/src/test/org/h2/test/scripts/other/concatenation.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/conditions.sql b/h2/src/test/org/h2/test/scripts/other/conditions.sql index fe240dc320..ae1444f1bd 100644 --- a/h2/src/test/org/h2/test/scripts/other/conditions.sql +++ b/h2/src/test/org/h2/test/scripts/other/conditions.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/data-change-delta-table.sql b/h2/src/test/org/h2/test/scripts/other/data-change-delta-table.sql index f10b5af7f4..f8040387ee 100644 --- a/h2/src/test/org/h2/test/scripts/other/data-change-delta-table.sql +++ b/h2/src/test/org/h2/test/scripts/other/data-change-delta-table.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -387,3 +387,31 @@ SELECT * FROM NEW TABLE (MERGE INTO TEST_VIEW TEST USING DROP TABLE TEST CASCADE; > ok + +CREATE TABLE TEST(ID BIGINT, DATA CHARACTER LARGE OBJECT); +> ok + +INSERT INTO TEST VALUES (1, REPEAT('A', 1000)); +> update count: 1 + +SELECT ID FROM FINAL TABLE (INSERT INTO TEST VALUES (2, REPEAT('B', 1000))); +>> 2 + +SELECT ID, SUBSTRING(DATA FROM 1 FOR 2) FROM TEST; +> ID SUBSTRING(DATA FROM 1 FOR 2) +> -- ---------------------------- +> 1 AA +> 2 BB +> rows: 2 + +@reconnect + +SELECT ID, SUBSTRING(DATA FROM 1 FOR 2) FROM TEST; +> ID SUBSTRING(DATA FROM 1 FOR 2) +> -- ---------------------------- +> 1 AA +> 2 BB +> rows: 2 + +DROP TABLE TEST; +> ok diff --git a/h2/src/test/org/h2/test/scripts/other/field-reference.sql b/h2/src/test/org/h2/test/scripts/other/field-reference.sql index 54818c1722..203ea53b0d 100644 --- a/h2/src/test/org/h2/test/scripts/other/field-reference.sql +++ b/h2/src/test/org/h2/test/scripts/other/field-reference.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/help.sql b/h2/src/test/org/h2/test/scripts/other/help.sql index fdeac907bb..efd05de9c6 100644 --- a/h2/src/test/org/h2/test/scripts/other/help.sql +++ b/h2/src/test/org/h2/test/scripts/other/help.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/sequence.sql b/h2/src/test/org/h2/test/scripts/other/sequence.sql index 0238f6b916..16c2e25f9e 100644 --- a/h2/src/test/org/h2/test/scripts/other/sequence.sql +++ b/h2/src/test/org/h2/test/scripts/other/sequence.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -255,34 +255,34 @@ CREATE SEQUENCE SEQ05 AS REAL; CREATE SEQUENCE SEQ06 AS DOUBLE PRECISION; > ok -CREATE SEQUENCE SEQ07 AS NUMERIC(10, 2); -> ok +CREATE SEQUENCE SEQ AS NUMERIC(10, 2); +> exception FEATURE_NOT_SUPPORTED_1 -CREATE SEQUENCE SEQ08 AS NUMERIC(100, 20); -> ok +CREATE SEQUENCE SEQ AS NUMERIC(100, 20); +> exception FEATURE_NOT_SUPPORTED_1 -CREATE SEQUENCE SEQ09 AS DECIMAL; +CREATE SEQUENCE SEQ07 AS DECIMAL; > ok -CREATE SEQUENCE SEQ10 AS DECIMAL(10); +CREATE SEQUENCE SEQ08 AS DECIMAL(10); > ok CREATE SEQUENCE SEQ11 AS DECIMAL(10, 2); -> ok +> exception FEATURE_NOT_SUPPORTED_1 -CREATE SEQUENCE SEQ12 AS FLOAT; +CREATE SEQUENCE SEQ09 AS FLOAT; > ok -CREATE SEQUENCE SEQ13 AS FLOAT(20); +CREATE SEQUENCE SEQ10 AS FLOAT(20); > ok -CREATE SEQUENCE SEQ14 AS DECFLOAT; +CREATE SEQUENCE SEQ11 AS DECFLOAT; > ok -CREATE SEQUENCE SEQ15 AS DECFLOAT(10); +CREATE SEQUENCE SEQ12 AS DECFLOAT(10); > ok -CREATE SEQUENCE SEQ16 AS DECFLOAT(20); +CREATE SEQUENCE SEQ13 AS DECFLOAT(20); > ok SELECT SEQUENCE_NAME, DATA_TYPE, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, MAXIMUM_VALUE, @@ -295,17 +295,14 @@ SELECT SEQUENCE_NAME, DATA_TYPE, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUM > SEQ04 BIGINT 64 2 0 9223372036854775807 BIGINT null null > SEQ05 REAL 24 2 null 16777216 REAL null null > SEQ06 DOUBLE PRECISION 53 2 null 9007199254740992 DOUBLE PRECISION null null -> SEQ07 NUMERIC 10 10 2 99999999 NUMERIC 10 2 -> SEQ08 NUMERIC 39 10 20 9223372036854775807 NUMERIC 100 20 -> SEQ09 NUMERIC 19 10 0 9223372036854775807 DECIMAL null null -> SEQ10 NUMERIC 10 10 0 9999999999 DECIMAL 10 null -> SEQ11 NUMERIC 10 10 2 99999999 DECIMAL 10 2 -> SEQ12 DOUBLE PRECISION 53 2 null 9007199254740992 FLOAT null null -> SEQ13 REAL 24 2 null 16777216 FLOAT 20 null -> SEQ14 DECFLOAT 19 10 null 9223372036854775807 DECFLOAT null null -> SEQ15 DECFLOAT 10 10 null 10000000000 DECFLOAT 10 null -> SEQ16 DECFLOAT 19 10 null 9223372036854775807 DECFLOAT 20 null -> rows: 16 +> SEQ07 NUMERIC 19 10 0 9223372036854775807 DECIMAL null null +> SEQ08 NUMERIC 10 10 0 9999999999 DECIMAL 10 null +> SEQ09 DOUBLE PRECISION 53 2 null 9007199254740992 FLOAT null null +> SEQ10 REAL 24 2 null 16777216 FLOAT 20 null +> SEQ11 DECFLOAT 19 10 null 9223372036854775807 DECFLOAT null null +> SEQ12 DECFLOAT 10 10 null 10000000000 DECFLOAT 10 null +> SEQ13 DECFLOAT 19 10 null 9223372036854775807 DECFLOAT 20 null +> rows: 13 SELECT NEXT VALUE FOR SEQ01 IS OF (TINYINT); >> TRUE diff --git a/h2/src/test/org/h2/test/scripts/other/set.sql b/h2/src/test/org/h2/test/scripts/other/set.sql index a6a9061fd6..35296158fa 100644 --- a/h2/src/test/org/h2/test/scripts/other/set.sql +++ b/h2/src/test/org/h2/test/scripts/other/set.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/two_phase_commit.sql b/h2/src/test/org/h2/test/scripts/other/two_phase_commit.sql index 30ef61093f..2cb8a7a17d 100644 --- a/h2/src/test/org/h2/test/scripts/other/two_phase_commit.sql +++ b/h2/src/test/org/h2/test/scripts/other/two_phase_commit.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/other/unique_include.sql b/h2/src/test/org/h2/test/scripts/other/unique_include.sql index 6c95969adb..9f5428045a 100644 --- a/h2/src/test/org/h2/test/scripts/other/unique_include.sql +++ b/h2/src/test/org/h2/test/scripts/other/unique_include.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/package.html b/h2/src/test/org/h2/test/scripts/package.html index 365d935484..cf8c836c51 100644 --- a/h2/src/test/org/h2/test/scripts/package.html +++ b/h2/src/test/org/h2/test/scripts/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/scripts/parser/comments.sql b/h2/src/test/org/h2/test/scripts/parser/comments.sql index 817718d142..aa4f6e635a 100644 --- a/h2/src/test/org/h2/test/scripts/parser/comments.sql +++ b/h2/src/test/org/h2/test/scripts/parser/comments.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/parser/identifiers.sql b/h2/src/test/org/h2/test/scripts/parser/identifiers.sql index 358d0d5161..6d8bb4957a 100644 --- a/h2/src/test/org/h2/test/scripts/parser/identifiers.sql +++ b/h2/src/test/org/h2/test/scripts/parser/identifiers.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/predicates/between.sql b/h2/src/test/org/h2/test/scripts/predicates/between.sql index fefc4470c5..0d4594f089 100644 --- a/h2/src/test/org/h2/test/scripts/predicates/between.sql +++ b/h2/src/test/org/h2/test/scripts/predicates/between.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/predicates/distinct.sql b/h2/src/test/org/h2/test/scripts/predicates/distinct.sql index 761a317f4e..6fcd2e2d40 100644 --- a/h2/src/test/org/h2/test/scripts/predicates/distinct.sql +++ b/h2/src/test/org/h2/test/scripts/predicates/distinct.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/predicates/in.sql b/h2/src/test/org/h2/test/scripts/predicates/in.sql index 82cc43f72b..a57b38c1ef 100644 --- a/h2/src/test/org/h2/test/scripts/predicates/in.sql +++ b/h2/src/test/org/h2/test/scripts/predicates/in.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/predicates/like.sql b/h2/src/test/org/h2/test/scripts/predicates/like.sql index 7bb8af15e3..de01420418 100644 --- a/h2/src/test/org/h2/test/scripts/predicates/like.sql +++ b/h2/src/test/org/h2/test/scripts/predicates/like.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/predicates/null.sql b/h2/src/test/org/h2/test/scripts/predicates/null.sql index 5ada350b7d..68ed9603d0 100644 --- a/h2/src/test/org/h2/test/scripts/predicates/null.sql +++ b/h2/src/test/org/h2/test/scripts/predicates/null.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/predicates/type.sql b/h2/src/test/org/h2/test/scripts/predicates/type.sql index 244a8bfa8d..d555c803f1 100644 --- a/h2/src/test/org/h2/test/scripts/predicates/type.sql +++ b/h2/src/test/org/h2/test/scripts/predicates/type.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/predicates/unique.sql b/h2/src/test/org/h2/test/scripts/predicates/unique.sql index 7e289c7fed..ffc26ea555 100644 --- a/h2/src/test/org/h2/test/scripts/predicates/unique.sql +++ b/h2/src/test/org/h2/test/scripts/predicates/unique.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/queries/derived-column-names.sql b/h2/src/test/org/h2/test/scripts/queries/derived-column-names.sql index 86bfe747a7..1b36b3f9bb 100644 --- a/h2/src/test/org/h2/test/scripts/queries/derived-column-names.sql +++ b/h2/src/test/org/h2/test/scripts/queries/derived-column-names.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/queries/distinct.sql b/h2/src/test/org/h2/test/scripts/queries/distinct.sql index 416b160dd3..7da7c9ad95 100644 --- a/h2/src/test/org/h2/test/scripts/queries/distinct.sql +++ b/h2/src/test/org/h2/test/scripts/queries/distinct.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/queries/joins.sql b/h2/src/test/org/h2/test/scripts/queries/joins.sql index 96cf879c74..57ccf2acd6 100644 --- a/h2/src/test/org/h2/test/scripts/queries/joins.sql +++ b/h2/src/test/org/h2/test/scripts/queries/joins.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -1002,3 +1002,45 @@ DROP SCHEMA S1 CASCADE; DROP SCHEMA S2 CASCADE; > ok + +CREATE TABLE T1(C1 INTEGER) AS VALUES 1, 2, 4; +> ok + +CREATE TABLE T2(C2 INTEGER) AS VALUES 1, 3, 4; +> ok + +CREATE TABLE T3(C3 INTEGER) AS VALUES 2, 3, 4; +> ok + +SELECT * FROM T1 JOIN T2 LEFT JOIN T3 ON T2.C2 = T3.C3 ON T1.C1 = T2.C2; +> C1 C2 C3 +> -- -- ---- +> 1 1 null +> 4 4 4 +> rows: 2 + +EXPLAIN SELECT * FROM T1 JOIN T2 LEFT JOIN T3 ON T2.C2 = T3.C3 ON T1.C1 = T2.C2; +>> SELECT "PUBLIC"."T1"."C1", "PUBLIC"."T2"."C2", "PUBLIC"."T3"."C3" FROM ( "PUBLIC"."T2" /* PUBLIC.T2.tableScan */ LEFT OUTER JOIN "PUBLIC"."T3" /* PUBLIC.T3.tableScan */ ON "T2"."C2" = "T3"."C3" ) INNER JOIN "PUBLIC"."T1" /* PUBLIC.T1.tableScan */ ON 1=1 WHERE "T1"."C1" = "T2"."C2" + +SELECT * FROM T1 RIGHT JOIN T2 LEFT JOIN T3 ON T2.C2 = T3.C3 ON T1.C1 = T2.C2; +> C1 C2 C3 +> ---- -- ---- +> 1 1 null +> 4 4 4 +> null 3 3 +> rows: 3 + +EXPLAIN SELECT * FROM T1 RIGHT JOIN T2 LEFT JOIN T3 ON T2.C2 = T3.C3 ON T1.C1 = T2.C2; +>> SELECT "PUBLIC"."T1"."C1", "PUBLIC"."T2"."C2", "PUBLIC"."T3"."C3" FROM "PUBLIC"."T2" /* PUBLIC.T2.tableScan */ LEFT OUTER JOIN "PUBLIC"."T3" /* PUBLIC.T3.tableScan */ ON "T2"."C2" = "T3"."C3" LEFT OUTER JOIN "PUBLIC"."T1" /* PUBLIC.T1.tableScan */ ON "T1"."C1" = "T2"."C2" + +DROP TABLE T1, T2, T3; +> ok + +SELECT X.A, Y.B, Z.C +FROM (SELECT 1 A) X JOIN ( + (SELECT 1 B) Y JOIN (SELECT 1 C) Z ON Z.C = Y.B +) ON Y.B = X.A; +> A B C +> - - - +> 1 1 1 +> rows: 1 diff --git a/h2/src/test/org/h2/test/scripts/queries/query-optimisations.sql b/h2/src/test/org/h2/test/scripts/queries/query-optimisations.sql index 32cae1f0ca..16f09f0479 100644 --- a/h2/src/test/org/h2/test/scripts/queries/query-optimisations.sql +++ b/h2/src/test/org/h2/test/scripts/queries/query-optimisations.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -175,3 +175,36 @@ SET TIME ZONE LOCAL; DROP TABLE A, B; > ok + +CREATE TABLE TEST(T TIMESTAMP WITH TIME ZONE) AS VALUES + NULL, + TIMESTAMP WITH TIME ZONE '2020-01-01 00:00:00+00', + TIMESTAMP WITH TIME ZONE '2020-01-01 01:00:00+01', + TIMESTAMP WITH TIME ZONE '2020-01-01 02:00:00+01', + NULL; +> ok + +SELECT T AT TIME ZONE 'UTC' FROM TEST GROUP BY T; +> T AT TIME ZONE 'UTC' +> ---------------------- +> 2020-01-01 00:00:00+00 +> 2020-01-01 01:00:00+00 +> null +> rows: 3 + +CREATE INDEX TEST_T_IDX ON TEST(T); +> ok + +SELECT T AT TIME ZONE 'UTC' FROM TEST GROUP BY T; +> T AT TIME ZONE 'UTC' +> ---------------------- +> 2020-01-01 00:00:00+00 +> 2020-01-01 01:00:00+00 +> null +> rows: 3 + +EXPLAIN SELECT T AT TIME ZONE 'UTC' FROM TEST GROUP BY T; +>> SELECT "T" AT TIME ZONE 'UTC' FROM "PUBLIC"."TEST" /* PUBLIC.TEST_T_IDX */ GROUP BY "T" /* group sorted */ + +DROP TABLE TEST; +> ok diff --git a/h2/src/test/org/h2/test/scripts/queries/select.sql b/h2/src/test/org/h2/test/scripts/queries/select.sql index 041d20ff7a..02c4d8e352 100644 --- a/h2/src/test/org/h2/test/scripts/queries/select.sql +++ b/h2/src/test/org/h2/test/scripts/queries/select.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -1178,3 +1178,9 @@ SELECT X FROM SYSTEM_RANGE(1, 2) ORDER BY X DESC FETCH FIRST 0xFFFFFFFF ROWS ONL > 2 > 1 > rows (ordered): 2 + +SELECT ((SELECT 1 X) EXCEPT (SELECT 1 Y)) T; +> T +> ---- +> null +> rows: 1 diff --git a/h2/src/test/org/h2/test/scripts/queries/table.sql b/h2/src/test/org/h2/test/scripts/queries/table.sql index 013d6d9797..a4d234739b 100644 --- a/h2/src/test/org/h2/test/scripts/queries/table.sql +++ b/h2/src/test/org/h2/test/scripts/queries/table.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/queries/values.sql b/h2/src/test/org/h2/test/scripts/queries/values.sql index 00f4822ed7..410945e759 100644 --- a/h2/src/test/org/h2/test/scripts/queries/values.sql +++ b/h2/src/test/org/h2/test/scripts/queries/values.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -93,7 +93,7 @@ VALUES (1, 2), (3, 4), (5, 1) ORDER BY C1 + C2, C1 * C2 OFFSET 1 ROW FETCH FIRST > 5 1 > rows (ordered): 1 -EXPLAIN VALUES (1, 2), (3, 4), (5, 1) ORDER BY C1 + C2, = C1 * C2 OFFSET 1 ROW FETCH FIRST 1 ROW ONLY; +EXPLAIN VALUES (1, 2), (3, 4), (5, 1) ORDER BY C1 + C2, C1 * C2 OFFSET 1 ROW FETCH FIRST 1 ROW ONLY; >> VALUES (1, 2), (3, 4), (5, 1) ORDER BY "C1" + "C2", "C1" * "C2" OFFSET 1 ROW FETCH NEXT ROW ONLY EXECUTE IMMEDIATE 'CREATE TABLE TEST AS SELECT C1 FROM (VALUES (' || (SELECT LISTAGG('1') FROM SYSTEM_RANGE(1, 16384)) || '))'; @@ -107,3 +107,9 @@ EXECUTE IMMEDIATE 'CREATE TABLE TEST AS SELECT C1 FROM (VALUES (' || (SELECT LIS VALUES (1), (1, 2); > exception COLUMN_COUNT_DOES_NOT_MATCH + +EXPLAIN SELECT C1, 2 FROM (VALUES 1, 2, 3) T ORDER BY 1; +>> SELECT "C1", 2 FROM (VALUES (1), (2), (3)) "T" /* table scan */ ORDER BY 1 + +EXPLAIN SELECT C1, 2 FROM (VALUES 1, 2, 3) T ORDER BY (1); +>> SELECT "C1", 2 FROM (VALUES (1), (2), (3)) "T" /* table scan */ diff --git a/h2/src/test/org/h2/test/scripts/queries/window.sql b/h2/src/test/org/h2/test/scripts/queries/window.sql index 09f3ad3328..7e1e8560ac 100644 --- a/h2/src/test/org/h2/test/scripts/queries/window.sql +++ b/h2/src/test/org/h2/test/scripts/queries/window.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/range_table.sql b/h2/src/test/org/h2/test/scripts/range_table.sql index 3ecc40cb8a..b3b758b2e4 100644 --- a/h2/src/test/org/h2/test/scripts/range_table.sql +++ b/h2/src/test/org/h2/test/scripts/range_table.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/scripts/testScript.sql b/h2/src/test/org/h2/test/scripts/testScript.sql index ee80477682..dd74558e9e 100644 --- a/h2/src/test/org/h2/test/scripts/testScript.sql +++ b/h2/src/test/org/h2/test/scripts/testScript.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- @@ -1800,12 +1800,12 @@ insert into test values(1, 'abc' || space(20)); script nopasswords nosettings noversion blocksize 10; > SCRIPT -> ----------------------------------------------------------------------------------------------------------------- +> ---------------------------------------------------------------------------------------------------------------------------------------- > CREATE USER IF NOT EXISTS "SA" PASSWORD '' ADMIN; > CREATE MEMORY TABLE "PUBLIC"."TEST"( "ID" INTEGER NOT NULL, "DATA" CHARACTER LARGE OBJECT ); > ALTER TABLE "PUBLIC"."TEST" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_2" PRIMARY KEY("ID"); > -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST; -> CREATE TABLE IF NOT EXISTS SYSTEM_LOB_STREAM(ID INT NOT NULL, PART INT NOT NULL, CDATA VARCHAR, BDATA VARBINARY); +> CREATE CACHED LOCAL TEMPORARY TABLE IF NOT EXISTS SYSTEM_LOB_STREAM(ID INT NOT NULL, PART INT NOT NULL, CDATA VARCHAR, BDATA VARBINARY); > ALTER TABLE SYSTEM_LOB_STREAM ADD CONSTRAINT SYSTEM_LOB_STREAM_PRIMARY_KEY PRIMARY KEY(ID, PART); > CREATE ALIAS IF NOT EXISTS SYSTEM_COMBINE_CLOB FOR 'org.h2.command.dml.ScriptCommand.combineClob'; > CREATE ALIAS IF NOT EXISTS SYSTEM_COMBINE_BLOB FOR 'org.h2.command.dml.ScriptCommand.combineBlob'; @@ -2971,8 +2971,9 @@ drop table test; create table test(id int primary key); > ok +-- Column A.ID cannot be referenced here explain select * from test a inner join test b left outer join test c on c.id = a.id; ->> SELECT "A"."ID", "B"."ID", "C"."ID" FROM "PUBLIC"."TEST" "A" /* PUBLIC.TEST.tableScan */ LEFT OUTER JOIN "PUBLIC"."TEST" "C" /* PUBLIC.PRIMARY_KEY_2: ID = A.ID */ ON "C"."ID" = "A"."ID" INNER JOIN "PUBLIC"."TEST" "B" /* PUBLIC.TEST.tableScan */ ON 1=1 +> exception COLUMN_NOT_FOUND_1 SELECT T.ID FROM TEST "T"; > ID diff --git a/h2/src/test/org/h2/test/scripts/testSimple.sql b/h2/src/test/org/h2/test/scripts/testSimple.sql index 5704d24424..ae5fc89bbc 100644 --- a/h2/src/test/org/h2/test/scripts/testSimple.sql +++ b/h2/src/test/org/h2/test/scripts/testSimple.sql @@ -1,4 +1,4 @@ --- Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +-- Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, -- and the EPL 1.0 (https://h2database.com/html/license.html). -- Initial Developer: H2 Group -- diff --git a/h2/src/test/org/h2/test/server/TestAutoServer.java b/h2/src/test/org/h2/test/server/TestAutoServer.java index 414204d899..72090a0130 100644 --- a/h2/src/test/org/h2/test/server/TestAutoServer.java +++ b/h2/src/test/org/h2/test/server/TestAutoServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/server/TestInit.java b/h2/src/test/org/h2/test/server/TestInit.java index 6d464b5634..49a90f0ac3 100644 --- a/h2/src/test/org/h2/test/server/TestInit.java +++ b/h2/src/test/org/h2/test/server/TestInit.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/server/TestJakartaWeb.java b/h2/src/test/org/h2/test/server/TestJakartaWeb.java new file mode 100644 index 0000000000..7d24757915 --- /dev/null +++ b/h2/src/test/org/h2/test/server/TestJakartaWeb.java @@ -0,0 +1,698 @@ +/* + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, + * and the EPL 1.0 (https://h2database.com/html/license.html). + * Initial Developer: H2 Group + */ +package org.h2.test.server; + +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; +import java.security.Principal; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Vector; + +import jakarta.servlet.AsyncContext; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.WriteListener; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpUpgradeHandler; +import jakarta.servlet.http.Part; + +import org.h2.server.web.JakartaWebServlet; +import org.h2.test.TestBase; +import org.h2.test.TestDb; +import org.h2.util.Utils10; + +/** + * Tests the Jakarta Web Servlet for the H2 Console. + */ +public class TestJakartaWeb extends TestDb { + + /** + * Run just this test. + * + * @param a ignored + */ + public static void main(String... a) throws Exception { + TestBase.createCaller().init().testFromMain(); + } + + @Override + public void test() throws Exception { + testServlet(); + } + + private void testServlet() throws Exception { + JakartaWebServlet servlet = new JakartaWebServlet(); + final HashMap configMap = new HashMap<>(); + configMap.put("ifExists", ""); + configMap.put("", ""); + ServletConfig config = new ServletConfig() { + + @Override + public String getServletName() { + return "H2Console"; + } + + @Override + public Enumeration getInitParameterNames() { + return new Vector<>(configMap.keySet()).elements(); + } + + @Override + public String getInitParameter(String name) { + return configMap.get(name); + } + + @Override + public ServletContext getServletContext() { + return null; + } + + }; + servlet.init(config); + + + TestHttpServletRequest request = new TestHttpServletRequest(); + request.setPathInfo("/"); + TestHttpServletResponse response = new TestHttpServletResponse(); + TestServletOutputStream out = new TestServletOutputStream(); + response.setServletOutputStream(out); + servlet.doGet(request, response); + assertContains(out.toString(), "location.href = 'login.jsp"); + servlet.destroy(); + } + + /** + * A HTTP servlet request for testing. + */ + static class TestHttpServletRequest implements HttpServletRequest { + + private String pathInfo; + + void setPathInfo(String pathInfo) { + this.pathInfo = pathInfo; + } + + @Override + public Object getAttribute(String name) { + return null; + } + + @Override + public Enumeration getAttributeNames() { + return new Vector().elements(); + } + + @Override + public String getCharacterEncoding() { + return null; + } + + @Override + public int getContentLength() { + return 0; + } + + @Override + public String getContentType() { + return null; + } + + @Override + public ServletInputStream getInputStream() throws IOException { + return null; + } + + @Override + public String getLocalAddr() { + return null; + } + + @Override + public String getLocalName() { + return null; + } + + @Override + public int getLocalPort() { + return 0; + } + + @Override + public Locale getLocale() { + return null; + } + + @Override + public Enumeration getLocales() { + return null; + } + + @Override + public String getParameter(String name) { + return null; + } + + @Override + public Map getParameterMap() { + return null; + } + + @Override + public Enumeration getParameterNames() { + return new Vector().elements(); + } + + @Override + public String[] getParameterValues(String name) { + return null; + } + + @Override + public String getProtocol() { + return null; + } + + @Override + public BufferedReader getReader() throws IOException { + return null; + } + + @Override + @Deprecated + public String getRealPath(String path) { + return null; + } + + @Override + public String getRemoteAddr() { + return null; + } + + @Override + public String getRemoteHost() { + return null; + } + + @Override + public int getRemotePort() { + return 0; + } + + @Override + public RequestDispatcher getRequestDispatcher(String name) { + return null; + } + + @Override + public String getScheme() { + return "http"; + } + + @Override + public String getServerName() { + return null; + } + + @Override + public int getServerPort() { + return 80; + } + + @Override + public boolean isSecure() { + return false; + } + + @Override + public void removeAttribute(String name) { + // ignore + } + + @Override + public void setAttribute(String name, Object value) { + // ignore + } + + @Override + public void setCharacterEncoding(String encoding) + throws UnsupportedEncodingException { + // ignore + } + + @Override + public String getAuthType() { + return null; + } + + @Override + public String getContextPath() { + return null; + } + + @Override + public Cookie[] getCookies() { + return null; + } + + @Override + public long getDateHeader(String x) { + return 0; + } + + @Override + public String getHeader(String name) { + return null; + } + + @Override + public Enumeration getHeaderNames() { + return null; + } + + @Override + public Enumeration getHeaders(String name) { + return null; + } + + @Override + public int getIntHeader(String name) { + return 0; + } + + @Override + public String getMethod() { + return null; + } + + @Override + public String getPathInfo() { + return pathInfo; + } + + @Override + public String getPathTranslated() { + return null; + } + + @Override + public String getQueryString() { + return null; + } + + @Override + public String getRemoteUser() { + return null; + } + + @Override + public String getRequestURI() { + return null; + } + + @Override + public StringBuffer getRequestURL() { + return null; + } + + @Override + public String getRequestedSessionId() { + return null; + } + + @Override + public String getServletPath() { + return null; + } + + @Override + public HttpSession getSession() { + return null; + } + + @Override + public HttpSession getSession(boolean x) { + return null; + } + + @Override + public Principal getUserPrincipal() { + return null; + } + + @Override + public boolean isRequestedSessionIdFromCookie() { + return false; + } + + @Override + public boolean isRequestedSessionIdFromURL() { + return false; + } + + @Override + @Deprecated + public boolean isRequestedSessionIdFromUrl() { + return false; + } + + @Override + public boolean isRequestedSessionIdValid() { + return false; + } + + @Override + public boolean isUserInRole(String x) { + return false; + } + + @Override + public java.util.Collection getParts() { + return null; + } + + @Override + public Part getPart(String name) { + return null; + } + + @Override + public boolean authenticate(HttpServletResponse response) { + return false; + } + + @Override + public void login(String username, String password) { + // ignore + } + + @Override + public void logout() { + // ignore + } + + @Override + public ServletContext getServletContext() { + return null; + } + + @Override + public AsyncContext startAsync() { + return null; + } + + @Override + public AsyncContext startAsync( + ServletRequest servletRequest, + ServletResponse servletResponse) { + return null; + } + + @Override + public boolean isAsyncStarted() { + return false; + } + + @Override + public boolean isAsyncSupported() { + return false; + } + + @Override + public AsyncContext getAsyncContext() { + return null; + } + + @Override + public DispatcherType getDispatcherType() { + return null; + } + + @Override + public long getContentLengthLong() { + return 0; + } + + @Override + public String changeSessionId() { + return null; + } + + @Override + public T upgrade(Class handlerClass) + throws IOException, ServletException { + return null; + } + + } + + /** + * A HTTP servlet response for testing. + */ + static class TestHttpServletResponse implements HttpServletResponse { + + ServletOutputStream servletOutputStream; + + void setServletOutputStream(ServletOutputStream servletOutputStream) { + this.servletOutputStream = servletOutputStream; + } + + @Override + public void flushBuffer() throws IOException { + // ignore + } + + @Override + public int getBufferSize() { + return 0; + } + + @Override + public String getCharacterEncoding() { + return null; + } + + @Override + public String getContentType() { + return null; + } + + @Override + public Locale getLocale() { + return null; + } + + @Override + public ServletOutputStream getOutputStream() throws IOException { + return servletOutputStream; + } + + @Override + public PrintWriter getWriter() throws IOException { + return null; + } + + @Override + public boolean isCommitted() { + return false; + } + + @Override + public void reset() { + // ignore + } + + @Override + public void resetBuffer() { + // ignore + } + + @Override + public void setBufferSize(int arg0) { + // ignore + } + + @Override + public void setCharacterEncoding(String arg0) { + // ignore + } + + @Override + public void setContentLength(int arg0) { + // ignore + } + + @Override + public void setContentLengthLong(long arg0) { + // ignore + } + + @Override + public void setContentType(String arg0) { + // ignore + } + + @Override + public void setLocale(Locale arg0) { + // ignore + } + + @Override + public void addCookie(Cookie arg0) { + // ignore + } + + @Override + public void addDateHeader(String arg0, long arg1) { + // ignore + } + + @Override + public void addHeader(String arg0, String arg1) { + // ignore + } + + @Override + public void addIntHeader(String arg0, int arg1) { + // ignore + } + + @Override + public boolean containsHeader(String arg0) { + return false; + } + + @Override + public String encodeRedirectURL(String arg0) { + return null; + } + + @Override + @Deprecated + public String encodeRedirectUrl(String arg0) { + return null; + } + + @Override + public String encodeURL(String arg0) { + return null; + } + + @Override + @Deprecated + public String encodeUrl(String arg0) { + return null; + } + + @Override + public void sendError(int arg0) throws IOException { + // ignore + } + + @Override + public void sendError(int arg0, String arg1) throws IOException { + // ignore + } + + @Override + public void sendRedirect(String arg0) throws IOException { + // ignore + } + + @Override + public void setDateHeader(String arg0, long arg1) { + // ignore + } + + @Override + public void setHeader(String arg0, String arg1) { + // ignore + } + + @Override + public void setIntHeader(String arg0, int arg1) { + // ignore + } + + @Override + public void setStatus(int arg0) { + // ignore + } + + @Override + @Deprecated + public void setStatus(int arg0, String arg1) { + // ignore + } + + @Override + public int getStatus() { + return 0; + } + + @Override + public String getHeader(String name) { + return null; + } + + @Override + public java.util.Collection getHeaders(String name) { + return null; + } + + @Override + public java.util.Collection getHeaderNames() { + return null; + } + + } + + /** + * A servlet output stream for testing. + */ + static class TestServletOutputStream extends ServletOutputStream { + + private final ByteArrayOutputStream buff = new ByteArrayOutputStream(); + + @Override + public void write(int b) throws IOException { + buff.write(b); + } + + @Override + public String toString() { + return Utils10.byteArrayOutputStreamToString(buff, StandardCharsets.UTF_8); + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setWriteListener(WriteListener writeListener) { + // ignore + } + + } + +} diff --git a/h2/src/test/org/h2/test/server/TestNestedLoop.java b/h2/src/test/org/h2/test/server/TestNestedLoop.java index b8efbccb99..e085efed57 100644 --- a/h2/src/test/org/h2/test/server/TestNestedLoop.java +++ b/h2/src/test/org/h2/test/server/TestNestedLoop.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/server/TestWeb.java b/h2/src/test/org/h2/test/server/TestWeb.java index 8d4a94147a..f7cac62797 100644 --- a/h2/src/test/org/h2/test/server/TestWeb.java +++ b/h2/src/test/org/h2/test/server/TestWeb.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/server/WebClient.java b/h2/src/test/org/h2/test/server/WebClient.java index 98caa4e231..a24d10a587 100644 --- a/h2/src/test/org/h2/test/server/WebClient.java +++ b/h2/src/test/org/h2/test/server/WebClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/server/package.html b/h2/src/test/org/h2/test/server/package.html index 3ff0857528..75974b6522 100644 --- a/h2/src/test/org/h2/test/server/package.html +++ b/h2/src/test/org/h2/test/server/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/store/CalculateHashConstant.java b/h2/src/test/org/h2/test/store/CalculateHashConstant.java index 3bef7c8893..9399768d00 100644 --- a/h2/src/test/org/h2/test/store/CalculateHashConstant.java +++ b/h2/src/test/org/h2/test/store/CalculateHashConstant.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/CalculateHashConstantLong.java b/h2/src/test/org/h2/test/store/CalculateHashConstantLong.java index e220c05ddf..6dd2aba472 100644 --- a/h2/src/test/org/h2/test/store/CalculateHashConstantLong.java +++ b/h2/src/test/org/h2/test/store/CalculateHashConstantLong.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/FreeSpaceList.java b/h2/src/test/org/h2/test/store/FreeSpaceList.java index 73e5659d57..b6cb3e9031 100644 --- a/h2/src/test/org/h2/test/store/FreeSpaceList.java +++ b/h2/src/test/org/h2/test/store/FreeSpaceList.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/FreeSpaceTree.java b/h2/src/test/org/h2/test/store/FreeSpaceTree.java index 577b9c336e..07931a9834 100644 --- a/h2/src/test/org/h2/test/store/FreeSpaceTree.java +++ b/h2/src/test/org/h2/test/store/FreeSpaceTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/RowDataType.java b/h2/src/test/org/h2/test/store/RowDataType.java index 2365c54896..ac4611f294 100644 --- a/h2/src/test/org/h2/test/store/RowDataType.java +++ b/h2/src/test/org/h2/test/store/RowDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/SequenceMap.java b/h2/src/test/org/h2/test/store/SequenceMap.java index 5b94ee02ce..aa94a5f99c 100644 --- a/h2/src/test/org/h2/test/store/SequenceMap.java +++ b/h2/src/test/org/h2/test/store/SequenceMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestBenchmark.java b/h2/src/test/org/h2/test/store/TestBenchmark.java index 37d0287c6c..1f720479d5 100644 --- a/h2/src/test/org/h2/test/store/TestBenchmark.java +++ b/h2/src/test/org/h2/test/store/TestBenchmark.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestCacheConcurrentLIRS.java b/h2/src/test/org/h2/test/store/TestCacheConcurrentLIRS.java index 504a020620..4c4f4093c1 100644 --- a/h2/src/test/org/h2/test/store/TestCacheConcurrentLIRS.java +++ b/h2/src/test/org/h2/test/store/TestCacheConcurrentLIRS.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestCacheLIRS.java b/h2/src/test/org/h2/test/store/TestCacheLIRS.java index a1834c1d3b..95b9c167e0 100644 --- a/h2/src/test/org/h2/test/store/TestCacheLIRS.java +++ b/h2/src/test/org/h2/test/store/TestCacheLIRS.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestCacheLongKeyLIRS.java b/h2/src/test/org/h2/test/store/TestCacheLongKeyLIRS.java index 173978dff0..487f0d6c47 100644 --- a/h2/src/test/org/h2/test/store/TestCacheLongKeyLIRS.java +++ b/h2/src/test/org/h2/test/store/TestCacheLongKeyLIRS.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestDataUtils.java b/h2/src/test/org/h2/test/store/TestDataUtils.java index 7b48cb9a9f..e6b2c4acaf 100644 --- a/h2/src/test/org/h2/test/store/TestDataUtils.java +++ b/h2/src/test/org/h2/test/store/TestDataUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestDefrag.java b/h2/src/test/org/h2/test/store/TestDefrag.java index f3189ad1fe..b78bab536d 100644 --- a/h2/src/test/org/h2/test/store/TestDefrag.java +++ b/h2/src/test/org/h2/test/store/TestDefrag.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestFreeSpace.java b/h2/src/test/org/h2/test/store/TestFreeSpace.java index e5d7606588..c4867a4eab 100644 --- a/h2/src/test/org/h2/test/store/TestFreeSpace.java +++ b/h2/src/test/org/h2/test/store/TestFreeSpace.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestImmutableArray.java b/h2/src/test/org/h2/test/store/TestImmutableArray.java index 6960541be9..9b40fdf404 100644 --- a/h2/src/test/org/h2/test/store/TestImmutableArray.java +++ b/h2/src/test/org/h2/test/store/TestImmutableArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestKillProcessWhileWriting.java b/h2/src/test/org/h2/test/store/TestKillProcessWhileWriting.java index 74e39a0d54..802949a8dd 100644 --- a/h2/src/test/org/h2/test/store/TestKillProcessWhileWriting.java +++ b/h2/src/test/org/h2/test/store/TestKillProcessWhileWriting.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVRTree.java b/h2/src/test/org/h2/test/store/TestMVRTree.java index 86fbfe1e42..4af60017df 100644 --- a/h2/src/test/org/h2/test/store/TestMVRTree.java +++ b/h2/src/test/org/h2/test/store/TestMVRTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVStore.java b/h2/src/test/org/h2/test/store/TestMVStore.java index 56e4a3bf19..3d5072b4b1 100644 --- a/h2/src/test/org/h2/test/store/TestMVStore.java +++ b/h2/src/test/org/h2/test/store/TestMVStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java b/h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java index bc6d0c422f..fc587d290d 100644 --- a/h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java +++ b/h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVStoreCachePerformance.java b/h2/src/test/org/h2/test/store/TestMVStoreCachePerformance.java index 9cd1f2b160..1576724447 100644 --- a/h2/src/test/org/h2/test/store/TestMVStoreCachePerformance.java +++ b/h2/src/test/org/h2/test/store/TestMVStoreCachePerformance.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVStoreConcurrent.java b/h2/src/test/org/h2/test/store/TestMVStoreConcurrent.java index a0e2970cde..e05fcb8bb4 100644 --- a/h2/src/test/org/h2/test/store/TestMVStoreConcurrent.java +++ b/h2/src/test/org/h2/test/store/TestMVStoreConcurrent.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVStoreStopCompact.java b/h2/src/test/org/h2/test/store/TestMVStoreStopCompact.java index 34f9257e1b..b4c7a885f6 100644 --- a/h2/src/test/org/h2/test/store/TestMVStoreStopCompact.java +++ b/h2/src/test/org/h2/test/store/TestMVStoreStopCompact.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVStoreTool.java b/h2/src/test/org/h2/test/store/TestMVStoreTool.java index 2137b99c9a..a63d85a785 100644 --- a/h2/src/test/org/h2/test/store/TestMVStoreTool.java +++ b/h2/src/test/org/h2/test/store/TestMVStoreTool.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestMVTableEngine.java b/h2/src/test/org/h2/test/store/TestMVTableEngine.java index 54526db4d3..3c2d421eba 100644 --- a/h2/src/test/org/h2/test/store/TestMVTableEngine.java +++ b/h2/src/test/org/h2/test/store/TestMVTableEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestObjectDataType.java b/h2/src/test/org/h2/test/store/TestObjectDataType.java index 0a460e8df3..8b4cc3adf1 100644 --- a/h2/src/test/org/h2/test/store/TestObjectDataType.java +++ b/h2/src/test/org/h2/test/store/TestObjectDataType.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestRandomMapOps.java b/h2/src/test/org/h2/test/store/TestRandomMapOps.java index 437e242456..b3f75b45a9 100644 --- a/h2/src/test/org/h2/test/store/TestRandomMapOps.java +++ b/h2/src/test/org/h2/test/store/TestRandomMapOps.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestShardedMap.java b/h2/src/test/org/h2/test/store/TestShardedMap.java index 74d2cecad3..69345601c3 100644 --- a/h2/src/test/org/h2/test/store/TestShardedMap.java +++ b/h2/src/test/org/h2/test/store/TestShardedMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestSpinLock.java b/h2/src/test/org/h2/test/store/TestSpinLock.java index d76f95e921..693d6ab53e 100644 --- a/h2/src/test/org/h2/test/store/TestSpinLock.java +++ b/h2/src/test/org/h2/test/store/TestSpinLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestStreamStore.java b/h2/src/test/org/h2/test/store/TestStreamStore.java index d8dc0643ef..1704fdad71 100644 --- a/h2/src/test/org/h2/test/store/TestStreamStore.java +++ b/h2/src/test/org/h2/test/store/TestStreamStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/TestTransactionStore.java b/h2/src/test/org/h2/test/store/TestTransactionStore.java index 5427d4fddb..07fee7007d 100644 --- a/h2/src/test/org/h2/test/store/TestTransactionStore.java +++ b/h2/src/test/org/h2/test/store/TestTransactionStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/store/package.html b/h2/src/test/org/h2/test/store/package.html index e83b30d299..f71790e7b3 100644 --- a/h2/src/test/org/h2/test/store/package.html +++ b/h2/src/test/org/h2/test/store/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/synth/BnfRandom.java b/h2/src/test/org/h2/test/synth/BnfRandom.java index 7118110e7c..cc35923947 100644 --- a/h2/src/test/org/h2/test/synth/BnfRandom.java +++ b/h2/src/test/org/h2/test/synth/BnfRandom.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/OutputCatcher.java b/h2/src/test/org/h2/test/synth/OutputCatcher.java index 31144b1934..2ab3413d44 100644 --- a/h2/src/test/org/h2/test/synth/OutputCatcher.java +++ b/h2/src/test/org/h2/test/synth/OutputCatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestBtreeIndex.java b/h2/src/test/org/h2/test/synth/TestBtreeIndex.java index 2b8f346e79..42dfae5ec1 100644 --- a/h2/src/test/org/h2/test/synth/TestBtreeIndex.java +++ b/h2/src/test/org/h2/test/synth/TestBtreeIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestConcurrentUpdate.java b/h2/src/test/org/h2/test/synth/TestConcurrentUpdate.java index 63a15395b3..072029b1a1 100644 --- a/h2/src/test/org/h2/test/synth/TestConcurrentUpdate.java +++ b/h2/src/test/org/h2/test/synth/TestConcurrentUpdate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestCrashAPI.java b/h2/src/test/org/h2/test/synth/TestCrashAPI.java index b0d9076022..f88c3841e9 100644 --- a/h2/src/test/org/h2/test/synth/TestCrashAPI.java +++ b/h2/src/test/org/h2/test/synth/TestCrashAPI.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestDiskFull.java b/h2/src/test/org/h2/test/synth/TestDiskFull.java index 9231010ecd..16e4a0a1c3 100644 --- a/h2/src/test/org/h2/test/synth/TestDiskFull.java +++ b/h2/src/test/org/h2/test/synth/TestDiskFull.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java b/h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java index a888be94cb..f029e1f361 100644 --- a/h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java +++ b/h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestHalt.java b/h2/src/test/org/h2/test/synth/TestHalt.java index eb0d257890..f6fd68f5ee 100644 --- a/h2/src/test/org/h2/test/synth/TestHalt.java +++ b/h2/src/test/org/h2/test/synth/TestHalt.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestHaltApp.java b/h2/src/test/org/h2/test/synth/TestHaltApp.java index 6374faaf35..22b5d902e9 100644 --- a/h2/src/test/org/h2/test/synth/TestHaltApp.java +++ b/h2/src/test/org/h2/test/synth/TestHaltApp.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestJoin.java b/h2/src/test/org/h2/test/synth/TestJoin.java index 19d5191d68..ca45c1aedf 100644 --- a/h2/src/test/org/h2/test/synth/TestJoin.java +++ b/h2/src/test/org/h2/test/synth/TestJoin.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestKill.java b/h2/src/test/org/h2/test/synth/TestKill.java index 058ff43cb5..52baf41465 100644 --- a/h2/src/test/org/h2/test/synth/TestKill.java +++ b/h2/src/test/org/h2/test/synth/TestKill.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestKillProcess.java b/h2/src/test/org/h2/test/synth/TestKillProcess.java index 6b4c1eaefb..b432222552 100644 --- a/h2/src/test/org/h2/test/synth/TestKillProcess.java +++ b/h2/src/test/org/h2/test/synth/TestKillProcess.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestKillRestart.java b/h2/src/test/org/h2/test/synth/TestKillRestart.java index 4b82173c3e..d9ed4920c5 100644 --- a/h2/src/test/org/h2/test/synth/TestKillRestart.java +++ b/h2/src/test/org/h2/test/synth/TestKillRestart.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestKillRestartMulti.java b/h2/src/test/org/h2/test/synth/TestKillRestartMulti.java index c909f2d9d6..a8858e19ab 100644 --- a/h2/src/test/org/h2/test/synth/TestKillRestartMulti.java +++ b/h2/src/test/org/h2/test/synth/TestKillRestartMulti.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestLimit.java b/h2/src/test/org/h2/test/synth/TestLimit.java index 2065af831a..5a063b0329 100644 --- a/h2/src/test/org/h2/test/synth/TestLimit.java +++ b/h2/src/test/org/h2/test/synth/TestLimit.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestMultiThreaded.java b/h2/src/test/org/h2/test/synth/TestMultiThreaded.java index 6f8ab9ddac..4e1fc87c9b 100644 --- a/h2/src/test/org/h2/test/synth/TestMultiThreaded.java +++ b/h2/src/test/org/h2/test/synth/TestMultiThreaded.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestNestedJoins.java b/h2/src/test/org/h2/test/synth/TestNestedJoins.java index e81a5af76c..d72fde3143 100644 --- a/h2/src/test/org/h2/test/synth/TestNestedJoins.java +++ b/h2/src/test/org/h2/test/synth/TestNestedJoins.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestOuterJoins.java b/h2/src/test/org/h2/test/synth/TestOuterJoins.java index 4fa96bfb73..41e97bbfd8 100644 --- a/h2/src/test/org/h2/test/synth/TestOuterJoins.java +++ b/h2/src/test/org/h2/test/synth/TestOuterJoins.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestPowerOffFs.java b/h2/src/test/org/h2/test/synth/TestPowerOffFs.java index 24d94a43ef..443b7844d1 100644 --- a/h2/src/test/org/h2/test/synth/TestPowerOffFs.java +++ b/h2/src/test/org/h2/test/synth/TestPowerOffFs.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestPowerOffFs2.java b/h2/src/test/org/h2/test/synth/TestPowerOffFs2.java index 6b36d69afa..1799b86fde 100644 --- a/h2/src/test/org/h2/test/synth/TestPowerOffFs2.java +++ b/h2/src/test/org/h2/test/synth/TestPowerOffFs2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestRandomCompare.java b/h2/src/test/org/h2/test/synth/TestRandomCompare.java index a3d14bbca2..7cf7657525 100644 --- a/h2/src/test/org/h2/test/synth/TestRandomCompare.java +++ b/h2/src/test/org/h2/test/synth/TestRandomCompare.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestRandomSQL.java b/h2/src/test/org/h2/test/synth/TestRandomSQL.java index e61c3f3ae4..9223e60d6c 100644 --- a/h2/src/test/org/h2/test/synth/TestRandomSQL.java +++ b/h2/src/test/org/h2/test/synth/TestRandomSQL.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestReleaseSelectLock.java b/h2/src/test/org/h2/test/synth/TestReleaseSelectLock.java index 416c66f10c..42907fe467 100644 --- a/h2/src/test/org/h2/test/synth/TestReleaseSelectLock.java +++ b/h2/src/test/org/h2/test/synth/TestReleaseSelectLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestSimpleIndex.java b/h2/src/test/org/h2/test/synth/TestSimpleIndex.java index 4c461ce34d..4a0337d45c 100644 --- a/h2/src/test/org/h2/test/synth/TestSimpleIndex.java +++ b/h2/src/test/org/h2/test/synth/TestSimpleIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestThreads.java b/h2/src/test/org/h2/test/synth/TestThreads.java index 60dfd38ce6..f88049ebfd 100644 --- a/h2/src/test/org/h2/test/synth/TestThreads.java +++ b/h2/src/test/org/h2/test/synth/TestThreads.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/TestTimer.java b/h2/src/test/org/h2/test/synth/TestTimer.java index 82eac6587e..aae2e40ccc 100644 --- a/h2/src/test/org/h2/test/synth/TestTimer.java +++ b/h2/src/test/org/h2/test/synth/TestTimer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/package.html b/h2/src/test/org/h2/test/synth/package.html index 2210f2067a..31abc88978 100644 --- a/h2/src/test/org/h2/test/synth/package.html +++ b/h2/src/test/org/h2/test/synth/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/synth/sql/Column.java b/h2/src/test/org/h2/test/synth/sql/Column.java index bea9896578..e797507155 100644 --- a/h2/src/test/org/h2/test/synth/sql/Column.java +++ b/h2/src/test/org/h2/test/synth/sql/Column.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/Command.java b/h2/src/test/org/h2/test/synth/sql/Command.java index 3d8ca05f26..00997cc057 100644 --- a/h2/src/test/org/h2/test/synth/sql/Command.java +++ b/h2/src/test/org/h2/test/synth/sql/Command.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/DbConnection.java b/h2/src/test/org/h2/test/synth/sql/DbConnection.java index c1e918157c..803fc28b6b 100644 --- a/h2/src/test/org/h2/test/synth/sql/DbConnection.java +++ b/h2/src/test/org/h2/test/synth/sql/DbConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/DbInterface.java b/h2/src/test/org/h2/test/synth/sql/DbInterface.java index 6742f29a9c..118b7030d3 100644 --- a/h2/src/test/org/h2/test/synth/sql/DbInterface.java +++ b/h2/src/test/org/h2/test/synth/sql/DbInterface.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/DbState.java b/h2/src/test/org/h2/test/synth/sql/DbState.java index e0ebd054bd..0ecee56720 100644 --- a/h2/src/test/org/h2/test/synth/sql/DbState.java +++ b/h2/src/test/org/h2/test/synth/sql/DbState.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/Expression.java b/h2/src/test/org/h2/test/synth/sql/Expression.java index 4206be117d..50d615425f 100644 --- a/h2/src/test/org/h2/test/synth/sql/Expression.java +++ b/h2/src/test/org/h2/test/synth/sql/Expression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/Index.java b/h2/src/test/org/h2/test/synth/sql/Index.java index 5a46042512..544a847667 100644 --- a/h2/src/test/org/h2/test/synth/sql/Index.java +++ b/h2/src/test/org/h2/test/synth/sql/Index.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/RandomGen.java b/h2/src/test/org/h2/test/synth/sql/RandomGen.java index fc3ad5d0f4..50ce674372 100644 --- a/h2/src/test/org/h2/test/synth/sql/RandomGen.java +++ b/h2/src/test/org/h2/test/synth/sql/RandomGen.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/Result.java b/h2/src/test/org/h2/test/synth/sql/Result.java index 0106bef9f4..556bf8c34b 100644 --- a/h2/src/test/org/h2/test/synth/sql/Result.java +++ b/h2/src/test/org/h2/test/synth/sql/Result.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/Row.java b/h2/src/test/org/h2/test/synth/sql/Row.java index 5abd5b23b4..e60988b1d3 100644 --- a/h2/src/test/org/h2/test/synth/sql/Row.java +++ b/h2/src/test/org/h2/test/synth/sql/Row.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/Table.java b/h2/src/test/org/h2/test/synth/sql/Table.java index 8761018765..abf1092715 100644 --- a/h2/src/test/org/h2/test/synth/sql/Table.java +++ b/h2/src/test/org/h2/test/synth/sql/Table.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/TestSynth.java b/h2/src/test/org/h2/test/synth/sql/TestSynth.java index 9531608fc8..389a914f88 100644 --- a/h2/src/test/org/h2/test/synth/sql/TestSynth.java +++ b/h2/src/test/org/h2/test/synth/sql/TestSynth.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/Value.java b/h2/src/test/org/h2/test/synth/sql/Value.java index cf892a5892..6707fee2f2 100644 --- a/h2/src/test/org/h2/test/synth/sql/Value.java +++ b/h2/src/test/org/h2/test/synth/sql/Value.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/sql/package.html b/h2/src/test/org/h2/test/synth/sql/package.html index c90246815e..6826f682db 100644 --- a/h2/src/test/org/h2/test/synth/sql/package.html +++ b/h2/src/test/org/h2/test/synth/sql/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/synth/thread/TestMulti.java b/h2/src/test/org/h2/test/synth/thread/TestMulti.java index db7b8eb4b5..e7e16b7686 100644 --- a/h2/src/test/org/h2/test/synth/thread/TestMulti.java +++ b/h2/src/test/org/h2/test/synth/thread/TestMulti.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/thread/TestMultiNews.java b/h2/src/test/org/h2/test/synth/thread/TestMultiNews.java index 08046a016f..4c2921f6bc 100644 --- a/h2/src/test/org/h2/test/synth/thread/TestMultiNews.java +++ b/h2/src/test/org/h2/test/synth/thread/TestMultiNews.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/thread/TestMultiNewsSimple.java b/h2/src/test/org/h2/test/synth/thread/TestMultiNewsSimple.java index 41d192989c..fc043105d8 100644 --- a/h2/src/test/org/h2/test/synth/thread/TestMultiNewsSimple.java +++ b/h2/src/test/org/h2/test/synth/thread/TestMultiNewsSimple.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/thread/TestMultiOrder.java b/h2/src/test/org/h2/test/synth/thread/TestMultiOrder.java index 7fd7c557a1..c10fec4850 100644 --- a/h2/src/test/org/h2/test/synth/thread/TestMultiOrder.java +++ b/h2/src/test/org/h2/test/synth/thread/TestMultiOrder.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/thread/TestMultiThread.java b/h2/src/test/org/h2/test/synth/thread/TestMultiThread.java index 4e8522fd7f..7ed64a1eb6 100644 --- a/h2/src/test/org/h2/test/synth/thread/TestMultiThread.java +++ b/h2/src/test/org/h2/test/synth/thread/TestMultiThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/synth/thread/package.html b/h2/src/test/org/h2/test/synth/thread/package.html index 4f15c37c88..6adf5e5236 100644 --- a/h2/src/test/org/h2/test/synth/thread/package.html +++ b/h2/src/test/org/h2/test/synth/thread/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/todo/TestDiskSpaceLeak.java b/h2/src/test/org/h2/test/todo/TestDiskSpaceLeak.java index 05fddf1317..51aff905d3 100644 --- a/h2/src/test/org/h2/test/todo/TestDiskSpaceLeak.java +++ b/h2/src/test/org/h2/test/todo/TestDiskSpaceLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/todo/TestDropTableLarge.java b/h2/src/test/org/h2/test/todo/TestDropTableLarge.java index c80b9e2d01..3a050642a1 100644 --- a/h2/src/test/org/h2/test/todo/TestDropTableLarge.java +++ b/h2/src/test/org/h2/test/todo/TestDropTableLarge.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/todo/TestLinkedTableFullCondition.java b/h2/src/test/org/h2/test/todo/TestLinkedTableFullCondition.java index 4ab997e865..9770cf6e23 100644 --- a/h2/src/test/org/h2/test/todo/TestLinkedTableFullCondition.java +++ b/h2/src/test/org/h2/test/todo/TestLinkedTableFullCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/todo/TestTempTableCrash.java b/h2/src/test/org/h2/test/todo/TestTempTableCrash.java index 86fd9480c7..8a4e452975 100644 --- a/h2/src/test/org/h2/test/todo/TestTempTableCrash.java +++ b/h2/src/test/org/h2/test/todo/TestTempTableCrash.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/todo/TestUndoLogLarge.java b/h2/src/test/org/h2/test/todo/TestUndoLogLarge.java index 0fa386f5cf..41a463ffb9 100644 --- a/h2/src/test/org/h2/test/todo/TestUndoLogLarge.java +++ b/h2/src/test/org/h2/test/todo/TestUndoLogLarge.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/todo/package.html b/h2/src/test/org/h2/test/todo/package.html index c8b466c806..a99d84ed75 100644 --- a/h2/src/test/org/h2/test/todo/package.html +++ b/h2/src/test/org/h2/test/todo/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/todo/tools.sql b/h2/src/test/org/h2/test/todo/tools.sql index 1831e0e256..bd61c7a5d0 100644 --- a/h2/src/test/org/h2/test/todo/tools.sql +++ b/h2/src/test/org/h2/test/todo/tools.sql @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/trace/Arg.java b/h2/src/test/org/h2/test/trace/Arg.java index 7697359a1c..55038562d5 100644 --- a/h2/src/test/org/h2/test/trace/Arg.java +++ b/h2/src/test/org/h2/test/trace/Arg.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). */ /* diff --git a/h2/src/test/org/h2/test/trace/Parser.java b/h2/src/test/org/h2/test/trace/Parser.java index 69dd2ee0a2..86e995ef58 100644 --- a/h2/src/test/org/h2/test/trace/Parser.java +++ b/h2/src/test/org/h2/test/trace/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). */ /* diff --git a/h2/src/test/org/h2/test/trace/Player.java b/h2/src/test/org/h2/test/trace/Player.java index 775dc006f0..cf0a750200 100644 --- a/h2/src/test/org/h2/test/trace/Player.java +++ b/h2/src/test/org/h2/test/trace/Player.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). */ /* diff --git a/h2/src/test/org/h2/test/trace/Statement.java b/h2/src/test/org/h2/test/trace/Statement.java index c3468c806a..6fcca9d58e 100644 --- a/h2/src/test/org/h2/test/trace/Statement.java +++ b/h2/src/test/org/h2/test/trace/Statement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). */ /* diff --git a/h2/src/test/org/h2/test/trace/package.html b/h2/src/test/org/h2/test/trace/package.html index 0287dcebf6..5b4b294356 100644 --- a/h2/src/test/org/h2/test/trace/package.html +++ b/h2/src/test/org/h2/test/trace/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/unit/TestAnsCompression.java b/h2/src/test/org/h2/test/unit/TestAnsCompression.java index 3de19a7d27..32daf07048 100644 --- a/h2/src/test/org/h2/test/unit/TestAnsCompression.java +++ b/h2/src/test/org/h2/test/unit/TestAnsCompression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestAutoReconnect.java b/h2/src/test/org/h2/test/unit/TestAutoReconnect.java index 5a65cc44c7..e275d3ed1e 100644 --- a/h2/src/test/org/h2/test/unit/TestAutoReconnect.java +++ b/h2/src/test/org/h2/test/unit/TestAutoReconnect.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestBinaryArithmeticStream.java b/h2/src/test/org/h2/test/unit/TestBinaryArithmeticStream.java index 4ea43c98ec..173691dd1d 100644 --- a/h2/src/test/org/h2/test/unit/TestBinaryArithmeticStream.java +++ b/h2/src/test/org/h2/test/unit/TestBinaryArithmeticStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestBinaryOperation.java b/h2/src/test/org/h2/test/unit/TestBinaryOperation.java index 5e41909e04..606d728d44 100644 --- a/h2/src/test/org/h2/test/unit/TestBinaryOperation.java +++ b/h2/src/test/org/h2/test/unit/TestBinaryOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestBitStream.java b/h2/src/test/org/h2/test/unit/TestBitStream.java index 52ac32de41..dd53cc55bc 100644 --- a/h2/src/test/org/h2/test/unit/TestBitStream.java +++ b/h2/src/test/org/h2/test/unit/TestBitStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestBnf.java b/h2/src/test/org/h2/test/unit/TestBnf.java index ecec1d1195..71f9113c64 100644 --- a/h2/src/test/org/h2/test/unit/TestBnf.java +++ b/h2/src/test/org/h2/test/unit/TestBnf.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestCache.java b/h2/src/test/org/h2/test/unit/TestCache.java index f7cd4bc2ca..4f71f0d317 100644 --- a/h2/src/test/org/h2/test/unit/TestCache.java +++ b/h2/src/test/org/h2/test/unit/TestCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestCharsetCollator.java b/h2/src/test/org/h2/test/unit/TestCharsetCollator.java index d28d78fda1..e1fb1d13fa 100644 --- a/h2/src/test/org/h2/test/unit/TestCharsetCollator.java +++ b/h2/src/test/org/h2/test/unit/TestCharsetCollator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestClassLoaderLeak.java b/h2/src/test/org/h2/test/unit/TestClassLoaderLeak.java index 2902c22f38..1a6b4f4719 100644 --- a/h2/src/test/org/h2/test/unit/TestClassLoaderLeak.java +++ b/h2/src/test/org/h2/test/unit/TestClassLoaderLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestCollation.java b/h2/src/test/org/h2/test/unit/TestCollation.java index 95ea3a9a94..7e0a9b1520 100644 --- a/h2/src/test/org/h2/test/unit/TestCollation.java +++ b/h2/src/test/org/h2/test/unit/TestCollation.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestCompress.java b/h2/src/test/org/h2/test/unit/TestCompress.java index 576c8047e7..7aacdf6c0c 100644 --- a/h2/src/test/org/h2/test/unit/TestCompress.java +++ b/h2/src/test/org/h2/test/unit/TestCompress.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestConcurrentJdbc.java b/h2/src/test/org/h2/test/unit/TestConcurrentJdbc.java index 62ae310388..bf75f5f70e 100644 --- a/h2/src/test/org/h2/test/unit/TestConcurrentJdbc.java +++ b/h2/src/test/org/h2/test/unit/TestConcurrentJdbc.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestConnectionInfo.java b/h2/src/test/org/h2/test/unit/TestConnectionInfo.java index 8c246f4b42..22405b1a1e 100644 --- a/h2/src/test/org/h2/test/unit/TestConnectionInfo.java +++ b/h2/src/test/org/h2/test/unit/TestConnectionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestDate.java b/h2/src/test/org/h2/test/unit/TestDate.java index dd65608b15..739c6b1633 100644 --- a/h2/src/test/org/h2/test/unit/TestDate.java +++ b/h2/src/test/org/h2/test/unit/TestDate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestDateIso8601.java b/h2/src/test/org/h2/test/unit/TestDateIso8601.java index e5e15d14aa..b3cfe3fe25 100644 --- a/h2/src/test/org/h2/test/unit/TestDateIso8601.java +++ b/h2/src/test/org/h2/test/unit/TestDateIso8601.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Robert Rathsack (firstName dot lastName at gmx dot de) */ diff --git a/h2/src/test/org/h2/test/unit/TestDateTimeUtils.java b/h2/src/test/org/h2/test/unit/TestDateTimeUtils.java index c4b308241d..e3aa5bf848 100644 --- a/h2/src/test/org/h2/test/unit/TestDateTimeUtils.java +++ b/h2/src/test/org/h2/test/unit/TestDateTimeUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestDbException.java b/h2/src/test/org/h2/test/unit/TestDbException.java index 46dd6c30a1..014b3d63e8 100644 --- a/h2/src/test/org/h2/test/unit/TestDbException.java +++ b/h2/src/test/org/h2/test/unit/TestDbException.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestExit.java b/h2/src/test/org/h2/test/unit/TestExit.java index 3bd10ef5e2..472a627dc3 100644 --- a/h2/src/test/org/h2/test/unit/TestExit.java +++ b/h2/src/test/org/h2/test/unit/TestExit.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestFile.java b/h2/src/test/org/h2/test/unit/TestFile.java index 49b8b96d6f..107d5e4099 100644 --- a/h2/src/test/org/h2/test/unit/TestFile.java +++ b/h2/src/test/org/h2/test/unit/TestFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestFileLock.java b/h2/src/test/org/h2/test/unit/TestFileLock.java index 203af6601b..716c5b1d22 100644 --- a/h2/src/test/org/h2/test/unit/TestFileLock.java +++ b/h2/src/test/org/h2/test/unit/TestFileLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestFileLockProcess.java b/h2/src/test/org/h2/test/unit/TestFileLockProcess.java index 9d86cc2ba2..b69846f180 100644 --- a/h2/src/test/org/h2/test/unit/TestFileLockProcess.java +++ b/h2/src/test/org/h2/test/unit/TestFileLockProcess.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestFileSystem.java b/h2/src/test/org/h2/test/unit/TestFileSystem.java index 9ad33ec5f2..8bd7dc1ee3 100644 --- a/h2/src/test/org/h2/test/unit/TestFileSystem.java +++ b/h2/src/test/org/h2/test/unit/TestFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestFtp.java b/h2/src/test/org/h2/test/unit/TestFtp.java index afce7f8aaa..53ba7d2bcd 100644 --- a/h2/src/test/org/h2/test/unit/TestFtp.java +++ b/h2/src/test/org/h2/test/unit/TestFtp.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestGeometryUtils.java b/h2/src/test/org/h2/test/unit/TestGeometryUtils.java index d2001a403f..6b8f1b54c5 100644 --- a/h2/src/test/org/h2/test/unit/TestGeometryUtils.java +++ b/h2/src/test/org/h2/test/unit/TestGeometryUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -30,7 +30,7 @@ import org.h2.util.geometry.EWKTUtils.EWKTTarget; import org.h2.util.geometry.GeometryUtils; import org.h2.util.geometry.GeometryUtils.DimensionSystemTarget; -import org.h2.util.geometry.GeometryUtils.EnvelopeAndDimensionSystemTarget; +import org.h2.util.geometry.GeometryUtils.EnvelopeTarget; import org.h2.util.geometry.GeometryUtils.Target; import org.h2.util.geometry.JTSUtils; import org.h2.util.geometry.JTSUtils.GeometryTarget; @@ -41,6 +41,7 @@ import org.locationtech.jts.geom.GeometryCollection; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.Point; +import org.locationtech.jts.io.ParseException; import org.locationtech.jts.io.WKBWriter; import org.locationtech.jts.io.WKTReader; import org.locationtech.jts.io.WKTWriter; @@ -197,7 +198,7 @@ private void testGeometry(String wkt, int numOfDimensions) throws Exception { private void testGeometry(String wkt, String h2Wkt, String jtsWkt, int numOfDimensions, boolean withEWKB) throws Exception { - Geometry geometryFromJTS = new WKTReader().read(wkt); + Geometry geometryFromJTS = readWKT(wkt); byte[] wkbFromJTS = new WKBWriter(numOfDimensions).write(geometryFromJTS); // Test WKB->WKT conversion @@ -226,7 +227,7 @@ private void testGeometry(String wkt, String h2Wkt, String jtsWkt, int numOfDime // Test Envelope Envelope envelopeFromJTS = geometryFromJTS.getEnvelopeInternal(); testEnvelope(envelopeFromJTS, GeometryUtils.getEnvelope(wkbFromJTS)); - EnvelopeAndDimensionSystemTarget target = new EnvelopeAndDimensionSystemTarget(); + EnvelopeTarget target = new EnvelopeTarget(); EWKBUtils.parseEWKB(wkbFromJTS, target); testEnvelope(envelopeFromJTS, target.getEnvelope()); @@ -269,23 +270,23 @@ private void testDimensionXY() throws Exception { assertEquals("POINT (1 2)", EWKTUtils.ewkb2ewkt(ewkb)); Point p = (Point) JTSUtils.ewkb2geometry(ewkb); CoordinateSequence cs = p.getCoordinateSequence(); - testDimensionXYCheckPoint(cs, false); + testDimensionXYCheckPoint(cs); assertEquals(ewkb, JTSUtils.geometry2ewkb(p)); testDimensions(GeometryUtils.DIMENSION_SYSTEM_XY, ewkb); testValueGeometryProperties(ewkb); - p = (Point) new WKTReader().read("POINT (1 2)"); + p = (Point) readWKT("POINT (1 2)"); cs = p.getCoordinateSequence(); - testDimensionXYCheckPoint(cs, true); + testDimensionXYCheckPoint(cs); ewkb = JTSUtils.geometry2ewkb(p); assertEquals("POINT (1 2)", EWKTUtils.ewkb2ewkt(ewkb)); p = (Point) JTSUtils.ewkb2geometry(ewkb); cs = p.getCoordinateSequence(); - testDimensionXYCheckPoint(cs, false); + testDimensionXYCheckPoint(cs); } - private void testDimensionXYCheckPoint(CoordinateSequence cs, boolean fromJTS) { - assertEquals(fromJTS ? 3 : 2, cs.getDimension()); + private void testDimensionXYCheckPoint(CoordinateSequence cs) { + assertEquals(2, cs.getDimension()); assertEquals(0, cs.getMeasures()); assertEquals(1, cs.getOrdinate(0, X)); assertEquals(2, cs.getOrdinate(0, Y)); @@ -304,7 +305,7 @@ private void testDimensionZ() throws Exception { testDimensions(GeometryUtils.DIMENSION_SYSTEM_XYZ, ewkb); testValueGeometryProperties(ewkb); - p = (Point) new WKTReader().read("POINT Z (1 2 3)"); + p = (Point) readWKT("POINT Z (1 2 3)"); cs = p.getCoordinateSequence(); testDimensionZCheckPoint(cs); ewkb = JTSUtils.geometry2ewkb(p); @@ -335,7 +336,7 @@ private void testDimensionM() throws Exception { testDimensions(GeometryUtils.DIMENSION_SYSTEM_XYM, ewkb); testValueGeometryProperties(ewkb); - p = (Point) new WKTReader().read("POINT M (1 2 3)"); + p = (Point) readWKT("POINT M (1 2 3)"); cs = p.getCoordinateSequence(); testDimensionMCheckPoint(cs); ewkb = JTSUtils.geometry2ewkb(p); @@ -366,7 +367,7 @@ private void testDimensionZM() throws Exception { testDimensions(GeometryUtils.DIMENSION_SYSTEM_XYZM, ewkb); testValueGeometryProperties(ewkb); - p = (Point) new WKTReader().read("POINT ZM (1 2 3 4)"); + p = (Point) readWKT("POINT ZM (1 2 3 4)"); cs = p.getCoordinateSequence(); testDimensionZMCheckPoint(cs); ewkb = JTSUtils.geometry2ewkb(p); @@ -467,9 +468,6 @@ private void testDimensions(int expected, byte[] ewkb) { DimensionSystemTarget dst = new DimensionSystemTarget(); EWKBUtils.parseEWKB(ewkb, dst); assertEquals(expected, dst.getDimensionSystem()); - EnvelopeAndDimensionSystemTarget envelopeAndDimensionTarget = new EnvelopeAndDimensionSystemTarget(); - EWKBUtils.parseEWKB(ewkb, envelopeAndDimensionTarget); - assertEquals(expected, envelopeAndDimensionTarget.getDimensionSystem()); } private void testIntersectionAndUnion() { @@ -524,4 +522,10 @@ private void testMixedGeometries() throws Exception { assertThrows(IllegalArgumentException.class, () -> JTSUtils.geometry2ewkb(g)); } + private static Geometry readWKT(String text) throws ParseException { + WKTReader reader = new WKTReader(); + reader.setIsOldJtsCoordinateSyntaxAllowed(false); + return reader.read(text); + } + } diff --git a/h2/src/test/org/h2/test/unit/TestIntArray.java b/h2/src/test/org/h2/test/unit/TestIntArray.java index c02373d1a8..04ab6f905d 100644 --- a/h2/src/test/org/h2/test/unit/TestIntArray.java +++ b/h2/src/test/org/h2/test/unit/TestIntArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestIntPerfectHash.java b/h2/src/test/org/h2/test/unit/TestIntPerfectHash.java index 5d50febe09..1aa4209d0d 100644 --- a/h2/src/test/org/h2/test/unit/TestIntPerfectHash.java +++ b/h2/src/test/org/h2/test/unit/TestIntPerfectHash.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestInterval.java b/h2/src/test/org/h2/test/unit/TestInterval.java index 0941b87f75..ddbf276dc6 100644 --- a/h2/src/test/org/h2/test/unit/TestInterval.java +++ b/h2/src/test/org/h2/test/unit/TestInterval.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestJakartaServlet.java b/h2/src/test/org/h2/test/unit/TestJakartaServlet.java new file mode 100644 index 0000000000..6f6cb83c03 --- /dev/null +++ b/h2/src/test/org/h2/test/unit/TestJakartaServlet.java @@ -0,0 +1,437 @@ +/* + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, + * and the EPL 1.0 (https://h2database.com/html/license.html). + * Initial Developer: H2 Group + */ +package org.h2.test.unit; + +import java.io.InputStream; +import java.net.URL; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Enumeration; +import java.util.EventListener; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterRegistration; +import jakarta.servlet.FilterRegistration.Dynamic; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRegistration; +import jakarta.servlet.SessionCookieConfig; +import jakarta.servlet.SessionTrackingMode; +import jakarta.servlet.descriptor.JspConfigDescriptor; +import org.h2.api.ErrorCode; +import org.h2.server.web.JakartaDbStarter; +import org.h2.test.TestBase; +import org.h2.test.TestDb; + +/** + * Tests the JakartaDbStarter servlet. + * This test simulates a minimum servlet container environment. + */ +public class TestJakartaServlet extends TestDb { + + /** + * Run just this test. + * + * @param a ignored + */ + public static void main(String... a) throws Exception { + TestBase.createCaller().init().testFromMain(); + } + + /** + * Minimum ServletContext implementation. + * Most methods are not implemented. + */ + static class TestServletContext implements ServletContext { + + private final Properties initParams = new Properties(); + private final HashMap attributes = new HashMap<>(); + + @Override + public void setAttribute(String key, Object value) { + attributes.put(key, value); + } + + @Override + public Object getAttribute(String key) { + return attributes.get(key); + } + + @Override + public boolean setInitParameter(String key, String value) { + initParams.setProperty(key, value); + return true; + } + + @Override + public String getInitParameter(String key) { + return initParams.getProperty(key); + } + + @Override + public Enumeration getAttributeNames() { + throw new UnsupportedOperationException(); + } + + @Override + public ServletContext getContext(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public Enumeration getInitParameterNames() { + throw new UnsupportedOperationException(); + } + + @Override + public int getMajorVersion() { + throw new UnsupportedOperationException(); + } + + @Override + public String getMimeType(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public int getMinorVersion() { + throw new UnsupportedOperationException(); + } + + @Override + public RequestDispatcher getNamedDispatcher(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public String getRealPath(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public RequestDispatcher getRequestDispatcher(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public URL getResource(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public InputStream getResourceAsStream(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public Set getResourcePaths(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public String getServerInfo() { + throw new UnsupportedOperationException(); + } + + /** + * @deprecated as of servlet API 2.1 + */ + @Override + @Deprecated + public Servlet getServlet(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public String getServletContextName() { + throw new UnsupportedOperationException(); + } + + /** + * @deprecated as of servlet API 2.1 + */ + @Deprecated + @Override + public Enumeration getServletNames() { + throw new UnsupportedOperationException(); + } + + /** + * @deprecated as of servlet API 2.0 + */ + @Deprecated + @Override + public Enumeration getServlets() { + throw new UnsupportedOperationException(); + } + + @Override + public void log(String string) { + throw new UnsupportedOperationException(); + } + + /** + * @deprecated as of servlet API 2.1 + */ + @Deprecated + @Override + public void log(Exception exception, String string) { + throw new UnsupportedOperationException(); + } + + @Override + public void log(String string, Throwable throwable) { + throw new UnsupportedOperationException(); + } + + @Override + public void removeAttribute(String string) { + throw new UnsupportedOperationException(); + } + + @Override + public Dynamic addFilter(String arg0, String arg1) { + throw new UnsupportedOperationException(); + } + + @Override + public Dynamic addFilter(String arg0, Filter arg1) { + throw new UnsupportedOperationException(); + } + + @Override + public Dynamic addFilter(String arg0, Class arg1) { + throw new UnsupportedOperationException(); + } + + @Override + public void addListener(String arg0) { + throw new UnsupportedOperationException(); + } + + @Override + public void addListener(T arg0) { + throw new UnsupportedOperationException(); + } + + @Override + public void addListener(Class arg0) { + throw new UnsupportedOperationException(); + } + + @Override + public jakarta.servlet.ServletRegistration.Dynamic addServlet( + String arg0, String arg1) { + throw new UnsupportedOperationException(); + } + + @Override + public jakarta.servlet.ServletRegistration.Dynamic addServlet( + String arg0, Servlet arg1) { + throw new UnsupportedOperationException(); + } + + @Override + public jakarta.servlet.ServletRegistration.Dynamic addServlet( + String arg0, Class arg1) { + throw new UnsupportedOperationException(); + } + + @Override + public T createFilter(Class arg0) + throws ServletException { + throw new UnsupportedOperationException(); + } + + @Override + public T createListener(Class arg0) + throws ServletException { + throw new UnsupportedOperationException(); + } + + @Override + public T createServlet(Class arg0) + throws ServletException { + throw new UnsupportedOperationException(); + } + + @Override + public void declareRoles(String... arg0) { + throw new UnsupportedOperationException(); + } + + @Override + public ClassLoader getClassLoader() { + throw new UnsupportedOperationException(); + } + + @Override + public String getContextPath() { + throw new UnsupportedOperationException(); + } + + @Override + public Set getDefaultSessionTrackingModes() { + throw new UnsupportedOperationException(); + } + + @Override + public int getEffectiveMajorVersion() { + throw new UnsupportedOperationException(); + } + + @Override + public int getEffectiveMinorVersion() { + throw new UnsupportedOperationException(); + } + + @Override + public Set getEffectiveSessionTrackingModes() { + throw new UnsupportedOperationException(); + } + + @Override + public FilterRegistration getFilterRegistration(String arg0) { + throw new UnsupportedOperationException(); + } + + @Override + public Map getFilterRegistrations() { + throw new UnsupportedOperationException(); + } + + @Override + public JspConfigDescriptor getJspConfigDescriptor() { + throw new UnsupportedOperationException(); + } + + @Override + public ServletRegistration getServletRegistration(String arg0) { + throw new UnsupportedOperationException(); + } + + @Override + public Map getServletRegistrations() { + throw new UnsupportedOperationException(); + } + + @Override + public SessionCookieConfig getSessionCookieConfig() { + throw new UnsupportedOperationException(); + } + + + @Override + public void setSessionTrackingModes(Set arg0) { + throw new UnsupportedOperationException(); + } + + @Override + public String getVirtualServerName() { + throw new UnsupportedOperationException(); + } + + @Override + public ServletRegistration.Dynamic addJspFile(String servletName, String jspFile) { + throw new UnsupportedOperationException(); + } + + @Override + public int getSessionTimeout() { + throw new UnsupportedOperationException(); + } + + @Override + public void setSessionTimeout(int sessionTimeout) { + throw new UnsupportedOperationException(); + } + + @Override + public String getRequestCharacterEncoding() { + throw new UnsupportedOperationException(); + } + + @Override + public void setRequestCharacterEncoding(String encoding) { + throw new UnsupportedOperationException(); + } + + @Override + public String getResponseCharacterEncoding() { + throw new UnsupportedOperationException(); + } + + @Override + public void setResponseCharacterEncoding(String encoding) { + throw new UnsupportedOperationException(); + } + + } + + @Override + public boolean isEnabled() { + if (config.networked || config.memory) { + return false; + } + return true; + } + + @Override + public void test() throws SQLException { + JakartaDbStarter listener = new JakartaDbStarter(); + + TestServletContext context = new TestServletContext(); + String url = getURL("servlet", true); + context.setInitParameter("db.url", url); + context.setInitParameter("db.user", getUser()); + context.setInitParameter("db.password", getPassword()); + context.setInitParameter("db.tcpServer", "-tcpPort 8888"); + + ServletContextEvent event = new ServletContextEvent(context); + listener.contextInitialized(event); + + Connection conn1 = listener.getConnection(); + Connection conn1a = (Connection) context.getAttribute("connection"); + assertTrue(conn1 == conn1a); + Statement stat1 = conn1.createStatement(); + stat1.execute("CREATE TABLE T(ID INT)"); + + String u2 = url.substring(url.indexOf("servlet")); + u2 = "jdbc:h2:tcp://localhost:8888/" + getBaseDir() + "/" + u2; + Connection conn2 = DriverManager.getConnection( + u2, getUser(), getPassword()); + Statement stat2 = conn2.createStatement(); + stat2.execute("SELECT * FROM T"); + stat2.execute("DROP TABLE T"); + + assertThrows(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_DATABASE_EMPTY_1, stat1). + execute("SELECT * FROM T"); + conn2.close(); + + listener.contextDestroyed(event); + + // listener must be stopped + assertThrows(ErrorCode.CONNECTION_BROKEN_1, + () -> getConnection("jdbc:h2:tcp://localhost:8888/" + getBaseDir() + "/servlet", getUser(), + getPassword())); + + // connection must be closed + assertThrows(ErrorCode.OBJECT_CLOSED, stat1). + execute("SELECT * FROM DUAL"); + + deleteDb("servlet"); + + } + +} diff --git a/h2/src/test/org/h2/test/unit/TestJmx.java b/h2/src/test/org/h2/test/unit/TestJmx.java index 29972cae49..20f6aea825 100644 --- a/h2/src/test/org/h2/test/unit/TestJmx.java +++ b/h2/src/test/org/h2/test/unit/TestJmx.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestJsonUtils.java b/h2/src/test/org/h2/test/unit/TestJsonUtils.java index 9f872321ed..35b3bae17f 100644 --- a/h2/src/test/org/h2/test/unit/TestJsonUtils.java +++ b/h2/src/test/org/h2/test/unit/TestJsonUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestKeywords.java b/h2/src/test/org/h2/test/unit/TestKeywords.java index eae8b9bf53..b006b5dcb9 100644 --- a/h2/src/test/org/h2/test/unit/TestKeywords.java +++ b/h2/src/test/org/h2/test/unit/TestKeywords.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -18,6 +18,8 @@ import java.util.TreeSet; import org.h2.command.Parser; +import org.h2.command.Token; +import org.h2.command.Tokenizer; import org.h2.message.DbException; import org.h2.test.TestBase; import org.h2.util.ParserUtil; @@ -457,6 +459,8 @@ private enum TokenType { }); + private static final HashSet STRICT_MODE_NON_KEYWORDS = toSet(new String[] { "LIMIT", "MINUS", "TOP" }); + private static final HashSet ALL_RESEVED_WORDS; private static final HashMap TOKENS; @@ -471,9 +475,17 @@ private enum TokenType { set.addAll(SQL2016_RESERVED_WORDS); ALL_RESEVED_WORDS = set; HashMap tokens = new HashMap<>(); + processClass(Parser.class, tokens); + processClass(ParserUtil.class, tokens); + processClass(Token.class, tokens); + processClass(Tokenizer.class, tokens); + TOKENS = tokens; + } + + private static void processClass(Class clazz, HashMap tokens) { ClassReader r; try { - r = new ClassReader(Parser.class.getResourceAsStream("Parser.class")); + r = new ClassReader(clazz.getResourceAsStream(clazz.getSimpleName() + ".class")); } catch (IOException e) { throw DbException.convert(e); } @@ -512,7 +524,7 @@ void add(Object value) { } } final TokenType type; - switch (ParserUtil.getTokenType(s, false, 0, l, true)) { + switch (ParserUtil.getTokenType(s, false, true)) { case ParserUtil.IDENTIFIER: type = TokenType.IDENTIFIER; break; @@ -525,7 +537,6 @@ void add(Object value) { tokens.put(s, type); } }, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); - TOKENS = tokens; } private static HashSet toSet(String[] array) { @@ -556,11 +567,20 @@ public void test() throws Exception { } private void testParser() throws Exception { - try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:keywords")) { + testParser(false); + testParser(true); + } + + private void testParser(boolean strictMode) throws Exception { + try (Connection conn = DriverManager + .getConnection("jdbc:h2:mem:keywords;MODE=" + (strictMode ? "STRICT" : "REGULAR"))) { Statement stat = conn.createStatement(); for (Entry entry : TOKENS.entrySet()) { String s = entry.getKey(); TokenType type = entry.getValue(); + if (strictMode && STRICT_MODE_NON_KEYWORDS.contains(s)) { + type = TokenType.IDENTIFIER; + } Throwable exception1 = null, exception2 = null; try { stat.execute("CREATE TABLE " + s + '(' + s + " INT)"); @@ -704,6 +724,12 @@ private void testMetaData() throws Exception { try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:")) { assertEquals(setToString(set), conn.getMetaData().getSQLKeywords()); } + try (Connection conn = DriverManager.getConnection("jdbc:h2:mem:;MODE=STRICT")) { + TreeSet set2 = new TreeSet<>(set); + set2.removeAll(STRICT_MODE_NON_KEYWORDS); + assertEquals(setToString(set2), conn.getMetaData().getSQLKeywords()); + } + set.add("INTERSECTS"); set.add("SYSDATE"); set.add("SYSTIME"); set.add("SYSTIMESTAMP"); diff --git a/h2/src/test/org/h2/test/unit/TestLocale.java b/h2/src/test/org/h2/test/unit/TestLocale.java index 72172d8d85..0c91b9f6cd 100644 --- a/h2/src/test/org/h2/test/unit/TestLocale.java +++ b/h2/src/test/org/h2/test/unit/TestLocale.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestMVTempResult.java b/h2/src/test/org/h2/test/unit/TestMVTempResult.java index 4e52ca3360..3dacb86ead 100644 --- a/h2/src/test/org/h2/test/unit/TestMVTempResult.java +++ b/h2/src/test/org/h2/test/unit/TestMVTempResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestMathUtils.java b/h2/src/test/org/h2/test/unit/TestMathUtils.java index ebce8d3a41..80b2e74428 100644 --- a/h2/src/test/org/h2/test/unit/TestMathUtils.java +++ b/h2/src/test/org/h2/test/unit/TestMathUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestMemoryEstimator.java b/h2/src/test/org/h2/test/unit/TestMemoryEstimator.java index 9c11626d57..31e0e4dc83 100644 --- a/h2/src/test/org/h2/test/unit/TestMemoryEstimator.java +++ b/h2/src/test/org/h2/test/unit/TestMemoryEstimator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestMemoryUnmapper.java b/h2/src/test/org/h2/test/unit/TestMemoryUnmapper.java index 28f6b50e27..c2d320cb7c 100644 --- a/h2/src/test/org/h2/test/unit/TestMemoryUnmapper.java +++ b/h2/src/test/org/h2/test/unit/TestMemoryUnmapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestMode.java b/h2/src/test/org/h2/test/unit/TestMode.java index ec7118c1e7..e8dd8a94fe 100644 --- a/h2/src/test/org/h2/test/unit/TestMode.java +++ b/h2/src/test/org/h2/test/unit/TestMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java b/h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java index 78805d68a5..658bf5dfac 100644 --- a/h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java +++ b/h2/src/test/org/h2/test/unit/TestMultiThreadedKernel.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestNetUtils.java b/h2/src/test/org/h2/test/unit/TestNetUtils.java index c2d51a6ffe..30bf100159 100644 --- a/h2/src/test/org/h2/test/unit/TestNetUtils.java +++ b/h2/src/test/org/h2/test/unit/TestNetUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Sergi Vladykin */ diff --git a/h2/src/test/org/h2/test/unit/TestObjectDeserialization.java b/h2/src/test/org/h2/test/unit/TestObjectDeserialization.java index 89f9aaf5d6..47274f014d 100644 --- a/h2/src/test/org/h2/test/unit/TestObjectDeserialization.java +++ b/h2/src/test/org/h2/test/unit/TestObjectDeserialization.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: Noah Fontes */ diff --git a/h2/src/test/org/h2/test/unit/TestOverflow.java b/h2/src/test/org/h2/test/unit/TestOverflow.java index 37c2e0fcdb..c23d34c858 100644 --- a/h2/src/test/org/h2/test/unit/TestOverflow.java +++ b/h2/src/test/org/h2/test/unit/TestOverflow.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java b/h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java index 9d2bad6913..6cbf7a5791 100644 --- a/h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java +++ b/h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestPattern.java b/h2/src/test/org/h2/test/unit/TestPattern.java index 6af04277d7..4a56deb722 100644 --- a/h2/src/test/org/h2/test/unit/TestPattern.java +++ b/h2/src/test/org/h2/test/unit/TestPattern.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestPerfectHash.java b/h2/src/test/org/h2/test/unit/TestPerfectHash.java index 55b3855ab6..bc8cac777c 100644 --- a/h2/src/test/org/h2/test/unit/TestPerfectHash.java +++ b/h2/src/test/org/h2/test/unit/TestPerfectHash.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestPgServer.java b/h2/src/test/org/h2/test/unit/TestPgServer.java index 55471e59bb..4a0a4741d7 100644 --- a/h2/src/test/org/h2/test/unit/TestPgServer.java +++ b/h2/src/test/org/h2/test/unit/TestPgServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestReader.java b/h2/src/test/org/h2/test/unit/TestReader.java index 3b5016512d..2ddb8fcb30 100644 --- a/h2/src/test/org/h2/test/unit/TestReader.java +++ b/h2/src/test/org/h2/test/unit/TestReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestRecovery.java b/h2/src/test/org/h2/test/unit/TestRecovery.java index 021baec210..3db1cc1d30 100644 --- a/h2/src/test/org/h2/test/unit/TestRecovery.java +++ b/h2/src/test/org/h2/test/unit/TestRecovery.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestReopen.java b/h2/src/test/org/h2/test/unit/TestReopen.java index 02422193c7..babf456eb9 100644 --- a/h2/src/test/org/h2/test/unit/TestReopen.java +++ b/h2/src/test/org/h2/test/unit/TestReopen.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestSampleApps.java b/h2/src/test/org/h2/test/unit/TestSampleApps.java index be072a3bd1..2bcafae5b2 100644 --- a/h2/src/test/org/h2/test/unit/TestSampleApps.java +++ b/h2/src/test/org/h2/test/unit/TestSampleApps.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestScriptReader.java b/h2/src/test/org/h2/test/unit/TestScriptReader.java index fbd5e358f5..6c430e9e76 100644 --- a/h2/src/test/org/h2/test/unit/TestScriptReader.java +++ b/h2/src/test/org/h2/test/unit/TestScriptReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestSecurity.java b/h2/src/test/org/h2/test/unit/TestSecurity.java index ae9c21d36a..7f3c97050c 100644 --- a/h2/src/test/org/h2/test/unit/TestSecurity.java +++ b/h2/src/test/org/h2/test/unit/TestSecurity.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestServlet.java b/h2/src/test/org/h2/test/unit/TestServlet.java index bd8283043c..8dd911ced6 100644 --- a/h2/src/test/org/h2/test/unit/TestServlet.java +++ b/h2/src/test/org/h2/test/unit/TestServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestShell.java b/h2/src/test/org/h2/test/unit/TestShell.java index 0d49cc77f9..36d9373293 100644 --- a/h2/src/test/org/h2/test/unit/TestShell.java +++ b/h2/src/test/org/h2/test/unit/TestShell.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestSort.java b/h2/src/test/org/h2/test/unit/TestSort.java index 970663c22d..ab7efe8e8b 100644 --- a/h2/src/test/org/h2/test/unit/TestSort.java +++ b/h2/src/test/org/h2/test/unit/TestSort.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestStreams.java b/h2/src/test/org/h2/test/unit/TestStreams.java index de4435c350..73a3c7cc36 100644 --- a/h2/src/test/org/h2/test/unit/TestStreams.java +++ b/h2/src/test/org/h2/test/unit/TestStreams.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestStringCache.java b/h2/src/test/org/h2/test/unit/TestStringCache.java index 9794bec0b2..ccfa2a18b9 100644 --- a/h2/src/test/org/h2/test/unit/TestStringCache.java +++ b/h2/src/test/org/h2/test/unit/TestStringCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestStringUtils.java b/h2/src/test/org/h2/test/unit/TestStringUtils.java index 6c2d1f3a7f..5115c4c374 100644 --- a/h2/src/test/org/h2/test/unit/TestStringUtils.java +++ b/h2/src/test/org/h2/test/unit/TestStringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java b/h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java index 3704040c71..5d29fce860 100644 --- a/h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java +++ b/h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestTools.java b/h2/src/test/org/h2/test/unit/TestTools.java index 49a574a831..69b8c9a0b2 100644 --- a/h2/src/test/org/h2/test/unit/TestTools.java +++ b/h2/src/test/org/h2/test/unit/TestTools.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -531,6 +531,19 @@ private void testJdbcDriverUtils() { } catch (SQLException e) { assertEquals("08001", e.getSQLState()); } + try { + JdbcUtils.getConnection("javax.naming.InitialContext", "ldap://localhost/ds", "sa", ""); + fail("Expected SQLException: 08001"); + } catch (SQLException e) { + assertEquals("08001", e.getSQLState()); + assertEquals("Only java scheme is supported for JNDI lookups", e.getMessage()); + } + try { + JdbcUtils.getConnection("org.h2.Driver", "jdbc:h2:mem:", "sa", "", null, true); + fail("Expected SQLException: " + ErrorCode.REMOTE_DATABASE_NOT_FOUND_1); + } catch (SQLException e) { + assertEquals(ErrorCode.REMOTE_DATABASE_NOT_FOUND_1, e.getErrorCode()); + } } private void testWrongServer() throws Exception { diff --git a/h2/src/test/org/h2/test/unit/TestTraceSystem.java b/h2/src/test/org/h2/test/unit/TestTraceSystem.java index 2c8e75c362..1c6c1e6af9 100644 --- a/h2/src/test/org/h2/test/unit/TestTraceSystem.java +++ b/h2/src/test/org/h2/test/unit/TestTraceSystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestUpgrade.java b/h2/src/test/org/h2/test/unit/TestUpgrade.java index b05eb01d73..b448560ec9 100644 --- a/h2/src/test/org/h2/test/unit/TestUpgrade.java +++ b/h2/src/test/org/h2/test/unit/TestUpgrade.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestUtils.java b/h2/src/test/org/h2/test/unit/TestUtils.java index a6993a1796..29fbefae65 100644 --- a/h2/src/test/org/h2/test/unit/TestUtils.java +++ b/h2/src/test/org/h2/test/unit/TestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestValue.java b/h2/src/test/org/h2/test/unit/TestValue.java index 77752f2aec..d04d2e18b5 100644 --- a/h2/src/test/org/h2/test/unit/TestValue.java +++ b/h2/src/test/org/h2/test/unit/TestValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/TestValueMemory.java b/h2/src/test/org/h2/test/unit/TestValueMemory.java index ebaa82b84e..96ac632472 100644 --- a/h2/src/test/org/h2/test/unit/TestValueMemory.java +++ b/h2/src/test/org/h2/test/unit/TestValueMemory.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/unit/package.html b/h2/src/test/org/h2/test/unit/package.html index f660b17c26..f87035f40d 100644 --- a/h2/src/test/org/h2/test/unit/package.html +++ b/h2/src/test/org/h2/test/unit/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/test/org/h2/test/utils/FilePathDebug.java b/h2/src/test/org/h2/test/utils/FilePathDebug.java index 8edaa45802..13144377a0 100644 --- a/h2/src/test/org/h2/test/utils/FilePathDebug.java +++ b/h2/src/test/org/h2/test/utils/FilePathDebug.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/FilePathReorderWrites.java b/h2/src/test/org/h2/test/utils/FilePathReorderWrites.java index 281458e1f8..a8d9c72f28 100644 --- a/h2/src/test/org/h2/test/utils/FilePathReorderWrites.java +++ b/h2/src/test/org/h2/test/utils/FilePathReorderWrites.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/FilePathUnstable.java b/h2/src/test/org/h2/test/utils/FilePathUnstable.java index 178ecbcc23..6343bf5ab6 100644 --- a/h2/src/test/org/h2/test/utils/FilePathUnstable.java +++ b/h2/src/test/org/h2/test/utils/FilePathUnstable.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/MemoryFootprint.java b/h2/src/test/org/h2/test/utils/MemoryFootprint.java index 1a083dfd13..ecfe077f82 100644 --- a/h2/src/test/org/h2/test/utils/MemoryFootprint.java +++ b/h2/src/test/org/h2/test/utils/MemoryFootprint.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/OutputCatcher.java b/h2/src/test/org/h2/test/utils/OutputCatcher.java index 0fb48ae992..ef9362199a 100644 --- a/h2/src/test/org/h2/test/utils/OutputCatcher.java +++ b/h2/src/test/org/h2/test/utils/OutputCatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/RandomDataUtils.java b/h2/src/test/org/h2/test/utils/RandomDataUtils.java index 9a96d0ad38..36b15e501c 100644 --- a/h2/src/test/org/h2/test/utils/RandomDataUtils.java +++ b/h2/src/test/org/h2/test/utils/RandomDataUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/ResultVerifier.java b/h2/src/test/org/h2/test/utils/ResultVerifier.java index 274f4dcb0f..ed5d73c75e 100644 --- a/h2/src/test/org/h2/test/utils/ResultVerifier.java +++ b/h2/src/test/org/h2/test/utils/ResultVerifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/SelfDestructor.java b/h2/src/test/org/h2/test/utils/SelfDestructor.java index a1abbaa3a8..6f11ffa745 100644 --- a/h2/src/test/org/h2/test/utils/SelfDestructor.java +++ b/h2/src/test/org/h2/test/utils/SelfDestructor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/test/org/h2/test/utils/package.html b/h2/src/test/org/h2/test/utils/package.html index 18ce176098..c2468caa43 100644 --- a/h2/src/test/org/h2/test/utils/package.html +++ b/h2/src/test/org/h2/test/utils/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/WEB-INF/console.html b/h2/src/tools/WEB-INF/console.html index 8175fefa3a..2ae76ab4a3 100644 --- a/h2/src/tools/WEB-INF/console.html +++ b/h2/src/tools/WEB-INF/console.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/WEB-INF/web.xml b/h2/src/tools/WEB-INF/web.xml index 5ae684b6d3..b1b067f3ca 100644 --- a/h2/src/tools/WEB-INF/web.xml +++ b/h2/src/tools/WEB-INF/web.xml @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/build/Build.java b/h2/src/tools/org/h2/build/Build.java index f26af99a22..7d23858a3b 100644 --- a/h2/src/tools/org/h2/build/Build.java +++ b/h2/src/tools/org/h2/build/Build.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -57,7 +57,9 @@ public class Build extends BuildBase { private static final String PGJDBC_HASH = "45fa6eef266aa80024ef2ab3688d9faa38c642e5"; - private static final String SERVLET_VERSION = "4.0.1"; + private static final String JAVAX_SERVLET_VERSION = "4.0.1"; + + private static final String JAKARTA_SERVLET_VERSION = "5.0.0"; private static final String SLF4J_VERSION = "1.7.30"; @@ -143,7 +145,8 @@ public void compile() { mkdir("temp"); download(); String classpath = "temp" + - File.pathSeparator + "ext/javax.servlet-api-" + SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/javax.servlet-api-" + JAVAX_SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/jakarta.servlet-api-" + JAKARTA_SERVLET_VERSION + ".jar" + File.pathSeparator + "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + @@ -181,14 +184,16 @@ public void compile() { exclude("*/package.html"); copy("temp", files, "src/test"); - javadoc("-sourcepath", "src/main", "org.h2.tools", "org.h2.jmx", + javadoc("-sourcepath", "src/main", + "-d", "docs/javadoc", + "org.h2.tools", "org.h2.jmx", "-classpath", "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + - File.pathSeparator + "ext/jts-core-" + JTS_VERSION + ".jar", - "-docletpath", "bin" + File.pathSeparator + "temp", - "-doclet", "org.h2.build.doclet.ResourceDoclet"); + File.pathSeparator + "ext/org.osgi.core-" + OSGI_VERSION + ".jar" + + File.pathSeparator + "ext/org.osgi.enterprise-" + OSGI_VERSION + ".jar" + + File.pathSeparator + "ext/jts-core-" + JTS_VERSION + ".jar"); files = files("src/main"). exclude("*.MF"). @@ -256,7 +261,8 @@ public void coverage() { delete(files("coverage/bin/META-INF/versions")); String cp = "coverage/bin" + File.pathSeparator + "ext/postgresql-" + PGJDBC_VERSION + ".jar" + - File.pathSeparator + "ext/javax.servlet-api-" + SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/javax.servlet-api-" + JAVAX_SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/jakarta.servlet-api-" + JAKARTA_SERVLET_VERSION + ".jar" + File.pathSeparator + "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + @@ -369,9 +375,12 @@ public void download() { } private void downloadOrVerify(boolean offline) { - downloadOrVerify("ext/javax.servlet-api-" + SERVLET_VERSION + ".jar", - "javax/servlet", "javax.servlet-api", SERVLET_VERSION, + downloadOrVerify("ext/javax.servlet-api-" + JAVAX_SERVLET_VERSION + ".jar", + "javax/servlet", "javax.servlet-api", JAVAX_SERVLET_VERSION, "a27082684a2ff0bf397666c3943496c44541d1ca", offline); + downloadOrVerify("ext/jakarta.servlet-api-" + JAKARTA_SERVLET_VERSION + ".jar", + "jakarta/servlet", "jakarta.servlet-api", JAKARTA_SERVLET_VERSION, + "2e6b8ccde55522c879434ddec3714683ccae6867", offline); downloadOrVerify("ext/lucene-core-" + LUCENE_VERSION + ".jar", "org/apache/lucene", "lucene-core", LUCENE_VERSION, "b275ca5f39b6dd45d5a7ecb49da65205ad2732ca", offline); @@ -578,16 +587,17 @@ public void javadoc() { compileTools(); delete("docs"); mkdir("docs/javadoc"); - javadoc("-sourcepath", "src/main", "org.h2.jdbc", "org.h2.jdbcx", + javadoc("-sourcepath", "src/main", + "-d", "docs/javadoc", + "org.h2.jdbc", "org.h2.jdbcx", "org.h2.tools", "org.h2.api", "org.h2.engine", "org.h2.fulltext", "-classpath", "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + - File.pathSeparator + "ext/jts-core-" + JTS_VERSION + ".jar", - "-docletpath", "bin" + File.pathSeparator + "temp", - "-doclet", "org.h2.build.doclet.Doclet"); - copy("docs/javadoc", files("src/docsrc/javadoc"), "src/docsrc/javadoc"); + File.pathSeparator + "ext/org.osgi.core-" + OSGI_VERSION + ".jar" + + File.pathSeparator + "ext/org.osgi.enterprise-" + OSGI_VERSION + ".jar" + + File.pathSeparator + "ext/jts-core-" + JTS_VERSION + ".jar"); } /** @@ -601,14 +611,13 @@ public void javadocImpl() { // need to be disabled if not enough memory File.pathSeparator + "src/test" + File.pathSeparator + "src/tools", - // need to be disabled for java 7 "-Xdoclint:all,-missing", "-noindex", - "-tag", "h2.resource", "-d", "docs/javadocImpl2", "-classpath", javaToolsJar + File.pathSeparator + "ext/slf4j-api-" + SLF4J_VERSION + ".jar" + - File.pathSeparator + "ext/javax.servlet-api-" + SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/javax.servlet-api-" + JAVAX_SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/jakarta.servlet-api-" + JAKARTA_SERVLET_VERSION + ".jar" + File.pathSeparator + "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + @@ -624,11 +633,11 @@ public void javadocImpl() { mkdir("docs/javadocImpl3"); javadoc("-sourcepath", "src/main", "-noindex", - "-tag", "h2.resource", "-d", "docs/javadocImpl3", "-classpath", javaToolsJar + File.pathSeparator + "ext/slf4j-api-" + SLF4J_VERSION + ".jar" + - File.pathSeparator + "ext/javax.servlet-api-" + SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/javax.servlet-api-" + JAVAX_SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/jakarta.servlet-api-" + JAKARTA_SERVLET_VERSION + ".jar" + File.pathSeparator + "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + @@ -643,9 +652,11 @@ public void javadocImpl() { javadoc("-sourcepath", "src/main" + File.pathSeparator + "src/test" + File.pathSeparator + "src/tools", + "-d", "docs/javadoc", "-classpath", javaToolsJar + File.pathSeparator + "ext/slf4j-api-" + SLF4J_VERSION + ".jar" + - File.pathSeparator + "ext/javax.servlet-api-" + SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/javax.servlet-api-" + JAVAX_SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/jakarta.servlet-api-" + JAKARTA_SERVLET_VERSION + ".jar" + File.pathSeparator + "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + @@ -656,10 +667,7 @@ public void javadocImpl() { File.pathSeparator + "ext/junit-jupiter-api-" + JUNIT_VERSION + ".jar" + File.pathSeparator + "ext/apiguardian-api-" + APIGUARDIAN_VERSION + ".jar", "-subpackages", "org.h2", - "-package", - "-docletpath", "bin" + File.pathSeparator + "temp", - "-doclet", "org.h2.build.doclet.Doclet"); - copy("docs/javadocImpl", files("src/docsrc/javadoc"), "src/docsrc/javadoc"); + "-package"); } private static void manifest(String path) { @@ -874,7 +882,8 @@ private void test(boolean ci) { downloadTest(); String cp = "temp" + File.pathSeparator + "bin" + File.pathSeparator + "ext/postgresql-" + PGJDBC_VERSION + ".jar" + - File.pathSeparator + "ext/javax.servlet-api-" + SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/javax.servlet-api-" + JAVAX_SERVLET_VERSION + ".jar" + + File.pathSeparator + "ext/jakarta.servlet-api-" + JAKARTA_SERVLET_VERSION + ".jar" + File.pathSeparator + "ext/lucene-core-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-analyzers-common-" + LUCENE_VERSION + ".jar" + File.pathSeparator + "ext/lucene-queryparser-" + LUCENE_VERSION + ".jar" + diff --git a/h2/src/tools/org/h2/build/BuildBase.java b/h2/src/tools/org/h2/build/BuildBase.java index ebbc7560ee..830747fc2a 100644 --- a/h2/src/tools/org/h2/build/BuildBase.java +++ b/h2/src/tools/org/h2/build/BuildBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -522,7 +522,12 @@ protected void javadoc(String...args) { "Generating ", })); } - Class clazz = Class.forName("com.sun.tools.javadoc.Main"); + Class clazz; + try { + clazz = Class.forName("jdk.javadoc.internal.tool.Main"); + } catch (Exception e) { + clazz = Class.forName("com.sun.tools.javadoc.Main"); + } Method execute = clazz.getMethod("execute", String[].class); result = (Integer) invoke(execute, null, new Object[] { args }); } catch (Exception e) { diff --git a/h2/src/tools/org/h2/build/code/AbbaDetect.java b/h2/src/tools/org/h2/build/code/AbbaDetect.java index 63d634e056..68bc0ab2d7 100644 --- a/h2/src/tools/org/h2/build/code/AbbaDetect.java +++ b/h2/src/tools/org/h2/build/code/AbbaDetect.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/code/CheckJavadoc.java b/h2/src/tools/org/h2/build/code/CheckJavadoc.java index 9055cc0566..a621e70fc8 100644 --- a/h2/src/tools/org/h2/build/code/CheckJavadoc.java +++ b/h2/src/tools/org/h2/build/code/CheckJavadoc.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/code/CheckTextFiles.java b/h2/src/tools/org/h2/build/code/CheckTextFiles.java index c2ce06e987..a8b3c2453b 100644 --- a/h2/src/tools/org/h2/build/code/CheckTextFiles.java +++ b/h2/src/tools/org/h2/build/code/CheckTextFiles.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -26,7 +26,7 @@ public class CheckTextFiles { private static final int MAX_SOURCE_LINE_SIZE = 120; // must contain "+" otherwise this here counts as well - private static final String COPYRIGHT1 = "Copyright 2004-2021"; + private static final String COPYRIGHT1 = "Copyright 2004-2022"; private static final String COPYRIGHT2 = "H2 Group."; private static final String LICENSE = "Multiple-Licensed " + "under the MPL 2.0"; diff --git a/h2/src/tools/org/h2/build/code/package.html b/h2/src/tools/org/h2/build/code/package.html index 1d78cf97ac..8f33d88b5b 100644 --- a/h2/src/tools/org/h2/build/code/package.html +++ b/h2/src/tools/org/h2/build/code/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/build/doc/BnfRailroad.java b/h2/src/tools/org/h2/build/doc/BnfRailroad.java index 1305e037ea..033c3ac149 100644 --- a/h2/src/tools/org/h2/build/doc/BnfRailroad.java +++ b/h2/src/tools/org/h2/build/doc/BnfRailroad.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/doc/BnfSyntax.java b/h2/src/tools/org/h2/build/doc/BnfSyntax.java index e4208ada0b..d1e8e6188e 100644 --- a/h2/src/tools/org/h2/build/doc/BnfSyntax.java +++ b/h2/src/tools/org/h2/build/doc/BnfSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/doc/FileConverter.java b/h2/src/tools/org/h2/build/doc/FileConverter.java index 66d1ddcd74..3d71af469f 100644 --- a/h2/src/tools/org/h2/build/doc/FileConverter.java +++ b/h2/src/tools/org/h2/build/doc/FileConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/doc/GenerateDoc.java b/h2/src/tools/org/h2/build/doc/GenerateDoc.java index 9adb49be82..4c7378324f 100644 --- a/h2/src/tools/org/h2/build/doc/GenerateDoc.java +++ b/h2/src/tools/org/h2/build/doc/GenerateDoc.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -70,8 +70,6 @@ private void run(String... args) throws Exception { bnf.linkStatements(); session.put("version", Constants.VERSION); session.put("versionDate", Constants.BUILD_DATE); - session.put("stableVersion", Constants.VERSION_STABLE); - session.put("stableVersionDate", Constants.BUILD_DATE_STABLE); session.put("downloadRoot", "https://github.com/h2database/h2database/releases/download/version-" + Constants.VERSION); String help = "SELECT ROWNUM ID, * FROM CSVREAD('" + diff --git a/h2/src/tools/org/h2/build/doc/LinkChecker.java b/h2/src/tools/org/h2/build/doc/LinkChecker.java index ae37b39a21..e857bf531d 100644 --- a/h2/src/tools/org/h2/build/doc/LinkChecker.java +++ b/h2/src/tools/org/h2/build/doc/LinkChecker.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -42,7 +42,8 @@ public class LinkChecker { "#functions_index", "#functions_aggregate_index", "#functions_window_index", - "#tutorial_index" + "#tutorial_index", + "docs/javadoc/" }; private static enum TargetKind { @@ -137,7 +138,8 @@ private void listExternalLinks() { private void listBadLinks() throws Exception { ArrayList errors = new ArrayList<>(); for (String link : links.keySet()) { - if (!link.startsWith("http") && !link.endsWith("h2.pdf")) { + if (!link.startsWith("http") && !link.endsWith("h2.pdf") + && /* For Javadoc 8 */ !link.startsWith("docs/javadoc")) { if (targets.get(link) == null) { errors.add(links.get(link) + ": Link missing " + link); } @@ -210,7 +212,8 @@ void processFile(Path file) throws IOException { } String ref = html.substring(start, end); if (!ref.startsWith("_")) { - targets.put(path + "#" + ref, TargetKind.ID); + targets.put(path + "#" + ref.replaceAll("%3C|<", "<").replaceAll("%3E|>", ">"), // + TargetKind.ID); } } // find all the href links in the document @@ -252,7 +255,10 @@ void processFile(Path file) throws IOException { ref = p + File.separator + ref; } if (ref != null) { - links.put(ref.replace('/', File.separatorChar), path); + links.put(ref.replace('/', File.separatorChar) // + .replaceAll("%5B", "[").replaceAll("%5D", "]") // + .replaceAll("%3C", "<").replaceAll("%3E", ">"), // + path); } } idx = -1; @@ -278,8 +284,9 @@ void processFile(Path file) throws IOException { if (type.equals("href")) { // already checked } else if (type.equals("id")) { + // For Javadoc 8 targets.put(path + "#" + ref, TargetKind.ID); - } else { + } else if (!type.equals("name")) { error(fileName, "Unsupported ", "
    ");
                     page = StringUtils.replaceAll(page, "", "");
                 }
    +            if (name.endsWith("changelog.html")) {
    +                page = page.replaceAll("Issue\\s+#?(\\d+)",
    +                        "Issue #$1");
    +                page = page.replaceAll("PR\\s+#?(\\d+)",
    +                        "PR #$1");
    +            }
                 bytes = page.getBytes(StandardCharsets.UTF_8);
             }
             Files.write(target, bytes);
    diff --git a/h2/src/tools/org/h2/build/doc/XMLChecker.java b/h2/src/tools/org/h2/build/doc/XMLChecker.java
    index c82e88f663..3bb0d65b91 100644
    --- a/h2/src/tools/org/h2/build/doc/XMLChecker.java
    +++ b/h2/src/tools/org/h2/build/doc/XMLChecker.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0,
    + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0,
      * and the EPL 1.0 (https://h2database.com/html/license.html).
      * Initial Developer: H2 Group
      */
    @@ -44,6 +44,15 @@ private static void run(String... args) throws Exception {
     
         private static void process(Path path) throws Exception {
             Files.walkFileTree(path, new SimpleFileVisitor() {
    +            @Override
    +            public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
    +                // For Javadoc 8
    +                if (dir.getFileName().toString().equals("javadoc")) {
    +                    return FileVisitResult.SKIP_SUBTREE;
    +                }
    +                return FileVisitResult.CONTINUE;
    +            }
    +
                 @Override
                 public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                     processFile(file);
    @@ -85,11 +94,11 @@ private static void checkXML(String xml, boolean html) throws Exception {
             // String lastElement = null;
             // 
  • : replace
  • ([^\r]*[^<]*) with
  • $1
  • // use this for html file, for example if
  • is not closed - String[] noClose = {}; + String[] noClose = {"br", "hr", "input", "link", "meta", "wbr"}; XMLParser parser = new XMLParser(xml); Stack stack = new Stack<>(); boolean rootElement = false; - while (true) { + loop: for (;;) { int event = parser.next(); if (event == XMLParser.END_DOCUMENT) { break; @@ -117,8 +126,7 @@ private static void checkXML(String xml, boolean html) throws Exception { if (html) { for (String n : noClose) { if (name.equals(n)) { - throw new Exception("Unnecessary closing element " - + name + " at " + parser.getRemaining()); + continue loop; } } } diff --git a/h2/src/tools/org/h2/build/doc/XMLParser.java b/h2/src/tools/org/h2/build/doc/XMLParser.java index d5ea592692..bf9cdaad85 100644 --- a/h2/src/tools/org/h2/build/doc/XMLParser.java +++ b/h2/src/tools/org/h2/build/doc/XMLParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/doc/buildNewsfeed.sql b/h2/src/tools/org/h2/build/doc/buildNewsfeed.sql index 38572873b0..bd04acf688 100644 --- a/h2/src/tools/org/h2/build/doc/buildNewsfeed.sql +++ b/h2/src/tools/org/h2/build/doc/buildNewsfeed.sql @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/doc/dictionary.txt b/h2/src/tools/org/h2/build/doc/dictionary.txt index 47e295763f..9e48dba39b 100644 --- a/h2/src/tools/org/h2/build/doc/dictionary.txt +++ b/h2/src/tools/org/h2/build/doc/dictionary.txt @@ -847,3 +847,4 @@ 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 diff --git a/h2/src/tools/org/h2/build/doc/package.html b/h2/src/tools/org/h2/build/doc/package.html index 71569e5021..339d88ba98 100644 --- a/h2/src/tools/org/h2/build/doc/package.html +++ b/h2/src/tools/org/h2/build/doc/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/build/doclet/Doclet.java b/h2/src/tools/org/h2/build/doclet/Doclet.java deleted file mode 100644 index b978b6b9c6..0000000000 --- a/h2/src/tools/org/h2/build/doclet/Doclet.java +++ /dev/null @@ -1,569 +0,0 @@ -/* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, - * and the EPL 1.0 (https://h2database.com/html/license.html). - * Initial Developer: H2 Group - */ -package org.h2.build.doclet; - -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashSet; -import org.h2.util.StringUtils; -import com.sun.javadoc.ClassDoc; -import com.sun.javadoc.ConstructorDoc; -import com.sun.javadoc.ExecutableMemberDoc; -import com.sun.javadoc.FieldDoc; -import com.sun.javadoc.LanguageVersion; -import com.sun.javadoc.MethodDoc; -import com.sun.javadoc.ParamTag; -import com.sun.javadoc.Parameter; -import com.sun.javadoc.RootDoc; -import com.sun.javadoc.Tag; -import com.sun.javadoc.ThrowsTag; -import com.sun.javadoc.Type; - -/** - * This class is a custom doclet implementation to generate the - * Javadoc for this product. - */ -public class Doclet { - - private static final boolean INTERFACES_ONLY = Boolean - .getBoolean("h2.interfacesOnly"); - private String destDir = System.getProperty("h2.javadocDestDir", - "docs/javadoc"); - private int errorCount; - private final HashSet errors = new HashSet<>(); - - /** - * This method is called by the javadoc framework and is required for all - * doclets. - * - * @param root the root - * @return true if successful - * @throws IOException on failure - */ - public static boolean start(RootDoc root) throws IOException { - return new Doclet().startDoc(root); - } - - private boolean startDoc(RootDoc root) throws IOException { - ClassDoc[] classes = root.classes(); - String[][] options = root.options(); - for (String[] op : options) { - if (op[0].equals("destdir")) { - destDir = op[1]; - } - } - for (ClassDoc clazz : classes) { - processClass(clazz); - } - if (errorCount > 0) { - new IOException("WARNING: " + errorCount + " javadoc issues found").printStackTrace(); - } - return true; - } - - private static String getClass(ClassDoc clazz) { - String name = clazz.name(); - if (clazz.qualifiedName().indexOf(".jdbc.") > 0 && name.startsWith("Jdbc")) { - return name.substring(4); - } - return name; - } - - private void processClass(ClassDoc clazz) throws IOException { - String packageName = clazz.containingPackage().name(); - String dir = destDir + "/" + packageName.replace('.', '/'); - Files.createDirectories(Paths.get(dir)); - String fileName = dir + "/" + clazz.name() + ".html"; - String className = getClass(clazz); - PrintWriter writer = new PrintWriter(Files.newBufferedWriter(Paths.get(fileName))); - writer.println(""); - String language = "en"; - writer.println(""); - writer.println("" + - ""); - writer.println(className); - writer.println("" + - ""); - writer.println(""); - writer.println(""); - writer.println("" + - "" + - "
    " + - "
    "); - writer.println("

    " + className + "

    "); - writer.println(formatText(clazz.commentText()) + "

    "); - - // methods - ConstructorDoc[] constructors = clazz.constructors(); - MethodDoc[] methods = clazz.methods(); - ExecutableMemberDoc[] constructorsMethods = - new ExecutableMemberDoc[constructors.length - + methods.length]; - System.arraycopy(constructors, 0, constructorsMethods, 0, - constructors.length); - System.arraycopy(methods, 0, constructorsMethods, constructors.length, - methods.length); - Arrays.sort(constructorsMethods, (a, b) -> { - // sort static method before non-static methods - if (a.isStatic() != b.isStatic()) { - return a.isStatic() ? -1 : 1; - } - return a.name().compareTo(b.name()); - }); - ArrayList signatures = new ArrayList<>(); - boolean hasMethods = false; - int id = 0; - for (int i = 0; i < constructorsMethods.length; i++) { - ExecutableMemberDoc method = constructorsMethods[i]; - String name = method.name(); - if (skipMethod(method)) { - continue; - } - if (!hasMethods) { - writer.println("" + - "" + - ""); - hasMethods = true; - } - String type = getTypeName(method.isStatic(), false, - getReturnType(method)); - writer.println(""); - writer.println(""); - writer.println(""); - writer.println(""); - id++; - } - if (hasMethods) { - writer.println("
    Methods
    " + type + - ""); - Parameter[] params = method.parameters(); - StringBuilder buff = new StringBuilder(); - StringBuilder buffSignature = new StringBuilder(name); - buff.append('('); - for (int j = 0; j < params.length; j++) { - if (j > 0) { - buff.append(", "); - } - buffSignature.append('_'); - Parameter param = params[j]; - boolean isVarArgs = method.isVarArgs() && j == params.length - 1; - String typeName = getTypeName(false, isVarArgs, param.type()); - buff.append(typeName); - buffSignature.append(StringUtils.replaceAll(typeName, "[]", "-")); - buff.append(' '); - buff.append(param.name()); - } - buff.append(')'); - if (isDeprecated(method)) { - name = "" + name + ""; - } - String signature = buffSignature.toString(); - while (signatures.size() < i) { - signatures.add(null); - } - signatures.add(i, signature); - writer.println("" + - name + "" + buff.toString()); - String firstSentence = getFirstSentence(method.firstSentenceTags()); - if (firstSentence != null) { - writer.println("
    " + - formatText(firstSentence) + "
    "); - } - writer.println("
    " + - type + ""); - writeMethodDetails(writer, clazz, method, signature); - writer.println("
    "); - } - - // field overview - FieldDoc[] fields = clazz.fields(); - if (clazz.interfaces().length > 0) { - fields = clazz.interfaces()[0].fields(); - } - Arrays.sort(fields, Comparator.comparing(FieldDoc::name)); - int fieldId = 0; - for (FieldDoc field : fields) { - if (skipField(clazz, field)) { - continue; - } - String name = field.name(); - String text = field.commentText(); - if (text == null || text.trim().length() == 0) { - addError("Undocumented field (" + - getLink(clazz, field.position().line()) + ") " + name); - } - if (text != null && text.startsWith("INTERNAL")) { - continue; - } - if (fieldId == 0) { - writer.println("
    "); - } - String type = getTypeName(true, false, field.type()); - writer.println(""); - fieldId++; - } - if (fieldId > 0) { - writer.println("
    Fields
    " + type + - ""); - String constant = field.constantValueExpression(); - - // add a link (a name) if there is a tag - String link = getFieldLink(text, constant, clazz, name); - writer.print("" + name + ""); - if (constant == null) { - writer.println(); - } else { - writer.println(" = " + constant); - } - writer.println("
    "); - } - - // field details - Arrays.sort(fields, (a, b) -> { - String ca = a.constantValueExpression(); - if (ca == null) { - ca = a.name(); - } - String cb = b.constantValueExpression(); - if (cb == null) { - cb = b.name(); - } - return ca.compareTo(cb); - }); - for (FieldDoc field : fields) { - writeFieldDetails(writer, clazz, field); - } - - writer.println("
    "); - writer.close(); - } - - private void writeFieldDetails(PrintWriter writer, ClassDoc clazz, - FieldDoc field) { - if (skipField(clazz, field)) { - return; - } - String text = field.commentText(); - if (text.startsWith("INTERNAL")) { - return; - } - String name = field.name(); - String constant = field.constantValueExpression(); - String link = getFieldLink(text, constant, clazz, name); - writer.println("

    " + - name); - if (constant == null) { - writer.println(); - } else { - writer.println(" = " + constant); - } - writer.println("

    "); - writer.println("
    " + formatText(text) + "
    "); - writer.println("
    "); - } - - private void writeMethodDetails(PrintWriter writer, ClassDoc clazz, - ExecutableMemberDoc method, String signature) { - String name = method.name(); - if (skipMethod(method)) { - return; - } - Parameter[] params = method.parameters(); - StringBuilder builder = new StringBuilder(); - builder.append('('); - for (int i = 0, l = params.length; i < l; i++) { - if (i > 0) { - builder.append(", "); - } - boolean isVarArgs = method.isVarArgs() && i == params.length - 1; - Parameter p = params[i]; - builder.append(getTypeName(false, isVarArgs, p.type())); - builder.append(' '); - builder.append(p.name()); - } - builder.append(')'); - ClassDoc[] exceptions = method.thrownExceptions(); - if (exceptions.length > 0) { - builder.append(" throws "); - for (int i = 0, l = exceptions.length; i < l; i++) { - if (i > 0) { - builder.append(", "); - } - builder.append(exceptions[i].typeName()); - } - } - if (isDeprecated(method)) { - name = "" + name + ""; - } - writer.println("" + - name + "" + builder.toString()); - boolean hasComment = method.commentText() != null && - method.commentText().trim().length() != 0; - writer.println("
    " + - formatText(method.commentText()) + "
    "); - ParamTag[] paramTags = method.paramTags(); - ThrowsTag[] throwsTags = method.throwsTags(); - boolean hasThrowsTag = throwsTags != null && throwsTags.length > 0; - if (paramTags.length != params.length) { - if (hasComment && !method.commentText().startsWith("[")) { - // [Not supported] and such are not problematic - addError("Undocumented parameter(s) (" + - getLink(clazz, method.position().line()) + ") " + - name + " documented: " + paramTags.length + - " params: "+ params.length); - } - } - for (int j = 0; j < paramTags.length; j++) { - String paramName = paramTags[j].parameterName(); - String comment = paramTags[j].parameterComment(); - if (comment.trim().length() == 0) { - addError("Undocumented parameter (" + - getLink(clazz, method.position().line()) + ") " + - name + " " + paramName); - } - String p = paramName + " - " + comment; - if (j == 0) { - writer.println("
    Parameters:
    "); - } - writer.println("
    " + p + "
    "); - } - Tag[] returnTags = method.tags("return"); - Type returnType = getReturnType(method); - if (returnTags != null && returnTags.length > 0) { - writer.println("
    Returns:
    "); - String returnComment = returnTags[0].text(); - if (returnComment.trim().length() == 0) { - addError("Undocumented return value (" + - getLink(clazz, method.position().line()) + ") " + name); - } - writer.println("
    " + returnComment + "
    "); - } else if (returnType != null && !returnType.toString().equals("void")) { - if (hasComment && !method.commentText().startsWith("[") && - !hasThrowsTag) { - // [Not supported] and such are not problematic - // also not problematic are methods that always throw an - // exception - addError("Undocumented return value (" - + getLink(clazz, method.position().line()) + ") " - + name + " " + getReturnType(method)); - } - } - if (hasThrowsTag) { - writer.println("
    Throws:
    "); - for (ThrowsTag tag : throwsTags) { - String p = tag.exceptionName(); - String c = tag.exceptionComment(); - if (c.length() > 0) { - p += " - " + c; - } - writer.println("
    " + p + "
    "); - } - } - } - - private static String getLink(ClassDoc clazz, int line) { - String c = clazz.name(); - int x = c.lastIndexOf('.'); - if (x >= 0) { - c = c.substring(0, x); - } - return c + ".java:" + line; - } - - private String getFieldLink(String text, String constant, ClassDoc clazz, - String name) { - String link = constant != null ? constant : name.toLowerCase(); - int linkStart = text.indexOf(""); - if (linkStart >= 0) { - int linkEnd = text.indexOf("", linkStart); - link = text.substring(linkStart + "".length(), linkEnd); - if (constant != null && !constant.equals(link)) { - System.out.println("Wrong code tag? " + clazz.name() + "." + - name + - " code: " + link + " constant: " + constant); - errorCount++; - } - } - if (link.startsWith("\"")) { - link = name; - } else if (Character.isDigit(link.charAt(0))) { - link = "c" + link; - } - return link; - } - - private static String formatText(String text) { - if (text == null) { - return text; - } - text = StringUtils.replaceAll(text, "\n
  • ", "
    "); - return text; - } - - private static boolean skipField(ClassDoc clazz, FieldDoc field) { - if (field.isPrivate() || field.isPackagePrivate() || field.containingClass() != clazz) { - return true; - } - if (field.isStatic() && field.isFinal() && "INSTANCE".equals(field.name())) { - return true; - } - return false; - } - - private boolean skipMethod(ExecutableMemberDoc method) { - ClassDoc clazz = method.containingClass(); - boolean isAbstract = method instanceof MethodDoc - && ((MethodDoc) method).isAbstract(); - boolean isInterface = clazz.isInterface() - || (clazz.isAbstract() && isAbstract); - if (INTERFACES_ONLY && !isInterface) { - return true; - } - String name = method.name(); - if (method.isPrivate() || method.isPackagePrivate() || name.equals("finalize")) { - return true; - } - if (method.isConstructor() - && method.getRawCommentText().trim().length() == 0) { - return true; - } - if (method.getRawCommentText().trim() - .startsWith("@deprecated INTERNAL")) { - return true; - } - String firstSentence = getFirstSentence(method.firstSentenceTags()); - String raw = method.getRawCommentText(); - if (firstSentence != null && firstSentence.startsWith("INTERNAL")) { - return true; - } - if ((firstSentence == null || firstSentence.trim().length() == 0) - && raw.indexOf("{@inheritDoc}") < 0) { - if (!doesOverride(method)) { - boolean setterOrGetter = name.startsWith("set") - && method.parameters().length == 1; - setterOrGetter |= name.startsWith("get") - && method.parameters().length == 0; - Type returnType = getReturnType(method); - setterOrGetter |= name.startsWith("is") - && method.parameters().length == 0 - && returnType != null - && returnType.toString().equals("boolean"); - boolean enumValueMethod = name.equals("values") || name.equals("valueOf"); - if (!setterOrGetter && !enumValueMethod) { - addError("Undocumented method " + " (" - + getLink(clazz, method.position().line()) + ") " - + clazz + "." + name + " " + raw); - return true; - } - } - } - return false; - } - - private static Type getReturnType(ExecutableMemberDoc method) { - if (method instanceof MethodDoc) { - MethodDoc m = (MethodDoc) method; - return m.returnType(); - } - return null; - } - - private void addError(String s) { - if (errors.add(s)) { - System.out.println(s); - errorCount++; - } - } - - private boolean doesOverride(ExecutableMemberDoc method) { - if (method.isConstructor()) { - return true; - } - ClassDoc clazz = method.containingClass(); - int parameterCount = method.parameters().length; - return foundMethod(clazz, false, method.name(), parameterCount); - } - - private boolean foundMethod(ClassDoc clazz, boolean include, - String methodName, int parameterCount) { - if (include) { - for (MethodDoc m : clazz.methods()) { - if (m.name().equals(methodName) - && m.parameters().length == parameterCount) { - return true; - } - } - } - for (ClassDoc doc : clazz.interfaces()) { - if (foundMethod(doc, true, methodName, parameterCount)) { - return true; - } - } - clazz = clazz.superclass(); - return clazz != null - && foundMethod(clazz, true, methodName, parameterCount); - } - - private static String getFirstSentence(Tag[] tags) { - String firstSentence = null; - if (tags.length > 0) { - Tag first = tags[0]; - firstSentence = first.text(); - } - return firstSentence; - } - - private static String getTypeName(boolean isStatic, boolean isVarArgs, - Type type) { - if (type == null) { - return ""; - } - String s = type.typeName() + type.dimension(); - if (isVarArgs) { - // remove the last "[]" and add "..." instead - s = s.substring(0, s.length() - 2) + "..."; - } - if (isStatic) { - s = "static " + s; - } - return s; - } - - private static boolean isDeprecated(ExecutableMemberDoc method) { - for (Tag t : method.tags()) { - if (t.kind().equals("@deprecated")) { - return true; - } - } - return false; - } - - /** - * Get the language version this doclet supports. - * - * @return the language version - */ - public static LanguageVersion languageVersion() { - // otherwise, isVarArgs always returns false - // (which sounds like a bug but is a feature :-) - return LanguageVersion.JAVA_1_5; - } - -} diff --git a/h2/src/tools/org/h2/build/doclet/ResourceDoclet.java b/h2/src/tools/org/h2/build/doclet/ResourceDoclet.java deleted file mode 100644 index 1d606856b0..0000000000 --- a/h2/src/tools/org/h2/build/doclet/ResourceDoclet.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, - * and the EPL 1.0 (https://h2database.com/html/license.html). - * Initial Developer: H2 Group - */ -package org.h2.build.doclet; - -import java.io.IOException; -import org.h2.build.doc.XMLParser; -import org.h2.build.indexer.HtmlConverter; -import org.h2.util.SortedProperties; -import com.sun.javadoc.ClassDoc; -import com.sun.javadoc.Doc; -import com.sun.javadoc.MethodDoc; -import com.sun.javadoc.RootDoc; -import com.sun.javadoc.Tag; - -/** - * This custom doclet generates resources from javadoc comments. - * Only comments that contain 'at resource' are included. - * Only class level and method level comments are supported. - */ -public class ResourceDoclet { - - private String destFile = System.getProperty("h2.javadocResourceFile", - "src/main/org/h2/res/javadoc.properties"); - - private final SortedProperties resources = new SortedProperties(); - - /** - * This method is called by the javadoc framework and is required for all - * doclets. - * - * @param root the root - * @return true if successful - * @throws IOException on failure - */ - public static boolean start(RootDoc root) throws IOException { - return new ResourceDoclet().startDoc(root); - } - - private boolean startDoc(RootDoc root) throws IOException { - ClassDoc[] classes = root.classes(); - String[][] options = root.options(); - for (String[] op : options) { - if (op[0].equals("dest")) { - destFile = op[1]; - } - } - for (ClassDoc clazz : classes) { - processClass(clazz); - } - resources.store(destFile); - return true; - } - - private void processClass(ClassDoc clazz) { - String packageName = clazz.containingPackage().name(); - String className = clazz.name(); - addResource(packageName + "." + className, clazz); - - for (MethodDoc method : clazz.methods()) { - String name = method.name(); - addResource(packageName + "." + className + "." + name, method); - } - } - - - private void addResource(String key, Doc doc) { - if (!isResource(doc)) { - return; - } - String xhtml = doc.commentText(); - XMLParser p = new XMLParser(xhtml); - StringBuilder buff = new StringBuilder(); - int column = 0; - int firstColumnSize = 0; - boolean inColumn = false; - while (p.hasNext()) { - String s; - switch (p.next()) { - case XMLParser.END_ELEMENT: - s = p.getName(); - if ("p".equals(s) || "tr".equals(s) || "br".equals(s)) { - buff.append('\n'); - } - break; - case XMLParser.START_ELEMENT: - s = p.getName(); - if ("table".equals(s)) { - buff.append('\n'); - } else if ("tr".equals(s)) { - column = 0; - } else if ("td".equals(s)) { - inColumn = true; - column++; - if (column == 2) { - buff.append('\t'); - } - } - break; - case XMLParser.CHARACTERS: - s = HtmlConverter.convertHtmlToString(p.getText().trim()); - if (inColumn && column == 1) { - firstColumnSize = Math.max(s.length(), firstColumnSize); - } - buff.append(s); - break; - } - } - for (int i = 0; i < buff.length(); i++) { - if (buff.charAt(i) == '\t') { - buff.deleteCharAt(i); - int length = i - buff.lastIndexOf("\n", i - 1); - for (int k = length; k < firstColumnSize + 3; k++) { - buff.insert(i, ' '); - } - } - } - String text = buff.toString().trim(); - resources.setProperty(key, text); - } - - private static boolean isResource(Doc doc) { - for (Tag t : doc.tags()) { - if (t.kind().equals("@h2.resource")) { - return true; - } - } - return false; - } - -} diff --git a/h2/src/tools/org/h2/build/doclet/package.html b/h2/src/tools/org/h2/build/doclet/package.html deleted file mode 100644 index 7ec8d0dda1..0000000000 --- a/h2/src/tools/org/h2/build/doclet/package.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - -Javadoc package documentation -

    - -A Javadoc doclet to build nicer and smaller API Javadoc HTML files. - -

    \ No newline at end of file diff --git a/h2/src/tools/org/h2/build/indexer/HtmlConverter.java b/h2/src/tools/org/h2/build/indexer/HtmlConverter.java index 5324ccf023..7d226a84e4 100644 --- a/h2/src/tools/org/h2/build/indexer/HtmlConverter.java +++ b/h2/src/tools/org/h2/build/indexer/HtmlConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/indexer/Indexer.java b/h2/src/tools/org/h2/build/indexer/Indexer.java index e003487af1..a324cce6c1 100644 --- a/h2/src/tools/org/h2/build/indexer/Indexer.java +++ b/h2/src/tools/org/h2/build/indexer/Indexer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/indexer/Page.java b/h2/src/tools/org/h2/build/indexer/Page.java index b1e20c864b..4950c9905c 100644 --- a/h2/src/tools/org/h2/build/indexer/Page.java +++ b/h2/src/tools/org/h2/build/indexer/Page.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/indexer/Weight.java b/h2/src/tools/org/h2/build/indexer/Weight.java index 08a6f296d1..f44a95ec81 100644 --- a/h2/src/tools/org/h2/build/indexer/Weight.java +++ b/h2/src/tools/org/h2/build/indexer/Weight.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/indexer/Word.java b/h2/src/tools/org/h2/build/indexer/Word.java index 0e241b25d7..4015491412 100644 --- a/h2/src/tools/org/h2/build/indexer/Word.java +++ b/h2/src/tools/org/h2/build/indexer/Word.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/build/indexer/package.html b/h2/src/tools/org/h2/build/indexer/package.html index 08291a0bfa..e982aed7a6 100644 --- a/h2/src/tools/org/h2/build/indexer/package.html +++ b/h2/src/tools/org/h2/build/indexer/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/build/package.html b/h2/src/tools/org/h2/build/package.html index f0b973c721..b4d57cdf3f 100644 --- a/h2/src/tools/org/h2/build/package.html +++ b/h2/src/tools/org/h2/build/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/cache/CacheLIRS.java b/h2/src/tools/org/h2/dev/cache/CacheLIRS.java index 5b651effc7..7667cb3a0c 100644 --- a/h2/src/tools/org/h2/dev/cache/CacheLIRS.java +++ b/h2/src/tools/org/h2/dev/cache/CacheLIRS.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/cache/package.html b/h2/src/tools/org/h2/dev/cache/package.html index e5f2d21880..b72f46deed 100644 --- a/h2/src/tools/org/h2/dev/cache/package.html +++ b/h2/src/tools/org/h2/dev/cache/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/cluster/ShardedMap.java b/h2/src/tools/org/h2/dev/cluster/ShardedMap.java index 3fc9df18cf..2ac17eb658 100644 --- a/h2/src/tools/org/h2/dev/cluster/ShardedMap.java +++ b/h2/src/tools/org/h2/dev/cluster/ShardedMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/cluster/package.html b/h2/src/tools/org/h2/dev/cluster/package.html index 83652f76a4..5e941c9d23 100644 --- a/h2/src/tools/org/h2/dev/cluster/package.html +++ b/h2/src/tools/org/h2/dev/cluster/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/fs/ArchiveTool.java b/h2/src/tools/org/h2/dev/fs/ArchiveTool.java index ea779a7c08..08128e953e 100644 --- a/h2/src/tools/org/h2/dev/fs/ArchiveTool.java +++ b/h2/src/tools/org/h2/dev/fs/ArchiveTool.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/fs/ArchiveToolStore.java b/h2/src/tools/org/h2/dev/fs/ArchiveToolStore.java index 42965aa31d..6324d2f26b 100644 --- a/h2/src/tools/org/h2/dev/fs/ArchiveToolStore.java +++ b/h2/src/tools/org/h2/dev/fs/ArchiveToolStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/fs/FilePathZip2.java b/h2/src/tools/org/h2/dev/fs/FilePathZip2.java index 9cac569c1b..92578827e0 100644 --- a/h2/src/tools/org/h2/dev/fs/FilePathZip2.java +++ b/h2/src/tools/org/h2/dev/fs/FilePathZip2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/fs/FileShell.java b/h2/src/tools/org/h2/dev/fs/FileShell.java index 13decbda37..be7ce88ba1 100644 --- a/h2/src/tools/org/h2/dev/fs/FileShell.java +++ b/h2/src/tools/org/h2/dev/fs/FileShell.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -52,7 +52,6 @@ public class FileShell extends Tool { * Execute the given commands and exit * * Multiple commands may be executed if separated by ; - * @h2.resource * * @param args the command line arguments * @throws SQLException on failure diff --git a/h2/src/tools/org/h2/dev/fs/package.html b/h2/src/tools/org/h2/dev/fs/package.html index 96b92564d3..e541d95b76 100644 --- a/h2/src/tools/org/h2/dev/fs/package.html +++ b/h2/src/tools/org/h2/dev/fs/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/ftp/FtpClient.java b/h2/src/tools/org/h2/dev/ftp/FtpClient.java index a060842d16..faf1f36239 100644 --- a/h2/src/tools/org/h2/dev/ftp/FtpClient.java +++ b/h2/src/tools/org/h2/dev/ftp/FtpClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/ftp/package.html b/h2/src/tools/org/h2/dev/ftp/package.html index b8878dd33f..fcfd171c67 100644 --- a/h2/src/tools/org/h2/dev/ftp/package.html +++ b/h2/src/tools/org/h2/dev/ftp/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/ftp/server/FtpControl.java b/h2/src/tools/org/h2/dev/ftp/server/FtpControl.java index 939e0fc1cf..7e0a42e22e 100644 --- a/h2/src/tools/org/h2/dev/ftp/server/FtpControl.java +++ b/h2/src/tools/org/h2/dev/ftp/server/FtpControl.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/ftp/server/FtpData.java b/h2/src/tools/org/h2/dev/ftp/server/FtpData.java index b5fe7d85b5..6faf76518b 100644 --- a/h2/src/tools/org/h2/dev/ftp/server/FtpData.java +++ b/h2/src/tools/org/h2/dev/ftp/server/FtpData.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/ftp/server/FtpEvent.java b/h2/src/tools/org/h2/dev/ftp/server/FtpEvent.java index 3078871b2f..55f91f8242 100644 --- a/h2/src/tools/org/h2/dev/ftp/server/FtpEvent.java +++ b/h2/src/tools/org/h2/dev/ftp/server/FtpEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/ftp/server/FtpEventListener.java b/h2/src/tools/org/h2/dev/ftp/server/FtpEventListener.java index f59b105eef..e01a19aa9d 100644 --- a/h2/src/tools/org/h2/dev/ftp/server/FtpEventListener.java +++ b/h2/src/tools/org/h2/dev/ftp/server/FtpEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/ftp/server/FtpServer.java b/h2/src/tools/org/h2/dev/ftp/server/FtpServer.java index e1d879ffb1..176e5f1f60 100644 --- a/h2/src/tools/org/h2/dev/ftp/server/FtpServer.java +++ b/h2/src/tools/org/h2/dev/ftp/server/FtpServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ @@ -146,7 +146,6 @@ public class FtpServer extends Tool implements Service { * [-trace] * Print additional trace information; for all servers * - * @h2.resource * * @param args the command line arguments */ diff --git a/h2/src/tools/org/h2/dev/ftp/server/package.html b/h2/src/tools/org/h2/dev/ftp/server/package.html index 8c10f93ebd..29801cdf07 100644 --- a/h2/src/tools/org/h2/dev/ftp/server/package.html +++ b/h2/src/tools/org/h2/dev/ftp/server/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/hash/IntPerfectHash.java b/h2/src/tools/org/h2/dev/hash/IntPerfectHash.java index 9d0f1877cd..58db01ff78 100644 --- a/h2/src/tools/org/h2/dev/hash/IntPerfectHash.java +++ b/h2/src/tools/org/h2/dev/hash/IntPerfectHash.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/hash/MinimalPerfectHash.java b/h2/src/tools/org/h2/dev/hash/MinimalPerfectHash.java index 2049cf9d6e..3019f11b93 100644 --- a/h2/src/tools/org/h2/dev/hash/MinimalPerfectHash.java +++ b/h2/src/tools/org/h2/dev/hash/MinimalPerfectHash.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/hash/PerfectHash.java b/h2/src/tools/org/h2/dev/hash/PerfectHash.java index e9ea64930f..185c942ec1 100644 --- a/h2/src/tools/org/h2/dev/hash/PerfectHash.java +++ b/h2/src/tools/org/h2/dev/hash/PerfectHash.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/hash/package.html b/h2/src/tools/org/h2/dev/hash/package.html index 49031fa5d2..f8d85f7907 100644 --- a/h2/src/tools/org/h2/dev/hash/package.html +++ b/h2/src/tools/org/h2/dev/hash/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/mail/SendMail.java.txt b/h2/src/tools/org/h2/dev/mail/SendMail.java.txt index a3182159cd..26018958b7 100644 --- a/h2/src/tools/org/h2/dev/mail/SendMail.java.txt +++ b/h2/src/tools/org/h2/dev/mail/SendMail.java.txt @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/net/PgTcpRedirect.java b/h2/src/tools/org/h2/dev/net/PgTcpRedirect.java index a845e8c77c..71ce3f98f1 100644 --- a/h2/src/tools/org/h2/dev/net/PgTcpRedirect.java +++ b/h2/src/tools/org/h2/dev/net/PgTcpRedirect.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/net/package.html b/h2/src/tools/org/h2/dev/net/package.html index 75e7394cee..4900db526b 100644 --- a/h2/src/tools/org/h2/dev/net/package.html +++ b/h2/src/tools/org/h2/dev/net/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/security/SecureKeyStoreBuilder.java b/h2/src/tools/org/h2/dev/security/SecureKeyStoreBuilder.java index 24784ed7fe..7deed4834c 100644 --- a/h2/src/tools/org/h2/dev/security/SecureKeyStoreBuilder.java +++ b/h2/src/tools/org/h2/dev/security/SecureKeyStoreBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/security/package.html b/h2/src/tools/org/h2/dev/security/package.html index 80bbd4b6e6..cb45245dd9 100644 --- a/h2/src/tools/org/h2/dev/security/package.html +++ b/h2/src/tools/org/h2/dev/security/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/sort/InPlaceStableMergeSort.java b/h2/src/tools/org/h2/dev/sort/InPlaceStableMergeSort.java index 7f33d692a4..a442391953 100644 --- a/h2/src/tools/org/h2/dev/sort/InPlaceStableMergeSort.java +++ b/h2/src/tools/org/h2/dev/sort/InPlaceStableMergeSort.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/sort/InPlaceStableQuicksort.java b/h2/src/tools/org/h2/dev/sort/InPlaceStableQuicksort.java index e921232064..dd0632e6ff 100644 --- a/h2/src/tools/org/h2/dev/sort/InPlaceStableQuicksort.java +++ b/h2/src/tools/org/h2/dev/sort/InPlaceStableQuicksort.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/sort/package.html b/h2/src/tools/org/h2/dev/sort/package.html index 80e7ccf87a..3632158b6a 100644 --- a/h2/src/tools/org/h2/dev/sort/package.html +++ b/h2/src/tools/org/h2/dev/sort/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/dev/util/AnsCompression.java b/h2/src/tools/org/h2/dev/util/AnsCompression.java index ae77e9633c..c27c8e37f4 100644 --- a/h2/src/tools/org/h2/dev/util/AnsCompression.java +++ b/h2/src/tools/org/h2/dev/util/AnsCompression.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ArrayUtils.java b/h2/src/tools/org/h2/dev/util/ArrayUtils.java index d7269c6935..657d7eafdb 100644 --- a/h2/src/tools/org/h2/dev/util/ArrayUtils.java +++ b/h2/src/tools/org/h2/dev/util/ArrayUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/Base64.java b/h2/src/tools/org/h2/dev/util/Base64.java index e8819373b2..3606adfb02 100644 --- a/h2/src/tools/org/h2/dev/util/Base64.java +++ b/h2/src/tools/org/h2/dev/util/Base64.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/BinaryArithmeticStream.java b/h2/src/tools/org/h2/dev/util/BinaryArithmeticStream.java index c1eb37d926..e0cacb29b8 100644 --- a/h2/src/tools/org/h2/dev/util/BinaryArithmeticStream.java +++ b/h2/src/tools/org/h2/dev/util/BinaryArithmeticStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/BitStream.java b/h2/src/tools/org/h2/dev/util/BitStream.java index be007dc4c7..7968a4a4f2 100644 --- a/h2/src/tools/org/h2/dev/util/BitStream.java +++ b/h2/src/tools/org/h2/dev/util/BitStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ConcurrentLinkedList.java b/h2/src/tools/org/h2/dev/util/ConcurrentLinkedList.java index 272f65ea13..bf82210857 100644 --- a/h2/src/tools/org/h2/dev/util/ConcurrentLinkedList.java +++ b/h2/src/tools/org/h2/dev/util/ConcurrentLinkedList.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ConcurrentLinkedListWithTail.java b/h2/src/tools/org/h2/dev/util/ConcurrentLinkedListWithTail.java index e82071cd5e..72a2ebd786 100644 --- a/h2/src/tools/org/h2/dev/util/ConcurrentLinkedListWithTail.java +++ b/h2/src/tools/org/h2/dev/util/ConcurrentLinkedListWithTail.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ConcurrentRing.java b/h2/src/tools/org/h2/dev/util/ConcurrentRing.java index fe6bd38e7e..73a06edd5e 100644 --- a/h2/src/tools/org/h2/dev/util/ConcurrentRing.java +++ b/h2/src/tools/org/h2/dev/util/ConcurrentRing.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/FileContentHash.java b/h2/src/tools/org/h2/dev/util/FileContentHash.java index 24d7fe9fe4..f815c37f6e 100644 --- a/h2/src/tools/org/h2/dev/util/FileContentHash.java +++ b/h2/src/tools/org/h2/dev/util/FileContentHash.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/FileViewer.java b/h2/src/tools/org/h2/dev/util/FileViewer.java index 4262005f88..d92cd51f36 100644 --- a/h2/src/tools/org/h2/dev/util/FileViewer.java +++ b/h2/src/tools/org/h2/dev/util/FileViewer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ImmutableArray.java b/h2/src/tools/org/h2/dev/util/ImmutableArray.java index fc88d8be6b..2cdcfb239b 100644 --- a/h2/src/tools/org/h2/dev/util/ImmutableArray.java +++ b/h2/src/tools/org/h2/dev/util/ImmutableArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ImmutableArray2.java b/h2/src/tools/org/h2/dev/util/ImmutableArray2.java index e029b9d708..3e4130fbfe 100644 --- a/h2/src/tools/org/h2/dev/util/ImmutableArray2.java +++ b/h2/src/tools/org/h2/dev/util/ImmutableArray2.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ImmutableArray3.java b/h2/src/tools/org/h2/dev/util/ImmutableArray3.java index 9d91ee3815..93cde7be31 100644 --- a/h2/src/tools/org/h2/dev/util/ImmutableArray3.java +++ b/h2/src/tools/org/h2/dev/util/ImmutableArray3.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/JavaProcessKiller.java b/h2/src/tools/org/h2/dev/util/JavaProcessKiller.java index cc75284f81..4a45487e7f 100644 --- a/h2/src/tools/org/h2/dev/util/JavaProcessKiller.java +++ b/h2/src/tools/org/h2/dev/util/JavaProcessKiller.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/Migrate.java b/h2/src/tools/org/h2/dev/util/Migrate.java index 894fb4833b..b9e647a88d 100644 --- a/h2/src/tools/org/h2/dev/util/Migrate.java +++ b/h2/src/tools/org/h2/dev/util/Migrate.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ReaderInputStream.java b/h2/src/tools/org/h2/dev/util/ReaderInputStream.java index d558e53ca8..1bb9c6a74c 100644 --- a/h2/src/tools/org/h2/dev/util/ReaderInputStream.java +++ b/h2/src/tools/org/h2/dev/util/ReaderInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/RemovePasswords.java b/h2/src/tools/org/h2/dev/util/RemovePasswords.java index a40a7cf616..9b915923f9 100644 --- a/h2/src/tools/org/h2/dev/util/RemovePasswords.java +++ b/h2/src/tools/org/h2/dev/util/RemovePasswords.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ThreadDumpCleaner.java b/h2/src/tools/org/h2/dev/util/ThreadDumpCleaner.java index bb3647c60d..0405a9057e 100644 --- a/h2/src/tools/org/h2/dev/util/ThreadDumpCleaner.java +++ b/h2/src/tools/org/h2/dev/util/ThreadDumpCleaner.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ThreadDumpFilter.java b/h2/src/tools/org/h2/dev/util/ThreadDumpFilter.java index b6269d67b2..acac8b9372 100644 --- a/h2/src/tools/org/h2/dev/util/ThreadDumpFilter.java +++ b/h2/src/tools/org/h2/dev/util/ThreadDumpFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/ThreadDumpInliner.java b/h2/src/tools/org/h2/dev/util/ThreadDumpInliner.java index 2c74e99249..0ab1755a11 100644 --- a/h2/src/tools/org/h2/dev/util/ThreadDumpInliner.java +++ b/h2/src/tools/org/h2/dev/util/ThreadDumpInliner.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/dev/util/package.html b/h2/src/tools/org/h2/dev/util/package.html index 54bea42514..39f23a4632 100644 --- a/h2/src/tools/org/h2/dev/util/package.html +++ b/h2/src/tools/org/h2/dev/util/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/java/ClassObj.java b/h2/src/tools/org/h2/java/ClassObj.java index dc34724e04..88a84beb2d 100644 --- a/h2/src/tools/org/h2/java/ClassObj.java +++ b/h2/src/tools/org/h2/java/ClassObj.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/Expr.java b/h2/src/tools/org/h2/java/Expr.java index a0eecb28aa..ed72d184bd 100644 --- a/h2/src/tools/org/h2/java/Expr.java +++ b/h2/src/tools/org/h2/java/Expr.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/Ignore.java b/h2/src/tools/org/h2/java/Ignore.java index f203bc2333..1ed8d3708f 100644 --- a/h2/src/tools/org/h2/java/Ignore.java +++ b/h2/src/tools/org/h2/java/Ignore.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/JavaParser.java b/h2/src/tools/org/h2/java/JavaParser.java index ff12e99264..9eadb1ddae 100644 --- a/h2/src/tools/org/h2/java/JavaParser.java +++ b/h2/src/tools/org/h2/java/JavaParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/Local.java b/h2/src/tools/org/h2/java/Local.java index 13d0e57c3d..2df19d9527 100644 --- a/h2/src/tools/org/h2/java/Local.java +++ b/h2/src/tools/org/h2/java/Local.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/Statement.java b/h2/src/tools/org/h2/java/Statement.java index 389879c4e0..13a5b2e8bf 100644 --- a/h2/src/tools/org/h2/java/Statement.java +++ b/h2/src/tools/org/h2/java/Statement.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/Test.java b/h2/src/tools/org/h2/java/Test.java index 1c2f737319..9ce40aece4 100644 --- a/h2/src/tools/org/h2/java/Test.java +++ b/h2/src/tools/org/h2/java/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/TestApp.java b/h2/src/tools/org/h2/java/TestApp.java index e7426541fa..cd848c6869 100644 --- a/h2/src/tools/org/h2/java/TestApp.java +++ b/h2/src/tools/org/h2/java/TestApp.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/io/PrintStream.java b/h2/src/tools/org/h2/java/io/PrintStream.java index 31e2752aee..4eed18ddb9 100644 --- a/h2/src/tools/org/h2/java/io/PrintStream.java +++ b/h2/src/tools/org/h2/java/io/PrintStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/io/package.html b/h2/src/tools/org/h2/java/io/package.html index 7e8e31f044..fb9167e95f 100644 --- a/h2/src/tools/org/h2/java/io/package.html +++ b/h2/src/tools/org/h2/java/io/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/java/lang/Integer.java b/h2/src/tools/org/h2/java/lang/Integer.java index e3f3234660..94e98755e9 100644 --- a/h2/src/tools/org/h2/java/lang/Integer.java +++ b/h2/src/tools/org/h2/java/lang/Integer.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/lang/Long.java b/h2/src/tools/org/h2/java/lang/Long.java index 73926eb3cc..fa99c22cd4 100644 --- a/h2/src/tools/org/h2/java/lang/Long.java +++ b/h2/src/tools/org/h2/java/lang/Long.java @@ -1,6 +1,6 @@ /* /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/lang/Math.java b/h2/src/tools/org/h2/java/lang/Math.java index 825573a223..f32cc63669 100644 --- a/h2/src/tools/org/h2/java/lang/Math.java +++ b/h2/src/tools/org/h2/java/lang/Math.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/lang/Object.java b/h2/src/tools/org/h2/java/lang/Object.java index ddf01fb9c4..2f7fb39921 100644 --- a/h2/src/tools/org/h2/java/lang/Object.java +++ b/h2/src/tools/org/h2/java/lang/Object.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/lang/String.java b/h2/src/tools/org/h2/java/lang/String.java index d314f4f7f5..7f316c6041 100644 --- a/h2/src/tools/org/h2/java/lang/String.java +++ b/h2/src/tools/org/h2/java/lang/String.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/lang/StringBuilder.java b/h2/src/tools/org/h2/java/lang/StringBuilder.java index e67b3c68e7..3d7eb79f11 100644 --- a/h2/src/tools/org/h2/java/lang/StringBuilder.java +++ b/h2/src/tools/org/h2/java/lang/StringBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/lang/System.java b/h2/src/tools/org/h2/java/lang/System.java index 6823292347..ba75438608 100644 --- a/h2/src/tools/org/h2/java/lang/System.java +++ b/h2/src/tools/org/h2/java/lang/System.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/lang/package.html b/h2/src/tools/org/h2/java/lang/package.html index 7e8e31f044..fb9167e95f 100644 --- a/h2/src/tools/org/h2/java/lang/package.html +++ b/h2/src/tools/org/h2/java/lang/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/java/package.html b/h2/src/tools/org/h2/java/package.html index 362d6c8934..0beb44f98c 100644 --- a/h2/src/tools/org/h2/java/package.html +++ b/h2/src/tools/org/h2/java/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/java/util/Arrays.java b/h2/src/tools/org/h2/java/util/Arrays.java index ad3be49d2e..463625c980 100644 --- a/h2/src/tools/org/h2/java/util/Arrays.java +++ b/h2/src/tools/org/h2/java/util/Arrays.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/java/util/package.html b/h2/src/tools/org/h2/java/util/package.html index 7e8e31f044..fb9167e95f 100644 --- a/h2/src/tools/org/h2/java/util/package.html +++ b/h2/src/tools/org/h2/java/util/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/jcr/Railroads.java b/h2/src/tools/org/h2/jcr/Railroads.java index e37656f728..21d167bddf 100644 --- a/h2/src/tools/org/h2/jcr/Railroads.java +++ b/h2/src/tools/org/h2/jcr/Railroads.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ diff --git a/h2/src/tools/org/h2/jcr/help.csv b/h2/src/tools/org/h2/jcr/help.csv index 1e0d298751..2040b35e94 100644 --- a/h2/src/tools/org/h2/jcr/help.csv +++ b/h2/src/tools/org/h2/jcr/help.csv @@ -1,4 +1,4 @@ -# Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, +# Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, # and the EPL 1.0 (https://h2database.com/html/license.html). # Initial Developer: H2 Group) diff --git a/h2/src/tools/org/h2/jcr/jcr-sql2.html b/h2/src/tools/org/h2/jcr/jcr-sql2.html index df9b1ed875..4cf12dcc2d 100644 --- a/h2/src/tools/org/h2/jcr/jcr-sql2.html +++ b/h2/src/tools/org/h2/jcr/jcr-sql2.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/jcr/package.html b/h2/src/tools/org/h2/jcr/package.html index 88686711ad..225645d0ff 100644 --- a/h2/src/tools/org/h2/jcr/package.html +++ b/h2/src/tools/org/h2/jcr/package.html @@ -1,6 +1,6 @@ diff --git a/h2/src/tools/org/h2/jcr/stylesheet.css b/h2/src/tools/org/h2/jcr/stylesheet.css index 0a370144c0..47ea40c2a4 100644 --- a/h2/src/tools/org/h2/jcr/stylesheet.css +++ b/h2/src/tools/org/h2/jcr/stylesheet.css @@ -1,5 +1,5 @@ /* - * Copyright 2004-2021 H2 Group. Multiple-Licensed under the MPL 2.0, + * Copyright 2004-2022 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */