From 77ac85ee79ce54c2df20d6d096da02c967f911f1 Mon Sep 17 00:00:00 2001 From: tdrz Date: Thu, 8 May 2025 15:16:50 +0200 Subject: [PATCH 1/3] speed --- pglite-REL_17_4_WASM/interactive_one.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pglite-REL_17_4_WASM/interactive_one.c b/pglite-REL_17_4_WASM/interactive_one.c index 8261c17c498c2..64f1229e1dbf8 100644 --- a/pglite-REL_17_4_WASM/interactive_one.c +++ b/pglite-REL_17_4_WASM/interactive_one.c @@ -528,10 +528,6 @@ PDEBUG("# 500: NO DATA:" PGS_IN ); // CMA wire mode. -> packetlen was set to cma_rsize resetStringInfo(inBuf); - for (int i=0; i Date: Mon, 12 May 2025 09:59:52 +0200 Subject: [PATCH 2/3] only copy fake stdin when in repl mode --- pglite-REL_17_4_WASM/interactive_one.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pglite-REL_17_4_WASM/interactive_one.c b/pglite-REL_17_4_WASM/interactive_one.c index 64f1229e1dbf8..3c0815fcd1c00 100644 --- a/pglite-REL_17_4_WASM/interactive_one.c +++ b/pglite-REL_17_4_WASM/interactive_one.c @@ -524,10 +524,13 @@ PDEBUG("# 500: NO DATA:" PGS_IN ); printf("\n# 500: fd=%d is_embed=%d is_repl=%d is_wire=%d fd %s,len=%d cma=%d peek=%d [%s]\n", MyProcPort->sock, is_embed, is_repl, is_wire, PGS_OLOCK, packetlen,cma_rsize, peek, IO); #endif - // buffer query TODO: direct access ? - // CMA wire mode. -> packetlen was set to cma_rsize - resetStringInfo(inBuf); - + if (is_repl) { + resetStringInfo(inBuf); + for (int i=0; i Date: Mon, 12 May 2025 11:38:01 +0200 Subject: [PATCH 3/3] Update interactive_one.c --- pglite-REL_17_4_WASM/interactive_one.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pglite-REL_17_4_WASM/interactive_one.c b/pglite-REL_17_4_WASM/interactive_one.c index 3c0815fcd1c00..04aaee51228a3 100644 --- a/pglite-REL_17_4_WASM/interactive_one.c +++ b/pglite-REL_17_4_WASM/interactive_one.c @@ -524,11 +524,12 @@ PDEBUG("# 500: NO DATA:" PGS_IN ); printf("\n# 500: fd=%d is_embed=%d is_repl=%d is_wire=%d fd %s,len=%d cma=%d peek=%d [%s]\n", MyProcPort->sock, is_embed, is_repl, is_wire, PGS_OLOCK, packetlen,cma_rsize, peek, IO); #endif + resetStringInfo(inBuf); + // when cma buffer is used to fake stdin, data is not read by socket/wire backend. if (is_repl) { - resetStringInfo(inBuf); - for (int i=0; i