Skip to content

Commit 54133ed

Browse files
takezoeebyhr
authored andcommitted
Upgrade Oracle docker image for testing to oracle-free 23
1 parent 4254df7 commit 54133ed

File tree

8 files changed

+27
-19
lines changed

8 files changed

+27
-19
lines changed

client/trino-jdbc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345

346346
<dependency>
347347
<groupId>org.testcontainers</groupId>
348-
<artifactId>oracle-xe</artifactId>
348+
<artifactId>oracle-free</artifactId>
349349
<scope>test</scope>
350350
</dependency>
351351

client/trino-jdbc/src/test/java/io/trino/jdbc/TestJdbcVendorCompatibility.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import org.junit.jupiter.api.Test;
2525
import org.junit.jupiter.api.TestInstance;
2626
import org.junit.jupiter.api.parallel.Execution;
27-
import org.testcontainers.containers.OracleContainer;
2827
import org.testcontainers.containers.PostgreSQLContainer;
28+
import org.testcontainers.oracle.OracleContainer;
2929

3030
import java.io.Closeable;
3131
import java.sql.Connection;
@@ -539,7 +539,7 @@ private static class OracleReferenceDriver
539539

540540
OracleReferenceDriver()
541541
{
542-
oracleServer = new OracleContainer("gvenzl/oracle-xe:11.2.0.2-full")
542+
oracleServer = new OracleContainer("gvenzl/oracle-free:23.9-slim")
543543
.usingSid();
544544
oracleServer.start();
545545
}

docs/src/main/sphinx/connector/oracle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ like Oracle and Hive, or different Oracle database instances.
1818

1919
To connect to Oracle, you need:
2020

21-
- Oracle 19 or higher.
21+
- Oracle 23 or higher.
2222
- Network access from the Trino coordinator and workers to Oracle.
2323
Port 1521 is the default port.
2424

plugin/trino-oracle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251

252252
<dependency>
253253
<groupId>org.testcontainers</groupId>
254-
<artifactId>oracle-xe</artifactId>
254+
<artifactId>oracle-free</artifactId>
255255
<scope>test</scope>
256256
</dependency>
257257

plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/BaseOracleConnectorTest.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void testInformationSchemaFiltering()
137137
@Override
138138
protected boolean isColumnNameRejected(Exception exception, String columnName, boolean delimited)
139139
{
140-
if (columnName.equals("a\"quote") && exception.getMessage().contains("ORA-03001: unimplemented feature")) {
140+
if (columnName.equals("a\"quote") && exception.getMessage().contains("ORA-25716: The identifier contains a double quotation mark (\") character")) {
141141
return true;
142142
}
143143

@@ -375,6 +375,14 @@ public void testTooLargeDomainCompactionThreshold()
375375
"SELECT * from nation", "Domain compaction threshold \\(10000\\) cannot exceed 1000");
376376
}
377377

378+
@Test
379+
@Override // Override because Oracle allows SELECT query in execute procedure
380+
public void testExecuteProcedureWithInvalidQuery()
381+
{
382+
assertUpdate("CALL system.execute('SELECT 1')");
383+
assertQueryFails("CALL system.execute('invalid')", "(?s)Failed to execute query.*");
384+
}
385+
378386
@Test
379387
@Override
380388
public void testNativeQuerySimple()
@@ -444,37 +452,37 @@ protected void verifyConcurrentAddColumnFailurePermissible(Exception e)
444452
@Override
445453
protected OptionalInt maxSchemaNameLength()
446454
{
447-
return OptionalInt.of(30);
455+
return OptionalInt.of(128);
448456
}
449457

450458
@Override
451459
protected void verifySchemaNameLengthFailurePermissible(Throwable e)
452460
{
453-
assertThat(e).hasMessageContaining("ORA-00972: identifier is too long");
461+
assertThat(e).hasMessageContaining("ORA-00972");
454462
}
455463

456464
@Override
457465
protected OptionalInt maxTableNameLength()
458466
{
459-
return OptionalInt.of(30);
467+
return OptionalInt.of(128);
460468
}
461469

