Follow-up patch for wrong SQL statement