'Tests the database using feature detection to see if it has
transactional DDL support.'

@cached_property
def has_ddl_transactions(self):

    self._possibly_initialise()
    connection = self._get_connection()
    if (hasattr(connection.features, 'confirm') and (not connection.features._confirmed)):
        connection.features.confirm()
    exceptions = (DatabaseError,)
    try:
        from MySQLdb import OperationalError
        exceptions += (OperationalError,)
    except ImportError:
        pass
    if getattr(connection.features, 'supports_transactions', True):
        cursor = connection.cursor()
        self.start_transaction()
        cursor.execute('CREATE    TABLE    DDL_TRANSACTION_TEST    (X    INT)')
        self.rollback_transaction()
        try:
            cursor.execute('CREATE    TABLE    DDL_TRANSACTION_TEST    (X    INT)')
        except exceptions:
            return False
        else:
            return True
        finally:
            cursor.execute('DROP    TABLE    DDL_TRANSACTION_TEST')
    else:
        return False
