Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit81631ac

Browse files
committed
Fixes for intagg regression tests to match new array internal handling.
mlw
1 parentf68fe67 commit81631ac

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

‎contrib/intagg/int_aggregate.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
* This file is the property of the Digital Music Network (DMN).
1212
* It is being made available to users of the PostgreSQL system
1313
* under the BSD license.
14-
*
14+
*
15+
* NOTE: This module requires sizeof(void *) to be the same as sizeof(int)
1516
*/
1617
#include"postgres.h"
1718

@@ -37,6 +38,9 @@
3738
#include"utils/lsyscache.h"
3839

3940

41+
/* Uncomment this define if you are compiling for postgres 7.2.x */
42+
/* #define PG_7_2 */
43+
4044
/* This is actually a postgres version of a one dimensional array */
4145

4246
typedefstruct
@@ -96,7 +100,9 @@ static PGARRAY * GetPGArray(int4 state, int fAdd)
96100
p->a.size=cb;
97101
p->a.ndim=0;
98102
p->a.flags=0;
103+
#ifndefPG_7_2
99104
p->a.elemtype=INT4OID;
105+
#endif
100106
p->items=0;
101107
p->lower=START_NUM;
102108
}
@@ -149,7 +155,9 @@ static PGARRAY *ShrinkPGArray(PGARRAY *p)
149155
pnew->a.size=cb;
150156
pnew->a.ndim=1;
151157
pnew->a.flags=0;
158+
#ifndefPG_7_2
152159
pnew->a.elemtype=INT4OID;
160+
#endif
153161
pnew->lower=0;
154162
}
155163
else

‎contrib/intagg/int_aggregate.sql.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
-- Drop functions
2+
drop aggregate int_array_aggregate(int4);
23
drop function int_agg_state (int4, int4);
34
drop function int_agg_final_array (int4);
4-
drop aggregate int_array_aggregate(int4);
55
drop function int_array_enum (int4[]);
66

77

88
-- Internal function for the aggregate
99
-- Is called for each item in an aggregation
1010
create function int_agg_state (int4, int4)
1111
returns int4
12-
as 'MODULE_FILENAME','int_agg_state'
12+
as 'MODULE_PATHNAME','int_agg_state'
1313
language 'c';
1414

1515
-- Internal function for the aggregate
1616
-- Is called at the end of the aggregation, and returns an array.
1717
create function int_agg_final_array (int4)
1818
returns int4[]
19-
as 'MODULE_FILENAME','int_agg_final_array'
19+
as 'MODULE_PATHNAME','int_agg_final_array'
2020
language 'c';
2121

2222
-- The aggration funcion.
@@ -35,6 +35,6 @@ create aggregate int_array_aggregate
3535
-- as a row.
3636
create function int_array_enum(int4[])
3737
returns setof integer
38-
as 'MODULE_FILENAME','int_enum'
38+
as 'MODULE_PATHNAME','int_enum'
3939
language 'c';
4040

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp