mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
Make [VACUUM] ANALYZE safe on zero-column tables.
This commit is contained in:
parent
60bc45a107
commit
de9c299aba
1 changed files with 3 additions and 2 deletions
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.47 2002/09/23 20:43:40 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.47.2.1 2003/04/25 21:29:22 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
|
@ -269,7 +269,8 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt)
|
|||
else
|
||||
{
|
||||
attr_cnt = onerel->rd_att->natts;
|
||||
vacattrstats = (VacAttrStats **) palloc(attr_cnt *
|
||||
/* +1 here is just to avoid palloc(0) with zero-column table */
|
||||
vacattrstats = (VacAttrStats **) palloc((attr_cnt + 1) *
|
||||
sizeof(VacAttrStats *));
|
||||
tcnt = 0;
|
||||
for (i = 1; i <= attr_cnt; i++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue