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

ResultSetHandle and column definition lists #146

Closed
jcflack opened this issue Mar 22, 2018 · 1 comment
Closed

ResultSetHandle and column definition lists #146

jcflack opened this issue Mar 22, 2018 · 1 comment

Comments

@jcflack
Copy link
Contributor

jcflack commented Mar 22, 2018

If a function is declared to return RECORD or SETOF RECORD, SQL requires it to be followed by a column definition list when used in a query. If the function returns SETOF RECORD using the ResultSetHandle interface, it is possible that the column definition list specifies different types for one or more columns than the ResultSet being supplied to ResultSetHandle. In that case, the appropriate casts should happen, just as they would when using ResultSetProvider and storing the values into the output ResultSet.

jcflack added a commit that referenced this issue Mar 23, 2018
A function declared to return RECORD or SETOF RECORD is required
by SQL to be followed by a column definition list in any query using it.
If the function returns SETOF RECORD using ResultSetHandle, there is a
possibility that one or more corresponding columns in the definition list
and the ResultSet offered by ResultSetHandle differ in type. Let the type
be cast automatically, just as it would be when using ResultSetProvider
and storing each value into the output ResultSet.

Also convert the SetOfRecordTest example to an annotation-style example
and add an SQLAction that tests it.

Addresses issue #146.
jcflack added a commit that referenced this issue Mar 23, 2018
Expand the API docs to explain the interaction with the calling query's
column definition list when a function is declared to return SETOF RECORD.

Except for the type-casting behavior change in ResultSetHandle
for issue #146, this is simply an exercise in documenting what currently
happens.
@jcflack
Copy link
Contributor Author

jcflack commented Oct 18, 2018

Closing with release of 1.5.1.

@jcflack jcflack closed this as completed Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant