Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql/parser: fix memory leak of scanned comments
This commit fixes a memory leak that cause a session's `scanner.Scanner`, which is embedded in a `pgwire.conn` via a `parser.Parser`, to retain previously scanned SQL comments in all parsed SQL statements. The scanner's slice of comments would continue to grow as it parsed new SQL strings with comments, as long as the session remained open. Also, the slice of comments holds references to the bytes in `pgwire` read buffers, preventing those buffers from being GC'd. Fixes cockroachdb#127710 Release note: None
- Loading branch information