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
81631ac4
Commit
81631ac4
authored
Sep 02, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for intagg regression tests to match new array internal handling.
mlw
parent
f68fe671
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
contrib/intagg/int_aggregate.c
contrib/intagg/int_aggregate.c
+9
-1
contrib/intagg/int_aggregate.sql.in
contrib/intagg/int_aggregate.sql.in
+4
-4
No files found.
contrib/intagg/int_aggregate.c
View file @
81631ac4
...
...
@@ -12,6 +12,7 @@
* It is being made available to users of the PostgreSQL system
* under the BSD license.
*
* NOTE: This module requires sizeof(void *) to be the same as sizeof(int)
*/
#include "postgres.h"
...
...
@@ -37,6 +38,9 @@
#include "utils/lsyscache.h"
/* Uncomment this define if you are compiling for postgres 7.2.x */
/* #define PG_7_2 */
/* This is actually a postgres version of a one dimensional array */
typedef
struct
...
...
@@ -96,7 +100,9 @@ static PGARRAY * GetPGArray(int4 state, int fAdd)
p
->
a
.
size
=
cb
;
p
->
a
.
ndim
=
0
;
p
->
a
.
flags
=
0
;
#ifndef PG_7_2
p
->
a
.
elemtype
=
INT4OID
;
#endif
p
->
items
=
0
;
p
->
lower
=
START_NUM
;
}
...
...
@@ -149,7 +155,9 @@ static PGARRAY *ShrinkPGArray(PGARRAY *p)
pnew
->
a
.
size
=
cb
;
pnew
->
a
.
ndim
=
1
;
pnew
->
a
.
flags
=
0
;
#ifndef PG_7_2
pnew
->
a
.
elemtype
=
INT4OID
;
#endif
pnew
->
lower
=
0
;
}
else
...
...
contrib/intagg/int_aggregate.sql.in
View file @
81631ac4
-- Drop functions
drop aggregate int_array_aggregate(int4);
drop function int_agg_state (int4, int4);
drop function int_agg_final_array (int4);
drop aggregate int_array_aggregate(int4);
drop function int_array_enum (int4[]);
...
...
@@ -9,14 +9,14 @@ drop function int_array_enum (int4[]);
-- Is called for each item in an aggregation
create function int_agg_state (int4, int4)
returns int4
as 'MODULE_
FILE
NAME','int_agg_state'
as 'MODULE_
PATH
NAME','int_agg_state'
language 'c';
-- Internal function for the aggregate
-- Is called at the end of the aggregation, and returns an array.
create function int_agg_final_array (int4)
returns int4[]
as 'MODULE_
FILE
NAME','int_agg_final_array'
as 'MODULE_
PATH
NAME','int_agg_final_array'
language 'c';
-- The aggration funcion.
...
...
@@ -35,6 +35,6 @@ create aggregate int_array_aggregate
-- as a row.
create function int_array_enum(int4[])
returns setof integer
as 'MODULE_
FILE
NAME','int_enum'
as 'MODULE_
PATH
NAME','int_enum'
language 'c';
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