Skip to content

Support INTERVAL as argument. #40

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

Merged

Conversation

zdenal
Copy link

@zdenal zdenal commented Jun 30, 2024

Why

We want to support common sql syntax DATE_SUB(date, INTERVAL value interval) (doc eg. https://www.w3schools.com/sql/func_mysql_date_sub.asp).

The issue was parsing INTERVAL logic. We were introducing support interval table name or aliases here: 093d974.

The conditions are ok except the last

&& self.maybe_parse(|parser| parser.parse_interval()).is_some() => {self.parse_interval()}

the parse_interval inside maybe_parse is already consuming tokens, so next call of parse_interval() is returning parser error.

This PR is keeping green the origin tests targeted to interval table aliases logic.

@zdenal zdenal merged commit 2a49c66 into main Jul 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant