Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bb1afb5

Browse files
committed
Fix hstore regression tests.
This was an oversight in commit b60653b. Also, fix a typo spotted by Thom Brown.
1 parent fbf99d2 commit bb1afb5

File tree

3 files changed

+57
-59
lines changed

3 files changed

+57
-59
lines changed

contrib/hstore/expected/hstore.out

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
CREATE EXTENSION hstore;
2-
WARNING: => is deprecated as an operator name
3-
DETAIL: This name may be disallowed altogether in future versions of PostgreSQL.
42
set escape_string_warning=off;
53
--hstore;
64
select ''::hstore;
@@ -708,45 +706,45 @@ select pg_column_size(''::hstore || 'aa=>1, b=>2'::hstore)
708706
t
709707
(1 row)
710708

711-
-- =>
712-
select 'a=>g, b=>c'::hstore || ( 'asd'=>'gf' );
709+
-- hstore(text,text)
710+
select 'a=>g, b=>c'::hstore || hstore('asd', 'gf');
713711
?column?
714712
---------------------------------
715713
"a"=>"g", "b"=>"c", "asd"=>"gf"
716714
(1 row)
717715

718-
select 'a=>g, b=>c'::hstore || ( 'b'=>'gf' );
716+
select 'a=>g, b=>c'::hstore || hstore('b', 'gf');
719717
?column?
720718
---------------------
721719
"a"=>"g", "b"=>"gf"
722720
(1 row)
723721

724-
select 'a=>g, b=>c'::hstore || ( 'b'=>'NULL' );
722+
select 'a=>g, b=>c'::hstore || hstore('b', 'NULL');
725723
?column?
726724
-----------------------
727725
"a"=>"g", "b"=>"NULL"
728726
(1 row)
729727

730-
select 'a=>g, b=>c'::hstore || ( 'b'=>NULL );
728+
select 'a=>g, b=>c'::hstore || hstore('b', NULL);
731729
?column?
732730
---------------------
733731
"a"=>"g", "b"=>NULL
734732
(1 row)
735733

736-
select ('a=>g, b=>c'::hstore || ( NULL=>'b' )) is null;
734+
select ('a=>g, b=>c'::hstore || hstore(NULL, 'b')) is null;
737735
?column?
738736
----------
739737
t
740738
(1 row)
741739

742-
select pg_column_size(('b'=>'gf'))
740+
select pg_column_size(hstore('b', 'gf'))
743741
= pg_column_size('b=>gf'::hstore);
744742
?column?
745743
----------
746744
t
747745
(1 row)
748746

749-
select pg_column_size('a=>g, b=>c'::hstore || ('b'=>'gf'))
747+
select pg_column_size('a=>g, b=>c'::hstore || hstore('b', 'gf'))
750748
= pg_column_size('a=>g, b=>gf'::hstore);
751749
?column?
752750
----------
@@ -945,45 +943,45 @@ select pg_column_size(hstore(v))
945943
t
946944
(1 row)
947945

948-
select populate_record(v, ('c' => '3.45')) from testhstore1 v;
946+
select populate_record(v, hstore('c', '3.45')) from testhstore1 v;
949947
populate_record
950948
------------------
951949
(1,foo,3.45,3,0)
952950
(1 row)
953951

954-
select populate_record(v, ('d' => '3.45')) from testhstore1 v;
952+
select populate_record(v, hstore('d', '3.45')) from testhstore1 v;
955953
populate_record
956954
--------------------
957955
(1,foo,1.2,3.45,0)
958956
(1 row)
959957

960-
select populate_record(v, ('e' => '123')) from testhstore1 v;
958+
select populate_record(v, hstore('e', '123')) from testhstore1 v;
961959
populate_record
962960
-------------------
963961
(1,foo,1.2,3,123)
964962
(1 row)
965963

966-
select populate_record(v, ('e' => null)) from testhstore1 v;
964+
select populate_record(v, hstore('e', null)) from testhstore1 v;
967965
ERROR: domain hstestdom1 does not allow null values
968-
select populate_record(v, ('c' => null)) from testhstore1 v;
966+
select populate_record(v, hstore('c', null)) from testhstore1 v;
969967
populate_record
970968
-----------------
971969
(1,foo,,3,0)
972970
(1 row)
973971

974-
select populate_record(v, ('b' => 'foo') || ('a' => '123')) from testhstore1 v;
972+
select populate_record(v, hstore('b', 'foo') || hstore('a', '123')) from testhstore1 v;
975973
populate_record
976974
-------------------
977975
(123,foo,1.2,3,0)
978976
(1 row)
979977

980-
select populate_record(v, ('b' => 'foo') || ('e' => null)) from testhstore0 v;
978+
select populate_record(v, hstore('b', 'foo') || hstore('e', null)) from testhstore0 v;
981979
populate_record
982980
-----------------
983981
(1,foo,1.2,3)
984982
(1 row)
985983

