﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34558	QuerySet.bulk_create() crashes with Now() on Oracle.	Mariusz Felisiak	Mariusz Felisiak	"`Now()` cannot be used with `QuerySet.bulk_create()` as it uses `CURRENT_TIMESTAMP` which returns `TIMESTAMP WITH TIME ZONE` and crashes when wrapped with `TO_TIMESTAMP`, e.g.
{{{#!diff
diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py
index a5050c9b0b..aee0cd9996 100644
--- a/tests/bulk_create/tests.py
+++ b/tests/bulk_create/tests.py
@@ -10,7 +10,7 @@ from django.db import (
     connection,
 )
 from django.db.models import FileField, Value
-from django.db.models.functions import Lower
+from django.db.models.functions import Lower, Now
 from django.test import (
     TestCase,
     override_settings,
@@ -300,6 +300,19 @@ class BulkCreateTests(TestCase):
         bbb = Restaurant.objects.filter(name=""betty's beetroot bar"")
         self.assertEqual(bbb.count(), 1)
 
+    @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"	Bug	closed	Database layer (models, ORM)	4.2	Normal	fixed	oracle	David Sanders Lily Foote	Accepted	0	0	0	0	0	0
