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

Teodor Sigaev
This commit is contained in:
Bruce Momjian 2002-08-06 05:35:29 +00:00
parent 683b0d3add
commit 34f03b1630
2 changed files with 72 additions and 0 deletions

View File

@ -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
--------

View File

@ -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;