TidStoreSetBlockOffsets() requires its offsets array to be strictly ascending and asserts this precondition. In test_tidstore, we were passing random offset numbers deduplicated by a DISTINCT clause in an array_agg() call directly to the do_set_block_offsets() test harness. However, DISTINCT without an ORDER BY clause does not guarantee sorted results according to the SQL standard. Fix this by sorting the offsets in-place inside do_set_block_offsets() before calling TidStoreSetBlockOffsets(). While this assertion failure is not observed during regular regression tests because they use queries simple enough that the optimizer consistently chooses plans yielding sorted results, it makes sense to stabilize the test. The failure could theoretically occur depending on the optimizer's plan choice, and has been reported when experimenting with certain third-party extensions. Backpatch to v17, where test_tidstore was introduced, to ensure extension development on stable branches does not hit this assertion. Reported-by: Andrei Lepikhov <lepihov@gmail.com> Author: Andrei Lepikhov <lepihov@gmail.com> Discussion: https://postgr.es/m/b97f1850-fc7b-43c4-9b04-4e97bb9e7dc0@gmail.com Backpatch-through: 17 |
||
|---|---|---|
| .github | ||
| config | ||
| contrib | ||
| doc | ||
| src | ||
| .abi-compliance-history | ||
| .cirrus.star | ||
| .cirrus.tasks.yml | ||
| .cirrus.yml | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| aclocal.m4 | ||
| configure | ||
| configure.ac | ||
| COPYRIGHT | ||
| GNUmakefile.in | ||
| HISTORY | ||
| Makefile | ||
| meson.build | ||
| meson_options.txt | ||
| README.md | ||
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/18/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/18/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.