Skip to content

Conversation

JeroennC
Copy link

Hi,

I've changed around the grammar a bit in order to support CASE WHENs being used as Conditions on their own (see #200). This means that the THENs and ELSEs have to be able to contain full expressions. One of the problems that made this not work was that Condition() would be okay with turning into a Column or a 0 or 1. I've removed this and added Conditions becoming SimpleExpressions. This does however mean that it will accept any SimpleExpression in place of a condition, for instance:

SELECT * FROM t1 WHERE 5

or

SELECT * FROM t1 WHERE a + b

Which is also why I removed one of the tests what ensure this is not parse-able. I would argue that while it may indeed not be valid SQL (depending on the DB's implementation), it is no harm if it is actually parse-able. What do you think of this?

…gular/SQLConditions besides SimpleExpressions. Swap Regular and SQL Condition around in Condition().
… become Expressions. Add Columns to SimpleExpression.
@coveralls
Copy link

coveralls commented Feb 17, 2017

Coverage Status

Coverage remained the same at 84.714% when pulling a990675 on JeroennC:master into 320f64a on JSQLParser:master.

@tomershay
Copy link
Contributor

@JeroennC, Thanks for providing this fix. I merged it to my own custom branch to see if it's working and it worked perfectly.
@wumpz - did you consider pulling this request?

@wumpz
Copy link
Member

wumpz commented Feb 4, 2021

already solved

@wumpz wumpz closed this Feb 4, 2021
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.

4 participants