Fixed #33339 -- Made QuerySet.bulk_create() use TO_NCLOB() for TextFields on Oracle.

This commit is contained in:
Georgi Yanchev 2021-12-02 18:27:25 -05:00 committed by Mariusz Felisiak
parent 97e9a84d27
commit 9c1fe446b6
1 changed files with 2 additions and 2 deletions

View File

@ -55,9 +55,9 @@ class Oracle_datetime(datetime.datetime):
class BulkInsertMapper: class BulkInsertMapper:
BLOB = 'TO_BLOB(%s)' BLOB = 'TO_BLOB(%s)'
CLOB = 'TO_CLOB(%s)'
DATE = 'TO_DATE(%s)' DATE = 'TO_DATE(%s)'
INTERVAL = 'CAST(%s as INTERVAL DAY(9) TO SECOND(6))' INTERVAL = 'CAST(%s as INTERVAL DAY(9) TO SECOND(6))'
NCLOB = 'TO_NCLOB(%s)'
NUMBER = 'TO_NUMBER(%s)' NUMBER = 'TO_NUMBER(%s)'
TIMESTAMP = 'TO_TIMESTAMP(%s)' TIMESTAMP = 'TO_TIMESTAMP(%s)'
@ -78,7 +78,7 @@ class BulkInsertMapper:
'PositiveSmallIntegerField': NUMBER, 'PositiveSmallIntegerField': NUMBER,
'SmallAutoField': NUMBER, 'SmallAutoField': NUMBER,
'SmallIntegerField': NUMBER, 'SmallIntegerField': NUMBER,
'TextField': CLOB, 'TextField': NCLOB,
'TimeField': TIMESTAMP, 'TimeField': TIMESTAMP,
} }