Issue Details (XML | Word | Printable)

Key: PYFB-63
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Pavel Cisar
Reporter: Sergey Stepanov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird driver for Python

Procedure,get_sql() incorrectly returns input parameters in place of output parameters

Created: 27/Jan/16 12:14 PM   Updated: 27/Jan/16 02:59 PM
Component/s: None
Affects Version/s: 1.4.3
Fix Version/s: None

Issue Links:
Duplicate
 


 Description  « Hide
In cases, where output parameters count is greater then 1, the Procedure.get_sql('create') method returns input parameter in place of output, , i.e.
instead of "create procedure proc (foo integer) returns (bar1 integer, bar2 integer)" it returns "create procedure proc (foo integer) returns (foo integer, )" (note extra comma in result)


 All   Comments   Change History   Subversion Commits      Sort Order: Descending order - Click to sort in ascending order
Sergey Stepanov added a comment - 27/Jan/16 01:09 PM
it turns out that it is already fixed in mainstream, should be closed.

Sergey Stepanov added a comment - 27/Jan/16 12:15 PM
following patch fixes this problem

diff --git a/fdb/schema.py b/fdb/schema.py
index 1299dc9..8126416 100644
--- a/fdb/schema.py
+++ b/fdb/schema.py
@@ -2849,7 +2849,7 @@ class Procedure(BaseSchemaItem):
                 result += 'RETURNS (%s)\n' % self.output_params[0].get_sql_definition()
             else:
                 result += 'RETURNS (\n'
- for p in self.input_params:
+ for p in self.output_params:
                     result += ' %s%s\n' % (p.get_sql_definition(),
                                             '' if p.sequence+1 == self._attributes['RDB$PROCEDURE_OUTPUTS']
                                             else ',')