From 003bb34b218adb23d1a7e67932a6ba9b3c4dcc81 Mon Sep 17 00:00:00 2001 From: Johannes Hoppe Date: Wed, 24 Jul 2019 08:39:45 +0200 Subject: [PATCH] Refs #29444 -- Made db.backends.oracle.utils.InsertVar use str as default. --- django/db/backends/oracle/utils.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/django/db/backends/oracle/utils.py b/django/db/backends/oracle/utils.py index 64e69136bf..ce2bf72d84 100644 --- a/django/db/backends/oracle/utils.py +++ b/django/db/backends/oracle/utils.py @@ -10,8 +10,15 @@ class InsertVar: insert statement. """ types = { + 'AutoField': int, + 'BigAutoField': int, + 'SmallAutoField': int, + 'IntegerField': int, + 'BigIntegerField': int, + 'SmallIntegerField': int, + 'PositiveSmallIntegerField': int, + 'PositiveIntegerField': int, 'FloatField': Database.NATIVE_FLOAT, - 'CharField': str, 'DateTimeField': Database.TIMESTAMP, 'DateField': Database.DATETIME, 'DecimalField': Database.NUMBER, @@ -19,7 +26,7 @@ class InsertVar: def __init__(self, field): internal_type = getattr(field, 'target_field', field).get_internal_type() - self.db_type = self.types.get(internal_type, int) + self.db_type = self.types.get(internal_type, str) def bind_parameter(self, cursor): param = cursor.cursor.var(self.db_type)