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 "pg_config_paths.h"
#include "pgtypes_date.h"
#include "pgtypes_interval.h"
#include "pgtypes_numeric.h"
#include "pgtypes_timestamp.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)
 
static void ecpg_sqlca_key_destructor (void *arg)
 
static void ecpg_sqlca_key_init (void)
 
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 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_listivlist = NULL
 

Macro Definition Documentation

◆ LONG_LONG_MIN

#define LONG_LONG_MIN   LONGLONG_MIN

Definition at line 25 of file misc.c.

◆ 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 349 of file misc.c.

350 {
351  for (length--; length >= 0; length--)
352  if (ptr[length] != 0xff)
353  return false;
354 
355  return true;
356 }

Referenced by ECPGis_noind_null().

◆ ecpg_init()

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

Definition at line 73 of file misc.c.

74 {
75  struct sqlca_t *sqlca = ECPGget_sqlca();
76 
77  if (sqlca == NULL)
78  {
80  NULL);
81  return false;
82  }
83 
85  if (con == NULL)
86  {
88  connection_name ? connection_name : ecpg_gettext("NULL"));
89  return false;
90  }
91 
92  return true;
93 }
#define ECPG_OUT_OF_MEMORY
Definition: ecpgerrno.h:15
#define ECPG_NO_CONN
Definition: ecpgerrno.h:36
#define ecpg_gettext(x)
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
#define ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
Definition: error.c:13
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:108
void ecpg_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:67
#define sqlca
Definition: sqlca.h:59
Definition: sqlca.h:20

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().

◆ ecpg_init_sqlca()

void ecpg_init_sqlca ( struct sqlca_t sqlca)

Definition at line 67 of file misc.c.

68 {
69  memcpy((char *) sqlca, (char *) &sqlca_init, sizeof(struct sqlca_t));
70 }
static struct sqlca_t sqlca_init
Definition: misc.c:31

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().

◆ ecpg_log()

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

Definition at line 232 of file misc.c.

233 {
234  va_list ap;
235  struct sqlca_t *sqlca = ECPGget_sqlca();
236  const char *intl_format;
237  int bufsize;
238  char *fmt;
239 
240  /*
241  * For performance reasons, inspect simple_debug without taking the mutex.
242  * This could be problematic if fetching an int isn't atomic, but we
243  * assume that it is in many other places too.
244  */
245  if (!simple_debug)
246  return;
247 
248  /* localize the error message string */
249  intl_format = ecpg_gettext(format);
250 
251  /*
252  * Insert PID into the format, unless ecpg_internal_regression_mode is set
253  * (regression tests want unchanging output).
254  */
255  bufsize = strlen(intl_format) + 100;
256  fmt = (char *) malloc(bufsize);
257  if (fmt == NULL)
258  return;
259 
261  snprintf(fmt, bufsize, "[NO_PID]: %s", intl_format);
262  else
263  snprintf(fmt, bufsize, "[%d]: %s", (int) getpid(), intl_format);
264 
266 
267  /* Now that we hold the mutex, recheck simple_debug */
268  if (simple_debug)
269  {
270  va_start(ap, format);
271  vfprintf(debugstream, fmt, ap);
272  va_end(ap);
273 
274  /* dump out internal sqlca variables */
275  if (ecpg_internal_regression_mode && sqlca != NULL)
276  {
277  fprintf(debugstream, "[NO_PID]: sqlca: code: %ld, state: %s\n",
278  sqlca->sqlcode, sqlca->sqlstate);
279  }
280 
282  }
283 
285 
286  free(fmt);
287 }
#define free(a)
Definition: header.h:65
#define malloc(a)
Definition: header.h:50
#define bufsize
Definition: indent_globs.h:36
static pthread_mutex_t debug_mutex
Definition: misc.c:61
static FILE * debugstream
Definition: misc.c:64
static volatile int simple_debug
Definition: misc.c:63
bool ecpg_internal_regression_mode
Definition: misc.c:29
static void const char * fmt
static void const char fflush(stdout)
va_end(args)
vfprintf(stderr, fmt, args)
va_start(args, fmt)
static char format
#define snprintf
Definition: port.h:238
#define fprintf
Definition: port.h:242
int pthread_mutex_unlock(pthread_mutex_t *mp)
Definition: pthread-win32.c:60
int pthread_mutex_lock(pthread_mutex_t *mp)
Definition: pthread-win32.c:42

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().

◆ ecpg_sqlca_key_destructor()

static void ecpg_sqlca_key_destructor ( void *  arg)
static

Definition at line 96 of file misc.c.

97 {
98  free(arg); /* sqlca structure allocated in ECPGget_sqlca */
99 }
void * arg

References arg, and free.

Referenced by ecpg_sqlca_key_init().

