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 "ecpgtype.h"
#include "ecpglib.h"
#include "ecpgerrno.h"
#include "ecpglib_extern.h"
#include "sqlca.h"
#include "pgtypes_numeric.h"
#include "pgtypes_date.h"
#include "pgtypes_timestamp.h"
#include "pgtypes_interval.h"
#include "pg_config_paths.h"
Include dependency graph for misc.c:

Go to the source code of this file.

Macros

#define POSTGRES_ECPG_INTERNAL
 

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

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

Referenced by ECPGis_noind_null().

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

◆ ecpg_init()

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

Definition at line 105 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(), ecpg_register_prepared_stmt(), ECPGdeallocate(), ECPGdeclare(), ECPGdisconnect(), ECPGprepare(), ECPGsetcommit(), ECPGsetconn(), ECPGstatus(), and ECPGtrans().

106 {
107  struct sqlca_t *sqlca = ECPGget_sqlca();
108 
109  if (sqlca == NULL)
110  {
112  NULL);
113  return false;
114  }
115 
116  ecpg_init_sqlca(sqlca);
117  if (con == NULL)
118  {
120  connection_name ? connection_name : ecpg_gettext("NULL"));
121  return false;
122  }
123 
124  return true;
125 }
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:99
#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:142
Definition: sqlca.h:19
#define ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST
#define ecpg_gettext(x)
Definition: ecpglib.h:18
static struct sqlca_t sqlca
Definition: misc.c:63
#define ECPG_NO_CONN
Definition: ecpgerrno.h:36

◆ ecpg_init_sqlca()

void ecpg_init_sqlca ( struct sqlca_t sqlca)

Definition at line 99 of file misc.c.

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

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

◆ ecpg_log()

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

Definition at line 267 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().

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

◆ ECPGdebug()

void ECPGdebug ( int  n,
FILE *  dbgs 
)

Definition at line 243 of file misc.c.

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

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

◆ ECPGget_sqlca()

struct sqlca_t* ECPGget_sqlca ( void  )

Definition at line 142 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().

143 {
144 #ifdef ENABLE_THREAD_SAFETY
145  struct sqlca_t *sqlca;
146 
147  pthread_once(&sqlca_key_once, ecpg_sqlca_key_init);
148 
149  sqlca = pthread_getspecific(sqlca_key);
150  if (sqlca == NULL)
151  {
152  sqlca = malloc(sizeof(struct sqlca_t));
153  if (sqlca == NULL)
154  return NULL;
155  ecpg_init_sqlca(sqlca);
156  pthread_setspecific(sqlca_key, sqlca);
157  }
158  return sqlca;
159 #else
160  return &sqlca;
161 #endif
162 }
void ecpg_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:99
#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:63
void pthread_setspecific(pthread_key_t key, void *val)
Definition: pthread-win32.c:24

◆ ECPGget_var()

void* ECPGget_var ( int  number)

Definition at line 586 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().

587 {
588  struct var_list *ptr;
589 
590  for (ptr = ivlist; ptr != NULL && ptr->number != number; ptr = ptr->next);
591  return (ptr) ? ptr->pointer : NULL;
592 }
struct var_list * next
void * pointer
struct var_list * ivlist
Definition: misc.c:528

◆ ECPGis_noind_null()

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

Definition at line 391 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, FALSE, fn(), ECPGgeneric_bytea::len, NUMERIC_NULL, PG_TEXTDOMAIN, pthread_mutex_lock(), pthread_mutex_unlock(), and sign.

Referenced by ecpg_store_input(), and risnull().

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

◆ ECPGset_noind_null()

void ECPGset_noind_null ( enum ECPGttype  type,
void *  ptr 
)

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

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

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

◆ ECPGset_var()

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

Definition at line 531 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().

532 {
533  struct var_list *ptr;
534 
535  struct sqlca_t *sqlca = ECPGget_sqlca();
536 
537  if (sqlca == NULL)
538  {
541  return;
542  }
543 
544  ecpg_init_sqlca(sqlca);
545 
546  for (ptr = ivlist; ptr != NULL; ptr = ptr->next)
547  {
548  if (ptr->number == number)
549  {
550  /* already known => just change pointer value */
551  ptr->pointer = pointer;
552  return;
553  }
554  }
555 
556  /* a new one has to be added */
557  ptr = (struct var_list *) calloc(1L, sizeof(struct var_list));
558  if (!ptr)
559  {
560  struct sqlca_t *sqlca = ECPGget_sqlca();
561 
562  if (sqlca == NULL)
563  {
566  return;
567  }
568 
569  sqlca->sqlcode = ECPG_OUT_OF_MEMORY;
570  strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
571  snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc), "out of memory on line %d", lineno);
572  sqlca->sqlerrm.sqlerrml = strlen(sqlca->sqlerrm.sqlerrmc);
573  /* free all memory we have allocated for the user */
575  }
576  else
577  {
578  ptr->number = number;
579  ptr->pointer = pointer;
580  ptr->next = ivlist;
581  ivlist = ptr;
582  }
583 }
#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:99
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:142
Definition: sqlca.h:19
char sqlstate[5]
Definition: sqlca.h:53
long sqlcode
Definition: sqlca.h:23
struct sqlca_t::@147 sqlerrm
static struct sqlca_t sqlca
Definition: misc.c:63
char sqlerrmc[SQLERRMC_LEN]
Definition: sqlca.h:27
#define snprintf
Definition: port.h:192
struct var_list * ivlist
Definition: misc.c:528

◆ ECPGstatus()

bool ECPGstatus ( int  lineno,
const char *  connection_name 
)

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

166 {
167  struct connection *con = ecpg_get_connection(connection_name);
168 
169  if (!ecpg_init(con, connection_name, lineno))
170  return false;
171 
172  /* are we connected? */
173  if (con->connection == NULL)
174  {
176  return false;
177  }
178 
179  return true;
180 }
#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:105
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 199 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 commitTable(), main(), and sql_check().

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

◆ ECPGtransactionStatus()

PGTransactionStatusType ECPGtransactionStatus ( const char *  connection_name)

Definition at line 183 of file misc.c.

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

184 {
185  const struct connection *con;
186 
187  con = ecpg_get_connection(connection_name);
188  if (con == NULL)
189  {
190  /* transaction status is unknown */
191  return PQTRANS_UNKNOWN;
192  }
193 
194  return PQtransactionStatus(con->connection);
195 
196 }
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
Definition: fe-connect.c:6516
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 96 of file misc.c.

Referenced by ecpg_log(), and ECPGdebug().

◆ ecpg_internal_regression_mode

bool ecpg_internal_regression_mode = false

Definition at line 30 of file misc.c.

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

◆ ivlist

struct var_list* ivlist = NULL

Definition at line 528 of file misc.c.

Referenced by ecpg_finish(), and ECPGset_var().

◆ simple_debug

int simple_debug = 0
static

Definition at line 95 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 63 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 32 of file misc.c.