pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix some minor spec-compliance issues in jsonpath lexer. 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix some minor spec-compliance issues in jsonpath lexer. @ 2019-09-20 18:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2019-09-20 18:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix some minor spec-compliance issues in jsonpath lexer. Although the SQL/JSON tech report makes reference to ECMAScript which allows both single- and double-quoted strings, all the rest of the report speaks only of double-quoted string literals in jsonpaths. That's more compatible with JSON itself; moreover single-quoted strings are hard to use inside a jsonpath that is itself a single-quoted SQL literal. So guess that the intent is to allow only double-quoted literals, and remove lexer support for single-quoted literals. It'll be less painful to add this again later if we're wrong, than to remove a shipped feature. Also, adjust the lexer so that unrecognized backslash sequences are treated as just meaning the escaped character, not as errors. This change has much better support in the standards, as JSON, JavaScript and ECMAScript all make it plain that that's what's supposed to happen. Back-patch to v12. Discussion: https://postgr.es/m/CAPpHfdvDci4iqNF9fhRkTqhe-5_8HmzeLt56drH%2B_Rv2rNRqfg@mail.gmail.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5f3bec0769c1d3c345ee2de30de271dce4feb469 Modified Files -------------- src/backend/utils/adt/jsonpath_scan.l | 79 +++++++++-------------- src/test/regress/expected/jsonpath.out | 18 ++---- src/test/regress/expected/jsonpath_encoding.out | 78 ---------------------- src/test/regress/expected/jsonpath_encoding_1.out | 72 --------------------- src/test/regress/sql/jsonpath.sql | 3 +- src/test/regress/sql/jsonpath_encoding.sql | 23 ------- 6 files changed, 38 insertions(+), 235 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix some minor spec-compliance issues in jsonpath lexer. @ 2019-09-20 18:23 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2019-09-20 18:23 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix some minor spec-compliance issues in jsonpath lexer. Although the SQL/JSON tech report makes reference to ECMAScript which allows both single- and double-quoted strings, all the rest of the report speaks only of double-quoted string literals in jsonpaths. That's more compatible with JSON itself; moreover single-quoted strings are hard to use inside a jsonpath that is itself a single-quoted SQL literal. So guess that the intent is to allow only double-quoted literals, and remove lexer support for single-quoted literals. It'll be less painful to add this again later if we're wrong, than to remove a shipped feature. Also, adjust the lexer so that unrecognized backslash sequences are treated as just meaning the escaped character, not as errors. This change has much better support in the standards, as JSON, JavaScript and ECMAScript all make it plain that that's what's supposed to happen. Back-patch to v12. Discussion: https://postgr.es/m/CAPpHfdvDci4iqNF9fhRkTqhe-5_8HmzeLt56drH%2B_Rv2rNRqfg@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e56cad84d542a8cc2056390a9c651118cfa6c89c Modified Files -------------- src/backend/utils/adt/jsonpath_scan.l | 79 +++++++++-------------- src/test/regress/expected/jsonpath.out | 18 ++---- src/test/regress/expected/jsonpath_encoding.out | 78 ---------------------- src/test/regress/expected/jsonpath_encoding_1.out | 72 --------------------- src/test/regress/sql/jsonpath.sql | 3 +- src/test/regress/sql/jsonpath_encoding.sql | 23 ------- 6 files changed, 38 insertions(+), 235 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-09-20 18:23 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-09-20 18:23 pgsql: Fix some minor spec-compliance issues in jsonpath lexer. Tom Lane <tgl@sss.pgh.pa.us> 2019-09-20 18:23 pgsql: Fix some minor spec-compliance issues in jsonpath lexer. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox