Fix MYSQL errors on  assign activity multiple, fixes #6584