986-
select populate_record(v, ('b' => 'foo') || ('e' => null)) from testhstore1 v;
984+
select populate_record(v, hstore('b', 'foo') || hstore('e', null)) from testhstore1 v;
987985
ERROR: domain hstestdom1 does not allow null values
988986
select populate_record(v, '') from testhstore0 v;
989987
populate_record
@@ -997,9 +995,9 @@ select populate_record(v, '') from testhstore1 v;
997995
(1,foo,1.2,3,0)
998996
(1 row)
999997

1000-
select populate_record(null::testhstore1, ('c' => '3.45') || ('a' => '123'));
998+
select populate_record(null::testhstore1, hstore('c', '3.45') || hstore('a', '123'));
1001999
ERROR: domain hstestdom1 does not allow null values
1002-
select populate_record(null::testhstore1, ('c' => '3.45') || ('e' => '123'));
1000+
select populate_record(null::testhstore1, hstore('c', '3.45') || hstore('e', '123'));
10031001
populate_record
10041002
-----------------
10051003
(,,3.45,,123)
@@ -1013,45 +1011,45 @@ select populate_record(null::testhstore0, '');
10131011

10141012
select populate_record(null::testhstore1, '');
10151013
ERROR: domain hstestdom1 does not allow null values
1016-
select v #= ('c' => '3.45') from testhstore1 v;
1014+
select v #= hstore('c', '3.45') from testhstore1 v;
10171015
?column?
10181016
------------------
10191017
(1,foo,3.45,3,0)
10201018
(1 row)
10211019

1022-
select v #= ('d' => '3.45') from testhstore1 v;
1020+
select v #= hstore('d', '3.45') from testhstore1 v;
10231021
?column?
10241022
--------------------
10251023
(1,foo,1.2,3.45,0)
10261024
(1 row)
10271025

1028-
select v #= ('e' => '123') from testhstore1 v;
1026+
select v #= hstore('e', '123') from testhstore1 v;
10291027
?column?
10301028
-------------------
10311029
(1,foo,1.2,3,123)
10321030
(1 row)
10331031

1034-
select v #= ('c' => null) from testhstore1 v;
1032+
select v #= hstore('c', null) from testhstore1 v;
10351033
?column?
10361034
--------------
10371035
(1,foo,,3,0)
10381036
(1 row)
10391037

1040-
select v #= ('e' => null) from testhstore0 v;
1038+
select v #= hstore('e', null) from testhstore0 v;
10411039
?column?
10421040
---------------
10431041
(1,foo,1.2,3)
10441042
(1 row)
10451043

1046-
select v #= ('e' => null) from testhstore1 v;
1044+
select v #= hstore('e', null) from testhstore1 v;
10471045
ERROR: domain hstestdom1 does not allow null values
1048-
select v #= (('b' => 'foo') || ('a' => '123')) from testhstore1 v;
1046+
select v #= (hstore('b', 'foo') || hstore('a', '123')) from testhstore1 v;
10491047
?column?
10501048
-------------------
10511049
(123,foo,1.2,3,0)
10521050
(1 row)
10531051

1054-
select v #= (('b' => 'foo') || ('e' => '123')) from testhstore1 v;
1052+
select v #= (hstore('b', 'foo') || hstore('e', '123')) from testhstore1 v;
10551053
?column?
10561054
-------------------
10571055
(1,foo,1.2,3,123)
@@ -1069,9 +1067,9 @@ select v #= hstore '' from testhstore1 v;
10691067
(1,foo,1.2,3,0)
10701068
(1 row)
10711069

1072-
select null::testhstore1 #= (('c' => '3.45') || ('a' => '123'));
1070+
select null::testhstore1 #= (hstore('c', '3.45') || hstore('a', '123'));
10731071
ERROR: domain hstestdom1 does not allow null values
1074-
select null::testhstore1 #= (('c' => '3.45') || ('e' => '123'));
1072+
select null::testhstore1 #= (hstore('c', '3.45') || hstore('e', '123'));
10751073
?column?
10761074
---------------
10771075
(,,3.45,,123)

contrib/hstore/hstore--1.0--1.1.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* contrib/hstore/hstore-1.0-1.1.sql */
1+
/* contrib/hstore/hstore--1.0--1.1.sql */
22

33
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
44
\echo Use "ALTER EXTENSION hstore UPDATE TO '1.1'" to load this file. \quit

contrib/hstore/sql/hstore.sql

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ select pg_column_size('aa=>1, b=>2'::hstore || ''::hstore)
152152
select pg_column_size(''::hstore || 'aa=>1, b=>2'::hstore)
153153
= pg_column_size('aa=>1, b=>2'::hstore);
154154

