Re: [PATCH] Optimize json_lex_string by batching character copying - Mailing list pgsql-hackers

From Jelte Fennema
Subject Re: [PATCH] Optimize json_lex_string by batching character copying
Date
Msg-id PR3PR83MB04762D58A50C9AFDACC08B03F7B49@PR3PR83MB0476.EURPRD83.prod.outlook.com
Whole thread Raw
In response to Re: [PATCH] Optimize json_lex_string by batching character copying  (Zhihong Yu <zyu@yugabyte.com>)
List pgsql-hackers
> +           if (copyable_characters_length)
> +           {
> +               /* flush copyable characters */
> +               appendBinaryStringInfo(
> +                                      lex->strval,
> +                                      s - copyable_characters_length,
> +                                      copyable_characters_length);
> +
> +           }
>            break;
>
> I wonder why copyable_characters_length is not reset after flushing.

It breaks from the loop right after. So copyable_characters_length isn't used
again and thus resetting is not necessary. But I agree this could use a comment.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Core dump in range_table_mutator()
Next
From: Hannu Krosing
Date:
Subject: Hardening PostgreSQL via (optional) ban on local file system access