From bf1c9570270b46e9e92b256fb9be394258029bbf Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 20 Jan 2017 04:20:14 +0100 Subject: [PATCH] Refs #23919 -- Removed Python 2 workaround for hashing Oracle params (refs #27632). --- django/db/backends/oracle/base.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 7e3591f60c..8d6b48e52a 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -443,17 +443,12 @@ class FormatStylePlaceholderCursor: # values. It can be used only in single query execute() because # executemany() shares the formatted query with each of the params # list. e.g. for input params = [0.75, 2, 0.75, 'sth', 0.75] - # params_dict = { - # (2, ): ':arg2', - # (0.75, ): ':arg1', - # ('sth', ): ':arg0', - # } + # params_dict = {0.75: ':arg0', 2: ':arg1', 'sth': ':arg2'} # args = [':arg0', ':arg1', ':arg0', ':arg2', ':arg0'] # params = {':arg0': 0.75, ':arg1': 2, ':arg2': 'sth'} - params = [(param, type(param)) for param in params] params_dict = {param: ':arg%d' % i for i, param in enumerate(set(params))} args = [params_dict[param] for param in params] - params = {value: key[0] for key, value in params_dict.items()} + params = {value: key for key, value in params_dict.items()} query = query % tuple(args) else: # Handle params as sequence