Refs #27795 -- Removed unneeded force_text calls from the Oracle backend.
This commit is contained in:
parent
8c6a3062dd
commit
e5dce7b0fb
|
@ -451,7 +451,7 @@ class FormatStylePlaceholderCursor:
|
||||||
# Handle params as sequence
|
# Handle params as sequence
|
||||||
args = [(':arg%d' % i) for i in range(len(params))]
|
args = [(':arg%d' % i) for i in range(len(params))]
|
||||||
query = query % tuple(args)
|
query = query % tuple(args)
|
||||||
return force_text(query, self.charset), self._format_params(params)
|
return query, self._format_params(params)
|
||||||
|
|
||||||
def execute(self, query, params=None):
|
def execute(self, query, params=None):
|
||||||
query, params = self._fix_for_params(query, params, unify_by_values=True)
|
query, params = self._fix_for_params(query, params, unify_by_values=True)
|
||||||
|
|
|
@ -6,7 +6,6 @@ from django.db.backends.base.introspection import (
|
||||||
BaseDatabaseIntrospection, FieldInfo, TableInfo,
|
BaseDatabaseIntrospection, FieldInfo, TableInfo,
|
||||||
)
|
)
|
||||||
from django.utils.deprecation import RemovedInDjango21Warning
|
from django.utils.deprecation import RemovedInDjango21Warning
|
||||||
from django.utils.encoding import force_text
|
|
||||||
|
|
||||||
|
|
||||||
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||||
|
@ -75,7 +74,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||||
self.cache_bust_counter))
|
self.cache_bust_counter))
|
||||||
description = []
|
description = []
|
||||||
for desc in cursor.description:
|
for desc in cursor.description:
|
||||||
name = force_text(desc[0]) # cx_Oracle always returns a 'str'
|
name = desc[0]
|
||||||
internal_size, default = field_map[name]
|
internal_size, default = field_map[name]
|
||||||
name = name % {} # cx_Oracle, for some reason, doubles percent signs.
|
name = name % {} # cx_Oracle, for some reason, doubles percent signs.
|
||||||
description.append(FieldInfo(*(
|
description.append(FieldInfo(*(
|
||||||
|
|
|
@ -6,7 +6,7 @@ from django.conf import settings
|
||||||
from django.db.backends.base.operations import BaseDatabaseOperations
|
from django.db.backends.base.operations import BaseDatabaseOperations
|
||||||
from django.db.backends.utils import strip_quotes, truncate_name
|
from django.db.backends.utils import strip_quotes, truncate_name
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.encoding import force_bytes, force_text
|
from django.utils.encoding import force_bytes
|
||||||
|
|
||||||
from .base import Database
|
from .base import Database
|
||||||
from .utils import BulkInsertMapper, InsertIdVar, Oracle_datetime
|
from .utils import BulkInsertMapper, InsertIdVar, Oracle_datetime
|
||||||
|
@ -182,7 +182,7 @@ WHEN (new.%(col_name)s IS NULL)
|
||||||
|
|
||||||
def convert_textfield_value(self, value, expression, connection, context):
|
def convert_textfield_value(self, value, expression, connection, context):
|
||||||
if isinstance(value, Database.LOB):
|
if isinstance(value, Database.LOB):
|
||||||
value = force_text(value.read())
|
value = value.read()
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def convert_binaryfield_value(self, value, expression, connection, context):
|
def convert_binaryfield_value(self, value, expression, connection, context):
|
||||||
|
@ -277,7 +277,7 @@ WHEN (new.%(col_name)s IS NULL)
|
||||||
def process_clob(self, value):
|
def process_clob(self, value):
|
||||||
if value is None:
|
if value is None:
|
||||||
return ''
|
return ''
|
||||||
return force_text(value.read())
|
return value.read()
|
||||||
|
|
||||||
def quote_name(self, name):
|
def quote_name(self, name):
|
||||||
# SQL92 requires delimited (quoted) names to be case-sensitive. When
|
# SQL92 requires delimited (quoted) names to be case-sensitive. When
|
||||||
|
|
Loading…
Reference in New Issue