pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix crash in contrib/ltree's lca() function for empty input arra 7+ messages / 1 participants [nested] [flat]
* pgsql: Fix crash in contrib/ltree's lca() function for empty input arra @ 2018-07-13 22:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-07-13 22:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/dbd7f4e7c433b4fc202e9520d2bd360200f07805 Modified Files -------------- contrib/ltree/expected/ltree.out | 18 ++++++++++++++++++ contrib/ltree/ltree_op.c | 34 +++++++++++++++++++++++++--------- contrib/ltree/sql/ltree.sql | 3 +++ doc/src/sgml/ltree.sgml | 8 ++++---- 4 files changed, 50 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix crash in contrib/ltree's lca() function for empty input arra @ 2018-07-13 22:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-07-13 22:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ac6b69c1959fee3d6c987229edad62185db70c8c Modified Files -------------- contrib/ltree/expected/ltree.out | 18 ++++++++++++++++++ contrib/ltree/ltree_op.c | 34 +++++++++++++++++++++++++--------- contrib/ltree/sql/ltree.sql | 3 +++ doc/src/sgml/ltree.sgml | 8 ++++---- 4 files changed, 50 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix crash in contrib/ltree's lca() function for empty input arra @ 2018-07-13 22:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-07-13 22:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/330cad2c4b9a1ad2b690d7434fef7a2c481dc884 Modified Files -------------- contrib/ltree/expected/ltree.out | 18 ++++++++++++++++++ contrib/ltree/ltree_op.c | 34 +++++++++++++++++++++++++--------- contrib/ltree/sql/ltree.sql | 3 +++ doc/src/sgml/ltree.sgml | 8 ++++---- 4 files changed, 50 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix crash in contrib/ltree's lca() function for empty input arra @ 2018-07-13 22:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-07-13 22:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com Branch ------ REL9_3_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/cbbe75fe67195d9ee3efb2ea7af216c37a521cbf Modified Files -------------- contrib/ltree/expected/ltree.out | 18 ++++++++++++++++++ contrib/ltree/ltree_op.c | 34 +++++++++++++++++++++++++--------- contrib/ltree/sql/ltree.sql | 3 +++ doc/src/sgml/ltree.sgml | 8 ++++---- 4 files changed, 50 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix crash in contrib/ltree's lca() function for empty input arra @ 2018-07-13 22:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-07-13 22:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f8e8be7f2f9ef9162985ca1a8f4cc41940363522 Modified Files -------------- contrib/ltree/expected/ltree.out | 18 ++++++++++++++++++ contrib/ltree/ltree_op.c | 34 +++++++++++++++++++++++++--------- contrib/ltree/sql/ltree.sql | 3 +++ doc/src/sgml/ltree.sgml | 8 ++++---- 4 files changed, 50 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix crash in contrib/ltree's lca() function for empty input arra @ 2018-07-13 22:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-07-13 22:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/28a1ae5342fe39b7c4057d3f872cb6057f5f33bf Modified Files -------------- contrib/ltree/expected/ltree.out | 18 ++++++++++++++++++ contrib/ltree/ltree_op.c | 34 +++++++++++++++++++++++++--------- contrib/ltree/sql/ltree.sql | 3 +++ doc/src/sgml/ltree.sgml | 8 ++++---- 4 files changed, 50 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Fix crash in contrib/ltree's lca() function for empty input arra @ 2018-07-13 22:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2018-07-13 22:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 really returns a path one shorter than the longest common prefix, for the typical definition of "prefix". Don't use that term in the docs, and adjust the examples to clarify what really happens. This has been broken since its beginning, so back-patch to all supported branches. Per report from Hailong Li. Thanks to Pierre Ducroquet for diagnosing and for the initial patch, though I whacked it around some and added test cases. Discussion: https://postgr.es/m/5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1f47eb08cb42986f1f0c6ef52156f55ba9f7b1a3 Modified Files -------------- contrib/ltree/expected/ltree.out | 18 ++++++++++++++++++ contrib/ltree/ltree_op.c | 34 +++++++++++++++++++++++++--------- contrib/ltree/sql/ltree.sql | 3 +++ doc/src/sgml/ltree.sgml | 8 ++++---- 4 files changed, 50 insertions(+), 13 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-07-13 22:45 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-07-13 22:45 pgsql: Fix crash in contrib/ltree's lca() function for empty input arra Tom Lane <tgl@sss.pgh.pa.us> 2018-07-13 22:45 pgsql: Fix crash in contrib/ltree's lca() function for empty input arra Tom Lane <tgl@sss.pgh.pa.us> 2018-07-13 22:45 pgsql: Fix crash in contrib/ltree's lca() function for empty input arra Tom Lane <tgl@sss.pgh.pa.us> 2018-07-13 22:45 pgsql: Fix crash in contrib/ltree's lca() function for empty input arra Tom Lane <tgl@sss.pgh.pa.us> 2018-07-13 22:45 pgsql: Fix crash in contrib/ltree's lca() function for empty input arra Tom Lane <tgl@sss.pgh.pa.us> 2018-07-13 22:45 pgsql: Fix crash in contrib/ltree's lca() function for empty input arra Tom Lane <tgl@sss.pgh.pa.us> 2018-07-13 22:45 pgsql: Fix crash in contrib/ltree's lca() function for empty input arra Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox