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

Commit9fdb1de

Browse files
committed
Make [VACUUM] ANALYZE safe on zero-column tables.
1 parent9cbaf72 commit9fdb1de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/backend/commands/analyze.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.52 2003/03/23 05:14:36 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.53 2003/04/25 21:29:18 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -269,7 +269,8 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt)
269269
else
270270
{
271271
attr_cnt=onerel->rd_att->natts;
272-
vacattrstats= (VacAttrStats**)palloc(attr_cnt*
272+
/* +1 here is just to avoid palloc(0) with zero-column table */
273+
vacattrstats= (VacAttrStats**)palloc((attr_cnt+1)*
273274
sizeof(VacAttrStats*));
274275
tcnt=0;
275276
for (i=1;i <=attr_cnt;i++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp