Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion client/trino-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<artifactId>oracle-free</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.parallel.Execution;
import org.testcontainers.containers.OracleContainer;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.oracle.OracleContainer;

import java.io.Closeable;
import java.sql.Connection;
Expand Down Expand Up @@ -539,7 +539,7 @@ private static class OracleReferenceDriver

OracleReferenceDriver()
{
oracleServer = new OracleContainer("gvenzl/oracle-xe:11.2.0.2-full")
oracleServer = new OracleContainer("gvenzl/oracle-free:23.9-slim")
.usingSid();
oracleServer.start();
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/connector/oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ like Oracle and Hive, or different Oracle database instances.

To connect to Oracle, you need:

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

Expand Down
8 changes: 7 additions & 1 deletion plugin/trino-oracle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<artifactId>jdbc</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-free</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void testInformationSchemaFiltering()
@Override
protected boolean isColumnNameRejected(Exception exception, String columnName, boolean delimited)
{
if (columnName.equals("a\"quote") && exception.getMessage().contains("ORA-03001: unimplemented feature")) {
if (columnName.equals("a\"quote") && exception.getMessage().contains("ORA-25716: The identifier contains a double quotation mark (\") character")) {
return true;
}

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

@Test
@Override // Override because Oracle allows SELECT query in execute procedure
public void testExecuteProcedureWithInvalidQuery()
{
assertUpdate("CALL system.execute('SELECT 1')");
assertQueryFails("CALL system.execute('invalid')", "(?s)Failed to execute query.*");
}

@Test
@Override
public void testNativeQuerySimple()
Expand Down Expand Up @@ -444,37 +452,37 @@ protected void verifyConcurrentAddColumnFailurePermissible(Exception e)
@Override
protected OptionalInt maxSchemaNameLength()
{
return OptionalInt.of(30);
return OptionalInt.of(128);
}

@Override
protected void verifySchemaNameLengthFailurePermissible(Throwable e)
{
assertThat(e).hasMessageContaining("ORA-00972: identifier is too long");
assertThat(e).hasMessageContaining("ORA-00972");
}

@Override
protected OptionalInt maxTableNameLength()
{
return OptionalInt.of(30);
return OptionalInt.of(128);
}

@Override
protected void verifyTableNameLengthFailurePermissible(Throwable e)
{
assertThat(e).hasMessageContaining("ORA-00972: identifier is too long");
assertThat(e).hasMessageContaining("ORA-00972");
}

@Override
protected OptionalInt maxColumnNameLength()
{
return OptionalInt.of(30);
return OptionalInt.of(128);
}

@Override
protected void verifyColumnNameLengthFailurePermissible(Throwable e)
{
assertThat(e).hasMessageContaining("ORA-00972: identifier is too long");
assertThat(e).hasMessageContaining("ORA-00972");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import io.trino.plugin.jdbc.credential.StaticCredentialProvider;
import io.trino.plugin.jdbc.jmx.StatisticsAwareConnectionFactory;
import oracle.jdbc.OracleDriver;
import org.testcontainers.containers.OracleContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.oracle.OracleContainer;
import org.testcontainers.utility.MountableFile;

import java.io.Closeable;
Expand All @@ -36,6 +37,7 @@
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.time.Duration;
import java.time.temporal.ChronoUnit;

import static io.trino.testing.TestingConnectorSession.SESSION;
Expand Down Expand Up @@ -73,11 +75,12 @@ public TestingOracleServer()

private void createContainer()
{
OracleContainer container = new OracleContainer("gvenzl/oracle-xe:11.2.0.2-full")
OracleContainer container = new OracleContainer("gvenzl/oracle-free:23.9-slim")
.withCopyFileToContainer(MountableFile.forClasspathResource("init.sql"), "/container-entrypoint-initdb.d/01-init.sql")
.withCopyFileToContainer(MountableFile.forClasspathResource("restart.sh"), "/container-entrypoint-initdb.d/02-restart.sh")
.withCopyFileToContainer(MountableFile.forHostPath(createConfigureScript()), "/container-entrypoint-initdb.d/03-create-users.sql")
.usingSid();
.waitingFor(Wait.forLogMessage(".*DATABASE IS READY TO USE!.*\\s", 1).withStartupTimeout(Duration.ofMinutes(2)))
.withStartupTimeoutSeconds(180);
try {
this.cleanup = startOrReuse(container);
this.container = container;
Expand All @@ -95,6 +98,7 @@ private Path createConfigureScript()
File tempFile = File.createTempFile("init-", ".sql");

Files.write(Joiner.on("\n").join(
format("ALTER SESSION SET CONTAINER=FREEPDB1;"),
format("CREATE TABLESPACE %s DATAFILE 'test_db.dat' SIZE 100M ONLINE;", TEST_TABLESPACE),
format("CREATE USER %s IDENTIFIED BY %s DEFAULT TABLESPACE %s;", TEST_USER, TEST_PASS, TEST_TABLESPACE),
format("GRANT UNLIMITED TABLESPACE TO %s;", TEST_USER),
Expand Down
2 changes: 1 addition & 1 deletion plugin/trino-resource-group-managers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<artifactId>oracle-free</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import org.jdbi.v3.core.Handle;
import org.testcontainers.containers.JdbcDatabaseContainer;
import org.testcontainers.containers.OracleContainer;
import org.testcontainers.oracle.OracleContainer;

import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
Expand All @@ -28,7 +28,7 @@ public class TestDbResourceGroupsOracleFlywayMigration
@Override
protected final JdbcDatabaseContainer<?> startContainer()
{
JdbcDatabaseContainer<?> container = new OracleContainer("gvenzl/oracle-xe:18.4.0-slim")
JdbcDatabaseContainer<?> container = new OracleContainer("gvenzl/oracle-free:23.9-slim")
.withPassword("trino")
.withEnv("ORACLE_PASSWORD", "trino");
container.start();
Expand Down