PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <limits.h>
#include <unistd.h>
#include "ecpg-pthread-win32.h"
#include "ecpgerrno.h"
#include "ecpglib.h"
#include "ecpglib_extern.h"
#include "ecpgtype.h"
#include "pg_config_paths.h"
#include "pgtypes_date.h"
#include "pgtypes_interval.h"
#include "pgtypes_numeric.h"
#include "pgtypes_timestamp.h"
#include "sqlca.h"
Go to the source code of this file.
Macros | |
#define | POSTGRES_ECPG_INTERNAL |
#define | LONG_LONG_MIN LONGLONG_MIN |
Functions | |
void | ecpg_init_sqlca (struct sqlca_t *sqlca) |
bool | ecpg_init (const struct connection *con, const char *connection_name, const int lineno) |
static void | ecpg_sqlca_key_destructor (void *arg) |
static void | ecpg_sqlca_key_init (void) |
struct sqlca_t * | ECPGget_sqlca (void) |
bool | ECPGstatus (int lineno, const char *connection_name) |
PGTransactionStatusType | ECPGtransactionStatus (const char *connection_name) |
bool | ECPGtrans (int lineno, const char *connection_name, const char *transaction) |
void | ECPGdebug (int n, FILE *dbgs) |
void | ecpg_log (const char *format,...) |
void | ECPGset_noind_null (enum ECPGttype type, void *ptr) |
static bool | _check (const unsigned char *ptr, int length) |
bool | ECPGis_noind_null (enum ECPGttype type, const void *ptr) |
void | ECPGset_var (int number, void *pointer, int lineno) |
void * | ECPGget_var (int number) |
Variables | |
bool | ecpg_internal_regression_mode = false |
static struct sqlca_t | sqlca_init |
static pthread_key_t | sqlca_key |
static pthread_once_t | sqlca_key_once = PTHREAD_ONCE_INIT |
static pthread_mutex_t | debug_mutex = PTHREAD_MUTEX_INITIALIZER |
static pthread_mutex_t | debug_init_mutex = PTHREAD_MUTEX_INITIALIZER |
static volatile int | simple_debug = 0 |
static FILE * | debugstream = NULL |
struct var_list * | ivlist = NULL |
|
static |
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, |
... | |||
) |
Definition at line 232 of file misc.c.
References bufsize, debug_mutex, debugstream, ecpg_gettext, ecpg_internal_regression_mode, ECPGget_sqlca(), fflush(), fmt, format, fprintf, free, malloc, pthread_mutex_lock(), pthread_mutex_unlock(), simple_debug, snprintf, sqlca, va_end(), va_start(), and vfprintf().
Referenced by ECPGdebug(), and ECPGtrans().
|
static |
|
static |
Definition at line 102 of file misc.c.
References ecpg_sqlca_key_destructor(), and sqlca_key.
Referenced by ECPGget_sqlca().
void ECPGdebug | ( | int | n, |
FILE * | dbgs | ||
) |
Definition at line 204 of file misc.c.
References debug_init_mutex, debug_mutex, debugstream, ecpg_internal_regression_mode, ecpg_log(), pthread_mutex_lock(), pthread_mutex_unlock(), and simple_debug.
struct sqlca_t* ECPGget_sqlca | ( | void | ) |
Definition at line 108 of file misc.c.
References ecpg_init_sqlca(), ecpg_sqlca_key_init(), malloc, pthread_getspecific(), pthread_setspecific(), sqlca, sqlca_key, and sqlca_key_once.
Referenced by ecpg_get_data(), ECPG_informix_reset_sqlca(), ecpg_init(), ecpg_log(), ecpg_process_output(), ecpg_raise(), ecpg_raise_backend(), ECPGallocate_desc(), ECPGconnect(), ECPGdeallocate_desc(), ECPGdisconnect(), ECPGget_desc(), ECPGget_desc_header(), ECPGnoticeReceiver(), ECPGset_var(), and sqlprint().
void* ECPGget_var | ( | int | number | ) |
Definition at line 593 of file misc.c.
References ivlist, var_list::next, var_list::number, and var_list::pointer.
Referenced by ECPG_informix_get_var(), get_record1(), open_cur1(), and openit().
bool ECPGis_noind_null | ( | enum ECPGttype | type, |
const void * | ptr | ||
) |
Definition at line 361 of file misc.c.
References _check(), ECPGgeneric_bytea::arr, ECPGt_bytea, ECPGt_char, 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, ECPGt_varchar, len, LONG_LONG_MIN, NUMERIC_NULL, sign, and type.
Referenced by ecpg_store_input(), and risnull().
void ECPGset_noind_null | ( | enum ECPGttype | type, |
void * | ptr | ||
) |
Definition at line 292 of file misc.c.
References ECPGt_bytea, ECPGt_char, 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, ECPGt_varchar, LONG_LONG_MIN, NUMERIC_NULL, and type.
Referenced by ecpg_get_data(), ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), and rsetnull().
void ECPGset_var | ( | int | number, |
void * | pointer, | ||
int | lineno | ||
) |
Definition at line 538 of file misc.c.
References calloc, ecpg_init_sqlca(), ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPGfree_auto_mem(), ECPGget_sqlca(), ivlist, var_list::next, var_list::number, var_list::pointer, snprintf, and sqlca.
Referenced by ECPG_informix_set_var(), get_var1(), and main().
bool ECPGstatus | ( | int | lineno, |
const char * | connection_name | ||
) |
Definition at line 127 of file misc.c.
References connection::connection, ecpg_get_connection(), ecpg_init(), ECPG_NOT_CONN, ecpg_raise(), ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, and connection::name.
bool ECPGtrans | ( | int | lineno, |
const char * | connection_name, | ||
const char * | transaction | ||
) |
Definition at line 160 of file misc.c.
References connection::autocommit, connection::connection, ecpg_check_PQresult(), ECPG_COMPAT_PGSQL, ecpg_get_connection(), ecpg_init(), ecpg_log(), connection::name, PQclear(), PQexec(), PQTRANS_IDLE, PQtransactionStatus(), and res.
Referenced by commitTable(), main(), sql_check(), and test_thread().
PGTransactionStatusType ECPGtransactionStatus | ( | const char * | connection_name | ) |
Definition at line 145 of file misc.c.
References connection::connection, ecpg_get_connection(), PQTRANS_UNKNOWN, and PQtransactionStatus().
|
static |
Definition at line 62 of file misc.c.
Referenced by ECPGdebug().
|
static |
Definition at line 61 of file misc.c.
Referenced by ecpg_log(), and ECPGdebug().
|
static |
Definition at line 64 of file misc.c.
Referenced by ecpg_log(), and ECPGdebug().
bool ecpg_internal_regression_mode = false |
Definition at line 29 of file misc.c.
Referenced by ecpg_get_data(), ecpg_log(), ECPGconnect(), and ECPGdebug().
struct var_list* ivlist = NULL |
Definition at line 535 of file misc.c.
Referenced by ecpg_finish(), ECPGget_var(), and ECPGset_var().
|
static |
Definition at line 63 of file misc.c.
Referenced by ecpg_log(), and ECPGdebug().
|
static |
Definition at line 29 of file misc.c.
Referenced by ecpg_init_sqlca().
|
static |
Definition at line 58 of file misc.c.
Referenced by ecpg_sqlca_key_init(), and ECPGget_sqlca().
|
static |
Definition at line 59 of file misc.c.
Referenced by ECPGget_sqlca().