MySQL queries with commas in 1.6

When moving my dialplan from 1.4 to 1.6, all mysql queries stopped working. Solution was easy: Remove all those escape backslashes. A really good thing, making the code easier to write and maintain. But what about commas?

Well they work too, but not if sending the sql string as a parameter to a macro, like this:

exten => s,1,Macro(sqlget, SELECT IFNULL(MAX(id)+1,1) AS nextid FROM log)

…which is what my dialplan does. A lot. This way the SQL string is cut at the (first) comma. Escaping it doesn’t work either.

Any better way to do this (obviously)?