Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 4673)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -3,6 +3,7 @@
 from django.conf import settings
 from django.core import validators
 from django import oldforms
+from django import newforms as forms
 from django.core.exceptions import ObjectDoesNotExist
 from django.utils.functional import curry
 from django.utils.itercompat import tee
@@ -419,6 +420,9 @@
                 raise validators.ValidationError, gettext_lazy("This field cannot be null.")
         return str(value)
 
+    def get_db_prep_save(self, value):
+        return Field.get_db_prep_save(self, str(value))
+
     def formfield(self, **kwargs):
         defaults = {'max_length': self.maxlength, 'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}
         defaults.update(kwargs)
@@ -485,12 +489,12 @@
     def get_db_prep_save(self, value):
         # Casts dates into string format for entry into database.
         if isinstance(value, datetime.datetime):
-            if settings.DATABASE_ENGINE != 'oracle':
-                # Oracle does not need a string conversion
+            if settings.DATABASE_ENGINE not in ('oracle', 'firebird'):
+                # Oracle and Firebird does not need a string conversion
                 value = value.date().strftime('%Y-%m-%d')
         elif isinstance(value, datetime.date):
-            if settings.DATABASE_ENGINE != 'oracle':
-                # Oracle does not need a string conversion
+            if settings.DATABASE_ENGINE not in ('oracle', 'firebird'):
+                # Oracle and Firebird does not need a string conversion
                 value = value.strftime('%Y-%m-%d')
         return Field.get_db_prep_save(self, value)
 
@@ -530,15 +534,17 @@
             # neither database supports microseconds.
             if settings.DATABASE_ENGINE in ('mysql', 'oracle') and hasattr(value, 'microsecond'):
                 value = value.replace(microsecond=0)
-            # cx_Oracle wants the raw datetime instead of a string.
-            if settings.DATABASE_ENGINE != 'oracle':
+            # cx_Oracle and Firebird wants the raw datetime instead of a string.
+            if settings.DATABASE_ENGINE not in ('oracle', 'firebird'):
                 value = str(value)
         return Field.get_db_prep_save(self, value)
 
     def get_db_prep_lookup(self, lookup_type, value):
         # Oracle will throw an error if microseconds are given, because it
         # doesn't support microseconds.
-        if settings.DATABASE_ENGINE == 'oracle' and hasattr(value, 'microsecond'):
+        # Firebird will throw a error if microseconds are given
+        # and DateTime converted to String
+        if settings.DATABASE_ENGINE in ('oracle', 'firebird') and hasattr(value, 'microsecond'):
             value = value.replace(microsecond=0)
         if lookup_type == 'range':
             value = [str(v) for v in value]
Index: django/db/models/fields/related.py
===================================================================
--- django/db/models/fields/related.py	(revision 4673)
+++ django/db/models/fields/related.py	(working copy)
@@ -335,8 +335,9 @@
                     (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)])
+                rows = cursor.fetchall()
+                if len(rows) != 0:
+                    existing_ids = set([row[0] for row in rows])
                 else:
                     existing_ids = set()
 
Index: django/db/models/query.py
===================================================================
--- django/db/models/query.py	(revision 4673)
+++ django/db/models/query.py	(working copy)
@@ -707,7 +707,10 @@
     else:
         cast_sql = '%s'
     try:
-        return '%s%s %s' % (table_prefix, field_name,
+        lookup_sql = '%s%s %s'
+        if (settings.DATABASE_ENGINE == 'firebird' and lookup_type[0] == 'i'):
+            lookup_sql = 'UPPER(%s%s) %s'
+        return lookup_sql % (table_prefix, field_name,
                             backend.OPERATOR_MAPPING[lookup_type] % cast_sql)
     except KeyError:
         pass
Index: django/core/management.py
===================================================================
--- django/core/management.py	(revision 4673)
+++ django/core/management.py	(working copy)
@@ -163,7 +163,7 @@
             # Make the definition (e.g. 'foo VARCHAR(30)') for this field.
             field_output = [style.SQL_FIELD(backend.quote_name(f.column)),
                 style.SQL_COLTYPE(col_type % rel_field.__dict__)]
-            field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or '')))
+            field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or 'DEFAULT ')))
             if f.unique and (not f.primary_key or backend.allows_unique_and_pk):
                 field_output.append(style.SQL_KEYWORD('UNIQUE'))
             if f.primary_key:
@@ -1177,7 +1177,7 @@
     index_output = []
     for f in fields:
         field_output = [backend.quote_name(f.name), data_types[f.get_internal_type()] % f.__dict__]
-        field_output.append("%sNULL" % (not f.null and "NOT " or ""))
+        field_output.append("%sNULL" % (not f.null and "NOT " or "DEFAULT "))
         if f.unique:
             field_output.append("UNIQUE")
         if f.primary_key:
Index: django/contrib/redirects/models.py
===================================================================
--- django/contrib/redirects/models.py	(revision 4673)
+++ django/contrib/redirects/models.py	(working copy)
@@ -4,9 +4,9 @@
 
 class Redirect(models.Model):
     site = models.ForeignKey(Site, radio_admin=models.VERTICAL)
-    old_path = models.CharField(_('redirect from'), maxlength=200, db_index=True,
+    old_path = models.CharField(_('redirect from'), maxlength=100,
         help_text=_("This should be an absolute path, excluding the domain name. Example: '/events/search/'."))
-    new_path = models.CharField(_('redirect to'), maxlength=200, blank=True,
+    new_path = models.CharField(_('redirect to'), maxlength=100, blank=True,
         help_text=_("This can be either an absolute path (as above) or a full URL starting with 'http://'."))
 
     class Meta:
