Fix memory leak when memory_cache_enabled = on and write SQLs are sent.
authorBo Peng <pengbo@sraoss.co.jp>
Tue, 9 Oct 2018 00:20:39 +0000 (09:20 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Tue, 9 Oct 2018 00:21:22 +0000 (09:21 +0900)
In a explicit transaction, we the SELECT results are cached in temporary buffer.
If a write SQL is sent which modifies the table, the temporary buffe should be reset.

src/query_cache/pool_memqcache.c

index 6c5a2cf23f1303fbf07980e7eecd980d156bbdf9..92fb921cf09279b3f1dd8035e2a2ad096264a8f2 100644 (file)
@@ -3460,6 +3460,7 @@ pool_handle_query_cache(POOL_CONNECTION_POOL * backend, char *query, Node *node,
                                         * DML/DDL modifies the TABLE which SELECT uses.
                                         */
                                        pool_check_and_discard_cache_buffer(num_oids, oids);
+                                       pool_reset_memqcache_buffer();
                                }
                        }
                        else if (num_oids == 0)