155-
-- =>
156-
select 'a=>g, b=>c'::hstore || ( 'asd'=>'gf' );
157-
select 'a=>g, b=>c'::hstore || ( 'b'=>'gf' );
158-
select 'a=>g, b=>c'::hstore || ( 'b'=>'NULL' );
159-
select 'a=>g, b=>c'::hstore || ( 'b'=>NULL );
160-
select ('a=>g, b=>c'::hstore || ( NULL=>'b' )) is null;
161-
select pg_column_size(('b'=>'gf'))
155+
-- hstore(text,text)
156+
select 'a=>g, b=>c'::hstore || hstore('asd', 'gf');
157+
select 'a=>g, b=>c'::hstore || hstore('b', 'gf');
158+
select 'a=>g, b=>c'::hstore || hstore('b', 'NULL');
159+
select 'a=>g, b=>c'::hstore || hstore('b', NULL);
160+
select ('a=>g, b=>c'::hstore || hstore(NULL, 'b')) is null;
161+
select pg_column_size(hstore('b', 'gf'))
162162
= pg_column_size('b=>gf'::hstore);
163-
select pg_column_size('a=>g, b=>c'::hstore || ('b'=>'gf'))
163+
select pg_column_size('a=>g, b=>c'::hstore || hstore('b', 'gf'))
164164
= pg_column_size('a=>g, b=>gf'::hstore);
165165

166166
-- slice()
@@ -215,32 +215,32 @@ select hstore(null::testhstore1);
215215
select pg_column_size(hstore(v))
216216
= pg_column_size('a=>1, b=>"foo", c=>"1.2", d=>"3", e=>"0"'::hstore)
217217
from testhstore1 v;
218-
select populate_record(v, ('c' => '3.45')) from testhstore1 v;
219-
select populate_record(v, ('d' => '3.45')) from testhstore1 v;
220-
select populate_record(v, ('e' => '123')) from testhstore1 v;
221-
select populate_record(v, ('e' => null)) from testhstore1 v;
222-
select populate_record(v, ('c' => null)) from testhstore1 v;
223-
select populate_record(v, ('b' => 'foo') || ('a' => '123')) from testhstore1 v;
224-
select populate_record(v, ('b' => 'foo') || ('e' => null)) from testhstore0 v;
225-
select populate_record(v, ('b' => 'foo') || ('e' => null)) from testhstore1 v;
218+
select populate_record(v, hstore('c', '3.45')) from testhstore1 v;
219+
select populate_record(v, hstore('d', '3.45')) from testhstore1 v;
220+
select populate_record(v, hstore('e', '123')) from testhstore1 v;
221+
select populate_record(v, hstore('e', null)) from testhstore1 v;
222+
select populate_record(v, hstore('c', null)) from testhstore1 v;
223+
select populate_record(v, hstore('b', 'foo') || hstore('a', '123')) from testhstore1 v;
224+
select populate_record(v, hstore('b', 'foo') || hstore('e', null)) from testhstore0 v;
225+
select populate_record(v, hstore('b', 'foo') || hstore('e', null)) from testhstore1 v;
226226
select populate_record(v, '') from testhstore0 v;
227227
select populate_record(v, '') from testhstore1 v;
228-
select populate_record(null::testhstore1, ('c' => '3.45') || ('a' => '123'));
229-
select populate_record(null::testhstore1, ('c' => '3.45') || ('e' => '123'));
228+
select populate_record(null::testhstore1, hstore('c', '3.45') || hstore('a', '123'));
229+
select populate_record(null::testhstore1, hstore('c', '3.45') || hstore('e', '123'));
230230
select populate_record(null::testhstore0, '');
231231
select populate_record(null::testhstore1, '');
232-
select v #= ('c' => '3.45') from testhstore1 v;
233-
select v #= ('d' => '3.45') from testhstore1 v;
234-
select v #= ('e' => '123') from testhstore1 v;
235-
select v #= ('c' => null) from testhstore1 v;
236-
select v #= ('e' => null) from testhstore0 v;
237-
select v #= ('e' => null) from testhstore1 v;
238-
select v #= (('b' => 'foo') || ('a' => '123')) from testhstore1 v;
239-
select v #= (('b' => 'foo') || ('e' => '123')) from testhstore1 v;
232+
select v #= hstore('c', '3.45') from testhstore1 v;
233+
select v #= hstore('d', '3.45') from testhstore1 v;
234+
select v #= hstore('e', '123') from testhstore1 v;
235+
select v #= hstore('c', null) from testhstore1 v;
236+
select v #= hstore('e', null) from testhstore0 v;
237+
select v #= hstore('e', null) from testhstore1 v;
238+
select v #= (hstore('b', 'foo') || hstore('a', '123')) from testhstore1 v;
239+
select v #= (hstore('b', 'foo') || hstore('e', '123')) from testhstore1 v;
240240
select v #= hstore '' from testhstore0 v;
241241
select v #= hstore '' from testhstore1 v;
242-
select null::testhstore1 #= (('c' => '3.45') || ('a' => '123'));
243-
select null::testhstore1 #= (('c' => '3.45') || ('e' => '123'));
242+
select null::testhstore1 #= (hstore('c', '3.45') || hstore('a', '123'));
243+
select null::testhstore1 #= (hstore('c', '3.45') || hstore('e', '123'));
244244
select null::testhstore0 #= hstore '';
245245
select null::testhstore1 #= hstore '';
246246
select v #= h from testhstore1 v, (values (hstore 'a=>123',1),('b=>foo,c=>3.21',2),('a=>null',3),('e=>123',4),('f=>blah',5)) x(h,i) order by i;

0 commit comments

Comments
 (0)