PostgreSQL Source Code  git master
misc.c File Reference
#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 "pgtypes_date.h"
#include "pgtypes_interval.h"
#include "pgtypes_numeric.h"
#include "pgtypes_timestamp.h"
#include "pg_config_paths.h"
#include "sqlca.h"
Include dependency graph for misc.c:

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)
 
struct sqlca_tECPGget_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 struct sqlca_t sqlca
 
static int simple_debug = 0
 
static FILE * debugstream = NULL
 
struct var_listivlist = NULL
 

Macro Definition Documentation

◆ LONG_LONG_MIN

#define LONG_LONG_MIN   LONGLONG_MIN

Definition at line 25 of file misc.c.

Referenced by ECPGis_noind_null(), and ECPGset_noind_null().

◆ POSTGRES_ECPG_INTERNAL

#define POSTGRES_ECPG_INTERNAL

Definition at line 3 of file misc.c.

Function Documentation

◆ _check()

static bool _check ( const unsigned char *  ptr,
int  length 
)
static

Definition at line 378 of file misc.c.

Referenced by ECPGis_noind_null().

379 {
380  for (length--; length >= 0; length--)
381  if (ptr[length] != 0xff)
382  return false;
383 
384  return true;
385 }

◆ ecpg_init()

bool ecpg_init ( const struct connection con,
const char *  connection_name,
const int  lineno 
)

Definition at line 104 of file misc.c.

References arg, 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 free.

Referenced by ecpg_do_prologue(), ECPGdeallocate(), ECPGdisconnect(), ECPGprepare(), ECPGsetcommit(), ECPGsetconn(), ECPGstatus(), and ECPGtrans().

105 {
106  struct sqlca_t *sqlca = ECPGget_sqlca();
107 
108  if (sqlca == NULL)
109  {
111  NULL);
112  return false;
113  }
114 
115  ecpg_init_sqlca(sqlca);
116  if (con == NULL)
117  {
119  connection_name ? connection_name : ecpg_gettext("NULL"));
120  return false;
121  }
122 
123  return true;
124 }
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
Definition: error.c:13
void ecpg_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:98
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
#define ecpg_gettext(x)
#define ECPG_OUT_OF_MEMORY
Definition: ecpgerrno.h:15
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:141
Definition: sqlca.h:19
#define ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST
static struct sqlca_t sqlca
Definition: misc.c:62
#define ECPG_NO_CONN
Definition: ecpgerrno.h:36

◆ ecpg_init_sqlca()

void ecpg_init_sqlca ( struct sqlca_t sqlca)

Definition at line 98 of file misc.c.

Referenced by ecpg_init(), ECPGallocate_desc(), ECPGconnect(), ECPGdeallocate_desc(), ECPGdisconnect(), ECPGget_desc(), ECPGget_desc_header(), ECPGget_sqlca(), and ECPGset_var().

99 {
100  memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
101 }
Definition: sqlca.h:19
static struct sqlca_t sqlca_init
Definition: misc.c:31

◆ ecpg_log()

void ecpg_log ( const char *  format,
  ... 
)

Definition at line 266 of file misc.c.

References debugstream, ecpg_gettext, ecpg_internal_regression_mode, ECPGget_sqlca(), fprintf, free, malloc, pthread_mutex_lock(), pthread_mutex_unlock(), simple_debug, snprintf, sqlca_t::sqlcode, sqlca_t::sqlstate, and vfprintf.

Referenced by ECPGdebug(), and ECPGtrans().

