forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1279414
committed
Fix misbehavior in contrib/pg_trgm with an unsatisfiable regex.
If the regex compiler can see that a regex is unsatisfiable(for example, '$foo') then it may emit an NFA having no arcs.pg_trgm's packGraph function did the wrong thing in this case;it would access off the end of a work array, and with bad luckcould produce a corrupted output data structure causing moreproblems later. This could end with wrong answers or crashesin queries using a pg_trgm GIN or GiST index with such a regex.Fix by not trying to de-duplicate if there aren't at least 2 arcs.Per bug #17830 from Alexander Lakhin. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/17830-57ff5f89bdb02b09@postgresql.org1 parenta303108 commit1279414
File tree
3 files changed
+25
-10
lines changed- contrib/pg_trgm
- expected
- sql
3 files changed
+25
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1935 | 1935 | | |
1936 | 1936 | | |
1937 | 1937 | | |
1938 | | - | |
1939 | | - | |
1940 | | - | |
| 1938 | + | |
1941 | 1939 | | |
1942 | 1940 | | |
1943 | 1941 | | |
| |||
2009 | 2007 | | |
2010 | 2008 | | |
2011 | 2009 | | |
2012 | | - | |
2013 | | - | |
2014 | | - | |
| 2010 | + | |
2015 | 2011 | | |
2016 | | - | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
2017 | 2018 | | |
2018 | | - | |
2019 | | - | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
2020 | 2024 | | |
| 2025 | + | |
2021 | 2026 | | |
2022 | | - | |
| 2027 | + | |
| 2028 | + | |
2023 | 2029 | | |
2024 | 2030 | | |
2025 | 2031 | | |
| |||
0 commit comments
Comments
(0)