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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

It should not be required to use a space after a - to use an arithmetic operation #393

Open
Alexnortung opened this issue Mar 27, 2024 · 0 comments

Comments

@Alexnortung
Copy link

Describe the bug

When using postgres it is not required to use space after a -. It seems that the 100-100 is interpreted as two numbers: 100 and -100. Where it should have been interpreted as an arithmetic operation of 100 minus 100.

馃挃 Your query failed to parse.
This is most likely due to a SQL syntax error. However, you might also have hit a bug, or an unimplemented feature of pg-mem.
If this is the case, please file an issue at https://github.com/oguimbal/pg-mem along with a query that reproduces this syntax error.

馃憠 Failed query:

    SELECT 100-100;

馃拃 Syntax error at line 1 col 11:

  SELECT 100-100
            ^
Unexpected int token: "-100". Instead, I was expecting to see one of the following:

    - A "op_cast" token
    - A "lbracket" token
    - A "op_member" token
    - A "op_membertext" token
    - A "word" token
    - A "word" token
    - A "op_exp" token
    - A "star" token
    - A "op_div" token
    - A "op_mod" token
    - A "op_plus" token
    - A "op_minus" token
    - A "op_additive" token
    - A "kw_not" token
    - A "kw_in" token
    - A "kw_not" token
    - A "op_like" token
    - A "op_ilike" token
    - A "op_not_like" token
    - A "op_not_ilike" token
    - A "kw_like" token
    - A "kw_ilike" token
    - A "ops_others" token
    - A "kw_not" token
    - A "kw_is" token
    - A "kw_notnull" token
    - A "kw_is" token
    - A "kw_isnull" token
    - A "kw_is" token
    - A "word" token
    - A "op_compare" token
    - A "op_eq" token
    - A "op_neq" token
    - A "kw_and" token
    - A "kw_or" token
    - A "kw_as" token
    - A "kw_primary" token
    - A "kw_unique" token
    - A "quoted_word" token
    - A "word" token
    - A "comma" token
    - A "kw_from" token
    - A "kw_where" token
    - A "kw_group" token
    - A "kw_order" token
    - A "kw_for" token
    - A "kw_offset" token
    - A "kw_limit" token
    - A "kw_fetch" token
    - A "kw_union" token
    - A "semicolon" token

To Reproduce

SELECT 100-100

pg-mem version

Used playground (it would be nice if the playground showed the current version :))

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