diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-21 10:09:19 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-21 10:19:17 +0300 |
commit | 31031664807af57b64c42818e69cf4fafdcd6b75 (patch) | |
tree | 0c3c5008d7c14d6eefe21d4e6237e22625516282 /contrib/libs/libpq/src/include | |
parent | a42e56882cf1b2f89af4a517a8e25fe3a67cebfc (diff) | |
download | ydb-31031664807af57b64c42818e69cf4fafdcd6b75.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/libs/libpq/src/include')
-rw-r--r-- | contrib/libs/libpq/src/include/mb/pg_wchar.h | 69 | ||||
-rw-r--r-- | contrib/libs/libpq/src/include/pg_config-linux.h | 17 | ||||
-rw-r--r-- | contrib/libs/libpq/src/include/utils/ascii.h | 84 |
3 files changed, 91 insertions, 79 deletions
diff --git a/contrib/libs/libpq/src/include/mb/pg_wchar.h b/contrib/libs/libpq/src/include/mb/pg_wchar.h index 25276b199f..06a56a41bb 100644 --- a/contrib/libs/libpq/src/include/mb/pg_wchar.h +++ b/contrib/libs/libpq/src/include/mb/pg_wchar.h @@ -19,8 +19,6 @@ #ifndef PG_WCHAR_H #define PG_WCHAR_H -#include "port/simd.h" - /* * The pg_wchar type */ @@ -702,71 +700,4 @@ extern int mic2latin_with_table(const unsigned char *mic, unsigned char *p, extern WCHAR *pgwin32_message_to_UTF16(const char *str, int len, int *utf16len); #endif - -/* - * Verify a chunk of bytes for valid ASCII. - * - * Returns false if the input contains any zero bytes or bytes with the - * high-bit set. Input len must be a multiple of the chunk size (8 or 16). - */ -static inline bool -is_valid_ascii(const unsigned char *s, int len) -{ - const unsigned char *const s_end = s + len; - Vector8 chunk; - Vector8 highbit_cum = vector8_broadcast(0); -#ifdef USE_NO_SIMD - Vector8 zero_cum = vector8_broadcast(0x80); -#endif - - Assert(len % sizeof(chunk) == 0); - - while (s < s_end) - { - vector8_load(&chunk, s); - - /* Capture any zero bytes in this chunk. */ -#ifdef USE_NO_SIMD - - /* - * First, add 0x7f to each byte. This sets the high bit in each byte, - * unless it was a zero. If any resulting high bits are zero, the - * corresponding high bits in the zero accumulator will be cleared. - * - * If none of the bytes in the chunk had the high bit set, the max - * value each byte can have after the addition is 0x7f + 0x7f = 0xfe, - * and we don't need to worry about carrying over to the next byte. If - * any input bytes did have the high bit set, it doesn't matter - * because we check for those separately. - */ - zero_cum &= (chunk + vector8_broadcast(0x7F)); -#else - - /* - * Set all bits in each lane of the highbit accumulator where input - * bytes are zero. - */ - highbit_cum = vector8_or(highbit_cum, - vector8_eq(chunk, vector8_broadcast(0))); -#endif - - /* Capture all set bits in this chunk. */ - highbit_cum = vector8_or(highbit_cum, chunk); - - s += sizeof(chunk); - } - - /* Check if any high bits in the high bit accumulator got set. */ - if (vector8_is_highbit_set(highbit_cum)) - return false; - -#ifdef USE_NO_SIMD - /* Check if any high bits in the zero accumulator got cleared. */ - if (zero_cum != vector8_broadcast(0x80)) - return false; -#endif - - return true; -} - #endif /* PG_WCHAR_H */ diff --git a/contrib/libs/libpq/src/include/pg_config-linux.h b/contrib/libs/libpq/src/include/pg_config-linux.h index afcf2967c5..b4592fa70a 100644 --- a/contrib/libs/libpq/src/include/pg_config-linux.h +++ b/contrib/libs/libpq/src/include/pg_config-linux.h @@ -32,7 +32,7 @@ #define BLCKSZ 8192 /* Saved arguments from configure */ -#define CONFIGURE_ARGS " '--prefix=/var/empty/postgresql-16.1' '--with-openssl' '--with-libxml' '--with-icu' '--sysconfdir=/etc' '--libdir=$(lib)/lib' '--with-system-tzdata=/var/empty/tzdata-2022f/share/zoneinfo' '--enable-debug' '--with-systemd' '--with-ossp-uuid' '--with-lz4' '--with-gssapi' '--without-gssapi' 'CC=cc' 'CXX=g++' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_PATH=/var/empty/libxcrypt-4.4.30/lib/pkgconfig:/var/empty/zlib-1.2.13-dev/lib/pkgconfig:/var/empty/ncurses-6.3-p20220507-dev/lib/pkgconfig:/var/empty/openssl-3.0.7-dev/lib/pkgconfig:/var/empty/libxml2-2.10.3-dev/lib/pkgconfig:/var/empty/icu4c-72.1-dev/lib/pkgconfig:/var/empty/lz4-1.9.4-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/share/pkgconfig:/var/empty/libkrb5-1.20-dev/lib/pkgconfig:/var/empty/libossp-uuid-1.6.2/lib/pkgconfig'" +#define CONFIGURE_ARGS " '--prefix=/var/empty/postgresql-16.2' '--with-openssl' '--with-libxml' '--with-icu' '--sysconfdir=/etc' '--libdir=$(lib)/lib' '--with-system-tzdata=/var/empty/tzdata-2022f/share/zoneinfo' '--enable-debug' '--with-systemd' '--with-ossp-uuid' '--with-lz4' '--with-gssapi' '--without-gssapi' 'CC=cc' 'CXX=g++' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_PATH=/var/empty/libxcrypt-4.4.30/lib/pkgconfig:/var/empty/zlib-1.2.13-dev/lib/pkgconfig:/var/empty/ncurses-6.3-p20220507-dev/lib/pkgconfig:/var/empty/openssl-3.0.7-dev/lib/pkgconfig:/var/empty/libxml2-2.10.3-dev/lib/pkgconfig:/var/empty/icu4c-72.1-dev/lib/pkgconfig:/var/empty/lz4-1.9.4-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/lib/pkgconfig:/var/empty/systemd-251.7-dev/share/pkgconfig:/var/empty/libkrb5-1.20-dev/lib/pkgconfig:/var/empty/libossp-uuid-1.6.2/lib/pkgconfig'" /* Define to the default TCP port number on which the server listens and to which clients will try to connect. This can be overridden at run-time, but @@ -71,9 +71,6 @@ /* Define to 1 if you have the `backtrace_symbols' function. */ #define HAVE_BACKTRACE_SYMBOLS 1 -/* Define to 1 if you have the `BIO_get_data' function. */ -#define HAVE_BIO_GET_DATA 1 - /* Define to 1 if you have the `BIO_meth_new' function. */ #define HAVE_BIO_METH_NEW 1 @@ -607,7 +604,7 @@ #define PACKAGE_NAME "PostgreSQL" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PostgreSQL 16.1" +#define PACKAGE_STRING "PostgreSQL 16.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "postgresql" @@ -616,7 +613,7 @@ #define PACKAGE_URL "https://www.postgresql.org/" /* Define to the version of this package. */ -#define PACKAGE_VERSION "16.1" +#define PACKAGE_VERSION "16.2" /* Define to the name of a signed 128-bit integer type. */ #define PG_INT128_TYPE __int128 @@ -635,7 +632,7 @@ #define PG_MAJORVERSION_NUM 16 /* PostgreSQL minor version number */ -#define PG_MINORVERSION_NUM 1 +#define PG_MINORVERSION_NUM 2 /* Define to best printf format archetype, usually gnu_printf if available. */ #define PG_PRINTF_ATTRIBUTE gnu_printf @@ -644,13 +641,13 @@ #define PG_USE_STDBOOL 1 /* PostgreSQL version as a string */ -#define PG_VERSION "16.1" +#define PG_VERSION "16.2" /* PostgreSQL version as a number */ -#define PG_VERSION_NUM 160001 +#define PG_VERSION_NUM 160002 /* A string containing the version number, platform, and C compiler */ -#define PG_VERSION_STR "PostgreSQL 16.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.3.0, 64-bit" +#define PG_VERSION_STR "PostgreSQL 16.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.3.0, 64-bit" /* Define to 1 to allow profiling output to be saved separately for each process. */ diff --git a/contrib/libs/libpq/src/include/utils/ascii.h b/contrib/libs/libpq/src/include/utils/ascii.h new file mode 100644 index 0000000000..7df024dad3 --- /dev/null +++ b/contrib/libs/libpq/src/include/utils/ascii.h @@ -0,0 +1,84 @@ +/*----------------------------------------------------------------------- + * ascii.h + * + * Portions Copyright (c) 1999-2023, PostgreSQL Global Development Group + * + * src/include/utils/ascii.h + * + *----------------------------------------------------------------------- + */ + +#ifndef _ASCII_H_ +#define _ASCII_H_ + +#include "port/simd.h" + +extern void ascii_safe_strlcpy(char *dest, const char *src, size_t destsiz); + +/* + * Verify a chunk of bytes for valid ASCII. + * + * Returns false if the input contains any zero bytes or bytes with the + * high-bit set. Input len must be a multiple of the chunk size (8 or 16). + */ +static inline bool +is_valid_ascii(const unsigned char *s, int len) +{ + const unsigned char *const s_end = s + len; + Vector8 chunk; + Vector8 highbit_cum = vector8_broadcast(0); +#ifdef USE_NO_SIMD + Vector8 zero_cum = vector8_broadcast(0x80); +#endif + + Assert(len % sizeof(chunk) == 0); + + while (s < s_end) + { + vector8_load(&chunk, s); + + /* Capture any zero bytes in this chunk. */ +#ifdef USE_NO_SIMD + + /* + * First, add 0x7f to each byte. This sets the high bit in each byte, + * unless it was a zero. If any resulting high bits are zero, the + * corresponding high bits in the zero accumulator will be cleared. + * + * If none of the bytes in the chunk had the high bit set, the max + * value each byte can have after the addition is 0x7f + 0x7f = 0xfe, + * and we don't need to worry about carrying over to the next byte. If + * any input bytes did have the high bit set, it doesn't matter + * because we check for those separately. + */ + zero_cum &= (chunk + vector8_broadcast(0x7F)); +#else + + /* + * Set all bits in each lane of the highbit accumulator where input + * bytes are zero. + */ + highbit_cum = vector8_or(highbit_cum, + vector8_eq(chunk, vector8_broadcast(0))); +#endif + + /* Capture all set bits in this chunk. */ + highbit_cum = vector8_or(highbit_cum, chunk); + + s += sizeof(chunk); + } + + /* Check if any high bits in the high bit accumulator got set. */ + if (vector8_is_highbit_set(highbit_cum)) + return false; + +#ifdef USE_NO_SIMD + /* Check if any high bits in the zero accumulator got cleared. */ + if (zero_cum != vector8_broadcast(0x80)) + return false; +#endif + + return true; +} + +#endif /* _ASCII_H_ */ |