mirror of https://github.com/django/django.git
Fixed #29541 -- Fixed Cursor.execute() crash when setinputsizes() is called without arguments wit cx_Oracle 6.4.
This commit is contained in:
parent
17403f0a9b
commit
d7d32964ef
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue