From 423e206c41c7a98a5664f519f2c97ed09e62840d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 21 Mar 2024 12:54:16 +0100 Subject: [PATCH] revert: "Add MySQL implementation (#803)" (#807) This reverts commit 98710d8d6b105481b857cea2bbe86ed4d0792d52. --- .../jdbc/state/DurableStateQueries.scala | 1 - .../jdbc/state/SequenceNextValUpdater.scala | 16 ---------------- .../MySQLDurableStateStorePluginSpec.scala | 8 -------- ...QLScalaJdbcDurableStateChangesByTagTest.scala | 16 ---------------- 4 files changed, 41 deletions(-) delete mode 100644 integration/src/test/scala/akka/persistence/jdbc/integration/MySQLDurableStateStorePluginSpec.scala delete mode 100644 integration/src/test/scala/akka/persistence/jdbc/integration/MySQLScalaJdbcDurableStateChangesByTagTest.scala diff --git a/core/src/main/scala/akka/persistence/jdbc/state/DurableStateQueries.scala b/core/src/main/scala/akka/persistence/jdbc/state/DurableStateQueries.scala index 87f339ae0..6a98adad2 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/DurableStateQueries.scala +++ b/core/src/main/scala/akka/persistence/jdbc/state/DurableStateQueries.scala @@ -39,7 +39,6 @@ import akka.persistence.jdbc.config.DurableStateTableConfiguration lazy val sequenceNextValUpdater = slickProfileToSchemaType(profile) match { case "H2" => new H2SequenceNextValUpdater(profile, durableStateTableCfg) case "Postgres" => new PostgresSequenceNextValUpdater(profile, durableStateTableCfg) - case "MySQL" => new MySQLSequenceNextValUpdater(profile, durableStateTableCfg) case _ => ??? } diff --git a/core/src/main/scala/akka/persistence/jdbc/state/SequenceNextValUpdater.scala b/core/src/main/scala/akka/persistence/jdbc/state/SequenceNextValUpdater.scala index 3feeb4085..65cbb1bed 100644 --- a/core/src/main/scala/akka/persistence/jdbc/state/SequenceNextValUpdater.scala +++ b/core/src/main/scala/akka/persistence/jdbc/state/SequenceNextValUpdater.scala @@ -51,19 +51,3 @@ import slick.sql.SqlStreamingAction def getSequenceNextValueExpr() = sql"""#$nextValFetcher""".as[String] } - -/** - * INTERNAL API - */ -@InternalApi private[jdbc] class MySQLSequenceNextValUpdater( - profile: JdbcProfile, - val durableStateTableCfg: DurableStateTableConfiguration) - extends SequenceNextValUpdater { - import profile.api._ - private val schema = durableStateTableCfg.schemaName.map(n => s"'$n'").getOrElse("DATABASE()") - // Note: for actual MySQL servers (i.e. not MariaDB) the variable information_schema_stats_expiry should be set to zero. - final val nextValFetcher = - s"""(SELECT AUTO_INCREMENT FROM information_schema.tables WHERE table_name = '${durableStateTableCfg.tableName}' AND table_schema = ${schema})""" - - def getSequenceNextValueExpr() = sql"""#$nextValFetcher""".as[String] -} diff --git a/integration/src/test/scala/akka/persistence/jdbc/integration/MySQLDurableStateStorePluginSpec.scala b/integration/src/test/scala/akka/persistence/jdbc/integration/MySQLDurableStateStorePluginSpec.scala deleted file mode 100644 index c3ef795f4..000000000 --- a/integration/src/test/scala/akka/persistence/jdbc/integration/MySQLDurableStateStorePluginSpec.scala +++ /dev/null @@ -1,8 +0,0 @@ -package akka.persistence.jdbc.integration - -import com.typesafe.config.ConfigFactory -import slick.jdbc.MySQLProfile -import akka.persistence.jdbc.state.scaladsl.DurableStateStorePluginSpec - -class MySQLDurableStateStorePluginSpec - extends DurableStateStorePluginSpec(ConfigFactory.load("mysql-shared-db-application.conf"), MySQLProfile) {} diff --git a/integration/src/test/scala/akka/persistence/jdbc/integration/MySQLScalaJdbcDurableStateChangesByTagTest.scala b/integration/src/test/scala/akka/persistence/jdbc/integration/MySQLScalaJdbcDurableStateChangesByTagTest.scala deleted file mode 100644 index 71ec11b09..000000000 --- a/integration/src/test/scala/akka/persistence/jdbc/integration/MySQLScalaJdbcDurableStateChangesByTagTest.scala +++ /dev/null @@ -1,16 +0,0 @@ -package akka.persistence.jdbc.integration - -import com.typesafe.config.ConfigFactory -import akka.actor.ActorSystem -import akka.persistence.jdbc.state.scaladsl.JdbcDurableStateSpec -import akka.persistence.jdbc.testkit.internal.MySQL -import org.scalatest.Ignore - -// FIXME this test doesn't pass because of something with SequenceNextValUpdater -@Ignore -class MySQLScalaJdbcDurableStateStoreQueryTest - extends JdbcDurableStateSpec(ConfigFactory.load("mysql-shared-db-application.conf"), MySQL) { - implicit lazy val system: ActorSystem = - ActorSystem("JdbcDurableStateSpec", config.withFallback(customSerializers)) - -}