diff options
| author | Ahmet Kucuk <ahmetkucuk92@gmail.com> | 2019-10-01 01:42:48 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-10-01 13:11:19 +0200 |
| commit | 9dc13f41b5c80941d4873ce0791b83afd8f7c1ca (patch) | |
| tree | 668a81d69b7456d8677258c1492fba1d3ef4917e /django | |
| parent | a135e1e16ebbac86ec09022a34b01316ca17a42f (diff) | |
[3.0.x] 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.
Backport of dc890bef5ad8e9fccce55f3e64af72103ea6e8c1 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/oracle/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/oracle/utils.py b/django/db/backends/oracle/utils.py index fdd6dee617..513ea5e82e 100644 --- a/django/db/backends/oracle/utils.py +++ b/django/db/backends/oracle/utils.py @@ -51,6 +51,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)' @@ -70,5 +71,6 @@ class BulkInsertMapper: 'PositiveIntegerField': NUMBER, 'PositiveSmallIntegerField': NUMBER, 'SmallIntegerField': NUMBER, + 'TextField': CBLOB, 'TimeField': TIMESTAMP, } |
