Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
PL/pgSQL RETURN NEXT was leaking converted tuples, causing
authorJoe Conway <mail@joeconway.com>
Thu, 10 May 2012 05:57:19 +0000 (22:57 -0700)
committerJoe Conway <mail@joeconway.com>
Thu, 10 May 2012 05:57:19 +0000 (22:57 -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 a385b9a82a20ef1b6dbb83c35f8df8e286f24d59..95e74b38dc4d9c64c656b877d0d74ac9fa165c37 100644 (file)
@@ -2472,6 +2472,7 @@ exec_stmt_return_next(PLpgSQL_execstate *estate,
                    {
                        tuple = do_convert_tuple(tuple, tupmap);
                        free_conversion_map(tupmap);
+                       free_tuple = true;
                    }
                }
                break;