Updated to Metabase 0.58.4, broken existing custom expression with division operator

Hi there,

We updated from Metabase 0.54.20 to 0.58.7.

Since then, all existing Questions chart with a custom expression that have “/” operator are broken.

At first I thought it was a data format problem, but even a “1/count()” doesn’t work.

I tried to created a new SQL request, and a new question based on this SQL request to see if it could be some kind of corrupt chart/sql request, but the problem is still there.

Note that if I only do “Count()” instead of “1/Count()”, it works (and count() is not null nor 0)

Note bis : “*” operator works fine

Thank you for your help

Does it only happen to MySQL Server? if you test something else do you get the same?

Can you check the SQL syntex that gets generated here:

I am guessing the syntax isn’t playing well with your DB version, what version are you running?

Hi,

I get that SQL syntax :

“SELECT
1.0 / NULLIF(CAST(COUNT(*) AS double), 0.0) AS test
FROM
mytable

I only use MySQL server with metabase, so I can’t tell if something else would work.

An incompatibility with the MySQL DB version and the Metabase version might be a nice lead, as it is prior v8. I will try an update this week and come back to tell if it solved the problem.

Thank you Tony for your kind help

Keep us posted! :folded_hands: