1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Add mbverifystr() functions specific to each encoding.

This makes pg_verify_mbstr() function faster, by allowing more efficient
encoding-specific implementations. All the implementations included in
this commit are pretty naive, they just call the same encoding-specific
verifychar functions that were used previously, but that already gives a
performance boost because the tight character-at-a-time loop is simpler.

Reviewed-by: John Naylor
Discussion: https://www.postgresql.org/message-id/e7861509-3960-538a-9025-b75a61188e01@iki.fi
This commit is contained in:
Heikki Linnakangas
2021-01-28 14:40:07 +02:00
parent a3367aa3c4
commit b80e10638e
9 changed files with 493 additions and 101 deletions

View File

@ -682,7 +682,7 @@ read_extension_script_file(const ExtensionControlFile *control,
src_encoding = control->encoding;
/* make sure that source string is valid in the expected encoding */
pg_verify_mbstr_len(src_encoding, src_str, len, false);
(void) pg_verify_mbstr(src_encoding, src_str, len, false);
/*
* Convert the encoding to the database encoding. read_whole_file