◆ ecpg_sqlca_key_init()

static void ecpg_sqlca_key_init ( void  )
static

Definition at line 102 of file misc.c.

103 {
104  pthread_key_create(&sqlca_key, ecpg_sqlca_key_destructor);
105 }
static pthread_key_t sqlca_key
Definition: misc.c:58
static void ecpg_sqlca_key_destructor(void *arg)
Definition: misc.c:96

References ecpg_sqlca_key_destructor(), and sqlca_key.

Referenced by ECPGget_sqlca().

◆ ECPGdebug()

void ECPGdebug ( int  n,
FILE *  dbgs 
)

Definition at line 204 of file misc.c.

205 {
206  /* Interlock against concurrent executions of ECPGdebug() */
208 
209  /* Prevent ecpg_log() from printing while we change settings */
211 
212  if (n > 100)
213  {
215  simple_debug = n - 100;
216  }
217  else
218  simple_debug = n;
219 
220  debugstream = dbgs;
221 
222  /* We must release debug_mutex before invoking ecpg_log() ... */
224 
225  /* ... but keep holding debug_init_mutex to avoid racy printout */
226  ecpg_log("ECPGdebug: set to %d\n", simple_debug);
227 
229 }
static pthread_mutex_t debug_init_mutex
Definition: misc.c:62
void ecpg_log(const char *format,...)
Definition: misc.c:232

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

◆ ECPGget_sqlca()

struct sqlca_t* ECPGget_sqlca ( void  )

Definition at line 108 of file misc.c.

109 {
110  struct sqlca_t *sqlca;
111 
112  pthread_once(&sqlca_key_once, ecpg_sqlca_key_init);
113 
115  if (sqlca == NULL)
116  {
117  sqlca = malloc(sizeof(struct sqlca_t));
118  if (sqlca == NULL)
119  return NULL;
122  }
123  return sqlca;
124 }
static void ecpg_sqlca_key_init(void)
Definition: misc.c:102
static pthread_once_t sqlca_key_once
Definition: misc.c:59
void * pthread_getspecific(pthread_key_t key)
Definition: pthread-win32.c:29
void pthread_setspecific(pthread_key_t key, void *val)
Definition: pthread-win32.c:24

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().

◆ ECPGget_var()

void* ECPGget_var ( int  number)

Definition at line 591 of file misc.c.

592 {
593  struct var_list *ptr;
594 
595  for (ptr = ivlist; ptr != NULL && ptr->number != number; ptr = ptr->next);
596  return (ptr) ? ptr->pointer : NULL;
597 }
struct var_list * ivlist
Definition: misc.c:533
struct var_list * next
void * pointer

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

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

◆ ECPGis_noind_null()

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

Definition at line 359 of file misc.c.

360 {
361  switch (type)
362  {
363  case ECPGt_char:
364  case ECPGt_unsigned_char:
365  case ECPGt_string:
366  if (*((const char *) ptr) == '\0')
367  return true;
368  break;
369  case ECPGt_short:
371  if (*((const short int *) ptr) == SHRT_MIN)
372  return true;
373  break;
374  case ECPGt_int:
375  case ECPGt_unsigned_int:
376  if (*((const int *) ptr) == INT_MIN)
377  return true;
378  break;
379  case ECPGt_long:
380  case ECPGt_unsigned_long:
381  case ECPGt_date:
382  if (*((const long *) ptr) == LONG_MIN)
383  return true;
384  break;
385  case ECPGt_long_long:
387  if (*((const long long *) ptr) == LONG_LONG_MIN)
388  return true;
389  break;
390  case ECPGt_float:
391  return _check(ptr, sizeof(float));
392  break;
393  case ECPGt_double:
394  return _check(ptr, sizeof(double));
395  break;
396  case ECPGt_varchar:
397  if (*(((const struct ECPGgeneric_varchar *) ptr)->arr) == 0x00)
398  return true;
399  break;
400  case ECPGt_bytea:
401  if (((const struct ECPGgeneric_bytea *) ptr)->len == 0)
402  return true;
403  break;
404  case ECPGt_decimal:
405  if (((const decimal *) ptr)->sign == NUMERIC_NULL)
406  return true;
407  break;
408  case ECPGt_numeric:
409  if (((const numeric *) ptr)->sign == NUMERIC_NULL)
410  return true;
411  break;
412  case ECPGt_interval:
413  return _check(ptr, sizeof(interval));
414  break;
415  case ECPGt_timestamp:
416  return _check(ptr, sizeof(timestamp));
417  break;
418  default:
419  break;
420  }
421 
422  return false;
423 }
@ ECPGt_float
Definition: ecpgtype.h:47
@ ECPGt_long_long
Definition: ecpgtype.h:45
@ ECPGt_short
Definition: ecpgtype.h:43
@ ECPGt_decimal
Definition: ecpgtype.h:51
@ ECPGt_bytea
Definition: ecpgtype.h:67
@ ECPGt_numeric
Definition: ecpgtype.h:49
@ ECPGt_varchar
Definition: ecpgtype.h:48
@ ECPGt_timestamp
Definition: ecpgtype.h:54
@ ECPGt_unsigned_short
Definition: ecpgtype.h:43
@ ECPGt_int
Definition: ecpgtype.h:44
@ ECPGt_long
Definition: ecpgtype.h:44
@ ECPGt_unsigned_char
Definition: ecpgtype.h:43
@ ECPGt_double
Definition: ecpgtype.h:47
@ ECPGt_date
Definition: ecpgtype.h:53
@ ECPGt_interval
Definition: ecpgtype.h:55
@ ECPGt_unsigned_long
Definition: ecpgtype.h:44
@ ECPGt_unsigned_long_long
Definition: ecpgtype.h:45
@ ECPGt_unsigned_int
Definition: ecpgtype.h:44
@ ECPGt_char
Definition: ecpgtype.h:43
@ ECPGt_string
Definition: ecpgtype.h:65
char sign
Definition: informix.c:674
static bool _check(const unsigned char *ptr, int length)
Definition: misc.c:349
#define LONG_LONG_MIN
Definition: misc.c:25
const void size_t len
#define NUMERIC_NULL
int64 timestamp
const char * type

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().

