Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Postgres/src/test/isolation/specs/   (Postgres Database Version 18.4©)  Datei vom 11.4.2026 mit Größe 1015 B image not shown  

Quelle  inplace-inval.spec   Sprache: unbekannt

 
Spracherkennung für: .spec vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

# An inplace update had been able to abort before sending the inplace
# invalidation message to the shared queue.  If a heap_update() caller then
# retrieved its oldtup from a cache, the heap_update() could revert the
# inplace update.

setup
{
 CREATE TABLE newly_indexed (c int);
}

teardown
{
 DROP TABLE newly_indexed;
}

session s1
step cir1 { BEGIN; CREATE INDEX i1 ON newly_indexed (c); ROLLBACK; }
step read1 {
 SELECT relhasindex FROM pg_class WHERE oid = 'newly_indexed'::regclass;
}

session s2
step cic2 { CREATE INDEX i2 ON newly_indexed (c); }

session s3
step cachefill3 { TABLE newly_indexed; }
step ddl3  { ALTER TABLE newly_indexed ADD extra int; }


permutation
 cachefill3 # populates the pg_class row in the catcache
 cir1 # sets relhasindex=true; rollback discards cache inval
 cic2 # sees relhasindex=true, skips changing it (so no inval)
 ddl3 # cached row as the oldtup of an update, losing relhasindex
 read1 # observe damage

# without cachefill3, no bug
permutation cir1 cic2 ddl3 read1

[Dauer der Verarbeitung: 0.15 Sekunden, vorverarbeitet 2026-08-08]