+ @skipUnlessDBFeature("has_bulk_insert")
+ def test_bulk_insert_now(self):
+ NullableFields.objects.bulk_create(
+ [
+ NullableFields(datetime_field=Now()),
+ NullableFields(datetime_field=Now()),
+ ]
+ )
+ self.assertEqual(
+
NullableFields.objects.filter(datetime_field__isnull=False).count(),
+ 2,
+ )
+
@skipUnlessDBFeature("has_bulk_insert")
def test_bulk_insert_nullable_fields(self):
fk_to_auto_fields = {
}}}
crashes with:
{{{
django.db.utils.DatabaseError: ORA-01830: date format picture ends before
converting entire input string
}}}
As far as I'm aware we can use `LOCALTIMESTAMP` instead (which return
`TIMESTAMP`) because time zones are ignored on Oracle.
Noticed while checking
https://github.com/django/django/pull/16092#issuecomment-1264633158
--
Ticket URL: <https://code.djangoproject.com/ticket/34558>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/34558#comment:1>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"72a86ceb33749d4fd17d3d2910e19b9d9ca1643b" 72a86ceb]:
{{{
#!CommitTicketReference repository=""
revision="72a86ceb33749d4fd17d3d2910e19b9d9ca1643b"
Fixed #34558 -- Fixed QuerySet.bulk_create() crash with Now() on Oracle.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34558#comment:2>