Fixed #29541 -- Fixed Cursor.execute() crash when setinputsizes() is called without arguments wit cx_Oracle 6.4.

This commit is contained in:
Mariusz Felisiak 2018-07-04 18:57:29 +02:00 committed by Tim Graham
parent 17403f0a9b
commit d7d32964ef
1 changed files with 4 additions and 2 deletions

View File

@ -459,7 +459,8 @@ class FormatStylePlaceholderCursor:
for k, value in params.items(): for k, value in params.items():
if value.input_size: if value.input_size:
sizes[k] = value.input_size sizes[k] = value.input_size
self.setinputsizes(**sizes) if sizes:
self.setinputsizes(**sizes)
else: else:
# It's not a list of dicts; it's a list of sequences # It's not a list of dicts; it's a list of sequences
sizes = [None] * len(params_list[0]) sizes = [None] * len(params_list[0])
@ -467,7 +468,8 @@ class FormatStylePlaceholderCursor:
for i, value in enumerate(params): for i, value in enumerate(params):
if value.input_size: if value.input_size:
sizes[i] = value.input_size sizes[i] = value.input_size
self.setinputsizes(*sizes) if sizes:
self.setinputsizes(*sizes)
def _param_generator(self, params): def _param_generator(self, params):
# Try dict handling; if that fails, treat as sequence # Try dict handling; if that fails, treat as sequence