forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2c4debb
committed
Make new expression eval code reject references to dropped columns.
Formerly, a Var referencing an already-dropped column was allowed and wouldalways produce a NULL value. However, that behavior was implemented inslot_getattr which the new expression code doesn't use; thus there is now arisk of returning theoretically-deleted data. We had regression test casesthat purported to exercise this, but they failed to expose any problem,apparently because plpgsql filters the dropped column and produces anoutput tuple that has a NULL there already.Ideally the DROP or ALTER attempt in these test cases would get rejecteddue to dependency checks; but until that happens, let's modify the behaviorso that we fail the query during executor start. This was already true forthe related case of a column having changed type underneath us, and there'sno obvious reason why we need to be laxer for dropped columns.In passing, adjust the error messages in CheckVarSlotCompatibility toinclude the composite type name. In the cases shown in the regressiontests this is always just "record", but it should be more useful inactual stale-plan cases, where the slot tupdesc would be a table'stupdesc directly.Discussion:https://postgr.es/m/16803.1490723570@sss.pgh.pa.us1 parentce96ce6 commit2c4debb
File tree
5 files changed
+95
-47
lines changed- src
- backend/executor
- test/regress
- expected
- sql
5 files changed
+95
-47
lines changedLines changed: 23 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1516 | 1516 |
| |
1517 | 1517 |
| |
1518 | 1518 |
| |
1519 |
| - | |
1520 |
| - | |
1521 |
| - | |
1522 |
| - | |
1523 |
| - | |
1524 |
| - | |
1525 |
| - | |
1526 |
| - | |
1527 |
| - | |
1528 |
| - | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
1529 | 1523 |
| |
1530 | 1524 |
| |
1531 | 1525 |
| |
1532 | 1526 |
| |
1533 | 1527 |
| |
1534 |
| - | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1535 | 1533 |
| |
1536 | 1534 |
| |
1537 | 1535 |
| |
| |||
1544 | 1542 |
| |
1545 | 1543 |
| |
1546 | 1544 |
| |
1547 |
| - | |
1548 |
| - | |
1549 |
| - | |
1550 |
| - | |
1551 |
| - | |
1552 |
| - | |
1553 |
| - | |
1554 |
| - | |
1555 |
| - | |
1556 |
| - | |
1557 |
| - | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
1558 | 1559 |
| |
1559 | 1560 |
| |
1560 | 1561 |
| |
|
Lines changed: 38 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1396 | 1396 |
| |
1397 | 1397 |
| |
1398 | 1398 |
| |
1399 |
| - | |
| 1399 | + | |
1400 | 1400 |
| |
1401 | 1401 |
| |
1402 |
| - | |
| 1402 | + | |
1403 | 1403 |
| |
1404 | 1404 |
| |
1405 | 1405 |
| |
| |||
1424 | 1424 |
| |
1425 | 1425 |
| |
1426 | 1426 |
| |
1427 |
| - | |
1428 |
| - | |
1429 |
| - | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
1430 | 1430 |
| |
1431 | 1431 |
| |
| 1432 | + | |
1432 | 1433 |
| |
1433 | 1434 |
| |
1434 |
| - | |
| 1435 | + | |
1435 | 1436 |
| |
1436 | 1437 |
| |
1437 | 1438 |
| |
| |||
1441 | 1442 |
| |
1442 | 1443 |
| |
1443 | 1444 |
| |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
1444 | 1452 |
| |
1445 |
| - | |
1446 |
| - | |
1447 |
| - | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1448 | 1466 |
| |
1449 | 1467 |
| |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1450 | 1479 |
| |
1451 | 1480 |
| |
1452 | 1481 |
| |
|
Lines changed: 8 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1909 | 1909 |
| |
1910 | 1910 |
| |
1911 | 1911 |
| |
1912 |
| - | |
1913 |
| - | |
1914 |
| - | |
1915 |
| - | |
1916 |
| - | |
1917 |
| - | |
1918 |
| - | |
1919 |
| - | |
1920 | 1912 |
| |
1921 | 1913 |
| |
1922 | 1914 |
| |
1923 | 1915 |
| |
1924 |
| - | |
1925 |
| - | |
| 1916 | + | |
| 1917 | + | |
1926 | 1918 |
| |
1927 | 1919 |
| |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
1928 | 1925 |
| |
1929 | 1926 |
| |
1930 |
| - | |
| 1927 | + | |
1931 | 1928 |
| |
1932 | 1929 |
| |
1933 | 1930 |
| |
|
Lines changed: 22 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
457 | 457 |
| |
458 | 458 |
| |
459 | 459 |
| |
460 |
| - | |
| 460 | + | |
461 | 461 |
| |
462 | 462 |
| |
463 | 463 |
| |
464 |
| - | |
| 464 | + | |
465 | 465 |
| |
466 | 466 |
| |
467 | 467 |
| |
| |||
483 | 483 |
| |
484 | 484 |
| |
485 | 485 |
| |
| 486 | + | |
| 487 | + | |
486 | 488 |
| |
487 | 489 |
| |
488 | 490 |
| |
489 |
| - | |
| 491 | + | |
490 | 492 |
| |
| 493 | + | |
| 494 | + | |
491 | 495 |
| |
492 | 496 |
| |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
493 | 512 |
| |
494 | 513 |
| |
495 | 514 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
555 | 555 |
| |
556 | 556 |
| |
557 | 557 |
| |
558 |
| - | |
559 |
| - | |
560 | 558 |
| |
561 | 559 |
| |
562 | 560 |
| |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
563 | 565 |
| |
564 | 566 |
| |
565 | 567 |
| |
|
0 commit comments
Comments
(0)