267 {
268  va_list ap;
269  struct sqlca_t *sqlca = ECPGget_sqlca();
270  const char *intl_format;
271  int bufsize;
272  char *fmt;
273 
274  if (!simple_debug)
275  return;
276 
277  /* localize the error message string */
278  intl_format = ecpg_gettext(format);
279 
280  /*
281  * Insert PID into the format, unless ecpg_internal_regression_mode is set
282  * (regression tests want unchanging output).
283  */
284  bufsize = strlen(intl_format) + 100;
285  fmt = (char *) malloc(bufsize);
286  if (fmt == NULL)
287  return;
288 
290  snprintf(fmt, bufsize, "[NO_PID]: %s", intl_format);
291  else
292  snprintf(fmt, bufsize, "[%d]: %s", (int) getpid(), intl_format);
293 
294 #ifdef ENABLE_THREAD_SAFETY
295  pthread_mutex_lock(&debug_mutex);
296 #endif
297 
298  va_start(ap, format);
299  vfprintf(debugstream, fmt, ap);
300  va_end(ap);
301 
302  /* dump out internal sqlca variables */
303  if (ecpg_internal_regression_mode && sqlca != NULL)
304  {
305  fprintf(debugstream, "[NO_PID]: sqlca: code: %ld, state: %s\n",
306  sqlca->sqlcode, sqlca->sqlstate);
307  }
308 
309  fflush(debugstream);
310 
311 #ifdef ENABLE_THREAD_SAFETY
312  pthread_mutex_unlock(&debug_mutex);
313 #endif
314 
315  free(fmt);
316 }
#define fprintf
Definition: port.h:196
#define malloc(a)
Definition: header.h:50
#define ecpg_gettext(x)
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:141
Definition: sqlca.h:19
int pthread_mutex_lock(pthread_mutex_t *mp)
Definition: pthread-win32.c:45
static int simple_debug
Definition: misc.c:94
char sqlstate[5]
Definition: sqlca.h:53
int pthread_mutex_unlock(pthread_mutex_t *mp)
Definition: pthread-win32.c:54
long sqlcode
Definition: sqlca.h:23
static FILE * debugstream
Definition: misc.c:95
#define free(a)
Definition: header.h:65
static struct sqlca_t sqlca
Definition: misc.c:62
bool ecpg_internal_regression_mode
Definition: misc.c:29
static char format
Definition: pg_basebackup.c:85
#define vfprintf
Definition: port.h:195
#define snprintf
Definition: port.h:192

◆ ECPGdebug()

void ECPGdebug ( int  n,
FILE *  dbgs 
)

Definition at line 242 of file misc.c.

References debugstream, ecpg_internal_regression_mode, ecpg_log(), pthread_mutex_lock(), pthread_mutex_unlock(), and simple_debug.

243 {
244 #ifdef ENABLE_THREAD_SAFETY
245  pthread_mutex_lock(&debug_init_mutex);
246 #endif
247 
248  if (n > 100)
249  {
251  simple_debug = n - 100;
252  }
253  else
254  simple_debug = n;
255 
256  debugstream = dbgs;
257 
258  ecpg_log("ECPGdebug: set to %d\n", simple_debug);
259 
260 #ifdef ENABLE_THREAD_SAFETY
261  pthread_mutex_unlock(&debug_init_mutex);
262 #endif
263 }
int pthread_mutex_lock(pthread_mutex_t *mp)
Definition: pthread-win32.c:45
static int simple_debug
Definition: misc.c:94
int pthread_mutex_unlock(pthread_mutex_t *mp)
Definition: pthread-win32.c:54
static FILE * debugstream
Definition: misc.c:95
void ecpg_log(const char *format,...)
Definition: misc.c:266
bool ecpg_internal_regression_mode
Definition: misc.c:29

◆ ECPGget_sqlca()

struct sqlca_t* ECPGget_sqlca ( void  )

Definition at line 141 of file misc.c.

References ecpg_init_sqlca(), malloc, pthread_getspecific(), pthread_setspecific(), and sqlca.

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(), main(), and sqlprint().

142 {
143 #ifdef ENABLE_THREAD_SAFETY
144  struct sqlca_t *sqlca;
145 
146  pthread_once(&sqlca_key_once, ecpg_sqlca_key_init);
147 
148  sqlca = pthread_getspecific(sqlca_key);
149  if (sqlca == NULL)
150  {
151  sqlca = malloc(sizeof(struct sqlca_t));
152  if (sqlca == NULL)
153  return NULL;
154  ecpg_init_sqlca(sqlca);
155  pthread_setspecific(sqlca_key, sqlca);
156  }
157  return sqlca;
158 #else
159  return &sqlca;
160 #endif
161 }
void ecpg_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:98
#define malloc(a)
Definition: header.h:50
Definition: sqlca.h:19
void * pthread_getspecific(pthread_key_t key)
Definition: pthread-win32.c:29
static struct sqlca_t sqlca
Definition: misc.c:62
void pthread_setspecific(pthread_key_t key, void *val)
Definition: pthread-win32.c:24

◆ ECPGget_var()

void* ECPGget_var ( int  number)

Definition at line 581 of file misc.c.

References var_list::next, var_list::number, and var_list::pointer.

Referenced by ECPG_informix_get_var(), get_record1(), open_cur1(), and openit().

