From 0b57189aa27862f2b0a09f7e62e9a3a70ddcb328 Mon Sep 17 00:00:00 2001 From: Boulder Sprinters Date: Tue, 10 Apr 2007 21:41:34 +0000 Subject: [PATCH] boulder-oracle-sprint: Fixed many_to_many and m2m_recursive test case failures. Thanks, Ian Kelly. DB code was relying on cursor.rowcount, which has different behavior on Oracle and isn't very consistent elsewhere. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4994 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/fields/related.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index fad9c164c1..c336585ac9 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -335,10 +335,7 @@ def create_many_related_manager(superclass): (target_col_name, self.join_table, source_col_name, target_col_name, ",".join(['%s'] * len(new_ids))), [self._pk_val] + list(new_ids)) - if cursor.rowcount is not None and cursor.rowcount != 0: - existing_ids = set([row[0] for row in cursor.fetchmany(cursor.rowcount)]) - else: - existing_ids = set() + existing_ids = set([row[0] for row in cursor.fetchall()]) # Add the ones that aren't there already for obj_id in (new_ids - existing_ids):