]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
PL/pgSQL RETURN NEXT was leaking converted tuples, causing
authorJoe Conway <mail@joeconway.com>
Thu, 10 May 2012 05:47:08 +0000 (22:47 -0700)
committerJoe Conway <mail@joeconway.com>
Thu, 10 May 2012 05:47:08 +0000 (22:47 -0700)
out of memory when looping through large numbers of rows.
Flag the converted tuples to be freed. Complaint and patch
by Joe.

src/pl/plpgsql/src/pl_exec.c

index 32f57a325675bca3711804a5520960066e97d49a..a6ee82a951d69f89f37baba10e257f5e8d89f3c6 100644 (file)
@@ -2221,6 +2221,7 @@ exec_stmt_return_next(PLpgSQL_execstate *estate,
                                        {
                                                tuple = do_convert_tuple(tuple, tupmap);
                                                free_conversion_map(tupmap);
+                                               free_tuple = true;
                                        }
                                }
                                break;