libpg_query
libpg_query copied to clipboard
Parser incorrectly parses queries with negative and zero values
The following queries produces an invalid tree when run through the parser : SELECT 0; SELECT -1;
Parser output:
{ version: 160001, stmts: [ { stmt: { SelectStmt: { targetList: [ { ResTarget: { val: { A_Const: { ival: {}, location: 7 } }, location: 7 } } ], limitOption: 'LIMIT_OPTION_DEFAULT', op: 'SETOP_NONE' } } } ] }
In version 15 these queries also produce incorrect tree, but version 14 is correct.