Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't create mysql trigger in dev container #20654

Closed
Dieken opened this issue Oct 10, 2021 · 5 comments · Fixed by #22648
Closed

can't create mysql trigger in dev container #20654

Dieken opened this issue Oct 10, 2021 · 5 comments · Fixed by #22648
Labels
kind/bug Something isn't working
Milestone

Comments

@Dieken
Copy link
Contributor

Dieken commented Oct 10, 2021

Describe the bug

If I put CREATE TRIGGER ... in my Flyway migration sql, quarkus dev will complain:

2021-10-10 21:22:19,770 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.sql.SQLException: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

According to https://www.testcontainers.org/modules/databases/mysql/, I set these properties but they don't work:

%dev.quarkus.datasource.devservices.properties.TC_MY_CNF=testcontainers/mysql_conf
%test.quarkus.datasource.devservices.properties.TC_MY_CNF=testcontainers/mysql_conf
$ cat src/main/resources/testcontainers/mysql_conf/extra.cnf 
[mysqld]
log_bin_trust_function_creators=ON

Expected behavior

The extra.cnf should be mounted into mysql container.

Actual behavior

The extra.cnf isn't mounted into mysql container.

How to Reproduce?

Put some CREATE TRIGGER ... in src/main/resources/db/migration/V1.0.0__init.sql, run quarkus dev to make it create mysql container automatically.

Output of uname -a or ver

Darwin XXX.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

Output of java -version

OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Client Version 2.3.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

quarkus dev

Additional information

No response

@Dieken Dieken added the kind/bug Something isn't working label Oct 10, 2021
@Dieken
Copy link
Contributor Author

Dieken commented Oct 25, 2021

Quarkus uses jdbc:mysql://localhost:PORT instead of jdbc:tc:mysql:VERSION://hostname/, I guess this is why TC_MY_CNF doesn't work: https://www.testcontainers.org/modules/databases/mysql/

@gsmet
Copy link
Member

gsmet commented Jan 5, 2022

We cannot use that because we don't want to use the org.testcontainers.jdbc.ContainerDatabaseDriver to start the containers. I'm working on a PR that should make it work. I'll post here in a few.

@gsmet
Copy link
Member

gsmet commented Jan 5, 2022

@Dieken sorry for the delay but could you check if #22648 make it work for you?

There are instructions here on how to build our main, you can follow them, just use the code from my branch instead: https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#building-main

gsmet added a commit to gsmet/quarkus that referenced this issue Jan 5, 2022
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Jan 7, 2022
@Dieken
Copy link
Contributor Author

Dieken commented Jan 17, 2022

@Dieken sorry for the delay but could you check if #22648 make it work for you?

There are instructions here on how to build our main, you can follow them, just use the code from my branch instead: https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#building-main

@gsmet, Verified it works for me, thank you very much!

@gsmet
Copy link
Member

gsmet commented Jan 17, 2022

@Dieken thanks for taking the time to check. It's going to be part of the upcoming 2.7 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants