From 6942c9a0010dcd82a93d9c6770d8157808435fa8 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 5 Jan 2011 14:41:38 +0000 Subject: [PATCH] same thing with mysql as in last commit --- extra/udfhack/linux/32/lib_mysqludf_sys/lib_mysqludf_sys.c | 2 ++ extra/udfhack/linux/64/lib_mysqludf_sys/lib_mysqludf_sys.c | 2 ++ .../32/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c | 2 ++ .../lib_postgresqludf_sys/lib_postgresqludf_sys.c | 2 ++ .../64/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c | 2 ++ 5 files changed, 10 insertions(+) diff --git a/extra/udfhack/linux/32/lib_mysqludf_sys/lib_mysqludf_sys.c b/extra/udfhack/linux/32/lib_mysqludf_sys/lib_mysqludf_sys.c index 082f69908..3d4600758 100644 --- a/extra/udfhack/linux/32/lib_mysqludf_sys/lib_mysqludf_sys.c +++ b/extra/udfhack/linux/32/lib_mysqludf_sys/lib_mysqludf_sys.c @@ -443,6 +443,8 @@ char* sys_eval( result = (char *)malloc(1); outlen = 0; + result[0] = (char)0; + pipe = popen(args->args[0], "r"); while (fgets(line, sizeof(line), pipe) != NULL) { diff --git a/extra/udfhack/linux/64/lib_mysqludf_sys/lib_mysqludf_sys.c b/extra/udfhack/linux/64/lib_mysqludf_sys/lib_mysqludf_sys.c index 082f69908..3d4600758 100644 --- a/extra/udfhack/linux/64/lib_mysqludf_sys/lib_mysqludf_sys.c +++ b/extra/udfhack/linux/64/lib_mysqludf_sys/lib_mysqludf_sys.c @@ -443,6 +443,8 @@ char* sys_eval( result = (char *)malloc(1); outlen = 0; + result[0] = (char)0; + pipe = popen(args->args[0], "r"); while (fgets(line, sizeof(line), pipe) != NULL) { diff --git a/extra/udfhack/windows/32/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c b/extra/udfhack/windows/32/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c index 082f69908..3d4600758 100644 --- a/extra/udfhack/windows/32/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c +++ b/extra/udfhack/windows/32/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c @@ -443,6 +443,8 @@ char* sys_eval( result = (char *)malloc(1); outlen = 0; + result[0] = (char)0; + pipe = popen(args->args[0], "r"); while (fgets(line, sizeof(line), pipe) != NULL) { diff --git a/extra/udfhack/windows/32/lib_postgresqludf_sys/lib_postgresqludf_sys/lib_postgresqludf_sys.c b/extra/udfhack/windows/32/lib_postgresqludf_sys/lib_postgresqludf_sys/lib_postgresqludf_sys.c index afb925ef2..73bbac951 100644 --- a/extra/udfhack/windows/32/lib_postgresqludf_sys/lib_postgresqludf_sys/lib_postgresqludf_sys.c +++ b/extra/udfhack/windows/32/lib_postgresqludf_sys/lib_postgresqludf_sys/lib_postgresqludf_sys.c @@ -122,6 +122,8 @@ extern DLLIMPORT Datum sys_eval(PG_FUNCTION_ARGS) { result = (char *)malloc(1); outlen = 0; + result[0] = (char)0; + pipe = popen(command, "r"); while (fgets(line, sizeof(line), pipe) != NULL) { diff --git a/extra/udfhack/windows/64/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c b/extra/udfhack/windows/64/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c index 082f69908..3d4600758 100644 --- a/extra/udfhack/windows/64/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c +++ b/extra/udfhack/windows/64/lib_mysqludf_sys/lib_mysqludf_sys/lib_mysqludf_sys.c @@ -443,6 +443,8 @@ char* sys_eval( result = (char *)malloc(1); outlen = 0; + result[0] = (char)0; + pipe = popen(args->args[0], "r"); while (fgets(line, sizeof(line), pipe) != NULL) {