summaryrefslogtreecommitdiff
path: root/django/db/backends/oracle/utils.py
diff options
context:
space:
mode:
authorAhmet Kucuk <ahmetkucuk92@gmail.com>2019-10-01 01:42:48 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-10-01 12:38:58 +0200
commitdc890bef5ad8e9fccce55f3e64af72103ea6e8c1 (patch)
tree176fbb572488e543934b0da6eb5b6a40f0627826 /django/db/backends/oracle/utils.py
parente1c1eaf0c6f4d3d2f60513d20aa9b84b17d096ec (diff)
downloaddjango-dc890bef5ad8e9fccce55f3e64af72103ea6e8c1.tar.gz
Fixed #30510 -- Fixed crash of QuerySet.bulk_create() with mixed-length texts on Oracle.
Text with more than 4000 characters must be set to as a CLOB on Oracle what caused a mixed datatype error (ORA-01790) when shorter text appeared in the same operation.
Diffstat (limited to 'django/db/backends/oracle/utils.py')
-rw-r--r--django/db/backends/oracle/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/oracle/utils.py b/django/db/backends/oracle/utils.py
index 38a2c71774..74ea0c2508 100644
--- a/django/db/backends/oracle/utils.py
+++ b/django/db/backends/oracle/utils.py
@@ -54,6 +54,7 @@ class Oracle_datetime(datetime.datetime):
class BulkInsertMapper:
BLOB = 'TO_BLOB(%s)'
+ CBLOB = 'TO_CLOB(%s)'
DATE = 'TO_DATE(%s)'
INTERVAL = 'CAST(%s as INTERVAL DAY(9) TO SECOND(6))'
NUMBER = 'TO_NUMBER(%s)'
@@ -73,5 +74,6 @@ class BulkInsertMapper:
'PositiveIntegerField': NUMBER,
'PositiveSmallIntegerField': NUMBER,
'SmallIntegerField': NUMBER,
+ 'TextField': CBLOB,
'TimeField': TIMESTAMP,
}