Fix psql to not go into infinite recursion when expanding a variable that

Tom Lane <tgl@sss.pgh.pa.us>

Commit: f9a60d1542d21f2caf9a51b249dde63054bd9272
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-05-05T22:19:31Z
Releases: 8.0.25
Fix psql to not go into infinite recursion when expanding a variable that
refers to itself (directly or indirectly).  Instead, print a message when
recursion is detected, and don't expand the repeated reference.  Per bug
#5448 from Francis Markham.

Back-patch to 8.0.  Although the issue exists in 7.4 as well, it seems
impractical to fix there because of the lack of any state stack that
could be used to track active expansions.

Files

PathChange+/−
src/bin/psql/psqlscan.l modified +75 −24