◆ ECPGset_noind_null()

void ECPGset_noind_null ( enum ECPGttype  type,
void *  ptr 
)

Definition at line 290 of file misc.c.

291 {
292  switch (type)
293  {
294  case ECPGt_char:
295  case ECPGt_unsigned_char:
296  case ECPGt_string:
297  *((char *) ptr) = '\0';
298  break;
299  case ECPGt_short:
301  *((short int *) ptr) = SHRT_MIN;
302  break;
303  case ECPGt_int:
304  case ECPGt_unsigned_int:
305  *((int *) ptr) = INT_MIN;
306  break;
307  case ECPGt_long:
308  case ECPGt_unsigned_long:
309  case ECPGt_date:
310  *((long *) ptr) = LONG_MIN;
311  break;
312  case ECPGt_long_long:
314  *((long long *) ptr) = LONG_LONG_MIN;
315  break;
316  case ECPGt_float:
317  memset((char *) ptr, 0xff, sizeof(float));
318  break;
319  case ECPGt_double:
320  memset((char *) ptr, 0xff, sizeof(double));
321  break;
322  case ECPGt_varchar:
323  *(((struct ECPGgeneric_varchar *) ptr)->arr) = 0x00;
324  ((struct ECPGgeneric_varchar *) ptr)->len = 0;
325  break;
326  case ECPGt_bytea:
327  ((struct ECPGgeneric_bytea *) ptr)->len = 0;
328  break;
329  case ECPGt_decimal:
330  memset((char *) ptr, 0, sizeof(decimal));
331  ((decimal *) ptr)->sign = NUMERIC_NULL;
332  break;
333  case ECPGt_numeric:
334  memset((char *) ptr, 0, sizeof(numeric));
335  ((numeric *) ptr)->sign = NUMERIC_NULL;
336  break;
337  case ECPGt_interval:
338  memset((char *) ptr, 0xff, sizeof(interval));
339  break;
340  case ECPGt_timestamp:
341  memset((char *) ptr, 0xff, sizeof(timestamp));
342  break;
343  default:
344  break;
345  }
346 }

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().

◆ ECPGset_var()

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

Definition at line 536 of file misc.c.

537 {
538  struct var_list *ptr;
539 
540  struct sqlca_t *sqlca = ECPGget_sqlca();
541 
542  if (sqlca == NULL)
543  {
546  return;
547  }
548 
550 
551  for (ptr = ivlist; ptr != NULL; ptr = ptr->next)
552  {
553  if (ptr->number == number)
554  {
555  /* already known => just change pointer value */
556  ptr->pointer = pointer;
557  return;
558  }
559  }
560 
561  /* a new one has to be added */
562  ptr = (struct var_list *) calloc(1L, sizeof(struct var_list));
563  if (!ptr)
564  {
565  sqlca = ECPGget_sqlca();
566 
567  if (sqlca == NULL)
568  {
571  return;
572  }
573 
574  sqlca->sqlcode = ECPG_OUT_OF_MEMORY;
575  strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
576  snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc), "out of memory on line %d", lineno);
577  sqlca->sqlerrm.sqlerrml = strlen(sqlca->sqlerrm.sqlerrmc);
578  /* free all memory we have allocated for the user */
580  }
581  else
582  {
583  ptr->number = number;
584  ptr->pointer = pointer;
585  ptr->next = ivlist;
586  ivlist = ptr;
587  }
588 }
#define calloc(a, b)
Definition: header.h:55
void ECPGfree_auto_mem(void)
Definition: memory.c:131

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().

