forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2a2b439
committed
Fix bogus tree-flattening logic in QTNTernary().
QTNTernary() contains logic to flatten, eg, '(a & b) & c' into 'a & b & c',which is all well and good, but it tries to do that to NOT nodes as well,so that '!!a' gets changed to '!a'. Explicitly restrict the conversion tobe done only on AND and OR nodes, and add a test case illustrating the bug.In passing, provide some comments for the sadly naked functions intsquery_util.c, and simplify some baroque logic in QTNFree(), whichI think may have been leaking some items it intended to free.Noted while investigating a complaint from Andreas Seltenreich.Back-patch to all supported versions.1 parent48a6592 commit2a2b439
File tree
3 files changed
+68
-23
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+68
-23
lines changedLines changed: 59 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 |
| |
21 | 24 |
| |
22 | 25 |
| |
| |||
50 | 53 |
| |
51 | 54 |
| |
52 | 55 |
| |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 |
| |
54 | 63 |
| |
55 | 64 |
| |
| |||
62 | 71 |
| |
63 | 72 |
| |
64 | 73 |
| |
65 |
| - | |
| 74 | + | |
66 | 75 |
| |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
80 | 80 |
| |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 |
| |
82 | 87 |
| |
83 | 88 |
| |
84 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
85 | 95 |
| |
86 | 96 |
| |
87 | 97 |
| |
| |||
135 | 145 |
| |
136 | 146 |
| |
137 | 147 |
| |
| 148 | + | |
| 149 | + | |
| 150 | + | |
138 | 151 |
| |
139 | 152 |
| |
140 | 153 |
| |
141 | 154 |
| |
142 | 155 |
| |
143 | 156 |
| |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
144 | 161 |
| |
145 | 162 |
| |
146 | 163 |
| |
| |||
158 | 175 |
| |
159 | 176 |
| |
160 | 177 |
| |
| 178 | + | |
| 179 | + | |
| 180 | + | |
161 | 181 |
| |
162 | 182 |
| |
163 | 183 |
| |
164 | 184 |
| |
165 | 185 |
| |
166 | 186 |
| |
167 |
| - | |
| 187 | + | |
168 | 188 |
| |
169 | 189 |
| |
170 | 190 |
| |
| |||
190 | 210 |
| |
191 | 211 |
| |
192 | 212 |
| |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
193 | 218 |
| |
194 | 219 |
| |
195 | 220 |
| |
196 | 221 |
| |
197 |
| - | |
198 | 222 |
| |
199 |
| - | |
200 |
| - | |
| 223 | + | |
201 | 224 |
| |
202 | 225 |
| |
203 | 226 |
| |
| |||
236 | 259 |
| |
237 | 260 |
| |
238 | 261 |
| |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 | 262 |
| |
243 | 263 |
| |
244 | 264 |
| |
| |||
263 | 283 |
| |
264 | 284 |
| |
265 | 285 |
| |
266 |
| - | |
267 |
| - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
268 | 289 |
| |
269 | 290 |
| |
270 | 291 |
| |
| |||
293 | 314 |
| |
294 | 315 |
| |
295 | 316 |
| |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
296 | 321 |
| |
297 | 322 |
| |
298 | 323 |
| |
| |||
330 | 355 |
| |
331 | 356 |
| |
332 | 357 |
| |
| 358 | + | |
| 359 | + | |
| 360 | + | |
333 | 361 |
| |
334 | 362 |
| |
335 | 363 |
| |
| |||
358 | 386 |
| |
359 | 387 |
| |
360 | 388 |
| |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
361 | 394 |
| |
362 | 395 |
| |
363 | 396 |
| |
| |||
393 | 426 |
| |
394 | 427 |
| |
395 | 428 |
| |
| 429 | + | |
| 430 | + | |
| 431 | + | |
396 | 432 |
| |
397 | 433 |
| |
398 | 434 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1184 | 1184 |
| |
1185 | 1185 |
| |
1186 | 1186 |
| |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1187 | 1194 |
| |
1188 | 1195 |
| |
1189 | 1196 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
402 | 402 |
| |
403 | 403 |
| |
404 | 404 |
| |
| 405 | + | |
| 406 | + | |
405 | 407 |
| |
406 | 408 |
| |
407 | 409 |
| |
|
0 commit comments
Comments
(0)