- Added protecting defines to include files.
Fri Sep 19 08:33:39 CEST 2003
- Some code cleanup
+
+Sat Sep 20 11:06:13 CEST 2003
+
+ - Applied some bug fixing patches by Dave Cramer <dave@fastcrypt.com>.
+ - Added protecting defines to include files.
+ - Renamed my own strndup() function because of a name clash.
- Set ecpg version to 3.0.0
- Set ecpg library to 4.0.0
- Set pgtypes library to 1.0.0
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.19 2003/09/19 14:06:21 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.20 2003/09/20 09:10:09 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
/* did we get an error? */
if (errno != 0)
{
+ ECPGlog("ECPGget_data line %d: RESULT: %s errno %d\n", lineno, pval ? pval : "", errno);
+
if (INFORMIX_MODE(compat))
{
/* Informix wants its own NULL value here instead of an error */
- ECPGset_informix_null(ECPGt_numeric, &nres);
+ ECPGset_informix_null(ECPGt_numeric, nres);
}
else
{
if (INFORMIX_MODE(compat))
{
/* Informix wants its own NULL value here instead of an error */
- ECPGset_informix_null(ECPGt_interval, &ires);
+ ECPGset_informix_null(ECPGt_interval, ires);
}
else
{
+#ifndef _ECPG_DATETIME_H
+#define _ECPG_DATETIME_H
+
#include <pgtypes_timestamp.h>
#include <pgtypes_interval.h>
extern int dttofmtasc(dtime_t *, char *, int, char *);
extern int intoasc(intrvl_t *, char *);
extern int dtcvfmtasc(char *, char *, dtime_t *);
+
+#endif /* ndef _ECPG_DATETIME_H */
+#ifndef _ECPG_DECIMAL_H
+#define _ECPG_DECIMAL_H
+
#include <pgtypes_numeric.h>
typedef decimal dec_t;
int dectodbl(dec_t *, double *);
int dectoint(dec_t *, int *);
int dectolong(dec_t *, long *);
+
+#endif /* ndef _ECPG_DECIMAL_H */
+#ifndef _ECPG_INFORMIX_H
+#define _ECPG_INFORMIX_H
/*
* This file contains stuff needed to be as compatible to Informix as possible.
*/
extern void ECPG_informix_set_var(int, void *, int);
extern void *ECPG_informix_get_var(int);
+
+#endif /* ndef _ECPG_INFORMIX_H */
-#ifndef _ECPG_ERROR_H
-#define _ECPG_ERROR_H
+#ifndef _ECPG_ERRNO_H
+#define _ECPG_ERRNO_H
#include <errno.h>
/* WARNING: BlankPortalAssignName: portal * already exists */
#define ECPG_WARNING_PORTAL_EXISTS -605
-#endif /* !_ECPG_ERROR_H */
+#endif /* !_ECPG_ERRNO_H */
+#ifndef _ECPG_SQL3TYPES_H
+#define _ECPG_SQL3TYPES_H
+
/* SQL3 dynamic type codes
*
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
*
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/include/sql3types.h,v 1.7 2001/10/28 06:26:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/include/sql3types.h,v 1.8 2003/09/20 09:10:09 meskes Exp $
*/
/* chapter 13.1 table 2: Codes used for SQL data types in Dynamic SQL */
SQL3_DDT_ILLEGAL /* not a datetime data type (not part of
* standard) */
};
+
+#endif /* !_ECPG_SQL3TYPES_H */
+#ifndef ECPG_SQLTYPES_H
+#define ECPG_SQLTYPES_H
+
#define CCHARTYPE ECPGt_char
#define CSHORTTYPE ECPGt_short
#define CINTTYPE ECPGt_int
#define CROWTYPE 123
#define CLVCHARPTRTYPE 124
#define CTYPEMAX 25
+
+#endif /* ndef ECPG_SQLTYPES_H */
bool have_dp = FALSE;
int i = 0;
+ errno = 0;
*ptr = str;
while (*(*ptr))
{
{
int i;
+ if ( dst == NULL ) return -1;
zero_var(dst);
dst->weight = src->weight;
break;
case 'S':
replace_val.uint_val = tm->tm_sec;
- replace_type = PGTYPES_TYPE_UINT;
+ replace_type = PGTYPES_TYPE_UINT_2_LZ;
break;
case 't':
replace_val.char_val = '\t';