From 95bd314d75a6caf2eed04b88d727fe88aed47b61 Mon Sep 17 00:00:00 2001 From: Christoph Kuhnke Date: Thu, 24 Nov 2022 10:49:05 +0100 Subject: [PATCH 1/3] Improved documentation of driver upload --- doc/user_guide/mysql_user_guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user_guide/mysql_user_guide.md b/doc/user_guide/mysql_user_guide.md index 9cbe988..17aca8d 100644 --- a/doc/user_guide/mysql_user_guide.md +++ b/doc/user_guide/mysql_user_guide.md @@ -46,7 +46,7 @@ Then create a schema to hold the adapter script. CREATE SCHEMA SCHEMA_FOR_VS_SCRIPT; ``` -The SQL statement below creates the adapter script, defines the Java class that serves as entry point and tells the UDF framework where to find the libraries (JAR files) for Virtual Schema and database driver. +The SQL statement below creates the adapter script, defines the Java class that serves as entry point and tells the UDF framework where to find the libraries (JAR files) for Virtual Schema and JDBC database driver (`mysql-connector-java-.jar`). ```sql CREATE OR REPLACE JAVA ADAPTER SCRIPT SCHEMA_FOR_VS_SCRIPT.ADAPTER_SCRIPT_MYSQL AS From 0a789e05593b3fd1bd25f2301eeaff5bb9ce96d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=A4r?= Date: Thu, 24 Nov 2022 13:38:05 +0100 Subject: [PATCH 2/3] Corrected documentation. --- .vscode/settings.json | 17 +++++++ dependencies.md | 63 ++++++++++++------------ doc/changes/changes_4.0.1.md | 46 ++++++++--------- doc/user_guide/mysql_user_guide.md | 79 +++++++++++++++--------------- lombok.config | 2 - pk_generated_parent.pom | 18 +++---- pom.xml | 21 +++----- 7 files changed, 126 insertions(+), 120 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 lombok.config diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f938933 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,17 @@ +{ + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": true, + "source.generate.finalModifiers": true, + "source.fixAll": true + }, + "java.codeGeneration.useBlocks": true, + "java.saveActions.organizeImports": true, + "java.sources.organizeImports.starThreshold": 3, + "java.sources.organizeImports.staticStarThreshold": 3, + "java.test.config": { + "vmArgs": [ + "-Djava.util.logging.config.file=src/test/resources/logging.properties" + ] + } +} diff --git a/dependencies.md b/dependencies.md index 0ede259..8ad5044 100644 --- a/dependencies.md +++ b/dependencies.md @@ -33,24 +33,24 @@ | [SonarQube Scanner for Maven][25] | [GNU LGPL 3][26] | | [Apache Maven Compiler Plugin][27] | [Apache License, Version 2.0][28] | | [Apache Maven Enforcer Plugin][29] | [Apache License, Version 2.0][28] | -| [Maven Flatten Plugin][30] | [Apache Software Licenese][31] | -| [Project keeper maven plugin][32] | [The MIT License][33] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][34] | [ASL2][31] | +| [Maven Flatten Plugin][30] | [Apache Software Licenese][28] | +| [Project keeper maven plugin][31] | [The MIT License][32] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][33] | [ASL2][34] | | [Maven Surefire Plugin][35] | [Apache License, Version 2.0][28] | | [Versions Maven Plugin][36] | [Apache License, Version 2.0][28] | | [Apache Maven Assembly Plugin][37] | [Apache License, Version 2.0][28] | | [Apache Maven JAR Plugin][38] | [Apache License, Version 2.0][28] | -| [Artifact reference checker and unifier][39] | [MIT][22] | -| [Apache Maven Dependency Plugin][40] | [Apache License, Version 2.0][28] | -| [Maven Failsafe Plugin][41] | [Apache License, Version 2.0][28] | -| [JaCoCo :: Maven Plugin][42] | [Eclipse Public License 2.0][24] | -| [error-code-crawler-maven-plugin][43] | [MIT License][44] | -| [Reproducible Build Maven Plugin][45] | [Apache 2.0][31] | -| [Maven Clean Plugin][46] | [The Apache Software License, Version 2.0][31] | -| [Maven Resources Plugin][47] | [The Apache Software License, Version 2.0][31] | -| [Maven Install Plugin][48] | [The Apache Software License, Version 2.0][31] | -| [Maven Deploy Plugin][49] | [The Apache Software License, Version 2.0][31] | -| [Maven Site Plugin 3][50] | [The Apache Software License, Version 2.0][31] | +| [Artifact reference checker and unifier][39] | [MIT License][40] | +| [Apache Maven Dependency Plugin][41] | [Apache License, Version 2.0][28] | +| [Maven Failsafe Plugin][42] | [Apache License, Version 2.0][28] | +| [JaCoCo :: Maven Plugin][43] | [Eclipse Public License 2.0][24] | +| [error-code-crawler-maven-plugin][44] | [MIT License][45] | +| [Reproducible Build Maven Plugin][46] | [Apache 2.0][34] | +| [Maven Clean Plugin][47] | [The Apache Software License, Version 2.0][34] | +| [Maven Resources Plugin][48] | [The Apache Software License, Version 2.0][34] | +| [Maven Install Plugin][49] | [The Apache Software License, Version 2.0][34] | +| [Maven Deploy Plugin][50] | [The Apache Software License, Version 2.0][34] | +| [Maven Site Plugin 3][51] | [The Apache Software License, Version 2.0][34] | [0]: https://github.com/exasol/virtual-schema-common-jdbc/ [1]: https://github.com/exasol/virtual-schema-common-jdbc/blob/main/LICENSE @@ -83,23 +83,24 @@ [28]: https://www.apache.org/licenses/LICENSE-2.0.txt [29]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ [30]: https://www.mojohaus.org/flatten-maven-plugin/ -[31]: http://www.apache.org/licenses/LICENSE-2.0.txt -[32]: https://github.com/exasol/project-keeper/ -[33]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[34]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[31]: https://github.com/exasol/project-keeper/ +[32]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[33]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[34]: http://www.apache.org/licenses/LICENSE-2.0.txt [35]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[36]: http://www.mojohaus.org/versions-maven-plugin/ +[36]: https://www.mojohaus.org/versions-maven-plugin/ [37]: https://maven.apache.org/plugins/maven-assembly-plugin/ [38]: https://maven.apache.org/plugins/maven-jar-plugin/ -[39]: https://github.com/exasol/artifact-reference-checker-maven-plugin -[40]: https://maven.apache.org/plugins/maven-dependency-plugin/ -[41]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[42]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[43]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[44]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[45]: http://zlika.github.io/reproducible-build-maven-plugin -[46]: http://maven.apache.org/plugins/maven-clean-plugin/ -[47]: http://maven.apache.org/plugins/maven-resources-plugin/ -[48]: http://maven.apache.org/plugins/maven-install-plugin/ -[49]: http://maven.apache.org/plugins/maven-deploy-plugin/ -[50]: http://maven.apache.org/plugins/maven-site-plugin/ +[39]: https://github.com/exasol/artifact-reference-checker-maven-plugin/ +[40]: https://github.com/exasol/artifact-reference-checker-maven-plugin/blob/main/LICENSE +[41]: https://maven.apache.org/plugins/maven-dependency-plugin/ +[42]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[43]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[44]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[45]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[46]: http://zlika.github.io/reproducible-build-maven-plugin +[47]: http://maven.apache.org/plugins/maven-clean-plugin/ +[48]: http://maven.apache.org/plugins/maven-resources-plugin/ +[49]: http://maven.apache.org/plugins/maven-install-plugin/ +[50]: http://maven.apache.org/plugins/maven-deploy-plugin/ +[51]: http://maven.apache.org/plugins/maven-site-plugin/ diff --git a/doc/changes/changes_4.0.1.md b/doc/changes/changes_4.0.1.md index 4262635..0c8933a 100644 --- a/doc/changes/changes_4.0.1.md +++ b/doc/changes/changes_4.0.1.md @@ -1,40 +1,36 @@ -# Virtual Schema for MySQL 4.0.1, released 2022-10-24 +# Virtual Schema for MySQL 4.0.1, released 2022-11-24 -Code name: Dependency Updates +Code name: Improved documentation ## Summary -Updated dependencies to fix vulnerabilities. +In release 4.0.1 we improved the installation instructions in the user guide, removed an old file that was left over from when the VS used Lombok and updated dependencies to fix vulnerabilities. -## Features +## Bugfixes * #23: Fixed CVE-2022-3171 reported for `com.google.protobuf:protobuf-java` by updating `com.mysql:mysql-connector-j`. ## Dependency Updates -### Compile Dependency Updates - -* Updated `com.exasol:virtual-schema-common-jdbc:9.0.5` to `10.0.1` - ### Test Dependency Updates -* Updated `com.exasol:exasol-testcontainers:6.1.1` to `6.2.0` -* Updated `com.exasol:hamcrest-resultset-matcher:1.5.1` to `1.5.2` -* Updated `com.exasol:test-db-builder-java:3.3.2` to `3.4.0` -* Updated `com.exasol:udf-debugging-java:0.6.2` to `0.6.4` -* Updated `com.exasol:virtual-schema-common-jdbc:9.0.5` to `10.0.1` -* Updated `com.exasol:virtual-schema-shared-integration-tests:2.2.0` to `2.2.2` -* Added `com.google.protobuf:protobuf-java:3.21.8` -* Added `com.mysql:mysql-connector-j:8.0.31` -* Removed `mysql:mysql-connector-java:8.0.29` -* Updated `org.junit.jupiter:junit-jupiter:5.8.2` to `5.9.1` -* Updated `org.mockito:mockito-junit-jupiter:4.6.1` to `4.8.1` -* Updated `org.testcontainers:junit-jupiter:1.17.2` to `1.17.5` -* Updated `org.testcontainers:mysql:1.17.2` to `1.17.5` +* Updated `com.exasol:exasol-testcontainers:6.2.0` to `6.3.1` +* Updated `com.exasol:test-db-builder-java:3.4.0` to `3.4.1` +* Updated `com.exasol:udf-debugging-java:0.6.4` to `0.6.5` +* Updated `com.google.protobuf:protobuf-java:3.21.8` to `3.21.9` +* Updated `org.mockito:mockito-junit-jupiter:4.8.1` to `4.9.0` +* Updated `org.testcontainers:junit-jupiter:1.17.5` to `1.17.6` +* Updated `org.testcontainers:mysql:1.17.5` to `1.17.6` ### Plugin Dependency Updates -* Updated `com.exasol:error-code-crawler-maven-plugin:1.1.1` to `1.1.2` -* Updated `com.exasol:project-keeper-maven-plugin:2.4.6` to `2.8.0` -* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.0.0` to `3.1.0` -* Updated `org.codehaus.mojo:versions-maven-plugin:2.11.0` to `2.10.0` +* Updated `com.exasol:artifact-reference-checker-maven-plugin:0.4.0` to `0.4.2` +* Updated `com.exasol:error-code-crawler-maven-plugin:1.1.2` to `1.2.1` +* Updated `com.exasol:project-keeper-maven-plugin:2.8.0` to `2.9.1` +* Updated `io.github.zlika:reproducible-build-maven-plugin:0.15` to `0.16` +* Updated `org.apache.maven.plugins:maven-assembly-plugin:3.3.0` to `3.4.2` +* Updated `org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5` to `3.0.0-M7` +* Updated `org.apache.maven.plugins:maven-jar-plugin:3.2.2` to `3.3.0` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5` to `3.0.0-M7` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.2.7` to `1.3.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.10.0` to `2.13.0` diff --git a/doc/user_guide/mysql_user_guide.md b/doc/user_guide/mysql_user_guide.md index 17aca8d..1accebb 100644 --- a/doc/user_guide/mysql_user_guide.md +++ b/doc/user_guide/mysql_user_guide.md @@ -19,12 +19,13 @@ Now register the driver in EXAOperation: You need to specify the following settings when adding the JDBC driver via EXAOperation. -| Parameter | Value | -|-------------|---------------------------------------| -| Driver Name | `MYSQL` | -| Main Class | `com.mysql.jdbc.Driver` | -| Prefix | `jdbc:mysql:` | -| Files | `mysql-connector-java-.jar` | +| Parameter | Value | +|------------------|-------------------------------------------------------------------------------------------| +| Driver Name | `MYSQL` | +| Main Class | `com.mysql.jdbc.Driver` | +| Prefix | `jdbc:mysql:` | +| Files | `mysql-connector-j-.jar` (older versions: `mysql-connector-java-.jar`) | +| Port (optional) | default 3306 | IMPORTANT: Currently you have to **Disable Security Manager** for the driver if you want to connect to MySQL using Virtual Schemas. It is necessary because JDBC driver requires a JAVA permission which we do not grant by default. @@ -46,13 +47,13 @@ Then create a schema to hold the adapter script. CREATE SCHEMA SCHEMA_FOR_VS_SCRIPT; ``` -The SQL statement below creates the adapter script, defines the Java class that serves as entry point and tells the UDF framework where to find the libraries (JAR files) for Virtual Schema and JDBC database driver (`mysql-connector-java-.jar`). +The SQL statement below creates the adapter script, defines the Java class that serves as entry point and tells the UDF framework where to find the libraries (JAR files) for Virtual Schema and JDBC database driver. ```sql CREATE OR REPLACE JAVA ADAPTER SCRIPT SCHEMA_FOR_VS_SCRIPT.ADAPTER_SCRIPT_MYSQL AS %scriptclass com.exasol.adapter.RequestDispatcher; %jar /buckets///virtual-schema-dist-10.0.1-mysql-4.0.1.jar; - %jar /buckets///mysql-connector-java-.jar; + %jar /buckets///mysql-connector-j-.jar; / ; ``` @@ -82,37 +83,37 @@ CREATE VIRTUAL SCHEMA ## Data Types Conversion -MySQL Data Type | Supported | Converted Exasol Data Type| Known limitations --------------------|-----------|---------------------------|------------------- -BOOLEAN | ✓ | BOOLEAN | -BIGINT | ✓ | DECIMAL | -BINARY | × | | -BIT | ✓ | BOOLEAN | -BLOB | × | | -CHAR | ✓ | CHAR | -DATE | ✓ | DATE | -DATETIME | ✓ | TIMESTAMP | -DECIMAL | ✓ | DECIMAL | -DOUBLE | ✓ | DOUBLE PRECISION | -ENUM | ✓ | CHAR | -FLOAT | ✓ | DOUBLE PRECISION | -INT | ✓ | DECIMAL | -LONGBLOB | × | | -LONGTEXT | ✓ | VARCHAR(2000000) | -MEDIUMBLOB | × | | -MEDIUMINT | ✓ | DECIMAL | -MEDIUMTEXT | ✓ | VARCHAR(2000000) | -SET | ✓ | CHAR | -SMALLINT | ✓ | DECIMAL | -TEXT | ✓ | VARCHAR(65535) | The size of the column is always 65535.* -TINYBLOB | × | | -TINYINT | ✓ | DECIMAL | -TINYTEXT | ✓ | VARCHAR | -TIME | ✓ | TIMESTAMP | Casted to `TIMESTAMP` with a format `1970-01-01 hh:mm:ss`. -TIMESTAMP | ✓ | TIMESTAMP | -VARBINARY | × | | -VARCHAR | ✓ | VARCHAR | -YEAR | ✓ | DATE | +| MySQL Data Type | Supported | Converted Exasol Data Type| Known limitations | +|-----------------|-----------|---------------------------|------------------------------------------------------------| +| BOOLEAN | ✓ | BOOLEAN | | +| BIGINT | ✓ | DECIMAL | | +| BINARY | × | | | +| BIT | ✓ | BOOLEAN | | +| BLOB | × | | | +| CHAR | ✓ | CHAR | | +| DATE | ✓ | DATE | | +| DATETIME | ✓ | TIMESTAMP | | +| DECIMAL | ✓ | DECIMAL | | +| DOUBLE | ✓ | DOUBLE PRECISION | | +| ENUM | ✓ | CHAR | | +| FLOAT | ✓ | DOUBLE PRECISION | | +| INT | ✓ | DECIMAL | | +| LONGBLOB | × | | | +| LONGTEXT | ✓ | VARCHAR(2000000) | | +| MEDIUMBLOB | × | | | +| MEDIUMINT | ✓ | DECIMAL | | +| MEDIUMTEXT | ✓ | VARCHAR(2000000) | | +| SET | ✓ | CHAR | | +| SMALLINT | ✓ | DECIMAL | | +| TEXT | ✓ | VARCHAR(65535) | The size of the column is always 65535.* | +| TINYBLOB | × | | | +| TINYINT | ✓ | DECIMAL | | +| TINYTEXT | ✓ | VARCHAR | | +| TIME | ✓ | TIMESTAMP | Casted to `TIMESTAMP` with a format `1970-01-01 hh:mm:ss`. | +| TIMESTAMP | ✓ | TIMESTAMP | | +| VARBINARY | × | | | +| VARCHAR | ✓ | VARCHAR | | +| YEAR | ✓ | DATE | | * The tested versions of MySQL Connector JDBC Driver return the column's size depending on the charset and its collation. As the real data in a MySQL table can sometimes exceed the size that we get from the JDBC driver, we set the size for all TEXT columns to 65535 characters. diff --git a/lombok.config b/lombok.config deleted file mode 100644 index a23edb4..0000000 --- a/lombok.config +++ /dev/null @@ -1,2 +0,0 @@ -config.stopBubbling = true -lombok.addLombokGeneratedAnnotation = true \ No newline at end of file diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index b7e733c..dac01a6 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -79,7 +79,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.2.7 + 1.3.0 true oss @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 3.0.0-M7 @@ -129,7 +129,7 @@ org.codehaus.mojo versions-maven-plugin - 2.10.0 + 2.13.0 display-updates @@ -147,7 +147,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.3.0 + 3.4.2 src/assembly/all-dependencies.xml @@ -168,7 +168,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 default-jar @@ -179,7 +179,7 @@ com.exasol artifact-reference-checker-maven-plugin - 0.4.0 + 0.4.2 verify @@ -212,7 +212,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.0.0-M5 + 3.0.0-M7 @@ -282,7 +282,7 @@ com.exasol error-code-crawler-maven-plugin - 1.1.2 + 1.2.1 verify @@ -295,7 +295,7 @@ io.github.zlika reproducible-build-maven-plugin - 0.15 + 0.16 strip-jar diff --git a/pom.xml b/pom.xml index b5c4a3b..7564873 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ https://github.com/exasol/mysql-virtual-schema/ 10.0.1 - 1.17.5 + 1.17.6 @@ -18,13 +18,6 @@ false - - maven.exasol.com-snapshots - https://maven.exasol.com/artifactory/exasol-snapshots - - true - - @@ -55,14 +48,14 @@ org.mockito mockito-junit-jupiter - 4.8.1 + 4.9.0 test com.exasol exasol-testcontainers - 6.2.0 + 6.3.1 test @@ -87,13 +80,13 @@ com.google.protobuf protobuf-java - 3.21.8 + 3.21.9 test com.exasol test-db-builder-java - 3.4.0 + 3.4.1 test @@ -111,7 +104,7 @@ com.exasol udf-debugging-java - 0.6.4 + 0.6.5 test @@ -146,7 +139,7 @@ com.exasol project-keeper-maven-plugin - 2.8.0 + 2.9.1 From 6eb87a79965daac1ee39293291153e9503058c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=A4r?= Date: Fri, 25 Nov 2022 08:33:26 +0100 Subject: [PATCH 3/3] #28: Added known issue. --- doc/changes/changes_4.0.1.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/changes/changes_4.0.1.md b/doc/changes/changes_4.0.1.md index 0c8933a..97e1d3c 100644 --- a/doc/changes/changes_4.0.1.md +++ b/doc/changes/changes_4.0.1.md @@ -6,6 +6,10 @@ Code name: Improved documentation In release 4.0.1 we improved the installation instructions in the user guide, removed an old file that was left over from when the VS used Lombok and updated dependencies to fix vulnerabilities. +## Known Issues + +There is a known issue with non-UTF databases MySQL that can lead to a type conversion error in the `IMPORT` triggered by the Virtual Schema. Currently, it looks like this is caused by an inconsistency in the behavior of the MySQL JDBC driver when getting metadata from tables and resultsets. Please follow [#26](https://github.com/exasol/mysql-virtual-schema/issues/26) for details. + ## Bugfixes * #23: Fixed CVE-2022-3171 reported for `com.google.protobuf:protobuf-java` by updating `com.mysql:mysql-connector-j`.