mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Make [VACUUM] ANALYZE safe on zero-column tables.
This commit is contained in:
parent
9cbaf72177
commit
9fdb1de3ba
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.52 2003/03/23 05:14:36 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.53 2003/04/25 21:29:18 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 New Issue
Block a user