|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.110 2005/03/31 22:46:04 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.111 2005/04/14 22:34:48 tgl Exp $ |
12 | 12 | * |
13 | 13 | * NOTES |
14 | 14 | * some of the executor utility code such as "ExecTypeFromTL" should be |
@@ -274,23 +274,34 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2) |
274 | 274 |
|
275 | 275 | /* |
276 | 276 | * We do not need to check every single field here: we can |
277 | | - * disregard attrelid, attnum (it was used to place the row in the |
278 | | - * attrs array) and everything derived from the column datatype. |
279 | | - * Also, attcacheoff must NOT be checked since it's possibly not |
280 | | - * set in both copies. |
| 277 | + * disregard attrelid and attnum (which were used to place the row |
| 278 | + * in the attrs array in the first place). It might look like we |
| 279 | + * could dispense with checking attlen/attbyval/attalign, since these |
| 280 | + * are derived from atttypid; but in the case of dropped columns |
| 281 | + * we must check them (since atttypid will be zero for all dropped |
| 282 | + * columns) and in general it seems safer to check them always. |
| 283 | + * |
| 284 | + * attcacheoff must NOT be checked since it's possibly not set |
| 285 | + * in both copies. |
281 | 286 | */ |
282 | 287 | if (strcmp(NameStr(attr1->attname), NameStr(attr2->attname)) != 0) |
283 | 288 | return false; |
284 | 289 | if (attr1->atttypid != attr2->atttypid) |
285 | 290 | return false; |
286 | 291 | if (attr1->attstattarget != attr2->attstattarget) |
287 | 292 | return false; |
| 293 | + if (attr1->attlen != attr2->attlen) |
| 294 | + return false; |
288 | 295 | if (attr1->attndims != attr2->attndims) |
289 | 296 | return false; |
290 | 297 | if (attr1->atttypmod != attr2->atttypmod) |
291 | 298 | return false; |
| 299 | + if (attr1->attbyval != attr2->attbyval) |
| 300 | + return false; |
292 | 301 | if (attr1->attstorage != attr2->attstorage) |
293 | 302 | return false; |
| 303 | + if (attr1->attalign != attr2->attalign) |
| 304 | + return false; |
294 | 305 | if (attr1->attnotnull != attr2->attnotnull) |
295 | 306 | return false; |
296 | 307 | if (attr1->atthasdef != attr2->atthasdef) |
|
0 commit comments