playframework / playframework/play-ebean

Evolution can't be run due to "delimiter $$" DDL parsing bug - Play 3, Ebean 8

Open
#496 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
111
Forks
67
Avg merge
1d 11h
Merged PRs (30d)
19

Description

We've been using play 2.8.1 with play-ebean 6.0.0 and java 1.8 for years now.

Recently, we decided to upgrade to play 3.0.5, play-ebean 8.3.0 and java 21, but it's been a nightmare due to the play architectural bug which has been ironically unresolved since 2018 (Originally raised: Issue #166 ).

No matter what I do, I can't get rid of the bug.

My question is why the plugin's DDL parser does not properly replace back the "delimiter $$ " to '' and "$$" to a semicolon when it must before executing the SQL?

Like why did you even release the plugin if it can't simply work?

Is there gonna be any solution for this? Let me know, otherwise, I'd have to downgrade back to play 2.8.1.


Config file:

`ebean {
default = ["models.global."]
local = ["models.local.
"]
}

db{
// datasources of com.mysql.cj.jdbc.Driver
}

play.evolutions {

db.default.enabled = true
db.default.autoApply = true

db.local.enabled = true
db.local.autoApply = true
}
`


build.sbt

`
lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)

libraryDependencies ++= Seq(
guice,
ws,
jdbc,
javaJdbc
)

playEbeanModels in Compile := Seq("models.global.", "models.local.")
`


Issue

Image


Solutions tried:

I tried a lot of solutions like setting ebean.ddl.generate and run in config file as well as settings values of ebean.migration.xxx, but always gave me "ddl is type OBJECT rather than LIST" etc etc.

I also tried importing io.ebean agents, ddl-generator, ddl-parser and a lot of different stuff.

I also tried using ebean-platform.

I also tried "-Debean.ddl.generateProcedures=false" in javacOptions.

I also tried creating a custom evolution parser to somehow run it after creating SQL and before executing SQL to replace the 'delimiter $$' issues.

P.s. I'm only seeking an automatic solution (and not manually removing the separators by hand.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the supplied build.sbt and play.evolutions configuration on Play 3.0.5, focusing on the evolution DDL parser's handling of MySQL delimiter $$ statements. Done means the configured evolution runs automatically without requiring manual separator removal; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.