PostgreSQL Source Code git master
|
#include "ecpg_config.h"
#include "ecpgtype.h"
#include "libpq-fe.h"
#include "sqlca.h"
#include "sqlda-compat.h"
#include "sqlda-native.h"
#include <limits.h>
Go to the source code of this file.
Data Structures | |
struct | ECPGgeneric_varchar |
struct | ECPGgeneric_bytea |
struct | ECPGtype_information_cache |
struct | statement |
struct | prepared_statement |
struct | connection |
struct | descriptor |
struct | descriptor_item |
struct | variable |
struct | var_list |
Enumerations | |
enum | COMPAT_MODE { ECPG_COMPAT_PGSQL = 0 , ECPG_COMPAT_INFORMIX , ECPG_COMPAT_INFORMIX_SE , ECPG_COMPAT_ORACLE , ECPG_COMPAT_PGSQL = 0 , ECPG_COMPAT_INFORMIX , ECPG_COMPAT_INFORMIX_SE , ECPG_COMPAT_ORACLE } |
enum | ARRAY_TYPE { ECPG_ARRAY_ERROR , ECPG_ARRAY_NOT_SET , ECPG_ARRAY_ARRAY , ECPG_ARRAY_VECTOR , ECPG_ARRAY_NONE } |
Functions | |
bool | ecpg_add_mem (void *ptr, int lineno) |
bool | ecpg_get_data (const PGresult *, int, int, int, enum ECPGttype type, enum ECPGttype, char *, char *, long, long, long, enum ARRAY_TYPE, enum COMPAT_MODE, bool) |
void | ecpg_pthreads_init (void) |
struct connection * | ecpg_get_connection (const char *connection_name) |
char * | ecpg_alloc (long size, int lineno) |
char * | ecpg_auto_alloc (long size, int lineno) |
char * | ecpg_realloc (void *ptr, long size, int lineno) |
void | ecpg_free (void *ptr) |
bool | ecpg_init (const struct connection *con, const char *connection_name, const int lineno) |
char * | ecpg_strdup (const char *string, int lineno) |
const char * | ecpg_type_name (enum ECPGttype typ) |
int | ecpg_dynamic_type (Oid type) |
int | sqlda_dynamic_type (Oid type, enum COMPAT_MODE compat) |
void | ecpg_clear_auto_mem (void) |
struct descriptor * | ecpg_find_desc (int line, const char *name) |
struct prepared_statement * | ecpg_find_prepared_statement (const char *name, struct connection *con, struct prepared_statement **prev_) |
bool | ecpg_store_result (const PGresult *results, int act_field, const struct statement *stmt, struct variable *var) |
bool | ecpg_store_input (const int lineno, const bool force_indicator, const struct variable *var, char **tobeinserted_p, bool quote) |
void | ecpg_free_params (struct statement *stmt, bool print) |
bool | ecpg_do_prologue (int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, enum ECPG_statement_type statement_type, const char *query, va_list args, struct statement **stmt_out) |
bool | ecpg_build_params (struct statement *stmt) |
bool | ecpg_autostart_transaction (struct statement *stmt) |
bool | ecpg_execute (struct statement *stmt) |
bool | ecpg_process_output (struct statement *stmt, bool clear_result) |
void | ecpg_do_epilogue (struct statement *stmt) |
bool | ecpg_do (const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query, va_list args) |
bool | ecpg_check_PQresult (PGresult *results, int lineno, PGconn *connection, enum COMPAT_MODE compat) |
void | ecpg_raise (int line, int code, const char *sqlstate, const char *str) |
void | ecpg_raise_backend (int line, PGresult *result, PGconn *conn, int compat) |
char * | ecpg_prepared (const char *name, struct connection *con) |
bool | ecpg_deallocate_all_conn (int lineno, enum COMPAT_MODE c, struct connection *con) |
void | ecpg_log (const char *format,...) pg_attribute_printf(1 |
void bool | ecpg_auto_prepare (int lineno, const char *connection_name, const int compat, char **name, const char *query) |
bool | ecpg_register_prepared_stmt (struct statement *stmt) |
void | ecpg_init_sqlca (struct sqlca_t *sqlca) |
struct sqlda_compat * | ecpg_build_compat_sqlda (int line, PGresult *res, int row, enum COMPAT_MODE compat) |
void | ecpg_set_compat_sqlda (int lineno, struct sqlda_compat **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat) |
struct sqlda_struct * | ecpg_build_native_sqlda (int line, PGresult *res, int row, enum COMPAT_MODE compat) |
void | ecpg_set_native_sqlda (int lineno, struct sqlda_struct **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat) |
unsigned | ecpg_hex_dec_len (unsigned srclen) |
unsigned | ecpg_hex_enc_len (unsigned srclen) |
unsigned | ecpg_hex_encode (const char *src, unsigned len, char *dst) |
Variables | |
bool | ecpg_internal_regression_mode |
struct var_list * | ivlist |
Definition at line 239 of file ecpglib_extern.h.
#define ECPG_IS_ARRAY | ( | X | ) | ((X) == ECPG_ARRAY_ARRAY || (X) == ECPG_ARRAY_VECTOR) |
Definition at line 32 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_ACTIVE_SQL_TRANSACTION "25001" |
Definition at line 255 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_CARDINALITY_VIOLATION "21000" |
Definition at line 253 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST "08003" |
Definition at line 251 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_DATATYPE_MISMATCH "42804" |
Definition at line 261 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_DUPLICATE_CURSOR "42P03" |
Definition at line 262 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR "YE000" |
Definition at line 265 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY "YE001" |
Definition at line 266 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_INVALID_CURSOR_NAME "34000" |
Definition at line 259 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_INVALID_DESCRIPTOR_INDEX "07009" |
Definition at line 249 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_INVALID_SQL_DESCRIPTOR_NAME "33000" |
Definition at line 258 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME "26000" |
Definition at line 257 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_NO_ACTIVE_SQL_TRANSACTION "25P01" |
Definition at line 256 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_NO_DATA "02000" |
Definition at line 245 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_NULL_VALUE_NO_INDICATOR_PARAMETER "22002" |
Definition at line 254 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_RESTRICTED_DATA_TYPE_ATTRIBUTE_VIOLATION "07006" |
Definition at line 248 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION "08001" |
Definition at line 250 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_SYNTAX_ERROR "42601" |
Definition at line 260 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN "08007" |
Definition at line 252 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_PARAMETERS "07001" |
Definition at line 246 of file ecpglib_extern.h.
#define ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_TARGETS "07002" |
Definition at line 247 of file ecpglib_extern.h.
#define INFORMIX_MODE | ( | X | ) | ((X) == ECPG_COMPAT_INFORMIX || (X) == ECPG_COMPAT_INFORMIX_SE) |
Definition at line 24 of file ecpglib_extern.h.
#define ORACLE_MODE | ( | X | ) | ((X) == ECPG_COMPAT_ORACLE) |
Definition at line 25 of file ecpglib_extern.h.
enum ARRAY_TYPE |
Enumerator | |
---|---|
ECPG_ARRAY_ERROR | |
ECPG_ARRAY_NOT_SET | |
ECPG_ARRAY_ARRAY | |
ECPG_ARRAY_VECTOR | |
ECPG_ARRAY_NONE |
Definition at line 27 of file ecpglib_extern.h.
enum COMPAT_MODE |
Enumerator | |
---|---|
ECPG_COMPAT_PGSQL | |
ECPG_COMPAT_INFORMIX | |
ECPG_COMPAT_INFORMIX_SE | |
ECPG_COMPAT_ORACLE | |
ECPG_COMPAT_PGSQL | |
ECPG_COMPAT_INFORMIX | |
ECPG_COMPAT_INFORMIX_SE | |
ECPG_COMPAT_ORACLE |
Definition at line 17 of file ecpglib_extern.h.
bool ecpg_add_mem | ( | void * | ptr, |
int | lineno | ||
) |
Definition at line 117 of file memory.c.
References ecpg_alloc(), get_auto_allocs(), auto_mem::next, auto_mem::pointer, and set_auto_allocs().
Referenced by ecpg_auto_alloc().
char * ecpg_alloc | ( | long | size, |
int | lineno | ||
) |
Definition at line 19 of file memory.c.
References calloc, ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, and size.
Referenced by AddStmtToCache(), convert_bytea_to_string(), deallocate_one(), ecpg_add_mem(), ecpg_auto_alloc(), ecpg_build_compat_sqlda(), ecpg_build_native_sqlda(), ecpg_build_params(), ecpg_do_prologue(), ecpg_get_data(), ecpg_is_type_an_array(), ecpg_register_prepared_stmt(), ecpg_store_input(), ecpg_type_infocache_push(), ECPGallocate_desc(), ECPGconnect(), ECPGset_desc(), insert_tobeinserted(), prepare_common(), print_param_value(), quote_postgres(), replace_variables(), and store_input_from_desc().
char * ecpg_auto_alloc | ( | long | size, |
int | lineno | ||
) |
Definition at line 101 of file memory.c.
References ecpg_add_mem(), ecpg_alloc(), ecpg_free(), and size.
Referenced by ecpg_store_result(), and ECPGget_desc().
void bool ecpg_auto_prepare | ( | int | lineno, |
const char * | connection_name, | ||
const int | compat, | ||
char ** | name, | ||
const char * | query | ||
) |
Definition at line 553 of file prepare.c.
References AddStmtToCache(), compat, ecpg_find_prepared_statement(), ecpg_get_connection(), ecpg_log(), ecpg_strdup(), ECPGprepare(), stmtCacheEntry::execs, name, nextStmtID, prepare_common(), SearchStmtCache(), sprintf, stmtCacheEntries, stmtCacheEntry::stmtID, and STMTID_SIZE.
Referenced by ecpg_do_prologue().
bool ecpg_autostart_transaction | ( | struct statement * | stmt | ) |
Definition at line 1581 of file execute.c.
References ecpg_check_PQresult(), ecpg_free_params(), PQclear(), PQexec(), PQTRANS_IDLE, PQtransactionStatus(), and stmt.
Referenced by ecpg_do().
struct sqlda_compat * ecpg_build_compat_sqlda | ( | int | line, |
PGresult * | res, | ||
int | row, | ||
enum COMPAT_MODE | compat | ||
) |
Definition at line 205 of file sqlda.c.
References compat, sqlda_compat::desc_occ, ecpg_alloc(), ecpg_log(), i, PQfname(), PQfsize(), PQftype(), PQnfields(), res, size, sqlda_compat::sqld, sqlda_compat_total_size(), sqlda_dynamic_type(), sqlvar_compat::sqlname, sqlvar_compat::sqltype, sqlvar_compat::sqltypelen, sqlda_compat::sqlvar, and sqlvar_compat::sqlxid.
Referenced by ecpg_process_output(), and ECPGdescribe().
struct sqlda_struct * ecpg_build_native_sqlda | ( | int | line, |
PGresult * | res, | ||
int | row, | ||
enum COMPAT_MODE | compat | ||
) |
Definition at line 412 of file sqlda.c.
References compat, sqlname::data, ecpg_alloc(), ecpg_log(), i, sqlname::length, PQfname(), PQftype(), PQnfields(), res, size, sprintf, sqlda_struct::sqld, sqlda_dynamic_type(), sqlda_native_total_size(), sqlda_struct::sqldabc, sqlda_struct::sqldaid, sqlda_struct::sqln, sqlvar_struct::sqlname, sqlvar_struct::sqltype, and sqlda_struct::sqlvar.
Referenced by ecpg_process_output(), and ECPGdescribe().
bool ecpg_build_params | ( | struct statement * | stmt | ) |
Definition at line 1213 of file execute.c.
References convert_bytea_to_string(), descriptor::count, descriptor_item::data_len, ecpg_alloc(), ecpg_find_desc(), ecpg_free(), ecpg_free_params(), ecpg_raise(), ecpg_realloc(), ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_PARAMETERS, ecpg_store_input(), ECPG_TOO_FEW_ARGUMENTS, ECPG_TOO_MANY_ARGUMENTS, ECPGst_exec_with_exprlist, ECPGst_prepare, ECPGt_bytea, ECPGt_char, ECPGt_char_variable, ECPGt_descriptor, ECPGt_NO_INDICATOR, ECPGt_short, ECPGt_sqlda, ECPGt_varchar, i, if(), INFORMIX_MODE, insert_tobeinserted(), descriptor_item::is_binary, descriptor::items, len, descriptor_item::next, variable::next, next_insert(), descriptor_item::num, variable::pointer, PQparameterStatus(), snprintf, sprintf, sqlda_compat::sqld, sqlvar_compat::sqldata, sqlvar_struct::sqldata, sqlvar_compat::sqlind, sqlvar_struct::sqlind, sqlda_struct::sqln, sqlvar_compat::sqltype, sqlvar_struct::sqltype, sqlda_compat::sqlvar, sqlda_struct::sqlvar, stmt, store_input_from_desc(), str, variable::type, value, and variable::value.
Referenced by ecpg_do().
bool ecpg_check_PQresult | ( | PGresult * | results, |
int | lineno, | ||
PGconn * | connection, | ||
enum COMPAT_MODE | compat | ||
) |
Definition at line 281 of file error.c.
References compat, ECPG_EMPTY, ecpg_log(), ecpg_raise(), ecpg_raise_backend(), ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, PGRES_BAD_RESPONSE, PGRES_COMMAND_OK, PGRES_COPY_IN, PGRES_COPY_OUT, PGRES_EMPTY_QUERY, PGRES_FATAL_ERROR, PGRES_NONFATAL_ERROR, PGRES_TUPLES_OK, PQclear(), PQendcopy(), PQerrorMessage(), PQresultErrorMessage(), and PQresultStatus().
Referenced by deallocate_one(), ecpg_autostart_transaction(), ecpg_execute(), ecpg_is_type_an_array(), ECPGdescribe(), ECPGsetcommit(), ECPGtrans(), and prepare_common().
void ecpg_clear_auto_mem | ( | void | ) |
Definition at line 151 of file memory.c.
References ecpg_free(), get_auto_allocs(), auto_mem::next, and set_auto_allocs().
Referenced by ecpg_do_prologue(), and ECPGconnect().
bool ecpg_deallocate_all_conn | ( | int | lineno, |
enum COMPAT_MODE | c, | ||
struct connection * | con | ||
) |
Definition at line 337 of file prepare.c.
References deallocate_one(), and connection::prep_stmts.
Referenced by ecpg_finish(), and ECPGdeallocate_all().
bool ecpg_do | ( | const int | lineno, |
const int | compat, | ||
const int | force_indicator, | ||
const char * | connection_name, | ||
const bool | questionmarks, | ||
const int | st, | ||
const char * | query, | ||
va_list | args | ||
) |
Definition at line 2241 of file execute.c.
References generate_unaccent_rules::args, compat, ecpg_autostart_transaction(), ecpg_build_params(), ecpg_do_epilogue(), ecpg_do_prologue(), ecpg_execute(), ecpg_process_output(), force_indicator, statement::lineno, questionmarks, and stmt.
Referenced by ECPGdo().
void ecpg_do_epilogue | ( | struct statement * | stmt | ) |
Definition at line 2214 of file execute.c.
References free_statement(), locale_t, setlocale, and stmt.
Referenced by ecpg_do(), and ecpg_do_prologue().
bool ecpg_do_prologue | ( | int | lineno, |
const int | compat, | ||
const int | force_indicator, | ||
const char * | connection_name, | ||
const bool | questionmarks, | ||
enum ECPG_statement_type | statement_type, | ||
const char * | query, | ||
va_list | args, | ||
struct statement ** | stmt_out | ||
) |
Definition at line 1944 of file execute.c.
References generate_unaccent_rules::args, variable::arrsize, Assert, statement::command, compat, connection::connection, ecpg_alloc(), ecpg_auto_prepare(), ecpg_clear_auto_mem(), ecpg_do_epilogue(), ECPG_EMPTY, ecpg_free(), ecpg_get_connection(), ecpg_gettext, ecpg_init(), ECPG_INVALID_STMT, ECPG_NOT_CONN, ecpg_prepared(), ecpg_pthreads_init(), ecpg_raise(), ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, ecpg_strdup(), ECPG_TOO_FEW_ARGUMENTS, ECPGst_execute, ECPGst_prepare, ECPGst_prepnormal, ECPGt_char, ECPGt_EOIT, ECPGt_EORT, ECPGt_NO_INDICATOR, ECPGt_unsigned_char, force_indicator, variable::ind_arrsize, variable::ind_offset, variable::ind_pointer, variable::ind_type, variable::ind_value, variable::ind_varcharsize, statement::lineno, sort-test::list, locale_t, connection::name, variable::next, variable::offset, variable::pointer, questionmarks, setlocale, statement::statement_type, stmt, type, variable::type, variable::value, and variable::varcharsize.
Referenced by ecpg_do().
int ecpg_dynamic_type | ( | Oid | type | ) |
Definition at line 73 of file typename.c.
References SQL3_BOOLEAN, SQL3_CHARACTER, SQL3_CHARACTER_VARYING, SQL3_DATE_TIME_TIMESTAMP, SQL3_DOUBLE_PRECISION, SQL3_INTEGER, SQL3_NUMERIC, SQL3_REAL, SQL3_SMALLINT, and type.
Referenced by ecpg_is_type_an_array(), and ECPGget_desc().
bool ecpg_execute | ( | struct statement * | stmt | ) |
Definition at line 1602 of file execute.c.
References ecpg_check_PQresult(), ecpg_free_params(), ecpg_log(), ecpg_register_prepared_stmt(), ECPGst_execute, ECPGst_prepare, PQexec(), PQexecParams(), PQexecPrepared(), and stmt.
Referenced by ecpg_do().
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().
struct prepared_statement * ecpg_find_prepared_statement | ( | const char * | name, |
struct connection * | con, | ||
struct prepared_statement ** | prev_ | ||
) |
Definition at line 239 of file prepare.c.
References name, prepared_statement::next, and connection::prep_stmts.
Referenced by ecpg_auto_prepare(), ecpg_freeStmtCacheEntry(), ecpg_prepared(), ecpg_register_prepared_stmt(), ECPGdeallocate(), ECPGdescribe(), and ECPGprepare().
void ecpg_free | ( | void * | ptr | ) |
Definition at line 13 of file memory.c.
References free.
Referenced by deallocate_one(), descriptor_free(), ecpg_auto_alloc(), ecpg_build_params(), ecpg_clear_auto_mem(), ecpg_do_prologue(), ecpg_finish(), ecpg_free_params(), ecpg_freeStmtCacheEntry(), ecpg_is_type_an_array(), ecpg_register_prepared_stmt(), ecpg_store_input(), ECPGallocate_desc(), ECPGconnect(), ECPGfree_auto_mem(), ECPGget_desc(), ECPGset_desc(), free_statement(), free_variable(), insert_tobeinserted(), prepare_common(), print_param_value(), quote_postgres(), replace_variables(), and set_desc_attr().
void ecpg_free_params | ( | struct statement * | stmt, |
bool | |||
) |
Definition at line 1106 of file execute.c.
References ecpg_free(), print(), print_param_value(), and stmt.
Referenced by ecpg_autostart_transaction(), ecpg_build_params(), and ecpg_execute().
struct connection * ecpg_get_connection | ( | const char * | connection_name | ) |
Definition at line 71 of file connect.c.
References actual_connection, actual_connection_key, connections_mutex, ecpg_get_connection_nr(), ecpg_pthreads_init(), pthread_getspecific(), pthread_mutex_lock(), and pthread_mutex_unlock().
Referenced by ecpg_auto_prepare(), ecpg_do_prologue(), ecpg_freeStmtCacheEntry(), ECPGconnect(), ECPGdeallocate(), ECPGdeallocate_all(), ECPGdescribe(), ECPGget_desc(), ECPGget_PGconn(), ECPGprepare(), ECPGprepared_statement(), ECPGsetcommit(), ECPGsetconn(), ECPGstatus(), ECPGtrans(), and ECPGtransactionStatus().
bool ecpg_get_data | ( | const PGresult * | results, |
int | act_tuple, | ||
int | act_field, | ||
int | lineno, | ||
enum ECPGttype | type, | ||
enum | ECPGttype, | ||
char * | var, | ||
char * | ind, | ||
long | varcharsize, | ||
long | offset, | ||
long | ind_offset, | ||
enum | ARRAY_TYPE, | ||
enum | COMPAT_MODE, | ||
bool | force_indicator | ||
) |
Definition at line 206 of file data.c.
References array_boundary(), array_delimiter(), check_special_value(), compat, ecpg_alloc(), ECPG_ARRAY_ARRAY, ECPG_COMPAT_PGSQL, ECPG_CONVERT_BOOL, ECPG_DATA_NOT_ARRAY, ECPG_DATE_FORMAT, ECPG_FLOAT_FORMAT, ecpg_hex_dec_len(), ecpg_hex_enc_len(), ECPG_INT_FORMAT, ecpg_internal_regression_mode, ECPG_INTERVAL_FORMAT, ECPG_IS_ARRAY, ecpg_log(), ECPG_MISSING_INDICATOR, ECPG_NOT_FOUND, ECPG_NUMERIC_FORMAT, ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_DATATYPE_MISMATCH, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPG_SQLSTATE_NO_DATA, ECPG_SQLSTATE_NULL_VALUE_NO_INDICATOR_PARAMETER, ECPG_TIMESTAMP_FORMAT, ecpg_type_name(), ECPG_UINT_FORMAT, ECPG_UNSUPPORTED, ECPGget_sqlca(), ECPGset_noind_null(), ECPGt_bool, ECPGt_bytea, ECPGt_char, ECPGt_date, ECPGt_decimal, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_interval, ECPGt_long, ECPGt_long_long, ECPGt_NO_INDICATOR, ECPGt_numeric, ECPGt_short, ECPGt_string, ECPGt_timestamp, ECPGt_unsigned_char, ECPGt_unsigned_int, ECPGt_unsigned_long, ECPGt_unsigned_long_long, ECPGt_unsigned_short, ECPGt_varchar, false, force_indicator, free, garbage_left(), hex_decode(), INFORMIX_MODE, ORACLE_MODE, PGTYPESdate_from_asc(), PGTYPESinterval_copy(), PGTYPESinterval_from_asc(), PGTYPESnumeric_copy(), PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), PGTYPESnumeric_new(), PGTYPESnumeric_to_decimal(), PGTYPEStimestamp_from_asc(), PQfformat(), PQgetisnull(), PQgetlength(), PQgetvalue(), res, size, sqlca, str, and type.
Referenced by ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), and ecpg_store_result().
unsigned ecpg_hex_dec_len | ( | unsigned | srclen | ) |
Definition at line 134 of file data.c.
Referenced by ecpg_get_data().
unsigned ecpg_hex_enc_len | ( | unsigned | srclen | ) |
Definition at line 128 of file data.c.
Referenced by convert_bytea_to_string(), ecpg_get_data(), and print_param_value().
unsigned ecpg_hex_encode | ( | const char * | src, |
unsigned | len, | ||
char * | dst | ||
) |
Definition at line 191 of file data.c.
Referenced by convert_bytea_to_string(), and print_param_value().
bool ecpg_init | ( | const struct connection * | con, |
const char * | connection_name, | ||
const int | lineno | ||
) |
Definition at line 73 of file misc.c.
References ecpg_gettext, ecpg_init_sqlca(), ECPG_NO_CONN, ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST, ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPGget_sqlca(), and sqlca.
Referenced by ecpg_do_prologue(), ECPGdeallocate(), ECPGdisconnect(), ECPGprepare(), ECPGsetcommit(), ECPGsetconn(), ECPGstatus(), and ECPGtrans().
void ecpg_init_sqlca | ( | struct sqlca_t * | sqlca | ) |
Definition at line 67 of file misc.c.
References sqlca, and sqlca_init.
Referenced by ecpg_init(), ECPGallocate_desc(), ECPGconnect(), ECPGdeallocate_desc(), ECPGdisconnect(), ECPGget_desc(), ECPGget_desc_header(), ECPGget_sqlca(), and ECPGset_var().
void ecpg_log | ( | const char * | format, |
... | |||
) |
Referenced by deallocate_one(), ecpg_auto_prepare(), ecpg_build_compat_sqlda(), ecpg_build_native_sqlda(), ecpg_check_PQresult(), ecpg_execute(), ecpg_finish(), ecpg_get_data(), ecpg_is_type_an_array(), ecpg_process_output(), ecpg_raise(), ecpg_raise_backend(), ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), ecpg_store_result(), ECPGconnect(), ECPGget_desc(), ECPGget_desc_header(), ECPGnoticeReceiver(), ECPGsetcommit(), prepare_common(), print_param_value(), and sqlprint().
char * ecpg_prepared | ( | const char * | name, |
struct connection * | con | ||
) |
Definition at line 357 of file prepare.c.
References ecpg_find_prepared_statement(), name, and stmt.
Referenced by ecpg_do_prologue(), and ECPGprepared_statement().
bool ecpg_process_output | ( | struct statement * | stmt, |
bool | clear_result | ||
) |
Definition at line 1671 of file execute.c.
References pgNotify::be_pid, ecpg_build_compat_sqlda(), ecpg_build_native_sqlda(), ECPG_COMPAT_INFORMIX_SE, ecpg_find_desc(), ecpg_log(), ECPG_NOT_FOUND, ECPG_OUT_OF_MEMORY, ecpg_raise(), ecpg_raise_backend(), ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPG_SQLSTATE_NO_DATA, ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_TARGETS, ecpg_store_result(), ECPG_TOO_FEW_ARGUMENTS, ECPG_TOO_MANY_ARGUMENTS, ECPGget_sqlca(), ECPGt_descriptor, ECPGt_sqlda, free, i, INFORMIX_MODE, variable::next, PGRES_COMMAND_OK, PGRES_COPY_OUT, PGRES_TUPLES_OK, variable::pointer, PQclear(), PQcmdStatus(), PQcmdTuples(), PQconsumeInput(), PQfreemem(), PQgetCopyData(), PQgetResult(), PQnfields(), PQnotifies(), PQntuples(), PQoidValue(), PQresultErrorMessage(), PQresultStatus(), printf, pgNotify::relname, res, descriptor::result, sqlca, stmt, variable::type, and while().
Referenced by ecpg_do().
void ecpg_raise | ( | int | line, |
int | code, | ||
const char * | sqlstate, | ||
const char * | str | ||
) |
Definition at line 13 of file error.c.
References ECPG_ARRAY_INSERT, ECPG_CONNECT, ECPG_CONVERT_BOOL, ECPG_DATA_NOT_ARRAY, ECPG_EMPTY, ECPG_FLOAT_FORMAT, ecpg_gettext, ECPG_INT_FORMAT, ECPG_INVALID_DESCRIPTOR_INDEX, ECPG_INVALID_STMT, ecpg_log(), ECPG_MISSING_INDICATOR, ECPG_NO_ARRAY, ECPG_NO_CONN, ECPG_NOT_CONN, ECPG_NOT_FOUND, ECPG_OUT_OF_MEMORY, ECPG_TOO_FEW_ARGUMENTS, ECPG_TOO_MANY_ARGUMENTS, ECPG_TRANS, ECPG_UINT_FORMAT, ECPG_UNKNOWN_DESCRIPTOR, ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPG_UNSUPPORTED, ECPG_VAR_NOT_CHAR, ECPG_VAR_NOT_NUMERIC, ECPGfree_auto_mem(), ECPGget_sqlca(), snprintf, sqlca, sqlca_t::sqlstate, and str.
Referenced by deallocate_one(), ecpg_alloc(), ecpg_build_params(), ecpg_check_PQresult(), ecpg_do_prologue(), ecpg_find_desc(), ecpg_get_data(), ecpg_init(), ecpg_process_output(), ecpg_realloc(), ecpg_store_input(), ecpg_store_result(), ecpg_strdup(), ECPGallocate_desc(), ECPGconnect(), ECPGdeallocate(), ECPGdeallocate_desc(), ECPGdescribe(), ECPGdisconnect(), ECPGget_desc(), ECPGget_desc_header(), ECPGset_desc(), ECPGset_var(), ECPGstatus(), get_char_item(), get_int_item(), and set_int_item().
Definition at line 219 of file error.c.
References compat, conn, CONNECTION_BAD, ECPG_DUPLICATE_KEY, ecpg_gettext, ECPG_INFORMIX_DUPLICATE_KEY, ECPG_INFORMIX_SUBSELECT_NOT_ONE, ecpg_log(), ECPG_PGSQL, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, ECPG_SUBSELECT_NOT_ONE, ECPGfree_auto_mem(), ECPGget_sqlca(), INFORMIX_MODE, PG_DIAG_MESSAGE_PRIMARY, PG_DIAG_SQLSTATE, PQerrorMessage(), PQresultErrorField(), PQstatus(), snprintf, sqlca, and sqlca_t::sqlstate.
Referenced by ecpg_check_PQresult(), and ecpg_process_output().
char * ecpg_realloc | ( | void * | ptr, |
long | size, | ||
int | lineno | ||
) |
Definition at line 33 of file memory.c.
References ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, realloc, and size.
Referenced by ecpg_build_params(), and ecpg_store_input().
bool ecpg_register_prepared_stmt | ( | struct statement * | stmt | ) |
Definition at line 59 of file prepare.c.
References statement::command, statement::connection, deallocate_one(), ecpg_alloc(), ECPG_COMPAT_PGSQL, ecpg_find_prepared_statement(), ecpg_free(), ecpg_strdup(), statement::inlist, statement::lineno, name, statement::name, next, statement::outlist, connection::prep_stmts, and stmt.
Referenced by ecpg_execute().
void ecpg_set_compat_sqlda | ( | int | lineno, |
struct sqlda_compat ** | _sqlda, | ||
const PGresult * | res, | ||
int | row, | ||
enum COMPAT_MODE | compat | ||
) |
Definition at line 255 of file sqlda.c.
References numeric::buf, compat, numeric::digits, ECPG_ARRAY_NONE, ecpg_get_data(), ecpg_log(), ecpg_sqlda_align_add_size(), ECPGset_noind_null(), ECPGt_bool, ECPGt_char, ECPGt_date, ECPGt_decimal, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_interval, ECPGt_long, ECPGt_long_long, ECPGt_NO_INDICATOR, ECPGt_numeric, ECPGt_short, ECPGt_string, ECPGt_timestamp, ECPGt_unsigned_char, ECPGt_unsigned_int, ECPGt_unsigned_long, ECPGt_unsigned_long_long, ECPGt_unsigned_short, i, numeric::ndigits, numeric(), PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), PQgetisnull(), PQgetvalue(), res, sqlda_compat::sqld, sqlda_compat_empty_size(), sqlvar_compat::sqldata, sqlvar_compat::sqlilen, sqlvar_compat::sqlilongdata, sqlvar_compat::sqlind, sqlvar_compat::sqlitype, sqlvar_compat::sqllen, sqlvar_compat::sqltype, sqlda_compat::sqlvar, val, value_is_not_null, and value_is_null.
Referenced by ecpg_process_output().
void ecpg_set_native_sqlda | ( | int | lineno, |
struct sqlda_struct ** | _sqlda, | ||
const PGresult * | res, | ||
int | row, | ||
enum COMPAT_MODE | compat | ||
) |
Definition at line 444 of file sqlda.c.
References numeric::buf, compat, numeric::digits, ECPG_ARRAY_NONE, ecpg_get_data(), ecpg_log(), ecpg_sqlda_align_add_size(), ECPGset_noind_null(), ECPGt_bool, ECPGt_char, ECPGt_date, ECPGt_decimal, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_interval, ECPGt_long, ECPGt_long_long, ECPGt_NO_INDICATOR, ECPGt_numeric, ECPGt_short, ECPGt_string, ECPGt_timestamp, ECPGt_unsigned_char, ECPGt_unsigned_int, ECPGt_unsigned_long, ECPGt_unsigned_long_long, ECPGt_unsigned_short, i, numeric::ndigits, numeric(), PGTYPESnumeric_free(), PGTYPESnumeric_from_asc(), PQgetisnull(), PQgetvalue(), res, sqlda_struct::sqld, sqlda_native_empty_size(), sqlvar_struct::sqldata, sqlvar_struct::sqlind, sqlvar_struct::sqllen, sqlvar_struct::sqltype, sqlda_struct::sqlvar, val, value_is_not_null, and value_is_null.
Referenced by ecpg_process_output().
bool ecpg_store_input | ( | const int | lineno, |
const bool | force_indicator, | ||
const struct variable * | var, | ||
char ** | tobeinserted_p, | ||
bool | quote | ||
) |
Definition at line 506 of file execute.c.
References variable::arrsize, numeric::dscale, ecpg_alloc(), ECPG_CONVERT_BOOL, ecpg_free(), ecpg_raise(), ecpg_realloc(), ECPG_SQLSTATE_DATATYPE_MISMATCH, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, ecpg_strdup(), ecpg_type_name(), ECPG_UNSUPPORTED, ECPGis_noind_null(), ECPGt_bool, ECPGt_bytea, ECPGt_char, ECPGt_char_variable, ECPGt_const, ECPGt_date, ECPGt_decimal, ECPGt_descriptor, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_interval, ECPGt_long, ECPGt_long_long, ECPGt_NO_INDICATOR, ECPGt_numeric, ECPGt_short, ECPGt_sqlda, ECPGt_string, ECPGt_timestamp, ECPGt_unsigned_char, ECPGt_unsigned_int, ECPGt_unsigned_long, ECPGt_unsigned_long_long, ECPGt_unsigned_short, ECPGt_varchar, element(), force_indicator, variable::ind_type, variable::ind_value, variable::offset, PGTYPESdate_to_asc(), PGTYPESinterval_to_asc(), PGTYPESnumeric_copy(), PGTYPESnumeric_free(), PGTYPESnumeric_from_decimal(), PGTYPESnumeric_new(), PGTYPESnumeric_to_asc(), PGTYPEStimestamp_to_asc(), quote_postgres(), sprintf, sprintf_double_value(), sprintf_float_value(), str, variable::type, variable::value, and variable::varcharsize.
Referenced by ecpg_build_params(), ECPGset_desc(), and store_input_from_desc().
bool ecpg_store_result | ( | const PGresult * | results, |
int | act_field, | ||
const struct statement * | stmt, | ||
struct variable * | var | ||
) |
Definition at line 303 of file execute.c.
References variable::arrsize, ECPG_ARRAY_ERROR, ECPG_ARRAY_NONE, ecpg_auto_alloc(), ecpg_get_data(), ECPG_INFORMIX_SUBSELECT_NOT_ONE, ecpg_is_type_an_array(), ecpg_log(), ECPG_NO_ARRAY, ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_CARDINALITY_VIOLATION, ECPG_SQLSTATE_DATATYPE_MISMATCH, ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPG_TOO_MANY_MATCHES, ECPGt_char, ECPGt_string, ECPGt_unsigned_char, ECPGt_varchar, variable::ind_arrsize, variable::ind_offset, variable::ind_pointer, variable::ind_type, variable::ind_value, variable::ind_varcharsize, INFORMIX_MODE, ECPGtype_information_cache::isarray, len, variable::offset, variable::pointer, PQfformat(), PQftype(), PQgetlength(), PQgetvalue(), PQntuples(), stmt, variable::type, variable::value, and variable::varcharsize.
Referenced by ecpg_process_output(), and ECPGget_desc().
char * ecpg_strdup | ( | const char * | string, |
int | lineno | ||
) |
Definition at line 47 of file memory.c.
References ECPG_OUT_OF_MEMORY, ecpg_raise(), and ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY.
Referenced by AddStmtToCache(), ecpg_auto_prepare(), ecpg_do_prologue(), ecpg_register_prepared_stmt(), ecpg_store_input(), ECPGconnect(), ECPGget_desc(), and prepare_common().
const char * ecpg_type_name | ( | enum ECPGttype | typ | ) |
Definition at line 17 of file typename.c.
References ECPGt_bool, ECPGt_bytea, ECPGt_char, ECPGt_char_variable, ECPGt_const, ECPGt_date, ECPGt_decimal, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_interval, ECPGt_long, ECPGt_long_long, ECPGt_numeric, ECPGt_short, ECPGt_string, ECPGt_timestamp, ECPGt_unsigned_char, ECPGt_unsigned_int, ECPGt_unsigned_long, ECPGt_unsigned_long_long, ECPGt_unsigned_short, and ECPGt_varchar.
Referenced by ecpg_get_data(), ecpg_store_input(), and ECPGdump_a_simple().
int sqlda_dynamic_type | ( | Oid | type, |
enum COMPAT_MODE | compat | ||
) |
Definition at line 107 of file typename.c.
References compat, ECPGt_char, ECPGt_date, ECPGt_decimal, ECPGt_double, ECPGt_float, ECPGt_int, ECPGt_interval, ECPGt_long, ECPGt_long_long, ECPGt_numeric, ECPGt_short, ECPGt_timestamp, INFORMIX_MODE, and type.
Referenced by ecpg_build_compat_sqlda(), ecpg_build_native_sqlda(), and sqlda_common_total_size().
|
extern |
Definition at line 29 of file misc.c.
Referenced by ecpg_get_data(), ecpg_log(), ECPGconnect(), and ECPGdebug().
|
extern |
Definition at line 535 of file misc.c.
Referenced by ecpg_finish(), ECPGget_var(), and ECPGset_var().