JSqlParser
JSqlParser copied to clipboard
PGSQL CCJSqlParserUtil.parse can't parse ||
Describe the bug PGSQL CCJSqlParserUtil.parse can't parse ||
To Reproduce Steps to reproduce the behavior:
- select id,name from test where name like '%'||?||'%'
- JSqlParser 4.3
- net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "||" <OP_CONCAT>
Expected behavior A clear and concise description of what you expected to happen.
System
- Postgresql 11.8
- jdk 1.8
- JSqlParser 4.3
?| is a JSON operator in JSqlParser. The parser cannot split ?|| to ? ||. So you will be able to parse the expression if you insert whitespaces:
select id,name from test where name like '%' || ? || '%'
Closed, since no further question has been asked.