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

Commit608d843

Browse files
committed
Array slice extraction should produce a result array with index lower
bounds of 1, not the lower bound subscripts of the original slice.Per bug report from Andre Holzner, 1-Feb-02.
1 parent1aac2c8 commit608d843

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎src/backend/utils/adt/arrayfuncs.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.74 2002/03/01 22:17:10 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.75 2002/03/02 00:34:24 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -839,7 +839,8 @@ array_get_slice(ArrayType *array,
839839
inti,
840840
ndim,
841841
*dim,
842-
*lb;
842+
*lb,
843+
*newlb;
843844
intfixedDim[1],
844845
fixedLb[1];
845846
char*arraydataptr;
@@ -911,7 +912,14 @@ array_get_slice(ArrayType *array,
911912
newarray->ndim=ndim;
912913
newarray->flags=0;
913914
memcpy(ARR_DIMS(newarray),span,ndim*sizeof(int));
914-
memcpy(ARR_LBOUND(newarray),lowerIndx,ndim*sizeof(int));
915+
/*
916+
* Lower bounds of the new array are set to 1. Formerly (before 7.3)
917+
* we copied the given lowerIndx values ... but that seems confusing.
918+
*/
919+
newlb=ARR_LBOUND(newarray);
920+
for (i=0;i<ndim;i++)
921+
newlb[i]=1;
922+
915923
array_extract_slice(ndim,dim,lb,arraydataptr,elmlen,
916924
lowerIndx,upperIndx,ARR_DATA_PTR(newarray));
917925

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp