Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions doc/changes/changes_2.0.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Virtual Schema for PostgreSQL 2.0.6, released 2022-??-??

Code name: Renamed error codes from PGVS to VSPG

## Summary

Renamed error codes from PGVS to VSPG

## Features

* #59: Renamed error codes from PGVS to VSPG.

## Dependency Updates

### Test Dependency Updates

* Updated `org.testcontainers:junit-jupiter:1.17.3` to `1.17.4`
* Updated `org.testcontainers:postgresql:1.17.3` to `1.17.4`
2 changes: 1 addition & 1 deletion doc/user_guide/postgresql_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The SQL statement below creates the adapter script, defines the Java class that
--/
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-10.0.1-postgresql-2.0.5.jar;
%jar /buckets/<BFS service>/<bucket>/virtual-schema-dist-10.0.1-postgresql-2.0.6.jar;
%jar /buckets/<BFS service>/<bucket>/postgresql-<postgresql-driver-version>.jar;
/
```
Expand Down
2 changes: 1 addition & 1 deletion error_code_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error-tags:
PGVS:
VSPG:
packages:
- com.exasol.adapter.dialects.postgresql
- com.exasol.closeafterall
Expand Down
2 changes: 1 addition & 1 deletion pk_generated_parent.pom

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.exasol</groupId>
<artifactId>postgresql-virtual-schema</artifactId>
<version>2.0.5</version>
<version>2.0.6</version>
<name>Virtual Schema for PostgreSQL</name>
<description>Virtual Schema for connecting PostgreSQL as data source to Exasol</description>
<properties>
<vscjdbc.version>10.0.1</vscjdbc.version>
<org.testcontainers.version>1.17.3</org.testcontainers.version>
<org.testcontainers.version>1.17.4</org.testcontainers.version>
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>
<repositories>
Expand Down Expand Up @@ -199,19 +199,19 @@
<plugin>
<groupId>org.sonatype.ossindex.maven</groupId>
<artifactId>ossindex-maven-plugin</artifactId>
<configuration>
<excludeVulnerabilityIds>
<!-- False positive, fixed already in snakeyaml version 1.32 according to https://bitbucket.org/snakeyaml/snakeyaml/issues/531/stackoverflow-oss-fuzz-47081. -->
<exclude>CVE-2022-38752</exclude>
</excludeVulnerabilityIds>
</configuration>
<configuration>
<excludeVulnerabilityIds>
<!-- False positive, fixed already in snakeyaml version 1.32 according to https://bitbucket.org/snakeyaml/snakeyaml/issues/531/stackoverflow-oss-fuzz-47081. -->
<exclude>CVE-2022-38752</exclude>
</excludeVulnerabilityIds>
</configuration>
</plugin>
</plugins>
</build>
<parent>
<artifactId>postgresql-virtual-schema-generated-parent</artifactId>
<groupId>com.exasol</groupId>
<version>2.0.5</version>
<version>2.0.6</version>
<relativePath>pk_generated_parent.pom</relativePath>
</parent>
<url>https://github.com/exasol/postgresql-virtual-schema/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public static PostgreSQLIdentifierMapping parse(final String mapping) {
case "PRESERVE_ORIGINAL_CASE":
return PRESERVE_ORIGINAL_CASE;
default:
throw new IllegalArgumentException(ExaError.messageBuilder("E-PGVS-2")
throw new IllegalArgumentException(ExaError.messageBuilder("E-VSPG-2")
.message("Unable to parse PostgreSQL identifier mapping {{mapping}}.", mapping).toString());
}
} else {
throw new IllegalArgumentException(ExaError.messageBuilder("E-PGVS-1")
throw new IllegalArgumentException(ExaError.messageBuilder("E-VSPG-1")
.message("Unable to parse PostgreSQL identifier mapping from a null value.").toString());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected RemoteMetadataReader createRemoteMetadataReader() {
try {
return new PostgreSQLMetadataReader(this.connectionFactory.getConnection(), this.properties);
} catch (final SQLException exception) {
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-PGVS-3")
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-VSPG-3")
.message("Unable to create PostgreSQL remote metadata reader. Caused by: {{cause}}",
exception.getMessage())
.toString(), exception);
Expand Down Expand Up @@ -210,7 +210,7 @@ private void checkPostgreSQLIdentifierPropertyConsistency() throws PropertyValid
final String propertyValue = this.properties.get(POSTGRESQL_IDENTIFIER_MAPPING_PROPERTY);
if (!propertyValue.equals(POSTGRESQL_IDENTIFER_MAPPING_PRESERVE_ORIGINAL_CASE_VALUE)
&& !propertyValue.equals(POSTGRESQL_IDENTIFIER_MAPPING_CONVERT_TO_UPPER_VALUE)) {
throw new PropertyValidationException(ExaError.messageBuilder("E-PGVS-4")
throw new PropertyValidationException(ExaError.messageBuilder("E-VSPG-4")
.message("Value for " + POSTGRESQL_IDENTIFIER_MAPPING_PROPERTY + " must be "
+ POSTGRESQL_IDENTIFER_MAPPING_PRESERVE_ORIGINAL_CASE_VALUE + " or "
+ POSTGRESQL_IDENTIFIER_MAPPING_CONVERT_TO_UPPER_VALUE)
Expand All @@ -219,7 +219,7 @@ private void checkPostgreSQLIdentifierPropertyConsistency() throws PropertyValid
}
if (this.properties.hasIgnoreErrors()
&& !List.of(POSTGRESQL_UPPERCASE_TABLES_SWITCH).containsAll(this.properties.getIgnoredErrors())) {
throw new PropertyValidationException(ExaError.messageBuilder("E-PGVS-5").message(
throw new PropertyValidationException(ExaError.messageBuilder("E-VSPG-5").message(
"Unknown error identifier in list of ignored errors ({{propertyName}}). Pick one of: {{availableValues}}",
IGNORE_ERRORS_PROPERTY, POSTGRESQL_UPPERCASE_TABLES_SWITCH).toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected boolean isUppercaseTableIncludedByMapping(final String tableName) {
+ POSTGRESQL_UPPERCASE_TABLES_SWITCH + ".");
return false;
} else {
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-PGVS-6").message(
throw new RemoteMetadataReaderException(ExaError.messageBuilder("E-VSPG-6").message(
"Table {{tableName}} cannot be used in virtual schema. Set property {{propertyName}} to {{propertyValue}} to enforce schema creation.",
tableName, IGNORE_ERRORS_PROPERTY, POSTGRESQL_UPPERCASE_TABLES_SWITCH).toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ void testParseConvertToPreserverOriginalCase() {
void testParseNullMappingThrowsException() {
final IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
() -> PostgreSQLIdentifierMapping.parse(null));
assertThat(exception.getMessage(), containsString("E-PGVS-1"));
assertThat(exception.getMessage(), containsString("E-VSPG-1"));
}

@Test
void testParseUnknownMappingThrowsException() {
final IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
() -> PostgreSQLIdentifierMapping.parse("UNKNOWN"));
assertThat(exception.getMessage(), containsString("E-PGVS-2"));
assertThat(exception.getMessage(), containsString("E-VSPG-2"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void testUnsetIgnoreUpperCaseTablesAndRefreshThrowsException() throws SQLExcepti
+ " set POSTGRESQL_IDENTIFIER_MAPPING = 'CONVERT_TO_UPPER'");
final Exception exception = assertThrows(SQLException.class, () -> statementExasol
.execute("ALTER VIRTUAL SCHEMA " + virtualSchemaPostgresUppercaseTable.getName() + " REFRESH"));
assertThat(exception.getMessage(), containsString("E-PGVS-6: Table '" + TABLE_POSTGRES_MIXED_CASE
assertThat(exception.getMessage(), containsString("E-VSPG-6: Table '" + TABLE_POSTGRES_MIXED_CASE
+ "' cannot be used in virtual schema. Set property 'IGNORE_ERRORS' to 'POSTGRESQL_UPPERCASE_TABLES' to enforce schema creation."));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void testCreateRemoteMetadataReaderConnectionFails(@Mock final Connection connec
when(this.connectionFactoryMock.getConnection()).thenThrow(new SQLException());
final RemoteMetadataReaderException exception = assertThrows(RemoteMetadataReaderException.class,
this.dialect::createRemoteMetadataReader);
assertThat(exception.getMessage(), containsString("E-PGVS-3"));
assertThat(exception.getMessage(), containsString("E-VSPG-3"));
}

@Test
Expand Down Expand Up @@ -123,7 +123,7 @@ void testPostgreSQLIdentifierMappingInvalidPropertyValueThrowsException() {
"POSTGRESQL_IDENTIFIER_MAPPING", "CONVERT")));
final PropertyValidationException exception = assertThrows(PropertyValidationException.class,
sqlDialect::validateProperties);
assertThat(exception.getMessage(), containsString("E-PGVS-4"));
assertThat(exception.getMessage(), containsString("E-VSPG-4"));
}

@Test
Expand All @@ -133,7 +133,7 @@ void testIgnoreErrorsConsistency() {
"IGNORE_ERRORS", "ORACLE_ERROR")));
final PropertyValidationException exception = assertThrows(PropertyValidationException.class,
sqlDialect::validateProperties);
assertThat(exception.getMessage(), containsString("E-PGVS-5"));
assertThat(exception.getMessage(), containsString("E-VSPG-5"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ void testIsUppercaseTableIncludedByMappingWithIgnoringUppercaseTables() {
void testIsUppercaseTableIncludedByMappingWithConvertToUpperNotIgnoringUppercaseTablesThrowsException() {
final RemoteMetadataReaderException exception = assertThrows(RemoteMetadataReaderException.class,
() -> this.reader.isTableIncludedByMapping("\"FooBar\""));
assertThat(exception.getMessage(), containsString("E-PGVS-6"));
assertThat(exception.getMessage(), containsString("E-VSPG-6"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* This class contains the common integration test setup for all PostgreSQL virtual schemas.
*/
public class PostgresVirtualSchemaIntegrationTestSetup implements Closeable {
private static final String VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION = "virtual-schema-dist-10.0.1-postgresql-2.0.5.jar";
private static final String VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION = "virtual-schema-dist-10.0.1-postgresql-2.0.6.jar";
private static final Path PATH_TO_VIRTUAL_SCHEMAS_JAR = Path.of("target", VIRTUAL_SCHEMAS_JAR_NAME_AND_VERSION);
private static final String SCHEMA_EXASOL = "SCHEMA_EXASOL";
private static final String ADAPTER_SCRIPT_EXASOL = "ADAPTER_SCRIPT_EXASOL";
Expand Down Expand Up @@ -86,7 +86,7 @@ private static void uploadDriverToBucket(final Bucket bucket)
bucket.uploadFile(JDBC_DRIVER_PATH, JDBC_DRIVER_NAME);
} catch (final BucketAccessException | FileNotFoundException exception) {
throw new IllegalStateException(
ExaError.messageBuilder("F-PGVS-8")
ExaError.messageBuilder("F-VSPG-8")
.message("An error occurred while uploading the jdbc driver to the bucket.")
.mitigation("Make sure the {{JDBC_DRIVER_PATH}} file exists.")
.parameter("JDBC_DRIVER_PATH", JDBC_DRIVER_PATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void closeObject(final Field field, final Object annotatedObject) throws
if (annotatedObject instanceof Closeable) {
((Closeable) annotatedObject).close();
} else {
throw new IllegalStateException(ExaError.messageBuilder("E-PGVS-9").message(
throw new IllegalStateException(ExaError.messageBuilder("E-VSPG-9").message(
"Could not close the field {{field}} annotated with @CloseAfterAll since it does not implement Closable.")
.parameter("field", field.getName()).toString());
}
Expand Down