Bug 27012: Fix incorrect SQL syntax in hold merging