Skip to content

Commit

Permalink
Upgrade to Oracle 23 (#1368)
Browse files Browse the repository at this point in the history
Related to #1343

Signed-off-by: Thomas Segismont <[email protected]>
  • Loading branch information
tsegismont authored Oct 13, 2023
1 parent b44afc9 commit 9cf145a
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-4.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@
</modules>
</profile>
<profile>
<id>Oracle-21</id>
<id>Oracle-23</id>
<properties>
<oracle-container.version>21-slim</oracle-container.version>
<oracle-container.version>23.3-slim-faststart</oracle-container.version>
</properties>
<modules>
<module>vertx-sql-client</module>
Expand Down
4 changes: 2 additions & 2 deletions vertx-oracle-client/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion vertx-oracle-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

<ojdbc.version>21.7.0.0</ojdbc.version>
<ojdbc.version>23.3.0.23.09</ojdbc.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}
16 changes: 16 additions & 0 deletions vertx-oracle-client/src/test/resources/tck/import.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ALTER SESSION SET CONTAINER=FREEPDB1;

CREATE TABLE World
(
id INTEGER NOT NULL,
Expand Down Expand Up @@ -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;

0 comments on commit 9cf145a

Please sign in to comment.