462470
@Override
463471
protected void verifyTableNameLengthFailurePermissible(Throwable e)
464472
{
465-
assertThat(e).hasMessageContaining("ORA-00972: identifier is too long");
473+
assertThat(e).hasMessageContaining("ORA-00972");
466474
}
467475

468476
@Override
469477
protected OptionalInt maxColumnNameLength()
470478
{
471-
return OptionalInt.of(30);
479+
return OptionalInt.of(128);
472480
}
473481

474482
@Override
475483
protected void verifyColumnNameLengthFailurePermissible(Throwable e)
476484
{
477-
assertThat(e).hasMessageContaining("ORA-00972: identifier is too long");
485+
assertThat(e).hasMessageContaining("ORA-00972");
478486
}
479487

480488
@Override

plugin/trino-oracle/src/test/java/io/trino/plugin/oracle/TestingOracleServer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import io.trino.plugin.jdbc.credential.StaticCredentialProvider;
2525
import io.trino.plugin.jdbc.jmx.StatisticsAwareConnectionFactory;
2626
import oracle.jdbc.OracleDriver;
27-
import org.testcontainers.containers.OracleContainer;
27+
import org.testcontainers.oracle.OracleContainer;
2828
import org.testcontainers.utility.MountableFile;
2929

3030
import java.io.Closeable;
@@ -73,11 +73,10 @@ public TestingOracleServer()
7373

7474
private void createContainer()
7575
{
76-
OracleContainer container = new OracleContainer("gvenzl/oracle-xe:11.2.0.2-full")
76+
OracleContainer container = new OracleContainer("gvenzl/oracle-free:23.9-slim")
7777
.withCopyFileToContainer(MountableFile.forClasspathResource("init.sql"), "/container-entrypoint-initdb.d/01-init.sql")
7878
.withCopyFileToContainer(MountableFile.forClasspathResource("restart.sh"), "/container-entrypoint-initdb.d/02-restart.sh")
79-
.withCopyFileToContainer(MountableFile.forHostPath(createConfigureScript()), "/container-entrypoint-initdb.d/03-create-users.sql")
80-
.usingSid();
79+
.withCopyFileToContainer(MountableFile.forHostPath(createConfigureScript()), "/container-entrypoint-initdb.d/03-create-users.sql");
8180
try {
8281
this.cleanup = startOrReuse(container);
8382
this.container = container;
@@ -95,6 +94,7 @@ private Path createConfigureScript()
9594
File tempFile = File.createTempFile("init-", ".sql");
9695

9796
Files.write(Joiner.on("\n").join(
97+
format("ALTER SESSION SET CONTAINER=FREEPDB1;"),
9898
format("CREATE TABLESPACE %s DATAFILE 'test_db.dat' SIZE 100M ONLINE;", TEST_TABLESPACE),
9999
format("CREATE USER %s IDENTIFIED BY %s DEFAULT TABLESPACE %s;", TEST_USER, TEST_PASS, TEST_TABLESPACE),
100100
format("GRANT UNLIMITED TABLESPACE TO %s;", TEST_USER),

plugin/trino-resource-group-managers/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256

257257
<dependency>
258258
<groupId>org.testcontainers</groupId>
259-
<artifactId>oracle-xe</artifactId>
259+
<artifactId>oracle-free</artifactId>
260260
<scope>test</scope>
261261
</dependency>
262262

plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupsOracleFlywayMigration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import org.jdbi.v3.core.Handle;
1717
import org.testcontainers.containers.JdbcDatabaseContainer;
18-
import org.testcontainers.containers.OracleContainer;
18+
import org.testcontainers.oracle.OracleContainer;
1919

2020
import java.sql.DatabaseMetaData;
2121
import java.sql.ResultSet;
@@ -28,7 +28,7 @@ public class TestDbResourceGroupsOracleFlywayMigration
2828
@Override
2929
protected final JdbcDatabaseContainer<?> startContainer()
3030
{
31-
JdbcDatabaseContainer<?> container = new OracleContainer("gvenzl/oracle-xe:18.4.0-slim")
31+
JdbcDatabaseContainer<?> container = new OracleContainer("gvenzl/oracle-free:23.9-slim")
3232
.withPassword("trino")
3333
.withEnv("ORACLE_PASSWORD", "trino");
3434
container.start();

0 commit comments

Comments
 (0)