Refs #23919 -- Removed Python 2 workaround for hashing Oracle params (refs #27632).

This commit is contained in:
Mariusz Felisiak 2017-01-20 04:20:14 +01:00 committed by Tim Graham
parent fedda6d9bd
commit bf1c957027
1 changed files with 2 additions and 7 deletions

View File

@ -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, <type 'int'>): ':arg2',
# (0.75, <type 'float'>): ':arg1',
# ('sth', <type 'str'>): ':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