• Tatsuo Ishii's avatar
    Fix bug with view locking code. · 1b26bd40
    Tatsuo Ishii authored
    LockViewRecurese() obtains view relation using heap_open() and passes
    it to get_view_query() to get view info. It immediately closes the
    relation then uses the returned view info by calling
    LockViewRecurse_walker().  Since get_view_query() returns a pointer
    within the relcache, the relcache should be kept until
    LockViewRecurse_walker() returns. Otherwise the relation could point
    to a garbage memory area.
    
    Fix is moving the heap_close() call after LockViewRecurse_walker().
    
    Problem reported by Tom Lane (buildfarm is unhappy, especially prion
    since it enables -DRELCACHE_FORCE_RELEASE cpp flag), fix by me.
    1b26bd40
lockcmds.c 8.27 KB