|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * 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 $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -269,7 +269,8 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt) |
269 | 269 | else |
270 | 270 | { |
271 | 271 | 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)* |
273 | 274 | sizeof(VacAttrStats*)); |
274 | 275 | tcnt=0; |
275 | 276 | for (i=1;i <=attr_cnt;i++) |
|