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

compiler: temp fix for typecast function parameters #530

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

maxhawkins
Copy link
Contributor

In cases where a FuncCall has a TypeCast node as an
argument, resolveCatalogRefs would erroneously output
two parameters for that argument instead of one.

This fix eliminates the duplicate param and allows queries
with typecast function args to compile, but it loses track
of the argument's connection with the function called. This
means the parameters use the generic ColumnN names even when
the function has named parameters.

A future refactor of resolveCatalogRefs to better address
function calls will be necessary to address the name issue.

(this only edits the experimental package and does not fix
the old dinosql compiler)

Closes #520

In cases where a FuncCall has a TypeCast node as an
argument, resolveCatalogRefs would erroneously output
two parameters for that argument instead of one.

This fix eliminates the duplicate param and allows queries
with typecast function args to compile, but it loses track
of the argument's connection with the function called. This
means the parameters use the generic ColumnN names even when
the function has named parameters.

A future refactor of resolveCatalogRefs to better address
function calls will be necessary to address the name issue.

(this only edits the experimental package and  does not fix
the old dinosql compiler)

Closes sqlc-dev#520
@maxhawkins
Copy link
Contributor Author

Does this look OK?

@kyleconroy
Copy link
Collaborator

Yes! I hit the "Merge master into branch" button and then forgot to merge. Doing so now.

@kyleconroy kyleconroy merged commit e0666b5 into sqlc-dev:master Jun 9, 2020
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

Successfully merging this pull request may close these issues.

Type cast in positional function args yields invalid params
2 participants