JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

Postgres "->" not support "?"

Open rarechit opened this issue 3 years ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

String sql = "SELECT ti.*\n" + " FROM ticket_info ti\n" + " WHERE ti.tenant_id = ?\n" + " AND (ti.form_value -> '23s'):: jsonb\n" + " ?| (array[?,?,?,?,?])"; Select selectStatement = (Select) CCJSqlParserUtil.parse(sql); System.out.println(selectStatement.toString());

if i do this, it's ok; if change ti.form_value -> '23s' to ti.form_value -> ?, it's throw a exception. image

Expected behavior A clear and concise description of what you expected to happen.

System

  • Database you are using postgres 9.6
  • Java Version 1.8
  • JSqlParser version 4.2

rarechit avatar Nov 30 '21 03:11 rarechit

That's right. At the moment those JSonExpressions only support character literals and longs. PRs are welcome.

wumpz avatar Dec 12 '21 14:12 wumpz