582 {
583  struct var_list *ptr;
584 
585  for (ptr = ivlist; ptr != NULL && ptr->number != number; ptr = ptr->next);
586  return (ptr) ? ptr->pointer : NULL;
587 }
struct var_list * next
void * pointer
struct var_list * ivlist
Definition: misc.c:523

◆ ECPGis_noind_null()

bool ECPGis_noind_null ( enum ECPGttype  type,
const void *  ptr 
)

Definition at line 388 of file misc.c.

References _check(), ECPGgeneric_bytea::arr, dgettext, ecpg_gettext, 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, fn(), ECPGgeneric_bytea::len, LONG_LONG_MIN, NUMERIC_NULL, PG_TEXTDOMAIN, pthread_mutex_lock(), pthread_mutex_unlock(), and sign.

Referenced by ecpg_store_input(), and risnull().

389 {
390  switch (type)
391  {
392  case ECPGt_char:
393  case ECPGt_unsigned_char:
394  case ECPGt_string:
395  if (*((const char *) ptr) == '\0')
396  return true;
397  break;
398  case ECPGt_short:
400  if (*((const short int *) ptr) == SHRT_MIN)
401  return true;
402  break;
403  case ECPGt_int:
404  case ECPGt_unsigned_int:
405  if (*((const int *) ptr) == INT_MIN)
406  return true;
407  break;
408  case ECPGt_long:
409  case ECPGt_unsigned_long:
410  case ECPGt_date:
411  if (*((const long *) ptr) == LONG_MIN)
412  return true;
413  break;
414  case ECPGt_long_long:
416  if (*((const long long *) ptr) == LONG_LONG_MIN)
417  return true;
418  break;
419  case ECPGt_float:
420  return _check(ptr, sizeof(float));
421  break;
422  case ECPGt_double:
423  return _check(ptr, sizeof(double));
424  break;
425  case ECPGt_varchar:
426  if (*(((const struct ECPGgeneric_varchar *) ptr)->arr) == 0x00)
427  return true;
428  break;
429  case ECPGt_bytea:
430  if (((const struct ECPGgeneric_bytea *) ptr)->len == 0)
431  return true;
432  break;
433  case ECPGt_decimal:
434  if (((const decimal *) ptr)->sign == NUMERIC_NULL)
435  return true;
436  break;
437  case ECPGt_numeric:
438  if (((const numeric *) ptr)->sign == NUMERIC_NULL)
439  return true;
440  break;
441  case ECPGt_interval:
442  return _check(ptr, sizeof(interval));
443  break;
444  case ECPGt_timestamp:
445  return _check(ptr, sizeof(timestamp));
446  break;
447  default:
448  break;
449  }
450 
451  return false;
452 }
#define LONG_LONG_MIN
Definition: misc.c:25
int64 timestamp
#define NUMERIC_NULL
static bool _check(const unsigned char *ptr, int length)
Definition: misc.c:378
char sign
Definition: informix.c:688

◆ ECPGset_noind_null()

void ECPGset_noind_null ( enum ECPGttype  type,
void *  ptr 
)

Definition at line 319 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, and NUMERIC_NULL.

Referenced by ecpg_get_data(), ecpg_set_compat_sqlda(), ecpg_set_native_sqlda(), and rsetnull().

320 {
321  switch (type)
322  {
323  case ECPGt_char:
324  case ECPGt_unsigned_char:
325  case ECPGt_string:
326  *((char *) ptr) = '\0';
327  break;
328  case ECPGt_short:
330  *((short int *) ptr) = SHRT_MIN;
331  break;
332  case ECPGt_int:
333  case ECPGt_unsigned_int:
334  *((int *) ptr) = INT_MIN;
335  break;
336  case ECPGt_long:
337  case ECPGt_unsigned_long:
338  case ECPGt_date:
339  *((long *) ptr) = LONG_MIN;
340  break;
341  case ECPGt_long_long:
343  *((long long *) ptr) = LONG_LONG_MIN;
344  break;
345  case ECPGt_float:
346  memset((char *) ptr, 0xff, sizeof(float));
347  break;
348  case ECPGt_double:
349  memset((char *) ptr, 0xff, sizeof(double));
350  break;
351  case ECPGt_varchar:
352  *(((struct ECPGgeneric_varchar *) ptr)->arr) = 0x00;
353  ((struct ECPGgeneric_varchar *) ptr)->len = 0;
354  break;
355  case ECPGt_bytea:
356  ((struct ECPGgeneric_bytea *) ptr)->len = 0;
357  break;
358  case ECPGt_decimal:
359  memset((char *) ptr, 0, sizeof(decimal));
360  ((decimal *) ptr)->sign = NUMERIC_NULL;
361  break;
362  case ECPGt_numeric:
363  memset((char *) ptr, 0, sizeof(numeric));
364  ((numeric *) ptr)->sign = NUMERIC_NULL;
365  break;
366  case ECPGt_interval:
367  memset((char *) ptr, 0xff, sizeof(interval));
368  break;
369  case ECPGt_timestamp:
370  memset((char *) ptr, 0xff, sizeof(timestamp));
371  break;
372  default:
373  break;
374  }
375 }
#define LONG_LONG_MIN
Definition: misc.c:25
int64 timestamp
#define NUMERIC_NULL

