question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Boolean expressions are not parsed

See original GitHub issue

Actual Behavior

The following select throws an JSQLParserException SELECT 2>1 AS FOO FROM BAR

Expected Behavior

SELECT 2>1 AS FOO FROM BAR should not throw an exception and the 2>1 should be recognized as a boolean expression.

Steps to Reproduce the Problem

  1. Try to parse SELECT 2>1 AS FOO FROM BAR
  2. Verify that an exception is thrown

Specifications

  • Version: 1.3
  • Platform:
  • Subsystem:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sivaraamcommented, Sep 24, 2019

Could you try a more recent version. There were changes using relations as parameters.

I tried using version 3.0 and I am unable to parse the following query,

SELECT (emp_name <> 'ron' AND emp_name != 'rick') FROM employee;

Code snippet:

        try {
            Statement conditionalsInSelectColumn =
                    CCJSqlParserUtil.parse("SELECT (emp_name <> 'ron' AND emp_name != 'rick') FROM employee;");
        } catch (JSQLParserException e) {
            e.printStackTrace();
        }
0reactions
manticore-projectscommented, Aug 6, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Parsing A Boolean Expression - LeetCode
A boolean expression is an expression that evaluates to either true or false . It can be in one of the following shapes:...
Read more >
How to parse a boolean expression - Stack Overflow
As I am so new to this language, I'm not sure what I'm doing wrong. Do you see it? let ComparisonSolver (comp:string) =...
Read more >
Parse::BooleanLogic - parser of boolean expressions
DESCRIPTION. This module is quite fast parser for boolean expressions. Originally it's been writen for Request Tracker to parse SQL like expressions and ......
Read more >
LeetCode 1106. Parsing A Boolean Expression Explanation ...
If you prefer, you can support me by clicking on the advertisement at the bottom of my homepage: https://www.happygirlzt.com/Thanks in ...
Read more >
LeetCode 1106 Parsing A Boolean Expression - YouTube
Source Problem https://leetcode.com/problems/parsing-a- boolean -expression/Solution inspired by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found