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

some function argument names cause "InternalServerError: syntax error" #6062

Closed
freeatnet opened this issue Sep 13, 2023 · 0 comments · Fixed by #6150
Closed

some function argument names cause "InternalServerError: syntax error" #6062

freeatnet opened this issue Sep 13, 2023 · 0 comments · Fixed by #6150

Comments

@freeatnet
Copy link

freeatnet commented Sep 13, 2023

  • EdgeDB Version: 3.3+d5734dd
  • EdgeDB CLI Version: 3.5.0+e1ad387
  • OS Version: macOS 13.5.2

Steps to Reproduce:

  1. Start with an empty edgedb project
  2. Add the schema specified above
  3. Create a migration and attempt to apply it

Expected: a function is created
Observed: InternalServerError: syntax error at or near "int8"

Additional triage:

The issue appears to be caused by using an argument name that matches a Postgres type that accepts a type modifier. For example, the following function declarations are handled correctly:

function myFuncPassA(arg0: int64) -> float64
using (
  select 2.3
);

function myFuncPassB(bigserial: str) -> float64
using (
  select 2.3
);

But the following cause an error:

function myFuncFailA(character: int64) -> float64
using (
  select 2.3
);

function myFuncFailB(interval: str) -> float64
using (
  select 2.3
);

Schema:

module default {
  function myFuncA(timestamp: int64) -> float64
  using (
    select 2.3
  );
}
@freeatnet freeatnet changed the title some function declarations cause "InternalServerError: syntax error" some function argument names cause "InternalServerError: syntax error" Sep 13, 2023
msullivan added a commit that referenced this issue Sep 22, 2023
We need to make sure to quote them. Unfortunately we can't
*unconditionally* quote them in quote_ident, because when referring to
them as types or builtin functions they need to not be quoted.

Fixes #6062.
msullivan added a commit that referenced this issue Sep 23, 2023
We need to make sure to quote them. Unfortunately we can't
*unconditionally* quote them in quote_ident, because when referring to
them as types or builtin functions they need to not be quoted.

Fixes #6062.
msullivan added a commit that referenced this issue Sep 26, 2023
We need to make sure to quote them. Unfortunately we can't
*unconditionally* quote them in quote_ident, because when referring to
them as types or builtin functions they need to not be quoted.

Fixes #6062.
msullivan added a commit that referenced this issue Sep 27, 2023
We need to make sure to quote them. Unfortunately we can't
*unconditionally* quote them in quote_ident, because when referring to
them as types or builtin functions they need to not be quoted.

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

Successfully merging a pull request may close this issue.

2 participants