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

[MySQL] Incorrect parsing of views involving functions without alias #689

Open
shubham-yb opened this issue Dec 19, 2022 · 0 comments
Open
Assignees
Labels
dep-issue Issues with dependencies

Comments

@shubham-yb
Copy link
Contributor

If we have a view in MYSQL, which contains a select on a function and no alias is provided for it, the function as defined in the view is considered as the alias which is an invalid syntax for PG.

It'll be clearer with an example.

Sample view definition:

CREATE OR REPLACE VIEW v1 as select foo(id) from bar;

where foo() is any function which returns something.

This is exported as:

CREATE OR REPLACE VIEW v1 AS select foo(bar.id) AS foo(id) FROM bar;

This is an invalid syntax which throws an error:

ERROR:  syntax error at or near "("
LINE 1: ...TE OR REPLACE VIEW v1 AS select foo(bar.id) AS foo(id) FROM ...

The same view defined with alias as :

CREATE OR REPLACE VIEW v1 AS select foo(bar.id) AS p_name FROM bar;

Works fine.

@shubham-yb shubham-yb added documentation Improvements or additions to documentation dep-issue Issues with dependencies labels Dec 19, 2022
@github-actions github-actions bot added the triage Needs to be triaged label Dec 19, 2022
@shubham-yb shubham-yb removed the triage Needs to be triaged label Dec 19, 2022
@shubham-yb shubham-yb removed the documentation Improvements or additions to documentation label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dep-issue Issues with dependencies
Projects
None yet
Development

No branches or pull requests

2 participants