PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include "catalog/pg_type_d.h"
#include "ecpg-pthread-win32.h"
#include "ecpgerrno.h"
#include "ecpglib.h"
#include "ecpglib_extern.h"
#include "ecpgtype.h"
#include "sql3types.h"
#include "sqlca.h"
#include "sqlda.h"
Go to the source code of this file.
Macros | |
#define | POSTGRES_ECPG_INTERNAL |
#define | RETURN_IF_NO_DATA |
Functions | |
static void | descriptor_free (struct descriptor *desc) |
static void | descriptor_deallocate_all (struct descriptor *list) |
static void | descriptor_destructor (void *arg) |
static void | descriptor_key_init (void) |
static struct descriptor * | get_descriptors (void) |
static void | set_descriptors (struct descriptor *value) |
static PGresult * | ecpg_result_by_descriptor (int line, const char *name) |
static unsigned int | ecpg_dynamic_type_DDT (Oid type) |
bool | ECPGget_desc_header (int lineno, const char *desc_name, int *count) |
static bool | get_int_item (int lineno, void *var, enum ECPGttype vartype, int value) |
static bool | set_int_item (int lineno, int *target, const void *var, enum ECPGttype vartype) |
static bool | get_char_item (int lineno, void *var, enum ECPGttype vartype, char *value, int varcharsize) |
bool | ECPGget_desc (int lineno, const char *desc_name, int index,...) |
bool | ECPGset_desc_header (int lineno, const char *desc_name, int count) |
static void | set_desc_attr (struct descriptor_item *desc_item, struct variable *var, char *tobeinserted) |
bool | ECPGset_desc (int lineno, const char *desc_name, int index,...) |
bool | ECPGdeallocate_desc (int line, const char *name) |
bool | ECPGallocate_desc (int line, const char *name) |
struct descriptor * | ecpg_find_desc (int line, const char *name) |
bool | ECPGdescribe (int line, int compat, bool input, const char *connection_name, const char *stmt_name,...) |
Variables | |
static pthread_key_t | descriptor_key |
static pthread_once_t | descriptor_once = PTHREAD_ONCE_INIT |
#define POSTGRES_ECPG_INTERNAL |
Definition at line 6 of file descriptor.c.
#define RETURN_IF_NO_DATA |
Definition at line 226 of file descriptor.c.
|
static |
Definition at line 780 of file descriptor.c.
References descriptor_free(), sort-test::list, and next.
Referenced by descriptor_destructor().
|
static |
Definition at line 28 of file descriptor.c.
References arg, and descriptor_deallocate_all().
Referenced by descriptor_key_init().
|
static |
Definition at line 728 of file descriptor.c.
References descriptor_item::data, ecpg_free(), descriptor::items, descriptor::name, descriptor_item::next, PQclear(), and descriptor::result.
Referenced by descriptor_deallocate_all(), and ECPGdeallocate_desc().
|
static |
Definition at line 34 of file descriptor.c.
References descriptor_destructor(), and descriptor_key.
Referenced by get_descriptors().
|
static |
Definition at line 64 of file descriptor.c.
References SQL3_DDT_DATE, SQL3_DDT_ILLEGAL, SQL3_DDT_TIME, SQL3_DDT_TIME_WITH_TIME_ZONE, SQL3_DDT_TIMESTAMP, SQL3_DDT_TIMESTAMP_WITH_TIME_ZONE, and type.
Referenced by ECPGget_desc().
struct descriptor* ecpg_find_desc | ( | int | line, |
const char * | name | ||
) |
Definition at line 832 of file descriptor.c.
References ecpg_raise(), ECPG_SQLSTATE_INVALID_SQL_DESCRIPTOR_NAME, ECPG_UNKNOWN_DESCRIPTOR, get_descriptors(), name, descriptor::name, and descriptor::next.
Referenced by ecpg_build_params(), ecpg_process_output(), ecpg_result_by_descriptor(), ECPGdescribe(), ECPGset_desc(), and ECPGset_desc_header().
|
static |
Definition at line 54 of file descriptor.c.
References ecpg_find_desc(), name, and descriptor::result.
Referenced by ECPGget_desc(), and ECPGget_desc_header().
bool ECPGallocate_desc | ( | int | line, |
const char * | name | ||
) |
Definition at line 792 of file descriptor.c.
References ecpg_alloc(), ecpg_free(), ecpg_init_sqlca(), ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPGget_sqlca(), get_descriptors(), name, PQmakeEmptyPGresult(), set_descriptors(), and sqlca.
Referenced by execute_test(), fn(), and main().
bool ECPGdeallocate_desc | ( | int | line, |
const char * | name | ||
) |
Definition at line 748 of file descriptor.c.
References descriptor_free(), ecpg_init_sqlca(), ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPG_SQLSTATE_INVALID_SQL_DESCRIPTOR_NAME, ECPG_UNKNOWN_DESCRIPTOR, ECPGget_sqlca(), get_descriptors(), name, descriptor::name, descriptor::next, set_descriptors(), and sqlca.
Referenced by execute_test(), fn(), and main().
bool ECPGdescribe | ( | int | line, |
int | compat, | ||
bool | input, | ||
const char * | connection_name, | ||
const char * | stmt_name, | ||
... | |||
) |
Definition at line 847 of file descriptor.c.
References generate_unaccent_rules::args, compat, connection::connection, sqlda_compat::desc_next, sqlda_struct::desc_next, ecpg_build_compat_sqlda(), ecpg_build_native_sqlda(), ecpg_check_PQresult(), ecpg_find_desc(), ecpg_find_prepared_statement(), ecpg_get_connection(), ecpg_gettext, ECPG_INVALID_STMT, ECPG_NO_CONN, ecpg_raise(), ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, ECPG_UNSUPPORTED, ECPGt_descriptor, ECPGt_EORT, ECPGt_sqlda, free, INFORMIX_MODE, input, name, PQclear(), PQdescribePrepared(), res, descriptor::result, type, va_end(), and va_start().
Referenced by execute_test(), and main().
bool ECPGget_desc | ( | int | lineno, |
const char * | desc_name, | ||
int | index, | ||
... | |||
) |
Definition at line 234 of file descriptor.c.
References generate_unaccent_rules::args, variable::arrsize, Assert, ecpg_auto_alloc(), ecpg_dynamic_type(), ecpg_dynamic_type_DDT(), ecpg_free(), ecpg_get_connection(), ecpg_init_sqlca(), ECPG_INVALID_DESCRIPTOR_INDEX, ecpg_log(), ECPG_OUT_OF_MEMORY, ecpg_raise(), ecpg_result_by_descriptor(), ECPG_SQLSTATE_CARDINALITY_VIOLATION, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPG_SQLSTATE_INVALID_DESCRIPTOR_INDEX, ecpg_store_result(), ecpg_strdup(), ECPG_TOO_MANY_MATCHES, ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPGd_cardinality, ECPGd_data, ECPGd_di_code, ECPGd_EODT, ECPGd_indicator, ECPGd_key_member, ECPGd_length, ECPGd_name, ECPGd_nullable, ECPGd_octet, ECPGd_precision, ECPGd_ret_length, ECPGd_ret_octet, ECPGd_scale, ECPGd_type, ECPGget_sqlca(), ECPGt_EORT, ECPGt_NO_INDICATOR, get_char_item(), get_int_item(), variable::ind_arrsize, variable::ind_offset, variable::ind_pointer, variable::ind_type, variable::ind_value, variable::ind_varcharsize, statement::lineno, locale_t, variable::offset, variable::pointer, PQfmod(), PQfname(), PQfsize(), PQftype(), PQgetisnull(), PQgetlength(), PQnfields(), PQntuples(), RETURN_IF_NO_DATA, setlocale, snprintf, sqlca, stmt, type, variable::type, va_end(), va_start(), variable::value, variable::varcharsize, and VARHDRSZ.
Referenced by execute_test(), and main().
bool ECPGget_desc_header | ( | int | lineno, |
const char * | desc_name, | ||
int * | count | ||
) |
Definition at line 84 of file descriptor.c.
References ecpg_init_sqlca(), ecpg_log(), ECPG_OUT_OF_MEMORY, ecpg_raise(), ecpg_result_by_descriptor(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPGget_sqlca(), PQnfields(), and sqlca.
Referenced by execute_test(), and main().
bool ECPGset_desc | ( | int | lineno, |
const char * | desc_name, | ||
int | index, | ||
... | |||
) |
Definition at line 605 of file descriptor.c.
References generate_unaccent_rules::args, variable::arrsize, descriptor::count, ecpg_alloc(), ecpg_find_desc(), ecpg_free(), ecpg_raise(), ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, ecpg_store_input(), ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPGd_data, ECPGd_EODT, ECPGd_indicator, ECPGd_length, ECPGd_precision, ECPGd_scale, ECPGd_type, descriptor_item::indicator, descriptor::items, descriptor_item::length, descriptor_item::next, variable::next, descriptor_item::num, variable::offset, variable::pointer, descriptor_item::precision, descriptor_item::scale, set_desc_attr(), set_int_item(), snprintf, descriptor_item::type, variable::type, va_end(), va_start(), variable::value, and variable::varcharsize.
Referenced by main().
bool ECPGset_desc_header | ( | int | lineno, |
const char * | desc_name, | ||
int | count | ||
) |
Definition at line 573 of file descriptor.c.
References descriptor::count, and ecpg_find_desc().
Referenced by main().
|
static |
Definition at line 194 of file descriptor.c.
References ecpg_raise(), ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, ECPG_VAR_NOT_CHAR, ECPGt_char, ECPGt_string, ECPGt_unsigned_char, ECPGt_varchar, and value.
Referenced by ECPGget_desc().
|
static |
Definition at line 40 of file descriptor.c.
References descriptor_key, descriptor_key_init(), descriptor_once, and pthread_getspecific().
Referenced by ecpg_find_desc(), ECPGallocate_desc(), and ECPGdeallocate_desc().
|
static |
Definition at line 108 of file descriptor.c.
References ecpg_raise(), ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, ECPG_VAR_NOT_NUMERIC, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_long, ECPGt_long_long, ECPGt_short, ECPGt_unsigned_int, ECPGt_unsigned_long, ECPGt_unsigned_long_long, ECPGt_unsigned_short, and value.
Referenced by ECPGget_desc().
|
static |
Definition at line 584 of file descriptor.c.
References descriptor_item::data, descriptor_item::data_len, ecpg_free(), ECPGt_bytea, descriptor_item::is_binary, variable::type, and variable::value.
Referenced by ECPGset_desc().
|
static |
Definition at line 47 of file descriptor.c.
References descriptor_key, pthread_setspecific(), and value.
Referenced by ECPGallocate_desc(), and ECPGdeallocate_desc().
|
static |
Definition at line 151 of file descriptor.c.
References ecpg_raise(), ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION, ECPG_VAR_NOT_NUMERIC, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_long, ECPGt_long_long, ECPGt_short, ECPGt_unsigned_int, ECPGt_unsigned_long, ECPGt_unsigned_long_long, and ECPGt_unsigned_short.
Referenced by ECPGset_desc().
|
static |
Definition at line 22 of file descriptor.c.
Referenced by descriptor_key_init(), get_descriptors(), and set_descriptors().
|
static |
Definition at line 23 of file descriptor.c.
Referenced by get_descriptors().