Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procedure,get_sql() incorrectly returns input parameters in place of output parameters [PYFB63] #80

Closed
firebird-automations opened this issue Jan 27, 2016 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: Sergey Stepanov (ssn)

Duplicates PYFB51

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)

@firebird-automations
Copy link
Author

Commented by: Sergey Stepanov (ssn)

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 ',')

@firebird-automations
Copy link
Author

Modified by: Sergey Stepanov (ssn)

Version: 1.4.3 [ 10643 ]

@firebird-automations
Copy link
Author

Modified by: Sergey Stepanov (ssn)

Version: 1.5 [ 10642 ] =>

@firebird-automations
Copy link
Author

Commented by: Sergey Stepanov (ssn)

it turns out that it is already fixed in mainstream, should be closed.

@firebird-automations
Copy link
Author

Modified by: @pcisar

Link: This issue duplicates PYFB51 [ PYFB51 ]

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Open [ 1 ] => Closed [ 6 ]

resolution: Duplicate [ 3 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants