9 #define POSTGRES_ECPG_INTERNAL
12 #include "catalog/pg_type_d.h"
35 if (offset % alignment)
36 offset += alignment - (offset % alignment);
55 for (
i = 0;
i < sqld;
i++)
72 for (
i = 0;
i < sqld;
i++)
150 offset = next_offset;
219 memset(sqlda, 0,
size);
222 fname = (
char *) (sqlvar + sqld);
225 ecpg_log(
"ecpg_build_compat_sqlda on line %d sqld = %d\n", line, sqld);
229 for (
i = 0;
i < sqlda->
sqld;
i++)
271 for (
i = 0;
i < sqlda->
sqld;
i++)
275 bool set_data =
true;
392 ecpg_log(
"ecpg_set_compat_sqlda on line %d row %d col %d %s\n", lineno, row,
i, isnull ?
"IS NULL" :
"IS NOT NULL");
407 offset = next_offset;
423 memset(sqlda, 0,
size);
427 ecpg_log(
"ecpg_build_native_sqlda on line %d sqld = %d\n", line, sqlda->
sqld);
430 for (
i = 0;
i < sqlda->
sqld;
i++)
460 for (
i = 0;
i < sqlda->
sqld;
i++)
464 bool set_data =
true;
579 ecpg_log(
"ecpg_set_native_sqlda on line %d row %d col %d %s\n", lineno, row,
i, isnull ?
"IS NULL" :
"IS NOT NULL");
590 offset = next_offset;
Datum numeric(PG_FUNCTION_ARGS)
bool ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, enum ECPGttype type, enum ECPGttype ind_type, char *var, char *ind, long varcharsize, long offset, long ind_offset, enum ARRAY_TYPE isarray, enum COMPAT_MODE compat, bool force_indicator)
static void PGresult * res
void ecpg_log(const char *format,...) pg_attribute_printf(1
char * ecpg_alloc(long size, int lineno)
int sqlda_dynamic_type(Oid type, enum COMPAT_MODE compat)
@ ECPGt_unsigned_long_long
Oid PQftype(const PGresult *res, int field_num)
char * PQfname(const PGresult *res, int field_num)
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
int PQgetisnull(const PGresult *res, int tup_num, int field_num)
int PQnfields(const PGresult *res)
int PQfsize(const PGresult *res, int field_num)
void ECPGset_noind_null(enum ECPGttype type, void *ptr)
numeric * PGTYPESnumeric_from_asc(char *str, char **endptr)
void PGTYPESnumeric_free(numeric *var)
static pg_noinline void Size size
struct sqlda_struct * ecpg_build_native_sqlda(int line, PGresult *res, int row, enum COMPAT_MODE compat)
static long sqlda_compat_total_size(const PGresult *res, int row, enum COMPAT_MODE compat)
static void ecpg_sqlda_align_add_size(long offset, int alignment, int size, long *current, long *next)
static long sqlda_common_total_size(const PGresult *res, int row, enum COMPAT_MODE compat, long offset)
static long sqlda_compat_empty_size(const PGresult *res)
static long sqlda_native_empty_size(const PGresult *res)
void ecpg_set_compat_sqlda(int lineno, struct sqlda_compat **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat)
static long sqlda_native_total_size(const PGresult *res, int row, enum COMPAT_MODE compat)
static int16 value_is_null
void ecpg_set_native_sqlda(int lineno, struct sqlda_struct **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat)
static int16 value_is_not_null
struct sqlda_compat * ecpg_build_compat_sqlda(int line, PGresult *res, int row, enum COMPAT_MODE compat)
struct sqlvar_compat * sqlvar
struct sqlvar_struct sqlvar[1]