pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: jsonpath scanner: reentrant scanner
Date: Tue, 24 Dec 2024 22:42:56 +0000
Message-ID: <E1tQDc8-001Axi-Ea@gemulon.postgresql.org> (raw)

jsonpath scanner: reentrant scanner

Use the flex %option reentrant to make the generated scanner
reentrant and thread-safe.  Note: The parser was already pure.

Simplify flex scan buffer management: Instead of constructing the
buffer from pieces and then using yy_scan_buffer(), we can just use
yy_scan_string(), which does the same thing internally.  (Actually, we
use yy_scan_bytes() here because we already have the length.)

Use flex yyextra to handle context information, instead of global
variables.  This complements the other changes to make the scanner
reentrant.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Discussion: https://www.postgresql.org/message-id/flat/eb6faeac-2a8a-4b69-9189-c33c520e5b7b@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2a7425d7eef9b4b848763fb920fefa23c3c43f31

Modified Files
--------------
src/backend/nls.mk                        |   2 +-
src/backend/utils/adt/jsonpath_gram.y     |   2 +
src/backend/utils/adt/jsonpath_internal.h |  12 +-
src/backend/utils/adt/jsonpath_scan.l     | 283 ++++++++++++++----------------
4 files changed, 145 insertions(+), 154 deletions(-)



Message-ID: <E1tQDc8-001Axi-Ea@gemulon.postgresql.org>
Permalink:  ../E1tQDc8-001Axi-Ea@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tQDc8-001Axi-Ea@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: jsonpath scanner: reentrant scanner
  In-Reply-To: <E1tQDc8-001Axi-Ea@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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