The solution using REPLACE sounds reasonable from my layman's point of view. I can't tell much about the row value constructor solution, but the HHH-9332 bug you referenced was reported for H2 DB, which is the same as the above problem.