Skip to content

Allow super previleges configuration #2627

@membersound

Description

@membersound

I'm writing an integration test for a batch LOAD DATA process.
Problem: the process to test executes a SET sql_log_bin = 0. On a normal mariadb that's no problem if the executing user has the correct permissions.

But the testcontainers user does not. Also also tried using root/test as login credentials for the testcontainers database. Same result.

So could you add some kind of boolean flag that allows super previleges being executed?

java.sql.DataSource ds;
java.sql.Connection con = DataSourceUtils.getConnection(ds);
Statement st = con.createStatement();
st.executeQuery("SET sql_log_bin = 0"); //this fails!
//...
st.executeBatch();
JdbcUtils.closeStatement(st);

Result:

java.sql.SQLSyntaxErrorException: (conn=9) Access denied; you need (at least one of) the SUPER privilege(s) for this operation
	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:242) ~[mariadb-java-client-2.4.4.jar:na]
	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:171) ~[mariadb-java-client-2.4.4.jar:na]
	at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:248) ~[mariadb-java-client-2.4.4.jar:na]
	at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:338) ~[mariadb-java-client-2.4.4.jar:na]
	at org.mariadb.jdbc.MariaDbStatement.executeQuery(MariaDbStatement.java:512) ~[mariadb-java-client-2.4.4.jar:na]
	at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:111) ~[HikariCP-3.4.2.jar:na]
	at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java) ~[HikariCP-3.4.2.jar:na]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions