You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(If .withBinaryParams/.withBinaryResults is set to false the inserts work)
Reproduction
Database setup:
create table foo (n numeric(6,2));
Scala:
def insertBigDecimal(bd: BigDecimal) =
sql"""insert into foo (n) values ($bd)"""
.exec(dbClient)
.map(rc => s"inserted $rc rows")
.handle{ case _ => "failed to insert" }
val a = BigDecimal(10)
val b = BigDecimal(10.0)
val c = BigDecimal("1E+1")
val d = BigDecimal("10")
val fa = insertBigDecimal(a)
val fb = insertBigDecimal(b)
val fc = insertBigDecimal(c)
val fd = insertBigDecimal(d)
println(a, Await.result(fa)) // (10,inserted 1 rows)
println(b, Await.result(fb)) // (10.0,inserted 1 rows)
println(c, Await.result(fc)) // (1E+1,failed to insert)
println(d, Await.result(fd)) // (10,inserted 1 rows)