Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
bf4ae685
Commit
bf4ae685
authored
Jul 29, 2016
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tqueue.c's range-remapping code.
It's depressingly clear that nobody ever tested this.
parent
80b346c2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
src/backend/executor/tqueue.c
src/backend/executor/tqueue.c
+2
-2
src/test/regress/expected/rangetypes.out
src/test/regress/expected/rangetypes.out
+17
-0
src/test/regress/sql/rangetypes.sql
src/test/regress/sql/rangetypes.sql
+14
-0
No files found.
src/backend/executor/tqueue.c
View file @
bf4ae685
...
...
@@ -371,7 +371,7 @@ tqueueWalkRange(TQueueDestReceiver *tqueue, Datum value)
* called in the first place: GetRemapClass should have returned NULL when
* asked about this range type.
*/
remapclass
=
GetRemapClass
(
typ
e
id
);
remapclass
=
GetRemapClass
(
typ
cache
->
rngelemtype
->
type_
id
);
Assert
(
remapclass
!=
TQUEUE_REMAP_NONE
);
/* Walk each bound, if present. */
...
...
@@ -749,7 +749,7 @@ TupleQueueRemapRange(TupleQueueReader *reader, Datum value)
* called in the first place: GetRemapClass should have returned NULL when
* asked about this range type.
*/
remapclass
=
GetRemapClass
(
typ
e
id
);
remapclass
=
GetRemapClass
(
typ
cache
->
rngelemtype
->
type_
id
);
Assert
(
remapclass
!=
TQUEUE_REMAP_NONE
);
/* Remap each bound, if present. */
...
...
src/test/regress/expected/rangetypes.out
View file @
bf4ae685
...
...
@@ -1336,6 +1336,23 @@ select array[1,3] <@ arrayrange(array[1,2], array[2,1]);
t
(1 row)
--
-- Ranges of composites
--
create type two_ints as (a int, b int);
create type two_ints_range as range (subtype = two_ints);
-- with force_parallel_mode on, this exercises tqueue.c's range remapping
select *, row_to_json(upper(t)) as u from
(values (two_ints_range(row(1,2), row(3,4))),
(two_ints_range(row(5,6), row(7,8)))) v(t);
t | u
-------------------+---------------
["(1,2)","(3,4)") | {"a":3,"b":4}
["(5,6)","(7,8)") | {"a":7,"b":8}
(2 rows)
drop type two_ints cascade;
NOTICE: drop cascades to type two_ints_range
--
-- OUT/INOUT/TABLE functions
--
...
...
src/test/regress/sql/rangetypes.sql
View file @
bf4ae685
...
...
@@ -447,6 +447,20 @@ select arrayrange(ARRAY[2,1], ARRAY[1,2]); -- fail
select
array
[
1
,
1
]
<@
arrayrange
(
array
[
1
,
2
],
array
[
2
,
1
]);
select
array
[
1
,
3
]
<@
arrayrange
(
array
[
1
,
2
],
array
[
2
,
1
]);
--
-- Ranges of composites
--
create
type
two_ints
as
(
a
int
,
b
int
);
create
type
two_ints_range
as
range
(
subtype
=
two_ints
);
-- with force_parallel_mode on, this exercises tqueue.c's range remapping
select
*
,
row_to_json
(
upper
(
t
))
as
u
from
(
values
(
two_ints_range
(
row
(
1
,
2
),
row
(
3
,
4
))),
(
two_ints_range
(
row
(
5
,
6
),
row
(
7
,
8
))))
v
(
t
);
drop
type
two_ints
cascade
;
--
-- OUT/INOUT/TABLE functions
--
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment