mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-06 12:20:15 +01:00
Two or more constants can have the same location. We handled this correctly for non squashed constants, but failed to do it if squashed (resulting in out-of-bounds memory access), because the code structure became broken by commit 0f65f3eec478: we failed to update 'last_loc' correctly when skipping these squashed constants. The simplest fix seems to be to get rid of 'last_loc' altogether -- in hindsight, it's quite pointless. Also, when ignoring a constant because of this, make sure to fulfill fill_in_constant_lengths's duty of setting its length to -1. Lastly, we can use == instead of <= because the locations have been sorted beforehand, so the < case cannot arise. Co-authored-by: Sami Imseih <samimseih@gmail.com> Co-authored-by: Dmitry Dolgov <9erthalion6@gmail.com> Reported-by: Konstantin Knizhnik <knizhnik@garret.ru> Backpatch-through: 18 Discussion: https://www.postgresql.org/message-id/2b91e358-0d99-43f7-be44-d2d4dbce37b3%40garret.ru |
||
|---|---|---|
| .. | ||
| expected | ||
| sql | ||
| t | ||
| .gitignore | ||
| Makefile | ||
| meson.build | ||
| pg_stat_statements--1.1--1.2.sql | ||
| pg_stat_statements--1.2--1.3.sql | ||
| pg_stat_statements--1.3--1.4.sql | ||
| pg_stat_statements--1.4--1.5.sql | ||
| pg_stat_statements--1.4.sql | ||
| pg_stat_statements--1.5--1.6.sql | ||
| pg_stat_statements--1.6--1.7.sql | ||
| pg_stat_statements--1.7--1.8.sql | ||
| pg_stat_statements--1.8--1.9.sql | ||
| pg_stat_statements--1.9--1.10.sql | ||
| pg_stat_statements--1.10--1.11.sql | ||
| pg_stat_statements--1.11--1.12.sql | ||
| pg_stat_statements--1.12--1.13.sql | ||
| pg_stat_statements--1.0--1.1.sql | ||
| pg_stat_statements.c | ||
| pg_stat_statements.conf | ||
| pg_stat_statements.control | ||