forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit79e1a9e
committed
Prevent crash when ts_rewrite() replaces a non-top-level subtree with null.
When ts_rewrite()'s replacement argument is an empty tsquery, it's supposedto simplify any operator nodes whose operand(s) become NULL; but it failedto do that reliably, because dropvoidsubtree() only examined the top levelof the result tree. Rather than make a second recursive pass, let's justgive the responsibility to dofindsubquery() to simplify while it's doingthe main replacement pass. Per report from Andreas Seltenreich.Artur Zakirov, with some cosmetic changes by me. Back-patch to allsupported branches.Discussion:https://postgr.es/m/8737i01dew.fsf@credativ.de1 parentcea6de2 commit79e1a9e
File tree
3 files changed
+47
-29
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+47
-29
lines changedLines changed: 29 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
143 | 149 |
| |
144 | 150 |
| |
145 | 151 |
| |
| |||
186 | 192 |
| |
187 | 193 |
| |
188 | 194 |
| |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
189 | 204 |
| |
190 | 205 |
| |
191 | 206 |
| |
| |||
196 | 211 |
| |
197 | 212 |
| |
198 | 213 |
| |
| 214 | + | |
199 | 215 |
| |
200 | 216 |
| |
201 |
| - | |
202 |
| - | |
203 |
| - | |
204 |
| - | |
205 |
| - | |
206 |
| - | |
207 |
| - | |
208 |
| - | |
209 |
| - | |
210 |
| - | |
211 |
| - | |
212 |
| - | |
213 |
| - | |
214 |
| - | |
215 |
| - | |
216 |
| - | |
217 |
| - | |
218 |
| - | |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 |
| - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
223 | 220 |
| |
224 | 221 |
| |
225 | 222 |
| |
226 | 223 |
| |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
227 | 228 |
| |
228 | 229 |
| |
229 |
| - | |
230 |
| - | |
231 |
| - | |
| 230 | + | |
| 231 | + | |
232 | 232 |
| |
233 |
| - | |
234 | 233 |
| |
235 | 234 |
| |
236 | 235 |
| |
237 | 236 |
| |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
238 | 241 |
| |
239 | 242 |
| |
240 | 243 |
| |
| |||
267 | 270 |
| |
268 | 271 |
| |
269 | 272 |
| |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 | 273 |
| |
274 | 274 |
| |
275 | 275 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
894 | 894 |
| |
895 | 895 |
| |
896 | 896 |
| |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
897 | 912 |
| |
898 | 913 |
| |
899 | 914 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
| 319 | + | |
| 320 | + | |
| 321 | + | |
319 | 322 |
| |
320 | 323 |
| |
321 | 324 |
| |
|
0 commit comments
Comments
(0)