forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit28a1ae5
committed
Fix crash in contrib/ltree's lca() function for empty input array.
lca_inner() wasn't prepared for the possibility of getting no inputs.Fix that, and make some cosmetic improvements to the code while at it.Also, I thought the documentation of this function as returning the"longest common prefix" of the paths was entirely misleading; it reallyreturns a path one shorter than the longest common prefix, for the typicaldefinition of "prefix". Don't use that term in the docs, and adjust theexamples to clarify what really happens.This has been broken since its beginning, so back-patch to all supportedbranches.Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosingand for the initial patch, though I whacked it around some and addedtest cases.Discussion:https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com1 parent333224c commit28a1ae5
File tree
4 files changed
+50
-13
lines changed- contrib/ltree
- expected
- sql
- doc/src/sgml
4 files changed
+50
-13
lines changedLines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
262 | 280 |
| |
263 | 281 |
| |
264 | 282 |
| |
|
Lines changed: 25 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
402 | 402 |
| |
403 | 403 |
| |
404 | 404 |
| |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
405 | 411 |
| |
406 | 412 |
| |
407 | 413 |
| |
408 | 414 |
| |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 |
| - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
413 | 419 |
| |
414 | 420 |
| |
415 | 421 |
| |
416 | 422 |
| |
417 |
| - | |
| 423 | + | |
| 424 | + | |
418 | 425 |
| |
419 |
| - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
420 | 430 |
| |
| 431 | + | |
| 432 | + | |
421 | 433 |
| |
422 | 434 |
| |
423 | 435 |
| |
| |||
428 | 440 |
| |
429 | 441 |
| |
430 | 442 |
| |
431 |
| - | |
| 443 | + | |
432 | 444 |
| |
433 |
| - | |
| 445 | + | |
434 | 446 |
| |
435 |
| - | |
| 447 | + | |
| 448 | + | |
436 | 449 |
| |
437 | 450 |
| |
438 | 451 |
| |
| |||
443 | 456 |
| |
444 | 457 |
| |
445 | 458 |
| |
| 459 | + | |
| 460 | + | |
446 | 461 |
| |
447 | 462 |
| |
448 | 463 |
| |
449 | 464 |
| |
450 | 465 |
| |
451 | 466 |
| |
452 | 467 |
| |
| 468 | + | |
453 | 469 |
| |
454 | 470 |
| |
455 | 471 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 |
| |
58 | 61 |
| |
59 | 62 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
457 | 457 |
| |
458 | 458 |
| |
459 | 459 |
| |
460 |
| - | |
| 460 | + | |
461 | 461 |
| |
462 |
| - | |
| 462 | + | |
463 | 463 |
| |
464 | 464 |
| |
465 | 465 |
| |
466 | 466 |
| |
467 | 467 |
| |
468 | 468 |
| |
469 |
| - | |
470 |
| - | |
| 469 | + | |
| 470 | + | |
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
|
0 commit comments
Comments
(0)