◆ ECPGstatus()

bool ECPGstatus ( int  lineno,
const char *  connection_name 
)

Definition at line 127 of file misc.c.

128 {
129  struct connection *con = ecpg_get_connection(connection_name);
130 
131  if (!ecpg_init(con, connection_name, lineno))
132  return false;
133 
134  /* are we connected? */
135  if (con->connection == NULL)
136  {
138  return false;
139  }
140 
141  return true;
142 }
struct connection * ecpg_get_connection(const char *connection_name)
Definition: connect.c:71
#define ECPG_NOT_CONN
Definition: ecpgerrno.h:37
#define ECPG_SQLSTATE_ECPG_INTERNAL_ERROR
bool ecpg_init(const struct connection *con, const char *connection_name, const int lineno)
Definition: misc.c:73
PGconn * connection

References connection::connection, ecpg_get_connection(), ecpg_init(), ECPG_NOT_CONN, ecpg_raise(), ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, and connection::name.

◆ ECPGtrans()

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

Definition at line 160 of file misc.c.

161 {
162  PGresult *res;
163  struct connection *con = ecpg_get_connection(connection_name);
164 
165  if (!ecpg_init(con, connection_name, lineno))
166  return false;
167 
168  ecpg_log("ECPGtrans on line %d: action \"%s\"; connection \"%s\"\n", lineno, transaction, con ? con->name : "null");
169 
170  /* if we have no connection we just simulate the command */
171  if (con && con->connection)
172  {
173  /*
174  * If we got a transaction command but have no open transaction, we
175  * have to start one, unless we are in autocommit, where the
176  * developers have to take care themselves. However, if the command is
177  * a begin statement, we just execute it once. And if the command is
178  * commit or rollback prepared, we don't execute it.
179  */
181  !con->autocommit &&
182  strncmp(transaction, "begin", 5) != 0 &&
183  strncmp(transaction, "start", 5) != 0 &&
184  strncmp(transaction, "commit prepared", 15) != 0 &&
185  strncmp(transaction, "rollback prepared", 17) != 0)
186  {
187  res = PQexec(con->connection, "begin transaction");
189  return false;
190  PQclear(res);
191  }
192 
193  res = PQexec(con->connection, transaction);
195  return false;
196  PQclear(res);
197  }
198 
199  return true;
200 }
bool ecpg_check_PQresult(PGresult *results, int lineno, PGconn *connection, enum COMPAT_MODE compat)
Definition: error.c:281
@ ECPG_COMPAT_PGSQL
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
Definition: fe-connect.c:7109
PGresult * PQexec(PGconn *conn, const char *query)
Definition: fe-exec.c:2262
@ PQTRANS_IDLE
Definition: libpq-fe.h:121

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().

◆ ECPGtransactionStatus()

PGTransactionStatusType ECPGtransactionStatus ( const char *  connection_name)

Definition at line 145 of file misc.c.

146 {
147  const struct connection *con;
148 
149  con = ecpg_get_connection(connection_name);
150  if (con == NULL)
151  {
152  /* transaction status is unknown */
153  return PQTRANS_UNKNOWN;
154  }
155 
156  return PQtransactionStatus(con->connection);
157 }
@ PQTRANS_UNKNOWN
Definition: libpq-fe.h:125

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

Variable Documentation

◆ debug_init_mutex

pthread_mutex_t debug_init_mutex = PTHREAD_MUTEX_INITIALIZER
static

Definition at line 62 of file misc.c.

Referenced by ECPGdebug().

◆ debug_mutex

Definition at line 61 of file misc.c.

Referenced by ecpg_log(), and ECPGdebug().

◆ debugstream

FILE* debugstream = NULL
static

Definition at line 64 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 533 of file misc.c.

Referenced by ecpg_finish(), ECPGget_var(), and ECPGset_var().

◆ simple_debug

volatile int simple_debug = 0
static

Definition at line 63 of file misc.c.

Referenced by ecpg_log(), and ECPGdebug().

◆ 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 at line 29 of file misc.c.

Referenced by ecpg_init_sqlca().

◆ sqlca_key

pthread_key_t sqlca_key
static

Definition at line 58 of file misc.c.

Referenced by ecpg_sqlca_key_init(), and ECPGget_sqlca().

◆ sqlca_key_once

pthread_once_t sqlca_key_once = PTHREAD_ONCE_INIT
static

Definition at line 59 of file misc.c.

Referenced by ECPGget_sqlca().