diff --git a/.github/workflows/ci-4.x.yml b/.github/workflows/ci-4.x.yml index 285ce129e..425680988 100644 --- a/.github/workflows/ci-4.x.yml +++ b/.github/workflows/ci-4.x.yml @@ -16,10 +16,10 @@ jobs: strategy: matrix: os: [ubuntu-latest] - profile: [PostgreSQL-9,PostgreSQL-10,PostgreSQL-11,MySQL-8.0,MySQL-5.6,MySQL-5.7,MariaDB-10.4,MSSQL-2017-latest,MSSQL-2019-latest,DB2-11.5,Oracle-21,SQL-templates] + profile: [ PostgreSQL-9,PostgreSQL-10,PostgreSQL-11,MySQL-8.0,MySQL-5.6,MySQL-5.7,MariaDB-10.4,MSSQL-2017-latest,MSSQL-2019-latest,DB2-11.5,Oracle-23,SQL-templates ] jdk: [8, 17] exclude: - - profile: Oracle-21 + - profile: Oracle-23 jdk: 8 - profile: DB2-11.5 jdk: 17 diff --git a/pom.xml b/pom.xml index 520bfbb7d..76f78d0d3 100644 --- a/pom.xml +++ b/pom.xml @@ -232,9 +232,9 @@ - Oracle-21 + Oracle-23 - 21-slim + 23.3-slim-faststart vertx-sql-client diff --git a/vertx-oracle-client/README.adoc b/vertx-oracle-client/README.adoc index a127b32e8..3a38e7489 100644 --- a/vertx-oracle-client/README.adoc +++ b/vertx-oracle-client/README.adoc @@ -24,14 +24,14 @@ You can start an external database: [source,bash] ---- -docker run -t -i -p 1521:1521 -e ORACLE_PASSWORD=vertx gvenzl/oracle-xe:21-slim +docker run -t -i -p 1521:1521 -e ORACLE_PASSWORD=vertx gvenzl/oracle-free:23-slim-faststart ---- Then run tests against it: [source,bash] ---- -mvn test -Dconnection.uri=oracle:thin:system/vertx@127.0.0.1:1521:xe +mvn test -Dconnection.uri="oracle:thin:sys as sysdba/vertx@localhost:1521/FREEPDB1" ---- * `connection.uri`: configure the client to connect to the specified database diff --git a/vertx-oracle-client/pom.xml b/vertx-oracle-client/pom.xml index b92e5ef01..595b91965 100644 --- a/vertx-oracle-client/pom.xml +++ b/vertx-oracle-client/pom.xml @@ -40,7 +40,7 @@ 11 11 - 21.7.0.0 + 23.3.0.23.09 diff --git a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/junit/OracleRule.java b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/junit/OracleRule.java index df8857890..bff36138e 100644 --- a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/junit/OracleRule.java +++ b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/junit/OracleRule.java @@ -24,9 +24,9 @@ public class OracleRule extends ExternalResource { public static final OracleRule SHARED_INSTANCE = new OracleRule(); - static final String IMAGE = "gvenzl/oracle-xe"; - static final String PASSWORD = "vertx"; - static final int PORT = 1521; + private static final String IMAGE = "gvenzl/oracle-free"; + private static final String PASSWORD = "vertx"; + private static final int PORT = 1521; private ServerContainer server; private OracleConnectOptions options; @@ -55,7 +55,7 @@ protected void after() { private OracleConnectOptions startOracle() throws IOException { String containerVersion = System.getProperty("oracle-container.version"); - containerVersion = isNullOrEmpty(containerVersion) ? "21-slim" : containerVersion; + containerVersion = isNullOrEmpty(containerVersion) ? "23-slim-faststart" : containerVersion; String image = IMAGE + ":" + containerVersion; @@ -79,7 +79,7 @@ private OracleConnectOptions startOracle() throws IOException { .setPort(server.getMappedPort(PORT)) .setUser("sys as sysdba") .setPassword(PASSWORD) - .setDatabase("xe"); + .setDatabase("FREEPDB1"); } private void stopOracle() { diff --git a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OraclePreparedQueryTest.java b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OraclePreparedQueryTest.java index 95024a562..1aaeb4cf1 100644 --- a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OraclePreparedQueryTest.java +++ b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OraclePreparedQueryTest.java @@ -50,9 +50,7 @@ public void testPreparedQueryParamCoercionTypeError(TestContext ctx) { @Override public void testPreparedQueryParamCoercionQuantityError(TestContext ctx) { - msgVerifier = t -> { - ctx.assertEquals("Invalid column index", t.getMessage()); - }; + msgVerifier = t -> ctx.assertTrue(t.getMessage().contains("Invalid column index")); super.testPreparedQueryParamCoercionQuantityError(ctx); } } diff --git a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleTransactionTest.java b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleTransactionTest.java index 9200b70b8..eb545ea3e 100644 --- a/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleTransactionTest.java +++ b/vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleTransactionTest.java @@ -14,6 +14,7 @@ import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; import io.vertx.oracleclient.OraclePool; +import io.vertx.oracleclient.OraclePrepareOptions; import io.vertx.oracleclient.test.junit.OracleRule; import io.vertx.sqlclient.Pool; import io.vertx.sqlclient.PoolOptions; @@ -65,4 +66,13 @@ public void testTransactionDoNotLeaveOpenCursors(TestContext ctx) { }, ctx.asyncAssertSuccess(v -> async.countDown())); } } + + @Test + public void testConstraintViolationIsReported(TestContext ctx) { + pool.withConnection(conn -> { + String sql = "INSERT INTO passenger (nif, name, last_name, contact_number, created_at, address_id)\n" + + "VALUES (null, 'Walt', 'White', '+34608554433', 1691060927694, 2)"; + return conn.preparedQuery(sql, new OraclePrepareOptions().setAutoGeneratedKeys(true)).execute(); + }).onComplete(ctx.asyncAssertFailure()); + } } diff --git a/vertx-oracle-client/src/test/resources/tck/import.sql b/vertx-oracle-client/src/test/resources/tck/import.sql index 606c80f62..406cb38fa 100644 --- a/vertx-oracle-client/src/test/resources/tck/import.sql +++ b/vertx-oracle-client/src/test/resources/tck/import.sql @@ -1,3 +1,5 @@ +ALTER SESSION SET CONTAINER=FREEPDB1; + CREATE TABLE World ( id INTEGER NOT NULL, @@ -154,5 +156,19 @@ VALUES (2, date '2019-11-04', timestamp '2018-11-04 15:13:28', timestamp '2019-1 INSERT INTO temporal_data_types(id, test_date, test_timestamp, test_timestamp_with_timezone) VALUES (3, NULL, NULL, NULL); +-- No response reproducer + +CREATE TABLE passenger +( + id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + nif VARCHAR(15) NOT NULL, + name VARCHAR(25) NOT NULL, + last_name VARCHAR(55) NOT NULL, + contact_number VARCHAR(20) NOT NULL, + created_at INT NOT NULL, + updated_at INT, + address_id NUMBER +); + -- Don't forget to commit... COMMIT;