◆ ECPGset_var()

void ECPGset_var ( int  number,
void *  pointer,
int  lineno 
)

Definition at line 526 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, sqlca_t::sqlcode, sqlca_t::sqlerrm, sqlca_t::sqlerrmc, sqlca_t::sqlerrml, and sqlca_t::sqlstate.

Referenced by ECPG_informix_set_var(), get_var1(), and main().

527 {
528  struct var_list *ptr;
529 
530  struct sqlca_t *sqlca = ECPGget_sqlca();
531 
532  if (sqlca == NULL)
533  {
536  return;
537  }
538 
539  ecpg_init_sqlca(sqlca);
540 
541  for (ptr = ivlist; ptr != NULL; ptr = ptr->next)
542  {
543  if (ptr->number == number)
544  {
545  /* already known => just change pointer value */
546  ptr->pointer = pointer;
547  return;
548  }
549  }
550 
551  /* a new one has to be added */
552  ptr = (struct var_list *) calloc(1L, sizeof(struct var_list));
553  if (!ptr)
554  {
555  struct sqlca_t *sqlca = ECPGget_sqlca();
556 
557  if (sqlca == NULL)
558  {
561  return;
562  }
563 
564  sqlca->sqlcode = ECPG_OUT_OF_MEMORY;
565  strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
566  snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc), "out of memory on line %d", lineno);
567  sqlca->sqlerrm.sqlerrml = strlen(sqlca->sqlerrm.sqlerrmc);
568  /* free all memory we have allocated for the user */
570  }
571  else
572  {
573  ptr->number = number;
574  ptr->pointer = pointer;
575  ptr->next = ivlist;
576  ivlist = ptr;
577  }
578 }
#define calloc(a, b)
Definition: header.h:55
struct var_list * next
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
Definition: error.c:13
void ECPGfree_auto_mem(void)
Definition: memory.c:138
void * pointer
void ecpg_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:98
int sqlerrml
Definition: sqlca.h:26
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
#define ECPG_OUT_OF_MEMORY
Definition: ecpgerrno.h:15
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:141
Definition: sqlca.h:19
char sqlstate[5]
Definition: sqlca.h:53
long sqlcode
Definition: sqlca.h:23
static struct sqlca_t sqlca
Definition: misc.c:62
struct sqlca_t::@148 sqlerrm
char sqlerrmc[SQLERRMC_LEN]
Definition: sqlca.h:27
#define snprintf
Definition: port.h:192
struct var_list * ivlist
Definition: misc.c:523

◆ ECPGstatus()

bool ECPGstatus ( int  lineno,
const char *  connection_name 
)

Definition at line 164 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.

165 {
166  struct connection *con = ecpg_get_connection(connection_name);
167 
168  if (!ecpg_init(con, connection_name, lineno))
169  return false;
170 
171  /* are we connected? */
172  if (con->connection == NULL)
173  {
175  return false;
176  }
177 
178  return true;
179 }
#define ECPG_NOT_CONN
Definition: ecpgerrno.h:37
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
Definition: error.c:13
PGconn * connection
bool ecpg_init(const struct connection *con, const char *connection_name, const int lineno)
Definition: misc.c:104
struct connection * ecpg_get_connection(const char *connection_name)
Definition: connect.c:74

◆ ECPGtrans()

bool ECPGtrans ( int  lineno,
const char *  connection_name,
const char *  transaction 
)

Definition at line 198 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, and PQtransactionStatus().

