def late_fix(self, sql):
        """Fix the WHERE condition in old Django 1.6"""
        assert not re.search(r'[\\"\']', sql)
        replacements = self.query_topology()
        # the replaced string is a alphanumeric word, including underscore
        assert all(re.match(r'^\w+$', x) for x in replacements.keys())
        pattern_replaced = re.compile('|'.join(replacements.keys()) % r'(?<=[^.\w])(%s)(?=\.\w+[^.\w])')
        def func(sql):
            start = 0
            out = []
            for match in pattern_replaced.finditer(sql):
                out.append(sql[start:match.start()])
                out.append(replacements[match.group(1)])
                start = match.end()
            out.append(sql[start:len(sql)])
            return ''.join(out)
        return subselect.transform_except_subselect(sql, func)
dataset/ETHPy150Open django-salesforce/django-salesforce/salesforce/backend/compiler.py/SQLCompiler.late_fix/swapped operands of `%`