Patch for current CVS. It add test of lca() to ltree test suite.

Teodor Sigaev
REL7_3_STABLE
Bruce Momjian 23 years ago
parent 683b0d3add
commit 34f03b1630
  1. 60
      contrib/ltree/expected/ltree.out
  2. 12
      contrib/ltree/sql/ltree.sql

@ -107,6 +107,66 @@ select ''::ltree || 'Top.Child1.Child2'::ltree;
Top.Child1.Child2
(1 row)
select lca('{la.2.3,1.2.3.4.5.6,}') is null;
?column?
----------
t
(1 row)
select lca('{la.2.3,1.2.3.4.5.6}') is null;
?column?
----------
f
(1 row)
select lca('{1.la.2.3,1.2.3.4.5.6}');
lca
-----
1
(1 row)
select lca('{1.2.3,1.2.3.4.5.6}');
lca
-----
1.2
(1 row)
select lca('1.la.2.3','1.2.3.4.5.6');
lca
-----
1
(1 row)
select lca('1.2.3','1.2.3.4.5.6');
lca
-----
1.2
(1 row)
select lca('1.2.2.3','1.2.3.4.5.6');
lca
-----
1.2
(1 row)
select lca('1.2.2.3','1.2.3.4.5.6','');
lca
-----
(1 row)
select lca('1.2.2.3','1.2.3.4.5.6','2');
lca
-----
(1 row)
select lca('1.2.2.3','1.2.3.4.5.6','1');
lca
-----
(1 row)
select '1'::lquery;
lquery
--------

@ -23,6 +23,18 @@ select 'Top_0'::ltree || 'Top.Child1.Child2'::ltree;
select 'Top.Child1.Child2'::ltree || ''::ltree;
select ''::ltree || 'Top.Child1.Child2'::ltree;
select lca('{la.2.3,1.2.3.4.5.6,}') is null;
select lca('{la.2.3,1.2.3.4.5.6}') is null;
select lca('{1.la.2.3,1.2.3.4.5.6}');
select lca('{1.2.3,1.2.3.4.5.6}');
select lca('1.la.2.3','1.2.3.4.5.6');
select lca('1.2.3','1.2.3.4.5.6');
select lca('1.2.2.3','1.2.3.4.5.6');
select lca('1.2.2.3','1.2.3.4.5.6','');
select lca('1.2.2.3','1.2.3.4.5.6','2');
select lca('1.2.2.3','1.2.3.4.5.6','1');
select '1'::lquery;
select '4|3|2'::lquery;
select '1.2'::lquery;

Loading…
Cancel
Save