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

Commitb1fdc72

Browse files
committed
Fix Windows build broken in6943a94
Also it fixes dynamic array allocation disallowed by ANSI-C.Author: Stas Kelvich
1 parent8829af4 commitb1fdc72

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ typedef struct
6666
#defineSTATHDRSIZE (offsetof(TSVectorStat, data))
6767

6868
staticDatumtsvector_update_trigger(PG_FUNCTION_ARGS,boolconfig_column);
69-
staticinttsvector_bsearch(TSVectortsin,char*lexin,intlexin_len);
69+
staticinttsvector_bsearch(constTSVectortsv,char*lexeme,intlexeme_len);
7070

7171
/*
7272
* Order: haspos, len, word, for all positions (pos, weight)
@@ -684,10 +684,12 @@ tsvector_to_array(PG_FUNCTION_ARGS)
684684
{
685685
TSVectortsin=PG_GETARG_TSVECTOR(0);
686686
WordEntry*arrin=ARRPTR(tsin);
687-
Datumelements[tsin->size];
687+
Datum*elements;
688688
inti;
689689
ArrayType*array;
690690

691+
elements=palloc(tsin->size*sizeof(Datum));
692+
691693
for (i=0;i<tsin->size;i++)
692694
{
693695
elements[i]=PointerGetDatum(
@@ -696,6 +698,8 @@ tsvector_to_array(PG_FUNCTION_ARGS)
696698
}
697699

698700
array=construct_array(elements,tsin->size,TEXTOID,-1, false,'i');
701+
702+
pfree(elements);
699703
PG_FREE_IF_COPY(tsin,0);
700704
PG_RETURN_POINTER(array);
701705
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp