I looked at MySQL docs - it indeed seems that adding `DETERMINISTIC` would be the proper fix here.
(Same behaviour is described for MySQL 5.0 so it shouldn't cause problems with the current test VM setups).