| От | PG Bug reporting form |
|---|---|
| Тема | BUG #16403: set_bit function does not have expected effect |
| Дата | |
| Msg-id | 16403-c4ad1c176b130a5b@postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #16403: set_bit function does not have expected effect
|
| Список | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 16403
Logged by: Alex Movitz
Email address: amovitz@bncpu.com
PostgreSQL version: 11.0
Operating system: Linux
Description:
Input:
SELECT set_bit('\x00000000'::bytea, 0, 1);
Expected Output:
'\x00000001' or '\x80000000'
Actual Output:
'\x01000000'
Input:
SELECT set_bit('\x00000000'::bytea, 8, 1);
Expected Output:
'\x00000100' or '\x00800000'
Actual Output:
'\x00010000'
Issue:
set_bit function changes the right-most bit of the byte, but with
little-endian byte order. This is confusing to any use case where setting a
bit in a BYTEA in a specific position. To iterate through the bits within
the BYTEA, one must have nested loops which set bits within byte boundaries.
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера