'Detect and adjust for the ANSI_QUOTES sql mode.'

def _detect_ansiquotes(self, connection):

    row = self._compat_first(connection.execute("SHOW    VARIABLES    LIKE    'sql_mode'"), charset=self._connection_charset)
    if (not row):
        mode = ''
    else:
        mode = (row[1] or '')
        if mode.isdigit():
            mode_no = int(mode)
            mode = ((((mode_no | 4) == mode_no) and 'ANSI_QUOTES') or '')
    self._server_ansiquotes = ('ANSI_QUOTES' in mode)
    self._backslash_escapes = ('NO_BACKSLASH_ESCAPES' not in mode)
