Skip to content

Commit c20effa

Browse files
authored
Upgrade to Oracle 23 (#1367)
Related to #1343 Signed-off-by: Thomas Segismont <[email protected]>
1 parent b228e10 commit c20effa

File tree

8 files changed

+39
-15
lines changed

8 files changed

+39
-15
lines changed

.github/workflows/ci-4.x.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest]
19-
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]
19+
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]
2020
jdk: [8, 17]
2121
exclude:
22-
- profile: Oracle-21
22+
- profile: Oracle-23
2323
jdk: 8
2424
- profile: DB2-11.5
2525
jdk: 17

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@
232232
</modules>
233233
</profile>
234234
<profile>
235-
<id>Oracle-21</id>
235+
<id>Oracle-23</id>
236236
<properties>
237-
<oracle-container.version>21-slim</oracle-container.version>
237+
<oracle-container.version>23.3-slim-faststart</oracle-container.version>
238238
</properties>
239239
<modules>
240240
<module>vertx-sql-client</module>

vertx-oracle-client/README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ You can start an external database:
2424

2525
[source,bash]
2626
----
27-
docker run -t -i -p 1521:1521 -e ORACLE_PASSWORD=vertx gvenzl/oracle-xe:21-slim
27+
docker run -t -i -p 1521:1521 -e ORACLE_PASSWORD=vertx gvenzl/oracle-free:23-slim-faststart
2828
----
2929

3030
Then run tests against it:
3131

3232
[source,bash]
3333
----
34-
mvn test -Dconnection.uri=oracle:thin:system/vertx@127.0.0.1:1521:xe
34+
mvn test -Dconnection.uri="oracle:thin:sys as sysdba/vertx@localhost:1521/FREEPDB1"
3535
----
3636

3737
* `connection.uri`: configure the client to connect to the specified database

vertx-oracle-client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<maven.compiler.source>11</maven.compiler.source>
4141
<maven.compiler.target>11</maven.compiler.target>
4242

43-
<ojdbc.version>21.7.0.0</ojdbc.version>
43+
<ojdbc.version>23.3.0.23.09</ojdbc.version>
4444
</properties>
4545

4646
<dependencies>

vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/junit/OracleRule.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public class OracleRule extends ExternalResource {
2424

2525
public static final OracleRule SHARED_INSTANCE = new OracleRule();
2626

27-
static final String IMAGE = "gvenzl/oracle-xe";
28-
static final String PASSWORD = "vertx";
29-
static final int PORT = 1521;
27+
private static final String IMAGE = "gvenzl/oracle-free";
28+
private static final String PASSWORD = "vertx";
29+
private static final int PORT = 1521;
3030

3131
private ServerContainer<?> server;
3232
private OracleConnectOptions options;
@@ -55,7 +55,7 @@ protected void after() {
5555

5656
private OracleConnectOptions startOracle() throws IOException {
5757
String containerVersion = System.getProperty("oracle-container.version");
58-
containerVersion = isNullOrEmpty(containerVersion) ? "21-slim" : containerVersion;
58+
containerVersion = isNullOrEmpty(containerVersion) ? "23-slim-faststart" : containerVersion;
5959

6060
String image = IMAGE + ":" + containerVersion;
6161

@@ -79,7 +79,7 @@ private OracleConnectOptions startOracle() throws IOException {
7979
.setPort(server.getMappedPort(PORT))
8080
.setUser("sys as sysdba")
8181
.setPassword(PASSWORD)
82-
.setDatabase("xe");
82+
.setDatabase("FREEPDB1");
8383
}
8484

8585
private void stopOracle() {

vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OraclePreparedQueryTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public void testPreparedQueryParamCoercionTypeError(TestContext ctx) {
5050

5151
@Override
5252
public void testPreparedQueryParamCoercionQuantityError(TestContext ctx) {
53-
msgVerifier = t -> {
54-
ctx.assertEquals("Invalid column index", t.getMessage());
55-
};
53+
msgVerifier = t -> ctx.assertTrue(t.getMessage().contains("Invalid column index"));
5654
super.testPreparedQueryParamCoercionQuantityError(ctx);
5755
}
5856
}

vertx-oracle-client/src/test/java/io/vertx/oracleclient/test/tck/OracleTransactionTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import io.vertx.ext.unit.TestContext;
1515
import io.vertx.ext.unit.junit.VertxUnitRunner;
1616
import io.vertx.oracleclient.OracleBuilder;
17+
import io.vertx.oracleclient.OraclePrepareOptions;
1718
import io.vertx.oracleclient.test.junit.OracleRule;
1819
import io.vertx.sqlclient.Pool;
1920
import io.vertx.sqlclient.PoolOptions;
@@ -71,4 +72,13 @@ public void testTransactionDoNotLeaveOpenCursors(TestContext ctx) {
7172
}, ctx.asyncAssertSuccess(v -> async.countDown()));
7273
}
7374
}
75+
76+
@Test
77+
public void testConstraintViolationIsReported(TestContext ctx) {
78+
pool.withConnection(conn -> {
79+
String sql = "INSERT INTO passenger (nif, name, last_name, contact_number, created_at, address_id)\n" +
80+
"VALUES (null, 'Walt', 'White', '+34608554433', 1691060927694, 2)";
81+
return conn.preparedQuery(sql, new OraclePrepareOptions().setAutoGeneratedKeys(true)).execute();
82+
}).onComplete(ctx.asyncAssertFailure());
83+
}
7484
}

vertx-oracle-client/src/test/resources/tck/import.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ALTER SESSION SET CONTAINER=FREEPDB1;
2+
13
CREATE TABLE World
24
(
35
id INTEGER NOT NULL,
@@ -154,5 +156,19 @@ VALUES (2, date '2019-11-04', timestamp '2018-11-04 15:13:28', timestamp '2019-1
154156
INSERT INTO temporal_data_types(id, test_date, test_timestamp, test_timestamp_with_timezone)
155157
VALUES (3, NULL, NULL, NULL);
156158

159+
-- No response reproducer
160+
161+
CREATE TABLE passenger
162+
(
163+
id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
164+
nif VARCHAR(15) NOT NULL,
165+
name VARCHAR(25) NOT NULL,
166+
last_name VARCHAR(55) NOT NULL,
167+
contact_number VARCHAR(20) NOT NULL,
168+
created_at INT NOT NULL,
169+
updated_at INT,
170+
address_id NUMBER
171+
);
172+
157173
-- Don't forget to commit...
158174
COMMIT;

0 commit comments

Comments
 (0)