Referenced by main(), and sql_check().

199 {
200  PGresult *res;
201  struct connection *con = ecpg_get_connection(connection_name);
202 
203  if (!ecpg_init(con, connection_name, lineno))
204  return false;
205 
206  ecpg_log("ECPGtrans on line %d: action \"%s\"; connection \"%s\"\n", lineno, transaction, con ? con->name : "null");
207 
208  /* if we have no connection we just simulate the command */
209  if (con && con->connection)
210  {
211  /*
212  * If we got a transaction command but have no open transaction, we
213  * have to start one, unless we are in autocommit, where the
214  * developers have to take care themselves. However, if the command is
215  * a begin statement, we just execute it once. And if the command is
216  * commit or rollback prepared, we don't execute it.
217  */
219  !con->autocommit &&
220  strncmp(transaction, "begin", 5) != 0 &&
221  strncmp(transaction, "start", 5) != 0 &&
222  strncmp(transaction, "commit prepared", 15) != 0 &&
223  strncmp(transaction, "rollback prepared", 17) != 0)
224  {
225  res = PQexec(con->connection, "begin transaction");
226  if (!ecpg_check_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
227  return false;
228  PQclear(res);
229  }
230 
231  res = PQexec(con->connection, transaction);
232  if (!ecpg_check_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
233  return false;
234  PQclear(res);
235  }
236 
237  return true;
238 }
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
Definition: fe-connect.c:6572
void ecpg_log(const char *format,...)
Definition: misc.c:266
void PQclear(PGresult *res)
Definition: fe-exec.c:694
bool ecpg_check_PQresult(PGresult *, int, PGconn *, enum COMPAT_MODE)
Definition: error.c:283
PGconn * connection
bool ecpg_init(const struct connection *con, const char *connection_name, const int lineno)
Definition: misc.c:104
struct connection * ecpg_get_connection(const char *connection_name)
Definition: connect.c:74
PGresult * PQexec(PGconn *conn, const char *query)
Definition: fe-exec.c:1939

◆ ECPGtransactionStatus()

PGTransactionStatusType ECPGtransactionStatus ( const char *  connection_name)

Definition at line 182 of file misc.c.

References connection::connection, ecpg_get_connection(), PQTRANS_UNKNOWN, and PQtransactionStatus().

183 {
184  const struct connection *con;
185 
186  con = ecpg_get_connection(connection_name);
187  if (con == NULL)
188  {
189  /* transaction status is unknown */
190  return PQTRANS_UNKNOWN;
191  }
192 
193  return PQtransactionStatus(con->connection);
194 
195 }
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
Definition: fe-connect.c:6572
PGconn * connection
struct connection * ecpg_get_connection(const char *connection_name)
Definition: connect.c:74

Variable Documentation

◆ debugstream

FILE* debugstream = NULL
static

Definition at line 95 of file misc.c.

Referenced by ecpg_log(), and ECPGdebug().

◆ ecpg_internal_regression_mode

bool ecpg_internal_regression_mode = false

Definition at line 29 of file misc.c.

Referenced by ecpg_get_data(), ecpg_log(), ECPGconnect(), and ECPGdebug().

◆ ivlist

struct var_list* ivlist = NULL

Definition at line 523 of file misc.c.

Referenced by ecpg_finish(), and ECPGset_var().

◆ simple_debug

int simple_debug = 0
static

Definition at line 94 of file misc.c.

Referenced by ecpg_log(), and ECPGdebug().

◆ sqlca

struct sqlca_t sqlca
static
Initial value:
=
{
{
'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '
},
sizeof(struct sqlca_t),
0,
{
0,
{
0
}
},
{
'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '
},
{
0, 0, 0, 0, 0, 0
},
{
0, 0, 0, 0, 0, 0, 0, 0
},
{
'0', '0', '0', '0', '0'
}
}
Definition: sqlca.h:19

Definition at line 62 of file misc.c.

Referenced by ECPGget_sqlca().

◆ sqlca_init

struct sqlca_t sqlca_init
static
Initial value:
=
{
{
'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '
},
sizeof(struct sqlca_t),
0,
{
0,
{
0
}
},
{
'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '
},
{
0, 0, 0, 0, 0, 0
},
{
0, 0, 0, 0, 0, 0, 0, 0
},
{
'0', '0', '0', '0', '0'
}
}
Definition: sqlca.h:19

Definition at line 31 of file misc.c.