aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/ecpglib')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c22
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c22
2 files changed, 21 insertions, 23 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index 5d6f31f089b..cae1c500d9b 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.3 2003/03/27 14:29:17 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.4 2003/04/01 14:37:25 meskes Exp $ */
#include "postgres_fe.h"
@@ -384,9 +384,9 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (pval)
{
if (isarray && *pval == '"')
- nres = PGTYPESnumeric_aton(pval + 1, &scan_length);
+ nres = PGTYPESnumeric_from_asc(pval + 1, &scan_length);
else
- nres = PGTYPESnumeric_aton(pval, &scan_length);
+ nres = PGTYPESnumeric_from_asc(pval, &scan_length);
if (isarray && *scan_length == '"')
scan_length++;
@@ -399,7 +399,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
}
}
else
- nres = PGTYPESnumeric_aton("0.0", &scan_length);
+ nres = PGTYPESnumeric_from_asc("0.0", &scan_length);
PGTYPESnumeric_copy(nres, (Numeric *)(var + offset * act_tuple));
break;
@@ -408,9 +408,9 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (pval)
{
if (isarray && *pval == '"')
- ires = PGTYPESinterval_atoi(pval + 1, &scan_length);
+ ires = PGTYPESinterval_from_asc(pval + 1, &scan_length);
else
- ires = PGTYPESinterval_atoi(pval, &scan_length);
+ ires = PGTYPESinterval_from_asc(pval, &scan_length);
if (isarray && *scan_length == '"')
scan_length++;
@@ -423,7 +423,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
}
}
else
- ires = PGTYPESinterval_atoi("0 seconds", NULL);
+ ires = PGTYPESinterval_from_asc("0 seconds", NULL);
PGTYPESinterval_copy(ires, (Interval *)(var + offset * act_tuple));
break;
@@ -431,9 +431,9 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (pval)
{
if (isarray && *pval == '"')
- ddres = PGTYPESdate_atod(pval + 1, &scan_length);
+ ddres = PGTYPESdate_from_asc(pval + 1, &scan_length);
else
- ddres = PGTYPESdate_atod(pval, &scan_length);
+ ddres = PGTYPESdate_from_asc(pval, &scan_length);
if (isarray && *scan_length == '"')
scan_length++;
@@ -453,9 +453,9 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (pval)
{
if (isarray && *pval == '"')
- tres = PGTYPEStimestamp_atot(pval + 1, &scan_length);
+ tres = PGTYPEStimestamp_from_asc(pval + 1, &scan_length);
else
- tres = PGTYPEStimestamp_atot(pval, &scan_length);
+ tres = PGTYPEStimestamp_from_asc(pval, &scan_length);
if (isarray && *scan_length == '"')
scan_length++;
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 6a9b38e7a88..99850664e86 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.7 2003/03/30 11:48:18 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.8 2003/04/01 14:37:25 meskes Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
@@ -847,7 +847,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
{
for (element = 0; element < var->arrsize; element++)
{
- str = PGTYPESnumeric_ntoa((Numeric *)((var + var->offset * element)->value), 0);
+ str = PGTYPESnumeric_to_asc((Numeric *)((var + var->offset * element)->value), 0);
slen = strlen (str);
if (!(mallocedval = ECPGrealloc(mallocedval, strlen(mallocedval) + slen + 5, stmt->lineno)))
@@ -863,7 +863,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
}
else
{
- str = PGTYPESnumeric_ntoa((Numeric *)(var->value), 0);
+ str = PGTYPESnumeric_to_asc((Numeric *)(var->value), 0);
slen = strlen (str);
if (!(mallocedval = ECPGalloc(slen + 1, stmt->lineno)))
@@ -888,7 +888,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
{
for (element = 0; element < var->arrsize; element++)
{
- str = PGTYPESinterval_itoa((Interval *)((var + var->offset * element)->value));
+ str = PGTYPESinterval_to_asc((Interval *)((var + var->offset * element)->value));
slen = strlen (str);
if (!(mallocedval = ECPGrealloc(mallocedval, strlen(mallocedval) + slen + 5, stmt->lineno)))
@@ -904,7 +904,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
}
else
{
- str = PGTYPESinterval_itoa((Interval *)(var->value));
+ str = PGTYPESinterval_to_asc((Interval *)(var->value));
slen = strlen (str);
if (!(mallocedval = ECPGalloc(slen + 1, stmt->lineno)))
@@ -929,7 +929,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
{
for (element = 0; element < var->arrsize; element++)
{
- str = PGTYPESdate_dtoa(*(Date *)((var + var->offset * element)->value));
+ str = PGTYPESdate_to_asc(*(Date *)((var + var->offset * element)->value));
slen = strlen (str);
if (!(mallocedval = ECPGrealloc(mallocedval, strlen(mallocedval) + slen + 5, stmt->lineno)))
@@ -945,7 +945,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
}
else
{
- str = PGTYPESdate_dtoa(*(Date *)(var->value));
+ str = PGTYPESdate_to_asc(*(Date *)(var->value));
slen = strlen (str);
if (!(mallocedval = ECPGalloc(slen + 1, stmt->lineno)))
@@ -970,7 +970,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
{
for (element = 0; element < var->arrsize; element++)
{
- str = PGTYPEStimestamp_ttoa(*(Timestamp *)((var + var->offset * element)->value));
+ str = PGTYPEStimestamp_to_asc(*(Timestamp *)((var + var->offset * element)->value));
slen = strlen (str);
if (!(mallocedval = ECPGrealloc(mallocedval, strlen(mallocedval) + slen + 5, stmt->lineno)))
@@ -986,7 +986,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
}
else
{
- str = PGTYPEStimestamp_ttoa(*(Timestamp *)(var->value));
+ str = PGTYPEStimestamp_to_asc(*(Timestamp *)(var->value));
slen = strlen (str);
if (!(mallocedval = ECPGalloc(slen + 1, stmt->lineno)))
@@ -1239,9 +1239,7 @@ ECPGexecute(struct statement * stmt)
{
ECPGlog("ECPGexecute line %d: ASYNC NOTIFY of '%s' from backend pid '%d' received\n",
stmt->lineno, notify->relname, notify->be_pid);
-/* PQfreemem(notify);*/
- free(notify);
-#warning Remove PQfreemem define
+ PQfreemem(notify);
}
return status;