aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test/expected/sql-sqlda.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2018-06-18 18:33:53 +1200
committerThomas Munro <tmunro@postgresql.org>2018-06-26 20:54:40 +1200
commit3bc19d0d263c32c225a391e5275d6ba24dbc423c (patch)
tree9d1f8e91d35611e19dab626e1fecc8feec3b6a4d /src/interfaces/ecpg/test/expected/sql-sqlda.c
parent7bcda60d41cb920193e9d56a3b03583d7998c635 (diff)
downloadpostgresql-3bc19d0d263c32c225a391e5275d6ba24dbc423c.tar.gz
postgresql-3bc19d0d263c32c225a391e5275d6ba24dbc423c.zip
Add PGTYPESchar_free() to avoid cross-module problems on Windows.
On Windows, it is sometimes important for corresponding malloc() and free() calls to be made from the same DLL, since some build options can result in multiple allocators being active at the same time. For that reason we already provided PQfreemem(). This commit adds a similar function for freeing string results allocated by the pgtypes library. Author: Takayuki Tsunakawa Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/0A3221C70F24FB45833433255569204D1F8AD5D6%40G01JPEXMBYT05
Diffstat (limited to 'src/interfaces/ecpg/test/expected/sql-sqlda.c')
-rw-r--r--src/interfaces/ecpg/test/expected/sql-sqlda.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/test/expected/sql-sqlda.c b/src/interfaces/ecpg/test/expected/sql-sqlda.c
index 2f034a0156c..bba78d796a0 100644
--- a/src/interfaces/ecpg/test/expected/sql-sqlda.c
+++ b/src/interfaces/ecpg/test/expected/sql-sqlda.c
@@ -50,6 +50,8 @@ typedef struct sqlda_struct sqlda_t;
#ifndef PGTYPES_NUMERIC
#define PGTYPES_NUMERIC
+#include <pgtypes.h>
+
#define NUMERIC_POS 0x0000
#define NUMERIC_NEG 0x4000
#define NUMERIC_NAN 0xC000
@@ -166,7 +168,7 @@ dump_sqlda(sqlda_t *sqlda)
val = PGTYPESnumeric_to_asc((numeric*)sqlda->sqlvar[i].sqldata, -1);
printf("name sqlda descriptor: '%s' value NUMERIC '%s'\n", sqlda->sqlvar[i].sqlname.data, val);
- free(val);
+ PGTYPESchar_free(val);
break;
}
}