Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 docs/src/main/sphinx/connector/mariadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ database.

To connect to MariaDB, you need:

- MariaDB version 10.2 or higher.
- MariaDB version 10.10 or higher.
- Network access from the Trino coordinator and workers to MariaDB. Port
3306 is the default port.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
import com.google.common.collect.ImmutableMap;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import org.junit.jupiter.api.Test;

import static io.trino.plugin.mariadb.MariaDbQueryRunner.createMariaDbQueryRunner;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

public class TestMariaDbConnectorTest
extends BaseMariaDbConnectorTest
Expand All @@ -37,30 +35,4 @@ protected SqlExecutor onRemoteDatabase()
{
return server::execute;
}

@Test
@Override
public void testRenameColumn()
{
assertThatThrownBy(super::testRenameColumn)
.hasMessageContaining("Rename column not supported for the MariaDB server version");
}

@Test
@Override
public void testRenameColumnName()
{
for (String columnName : testColumnNameDataProvider()) {
assertThatThrownBy(() -> testRenameColumnName(columnName, requiresDelimiting(columnName)))
.hasMessageContaining("Rename column not supported for the MariaDB server version");
}
}

@Test
@Override
public void testAlterTableRenameColumnToLongName()
{
assertThatThrownBy(super::testAlterTableRenameColumnToLongName)
.hasMessageContaining("Rename column not supported for the MariaDB server version");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@
package io.trino.plugin.mariadb;

import com.google.common.collect.ImmutableMap;
import io.trino.plugin.jdbc.BaseJdbcConnectorSmokeTest;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import io.trino.testing.TestingConnectorBehavior;

import static io.trino.plugin.mariadb.MariaDbQueryRunner.createMariaDbQueryRunner;
import static io.trino.plugin.mariadb.TestingMariaDbServer.LATEST_VERSION;

public class TestMariaDbLatestConnectorTest
extends BaseMariaDbConnectorTest
public class TestMariaDbLatestConnectorSmokeTest
extends BaseJdbcConnectorSmokeTest
{
@Override
protected QueryRunner createQueryRunner()
throws Exception
protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
{
server = closeAfterClass(new TestingMariaDbServer(LATEST_VERSION));
return createMariaDbQueryRunner(server, ImmutableMap.of(), ImmutableMap.of(), REQUIRED_TPCH_TABLES);
return switch (connectorBehavior) {
case SUPPORTS_RENAME_SCHEMA -> false;
default -> super.hasBehavior(connectorBehavior);
};
}

@Override
protected SqlExecutor onRemoteDatabase()
protected QueryRunner createQueryRunner()
throws Exception
{
return server::execute;
TestingMariaDbServer server = closeAfterClass(new TestingMariaDbServer(LATEST_VERSION));
return createMariaDbQueryRunner(server, ImmutableMap.of(), ImmutableMap.of(), REQUIRED_TPCH_TABLES);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
public class TestingMariaDbServer
implements AutoCloseable
{
public static final String LATEST_VERSION = "10.7.1";
public static final String DEFAULT_VERSION = "10.2";
public static final String LATEST_VERSION = "11.1.3";
public static final String DEFAULT_VERSION = "10.10";
private static final int MARIADB_PORT = 3306;

private final MariaDBContainer<?> container;
Expand Down