diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index 22c6b80..55d839d 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -22,7 +22,7 @@ jobs: } steps: - id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { persist-credentials: false } diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f337f8e..6179605 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -33,12 +33,12 @@ jobs: fail-fast: false matrix: exasol_db_version: [ - 2025.2.1, - 2025.1.10 + 2026.1.0, + 2025.1.13 ] env: { - DEFAULT_EXASOL_DB_VERSION: 2025.2.1 + DEFAULT_EXASOL_DB_VERSION: 2026.1.0 } steps: - name: Free Disk Space @@ -49,7 +49,7 @@ jobs: sudo rm -rf /usr/share/dotnet - name: Checkout the repository id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { fetch-depth: 0, persist-credentials: false @@ -61,11 +61,11 @@ jobs: distribution: temurin java-version: |- 11 - 17 + 21 cache: maven - name: Cache SonarCloud packages id: cache-sonar - uses: actions/cache@v5 + uses: actions/cache@v6 with: { path: ~/.sonar/cache, key: '${{ runner.os }}-sonar', @@ -107,7 +107,35 @@ jobs: } - name: Verify Release Artifacts id: verify-release-artifacts - run: "print_message() {\n local -r message=$1\n echo \"$message\"\n echo \"$message\" >> \"$GITHUB_STEP_SUMMARY\"\n}\n\nprint_message \"### Release Artifacts\"\n\nIFS=$'\\n' artifacts_array=($ARTIFACTS)\nmissing_files=()\nfor file in \"${artifacts_array[@]}\";\ndo \n echo \"Checking if file $file exists...\"\n if ! [[ -f \"$file\" ]]; then\n print_message \"* ⚠️ \\`$file\\` does not exist ⚠️\"\n echo \"Content of directory $(dirname \"$file\"):\"\n ls \"$(dirname \"$file\")\"\n missing_files+=(\"$file\")\n else\n print_message \"* \\`$file\\` ✅\" \n fi\ndone\nprint_message \"\"\nnumber_of_missing_files=${#missing_files[@]}\nif [[ $number_of_missing_files -gt 0 ]]; then\n print_message \"⚠️ $number_of_missing_files release artifact(s) missing ⚠️\"\n exit 1\nfi\n" + run: | + print_message() { + local -r message=$1 + echo "$message" + echo "$message" >> "$GITHUB_STEP_SUMMARY" + } + + print_message "### Release Artifacts" + + IFS=$'\n' artifacts_array=($ARTIFACTS) + missing_files=() + for file in "${artifacts_array[@]}"; + do + echo "Checking if file $file exists..." + if ! [[ -f "$file" ]]; then + print_message "* ⚠️ \`$file\` does not exist ⚠️" + echo "Content of directory $(dirname "$file"):" + ls "$(dirname "$file")" + missing_files+=("$file") + else + print_message "* \`$file\` ✅" + fi + done + print_message "" + number_of_missing_files=${#missing_files[@]} + if [[ $number_of_missing_files -gt 0 ]]; then + print_message "⚠️ $number_of_missing_files release artifact(s) missing ⚠️" + exit 1 + fi env: { ARTIFACTS: '${{ steps.build-pk-verify.outputs.release-artifacts }}' } @@ -152,7 +180,7 @@ jobs: steps: - name: Checkout the repository id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { fetch-depth: 0, persist-credentials: false @@ -187,7 +215,7 @@ jobs: steps: - name: Checkout the repository id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { persist-credentials: false } @@ -198,7 +226,7 @@ jobs: distribution: temurin java-version: |- 11 - 17 + 21 cache: maven server-id: ossindex server-username: OSSINDEX_USERNAME @@ -232,13 +260,13 @@ jobs: steps: - name: Checkout the repository id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { persist-credentials: false } - name: Lint GitHub actions with Zizmore id: lint-github-actions - uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e + uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa with: { advanced-security: false } @@ -264,7 +292,7 @@ jobs: steps: - name: Checkout the repository id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { fetch-depth: 0, persist-credentials: false @@ -276,7 +304,7 @@ jobs: distribution: temurin java-version: |- 11 - 17 + 21 cache: maven - name: Check if release is needed id: check-release diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index b006a34..fa5164f 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { persist-credentials: false } @@ -38,7 +38,7 @@ jobs: distribution: temurin java-version: |- 11 - 17 + 21 cache: maven server-id: ossindex server-username: OSSINDEX_USERNAME @@ -56,7 +56,7 @@ jobs: } - name: Create GitHub Issues id: create-security-issues - uses: exasol/python-toolbox/.github/actions/security-issues@6.4.0 + uses: exasol/python-toolbox/.github/actions/security-issues@10.1.0 with: { format: maven, command: cat ossindex-report.json, diff --git a/.github/workflows/dependencies_update.yml b/.github/workflows/dependencies_update.yml index 73478fe..1986eae 100644 --- a/.github/workflows/dependencies_update.yml +++ b/.github/workflows/dependencies_update.yml @@ -34,7 +34,7 @@ jobs: cancel-in-progress: false } steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 id: checkout with: { fetch-depth: 0, @@ -47,7 +47,7 @@ jobs: distribution: temurin java-version: |- 11 - 17 + 21 cache: maven - name: Print issues id: debug-print-issues diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5baca97..1b177b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,7 +75,7 @@ jobs: steps: - name: Checkout the repository id: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: { fetch-depth: 0, persist-credentials: true @@ -88,7 +88,7 @@ jobs: distribution: temurin java-version: |- 11 - 17 + 21 server-id: maven-central-portal server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD @@ -102,7 +102,7 @@ jobs: distribution: temurin java-version: |- 11 - 17 + 21 cache: maven - name: Fail if not running on main or release branch id: check-main-or-release-branch diff --git a/.github/zizmor.yml b/.github/zizmor.yml index bd1b52d..a8508a1 100644 --- a/.github/zizmor.yml +++ b/.github/zizmor.yml @@ -20,8 +20,10 @@ rules: obfuscation: ignore: # Generated workflows use boolean conditions like ${{ false }} + # Note: We cannot exclude this using inline comments because GitHubWorkflowIO does not preserve comments in the workflow YAML files. - ci-build.yml - release.yml + - project-keeper-verify.yml secrets-inherit: ignore: # Required for passing slack webhooks diff --git a/.project-keeper.yml b/.project-keeper.yml index c86d90d..8ad0c87 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -7,8 +7,8 @@ sources: build: runnerOs: ubuntu-latest exasolDbVersions: - - "2025.2.1" - - "2025.1.10" + - "2026.1.0" + - "2025.1.13" workflows: - name: ci-build.yml stepCustomizations: diff --git a/dependencies.md b/dependencies.md index 82b64f5..77a410d 100644 --- a/dependencies.md +++ b/dependencies.md @@ -29,32 +29,32 @@ ## Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ------------------------------------------- | -| [SonarQube Scanner for Maven][28] | [GNU LGPL 3][29] | -| [Apache Maven Toolchains Plugin][30] | [Apache-2.0][31] | -| [Project Keeper Maven plugin][32] | [The MIT License][33] | -| [Apache Maven Dependency Plugin][34] | [Apache-2.0][31] | -| [Apache Maven Compiler Plugin][35] | [Apache-2.0][31] | -| [Apache Maven Enforcer Plugin][36] | [Apache-2.0][31] | -| [Maven Flatten Plugin][37] | [Apache Software License][31] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][38] | [ASL2][39] | -| [Maven Surefire Plugin][40] | [Apache-2.0][31] | -| [Versions Maven Plugin][41] | [Apache License, Version 2.0][31] | -| [duplicate-finder-maven-plugin Maven Mojo][42] | [Apache License 2.0][43] | -| [Apache Maven Artifact Plugin][44] | [Apache-2.0][31] | -| [Apache Maven Assembly Plugin][45] | [Apache-2.0][31] | -| [Apache Maven JAR Plugin][46] | [Apache-2.0][31] | -| [Artifact reference checker and unifier][47] | [MIT License][48] | -| [Maven Failsafe Plugin][49] | [Apache-2.0][31] | -| [JaCoCo :: Maven Plugin][50] | [EPL-2.0][51] | -| [Quality Summarizer Maven Plugin][52] | [MIT License][53] | -| [error-code-crawler-maven-plugin][54] | [MIT License][55] | -| [Git Commit Id Maven Plugin][56] | [GNU Lesser General Public License 3.0][57] | -| [Apache Maven Clean Plugin][58] | [Apache-2.0][31] | -| [Apache Maven Resources Plugin][59] | [Apache-2.0][31] | -| [Apache Maven Install Plugin][60] | [Apache-2.0][31] | -| [Apache Maven Site Plugin][61] | [Apache-2.0][31] | +| Dependency | License | +| ------------------------------------------------------- | ---------------------------------------------- | +| [SonarQube Scanner for Maven][28] | [GNU LGPL 3][29] | +| [Apache Maven Toolchains Plugin][30] | [Apache-2.0][31] | +| [Project Keeper Maven plugin][32] | [The MIT License][33] | +| [Apache Maven Dependency Plugin][34] | [Apache-2.0][31] | +| [Apache Maven Compiler Plugin][35] | [Apache-2.0][31] | +| [Apache Maven Enforcer Plugin][36] | [Apache-2.0][31] | +| [Maven Flatten Plugin][37] | [Apache Software License][31] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][38] | [ASL2][39] | +| [Maven Surefire Plugin][40] | [Apache-2.0][31] | +| [Versions Maven Plugin][41] | [Apache License, Version 2.0][31] | +| [duplicate-finder-maven-plugin Maven Mojo][42] | [Apache License 2.0][43] | +| [Apache Maven Artifact Plugin][44] | [Apache-2.0][31] | +| [Apache Maven Assembly Plugin][45] | [Apache-2.0][31] | +| [Apache Maven JAR Plugin][46] | [Apache-2.0][31] | +| [Artifact reference checker and unifier][47] | [MIT License][48] | +| [spdx-maven-plugin Maven Plugin][49] | [The Apache Software License, Version 2.0][39] | +| [Maven Failsafe Plugin][50] | [Apache-2.0][31] | +| [JaCoCo :: Maven Plugin][51] | [EPL-2.0][52] | +| [error-code-crawler-maven-plugin][53] | [MIT License][54] | +| [Git Commit Id Maven Plugin][55] | [GNU Lesser General Public License 3.0][56] | +| [Apache Maven Clean Plugin][57] | [Apache-2.0][31] | +| [Apache Maven Resources Plugin][58] | [Apache-2.0][31] | +| [Apache Maven Install Plugin][59] | [Apache-2.0][31] | +| [Apache Maven Site Plugin][60] | [Apache-2.0][31] | [0]: https://github.com/exasol/virtual-schema-common-jdbc/ [1]: https://github.com/exasol/virtual-schema-common-jdbc/blob/main/LICENSE @@ -105,16 +105,15 @@ [46]: https://maven.apache.org/plugins/maven-jar-plugin/ [47]: https://github.com/exasol/artifact-reference-checker-maven-plugin/ [48]: https://github.com/exasol/artifact-reference-checker-maven-plugin/blob/main/LICENSE -[49]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[50]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[51]: https://www.eclipse.org/legal/epl-2.0/ -[52]: https://github.com/exasol/quality-summarizer-maven-plugin/ -[53]: https://github.com/exasol/quality-summarizer-maven-plugin/blob/main/LICENSE -[54]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[55]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[56]: https://github.com/git-commit-id/git-commit-id-maven-plugin -[57]: http://www.gnu.org/licenses/lgpl-3.0.txt -[58]: https://maven.apache.org/plugins/maven-clean-plugin/ -[59]: https://maven.apache.org/plugins/maven-resources-plugin/ -[60]: https://maven.apache.org/plugins/maven-install-plugin/ -[61]: https://maven.apache.org/plugins/maven-site-plugin/ +[49]: https://github.com/spdx/spdx-maven-plugin +[50]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[51]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[52]: https://www.eclipse.org/legal/epl-2.0/ +[53]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[54]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[55]: https://github.com/git-commit-id/git-commit-id-maven-plugin +[56]: http://www.gnu.org/licenses/lgpl-3.0.txt +[57]: https://maven.apache.org/plugins/maven-clean-plugin/ +[58]: https://maven.apache.org/plugins/maven-resources-plugin/ +[59]: https://maven.apache.org/plugins/maven-install-plugin/ +[60]: https://maven.apache.org/plugins/maven-site-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index d0c7c13..49f2bbf 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [3.0.1](changes_3.0.1.md) * [3.0.0](changes_3.0.0.md) * [2.1.6](changes_2.1.6.md) * [2.1.5](changes_2.1.5.md) diff --git a/doc/changes/changes_3.0.1.md b/doc/changes/changes_3.0.1.md new file mode 100644 index 0000000..1116819 --- /dev/null +++ b/doc/changes/changes_3.0.1.md @@ -0,0 +1,49 @@ +# Virtual Schema for SQLServer 3.0.1, released 2026-07-31 + +Code name: Fixed vulnerability CVE-2026-9563 in org.eclipse.parsson:parsson:jar:1.1.7:test + +## Summary + +This release fixes the following vulnerability: + +### CVE-2026-9563 (CWE-400) in dependency `org.eclipse.parsson:parsson:jar:1.1.7:test` +In Eclipse Parsson published Maven Central artifacts before version 1.1.8, the JSON parser did not enforce a default maximum on the number of characters consumed while parsing a single JSON document. Applications that parse attacker- controlled JSON can be forced to consume excessive CPU and memory by processing very large documents, including large arrays, objects, strings, numbers, whitespace, or nested structures, resulting in a denial of service. Eclipse Parsson 1.1.8 introduces a configurable maximum parsing limit with a default limit of 15 million parser-consumed characters. +#### References +* https://guide.sonatype.com/vulnerability/CVE-2026-9563?component-type=maven&component-name=org.eclipse.parsson%2Fparsson&utm_source=ossindex-client&utm_medium=integration&utm_content=1.8.1 +* http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2026-9563 +* https://github.com/eclipse-ee4j/parsson/pull/169 +* https://gitlab.eclipse.org/security/vulnerability-reports/-/work_items/444 + +## Security + +* #48: Fixed vulnerability CVE-2026-9563 in dependency `org.eclipse.parsson:parsson:jar:1.1.7:test` + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:virtual-schema-common-jdbc:14.0.2` to `14.0.4` + +### Test Dependency Updates + +* Updated `com.exasol:exasol-test-setup-abstraction-java:2.1.11` to `3.0.0` +* Updated `com.exasol:exasol-testcontainers:7.2.3` to `8.0.1` +* Updated `com.exasol:hamcrest-resultset-matcher:1.7.2` to `1.7.3` +* Updated `com.exasol:test-db-builder-java:4.0.0` to `4.0.2` +* Updated `com.exasol:udf-debugging-java:0.6.18` to `0.6.20` +* Updated `com.exasol:virtual-schema-common-jdbc:14.0.2` to `14.0.4` +* Updated `org.slf4j:slf4j-jdk14:2.0.17` to `2.0.18` + +### Plugin Dependency Updates + +* Updated `com.exasol:artifact-reference-checker-maven-plugin:0.4.4` to `1.0.1` +* Updated `com.exasol:error-code-crawler-maven-plugin:2.0.7` to `2.1.0` +* Updated `com.exasol:project-keeper-maven-plugin:5.6.1` to `5.7.4` +* Removed `com.exasol:quality-summarizer-maven-plugin:0.2.1` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.6.2` to `3.6.3` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.5.5` to `3.5.6` +* Updated `org.apache.maven.plugins:maven-site-plugin:3.21.0` to `3.22.0` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.5.5` to `3.5.6` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.14` to `0.8.15` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356` to `5.7.0.6970` +* Added `org.spdx:spdx-maven-plugin:1.0.4` diff --git a/doc/user_guide/sqlserver_user_guide.md b/doc/user_guide/sqlserver_user_guide.md index e4d33c8..52441d5 100644 --- a/doc/user_guide/sqlserver_user_guide.md +++ b/doc/user_guide/sqlserver_user_guide.md @@ -48,7 +48,7 @@ The SQL statement below creates the adapter script, defines the Java class that ```sql CREATE OR REPLACE JAVA ADAPTER SCRIPT SCHEMA_FOR_VS_SCRIPT.ADAPTER_SCRIPT_SQLSERVER AS %scriptclass com.exasol.adapter.RequestDispatcher; - %jar /buckets///virtual-schema-dist-14.0.2-sqlserver-3.0.0.jar; + %jar /buckets///virtual-schema-dist-14.0.4-sqlserver-3.0.1.jar; %jar /buckets///mssql-jdbc-.jre8.jar; / ``` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index 52a262d..b23feee 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol sqlserver-virtual-schema-generated-parent - 3.0.0 + 3.0.1 pom UTF-8 @@ -57,7 +57,7 @@ org.apache.maven.plugins maven-site-plugin - 3.21.0 + 3.22.0 org.codehaus.mojo @@ -75,7 +75,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 5.5.0.6356 + 5.7.0.6970 org.apache.maven.plugins @@ -101,8 +101,7 @@ maven-compiler-plugin 3.15.0 - ${java.version} - ${java.version} + ${java.version} true -Xlint:all @@ -113,7 +112,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.6.2 + 3.6.3 enforce-maven @@ -180,7 +179,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.5 + 3.5.6 ${argLine} @@ -302,7 +301,7 @@ com.exasol artifact-reference-checker-maven-plugin - 0.4.4 + 1.0.1 verify @@ -312,10 +311,39 @@ + + + org.spdx + spdx-maven-plugin + 1.0.4 + + + build-spdx + package + + createSPDX + + + + + build + + true + true + true + true + false + false + Copyright (c) Exasol + false + JSON-LD + ${project.build.directory}/site/${project.groupId}.${project.artifactId}-${project.version}.spdx3.json + + org.apache.maven.plugins maven-failsafe-plugin - 3.5.5 + 3.5.6 ${argLine} @@ -340,7 +368,7 @@ org.jacoco jacoco-maven-plugin - 0.8.14 + 0.8.15 prepare-agent @@ -378,23 +406,10 @@ - - com.exasol - quality-summarizer-maven-plugin - 0.2.1 - - - summarize-metrics - - summarize - - - - com.exasol error-code-crawler-maven-plugin - 2.0.7 + 2.1.0 verify diff --git a/pom.xml b/pom.xml index ea90668..1cd57d6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,12 +2,12 @@ 4.0.0 sqlserver-virtual-schema - 3.0.0 + 3.0.1 Virtual Schema for SQLServer Abstraction layer that makes an external Microsoft SQL Server database accessible from an Exasol database through regular SQL commands https://github.com/exasol/sqlserver-virtual-schema/ - 14.0.2 + 14.0.4 2.0.5 @@ -43,7 +43,7 @@ org.junit.jupiter junit-jupiter - + 5.14.4 test @@ -57,7 +57,7 @@ com.exasol exasol-testcontainers - 7.2.3 + 8.0.1 test @@ -82,13 +82,13 @@ com.exasol test-db-builder-java - 4.0.0 + 4.0.2 test com.exasol exasol-test-setup-abstraction-java - 2.1.11 + 3.0.0 test @@ -100,20 +100,20 @@ com.exasol udf-debugging-java - 0.6.18 + 0.6.20 test com.exasol hamcrest-resultset-matcher - 1.7.2 + 1.7.3 test org.slf4j slf4j-jdk14 - 2.0.17 + 2.0.18 test @@ -145,7 +145,7 @@ com.exasol project-keeper-maven-plugin - 5.6.1 + 5.7.4 @@ -208,7 +208,7 @@ sqlserver-virtual-schema-generated-parent com.exasol - 3.0.0 + 3.0.1 pk_generated_parent.pom diff --git a/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlDialectIT.java b/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlDialectIT.java index a519fc0..962a205 100644 --- a/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlDialectIT.java +++ b/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlDialectIT.java @@ -10,7 +10,6 @@ import java.io.FileNotFoundException; import java.nio.file.Path; import java.sql.*; -import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.concurrent.TimeoutException; @@ -48,7 +47,7 @@ class SQLServerSqlDialectIT { private static final String VIRTUAL_SCHEMA_JDBC = "VIRTUAL_SCHEMA_JDBC"; private static final String JDBC_DRIVER_NAME = "mssql-jdbc.jar"; private static final Path JDBC_DRIVER_PATH = Path.of("target/sqlserver-driver/" + JDBC_DRIVER_NAME); - public static final String VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION = "virtual-schema-dist-14.0.2-sqlserver-3.0.0.jar"; + public static final String VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION = "virtual-schema-dist-14.0.4-sqlserver-3.0.1.jar"; public static final Path PATH_TO_VIRTUAL_SCHEMAS_JAR = Path.of("target", VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION); public static final String SCHEMA_EXASOL = "SCHEMA_EXASOL"; public static final String ADAPTER_SCRIPT_EXASOL = "ADAPTER_SCRIPT_EXASOL"; @@ -147,6 +146,15 @@ private ResultSet getActualResultSet(final String query) throws SQLException { } } + private String getExpectedSqlServerDate(final String query) throws SQLException { + try (final Connection connection = MS_SQL_SERVER_CONTAINER.createConnection(""); + final Statement statement = connection.createStatement(); + final ResultSet resultSet = statement.executeQuery(query)) { + assertTrue(resultSet.next(), "Expected SQL Server query to return one row"); + return resultSet.getString(1); + } + } + private String getExplainVirtualString(final String query) throws SQLException { try (final Statement statement = exasolConnection.createStatement()) { final ResultSet explainVirtual = statement.executeQuery("EXPLAIN VIRTUAL " + query); @@ -312,7 +320,7 @@ void testGetDate() throws SQLException { final String query = "SELECT CURRENT_DATE FROM " + VIRTUAL_SCHEMA_JDBC + "." + TABLE_SQL_SERVER_SIMPLE + " LIMIT 1"; final ResultSet expected = getExpectedResultSet(List.of("col1 DATE"), - List.of("'" + LocalDate.now() + "'")); + List.of("'" + getExpectedSqlServerDate("SELECT CAST(GETDATE() AS DATE)") + "'")); final String expectedRewrittenQuery = "SELECT TOP 1 CAST(GETDATE() AS DATE) FROM"; assertAll(() -> assertThat(getActualResultSet(query), matchesResultSet(expected)), () -> assertThat(getExplainVirtualString(query), containsString(expectedRewrittenQuery))); diff --git a/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlGenerationVisitorTest.java b/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlGenerationVisitorTest.java index 9db78cb..38f69c5 100644 --- a/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlGenerationVisitorTest.java +++ b/src/test/java/com/exasol/adapter/dialects/sqlserver/SQLServerSqlGenerationVisitorTest.java @@ -2,6 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.instanceOf; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -24,8 +25,6 @@ import com.exasol.adapter.metadata.*; import com.exasol.adapter.sql.*; -import jakarta.json.stream.JsonParsingException; - class SQLServerSqlGenerationVisitorTest { private SQLServerSqlGenerationVisitor visitor; @@ -265,6 +264,8 @@ void testVisitColumn() { final SqlGenerationVisitorException exception = assertThrows(SqlGenerationVisitorException.class, () -> this.visitor.visit(column)); assertThat(exception.getMessage(), equalTo("E-VSSQLS-1: Unable to get a JDBC data type for an sql column 0.")); - assertThat(exception.getCause().getCause(), instanceOf(JsonParsingException.class)); + assertThat(exception.getCause(), instanceOf(AdapterException.class)); + assertThat(exception.getCause().getMessage(), + containsString("E-VSCJDBC-4: Could not parse the column adapter notes of column 'col1'.")); } } diff --git a/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000..fdbd0b1 --- /dev/null +++ b/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-subclass