Fix a SQL query in the AgendavMv plugin.