PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 "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 (unsigned char *ptr, int length)
 
bool ECPGis_noind_null (enum ECPGttype type, 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

#define POSTGRES_ECPG_INTERNAL

Definition at line 3 of file misc.c.

Function Documentation

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

Definition at line 372 of file misc.c.

Referenced by ECPGis_noind_null().

373 {
374  for (length--; length >= 0; length--)
375  if (ptr[length] != 0xff)
376  return false;
377 
378  return true;
379 }
int length(const List *list)
Definition: list.c:1271
bool ecpg_init ( const struct connection con,
const char *  connection_name,
const int  lineno 
)

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

Referenced by ecpg_do_prologue(), ECPGdeallocate(), 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_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:99
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
Definition: extern.h:221
#define ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST
Definition: extern.h:206
#define ECPG_OUT_OF_MEMORY
Definition: ecpgerrno.h:15
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:142
Definition: sqlca.h:19
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
Definition: error.c:13
#define ecpg_gettext(x)
Definition: ecpglib.h:18
#define NULL
Definition: c.h:226
static struct sqlca_t sqlca
Definition: misc.c:63
#define ECPG_NO_CONN
Definition: ecpgerrno.h:36
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(), and ECPGget_sqlca().

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
void ecpg_log ( const char *  format,
  ... 
)

Definition at line 261 of file misc.c.

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

Referenced by ECPGdebug(), and ECPGtrans().

262 {
263  va_list ap;
264  struct sqlca_t *sqlca = ECPGget_sqlca();
265  const char *intl_format;
266  int bufsize;
267  char *fmt;
268 
269  if (!simple_debug)
270  return;
271 
272  /* localize the error message string */
273  intl_format = ecpg_gettext(format);
274 
275  /*
276  * Insert PID into the format, unless ecpg_internal_regression_mode is set
277  * (regression tests want unchanging output).
278  */
279  bufsize = strlen(intl_format) + 100;
280  fmt = (char *) malloc(bufsize);
281  if (fmt == NULL)
282  return;
283 
285  snprintf(fmt, bufsize, "[NO_PID]: %s", intl_format);
286  else
287  snprintf(fmt, bufsize, "[%d]: %s", (int) getpid(), intl_format);
288 
289 #ifdef ENABLE_THREAD_SAFETY
290  pthread_mutex_lock(&debug_mutex);
291 #endif
292 
293  va_start(ap, format);
294  vfprintf(debugstream, fmt, ap);
295  va_end(ap);
296 
297  /* dump out internal sqlca variables */
298  if (ecpg_internal_regression_mode && sqlca != NULL)
299  {
300  fprintf(debugstream, "[NO_PID]: sqlca: code: %ld, state: %s\n",
301  sqlca->sqlcode, sqlca->sqlstate);
302  }
303 
304  fflush(debugstream);
305 
306 #ifdef ENABLE_THREAD_SAFETY
307  pthread_mutex_unlock(&debug_mutex);
308 #endif
309 
310  free(fmt);
311 }
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
#define malloc(a)
Definition: header.h:45
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:46
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:55
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:60
#define NULL
Definition: c.h:226
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:83
void ECPGdebug ( int  n,
FILE *  dbgs 
)

Definition at line 237 of file misc.c.

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

238 {
239 #ifdef ENABLE_THREAD_SAFETY
240  pthread_mutex_lock(&debug_init_mutex);
241 #endif
242 
243  if (n > 100)
244  {
246  simple_debug = n - 100;
247  }
248  else
249  simple_debug = n;
250 
251  debugstream = dbgs;
252 
253  ecpg_log("ECPGdebug: set to %d\n", simple_debug);
254 
255 #ifdef ENABLE_THREAD_SAFETY
256  pthread_mutex_unlock(&debug_init_mutex);
257 #endif
258 }
int pthread_mutex_lock(pthread_mutex_t *mp)
Definition: pthread-win32.c:46
static int simple_debug
Definition: misc.c:95
int pthread_mutex_unlock(pthread_mutex_t *mp)
Definition: pthread-win32.c:55
static FILE * debugstream
Definition: misc.c:96
void ecpg_log(const char *format,...)
Definition: misc.c:261
bool ecpg_internal_regression_mode
Definition: misc.c:30
struct sqlca_t* ECPGget_sqlca ( void  )

Definition at line 142 of file misc.c.

References ecpg_init_sqlca(), malloc, NULL, 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(), 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:45
Definition: sqlca.h:19
#define NULL
Definition: c.h:226
void * pthread_getspecific(pthread_key_t key)
Definition: pthread-win32.c:30
static struct sqlca_t sqlca
Definition: misc.c:63
void pthread_setspecific(pthread_key_t key, void *val)
Definition: pthread-win32.c:25
void* ECPGget_var ( int  number)

Definition at line 562 of file misc.c.

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

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

563 {
564  struct var_list *ptr;
565 
566  for (ptr = ivlist; ptr != NULL && ptr->number != number; ptr = ptr->next);
567  return (ptr) ? ptr->pointer : NULL;
568 }
struct var_list * next
Definition: extern.h:132
void * pointer
Definition: extern.h:131
int number
Definition: extern.h:130
#define NULL
Definition: c.h:226
struct var_list * ivlist
Definition: misc.c:515
bool ECPGis_noind_null ( enum ECPGttype  type,
void *  ptr 
)

Definition at line 382 of file misc.c.

References _check(), ECPGgeneric_varchar::arr, 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, NUMERIC_NULL, and sign.

Referenced by ecpg_store_input(), and risnull().

383 {
384  switch (type)
385  {
386  case ECPGt_char:
387  case ECPGt_unsigned_char:
388  case ECPGt_string:
389  if (*((char *) ptr) == '\0')
390  return true;
391  break;
392  case ECPGt_short:
394  if (*((short int *) ptr) == SHRT_MIN)
395  return true;
396  break;
397  case ECPGt_int:
398  case ECPGt_unsigned_int:
399  if (*((int *) ptr) == INT_MIN)
400  return true;
401  break;
402  case ECPGt_long:
403  case ECPGt_unsigned_long:
404  case ECPGt_date:
405  if (*((long *) ptr) == LONG_MIN)
406  return true;
407  break;
408 #ifdef HAVE_LONG_LONG_INT
409  case ECPGt_long_long:
411  if (*((long long *) ptr) == LONG_LONG_MIN)
412  return true;
413  break;
414 #endif /* HAVE_LONG_LONG_INT */
415  case ECPGt_float:
416  return (_check(ptr, sizeof(float)));
417  break;
418  case ECPGt_double:
419  return (_check(ptr, sizeof(double)));
420  break;
421  case ECPGt_varchar:
422  if (*(((struct ECPGgeneric_varchar *) ptr)->arr) == 0x00)
423  return true;
424  break;
425  case ECPGt_decimal:
426  if (((decimal *) ptr)->sign == NUMERIC_NULL)
427  return true;
428  break;
429  case ECPGt_numeric:
430  if (((numeric *) ptr)->sign == NUMERIC_NULL)
431  return true;
432  break;
433  case ECPGt_interval:
434  return (_check(ptr, sizeof(interval)));
435  break;
436  case ECPGt_timestamp:
437  return (_check(ptr, sizeof(timestamp)));
438  break;
439  default:
440  break;
441  }
442 
443  return false;
444 }
int64 timestamp
#define NUMERIC_NULL
static bool _check(unsigned char *ptr, int length)
Definition: misc.c:372
char sign
Definition: informix.c:693
void ECPGset_noind_null ( enum ECPGttype  type,
void *  ptr 
)

Definition at line 314 of file misc.c.

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

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

Definition at line 518 of file misc.c.

References calloc, ECPG_OUT_OF_MEMORY, ecpg_raise(), ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, ECPGfree_auto_mem(), ECPGget_sqlca(), ivlist, var_list::next, NULL, 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().

519 {
520  struct var_list *ptr;
521 
522  for (ptr = ivlist; ptr != NULL; ptr = ptr->next)
523  {
524  if (ptr->number == number)
525  {
526  /* already known => just change pointer value */
527  ptr->pointer = pointer;
528  return;
529  }
530  }
531 
532  /* a new one has to be added */
533  ptr = (struct var_list *) calloc(1L, sizeof(struct var_list));
534  if (!ptr)
535  {
536  struct sqlca_t *sqlca = ECPGget_sqlca();
537 
538  if (sqlca == NULL)
539  {
542  return;
543  }
544 
545  sqlca->sqlcode = ECPG_OUT_OF_MEMORY;
546  strncpy(sqlca->sqlstate, "YE001", sizeof(sqlca->sqlstate));
547  snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc), "out of memory on line %d", lineno);
548  sqlca->sqlerrm.sqlerrml = strlen(sqlca->sqlerrm.sqlerrmc);
549  /* free all memory we have allocated for the user */
551  }
552  else
553  {
554  ptr->number = number;
555  ptr->pointer = pointer;
556  ptr->next = ivlist;
557  ivlist = ptr;
558  }
559 }
#define calloc(a, b)
Definition: header.h:50
struct var_list * next
Definition: extern.h:132
void ECPGfree_auto_mem(void)
Definition: memory.c:138
void * pointer
Definition: extern.h:131
int sqlerrml
Definition: sqlca.h:26
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
#define ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY
Definition: extern.h:221
struct sqlca_t::@79 sqlerrm
#define ECPG_OUT_OF_MEMORY
Definition: ecpgerrno.h:15
struct sqlca_t * ECPGget_sqlca(void)
Definition: misc.c:142
Definition: sqlca.h:19
int number
Definition: extern.h:130
char sqlstate[5]
Definition: sqlca.h:53
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
Definition: error.c:13
long sqlcode
Definition: sqlca.h:23
#define NULL
Definition: c.h:226
static struct sqlca_t sqlca
Definition: misc.c:63
char sqlerrmc[SQLERRMC_LEN]
Definition: sqlca.h:27
struct var_list * ivlist
Definition: misc.c:515
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, connection::name, and NULL.

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_SQLSTATE_ECPG_INTERNAL_ERROR
Definition: extern.h:220
#define ECPG_NOT_CONN
Definition: ecpgerrno.h:37
char * name
Definition: extern.h:81
void ecpg_raise(int line, int code, const char *sqlstate, const char *str)
Definition: error.c:13
PGconn * connection
Definition: extern.h:82
#define NULL
Definition: c.h:226
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
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(), FALSE, connection::name, PQclear(), PQexec(), PQTRANS_IDLE, and PQtransactionStatus().

Referenced by 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.
217  */
218  if (PQtransactionStatus(con->connection) == PQTRANS_IDLE && !con->autocommit && strncmp(transaction, "begin", 5) != 0 && strncmp(transaction, "start", 5) != 0)
219  {
220  res = PQexec(con->connection, "begin transaction");
221  if (!ecpg_check_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
222  return FALSE;
223  PQclear(res);
224  }
225 
226  res = PQexec(con->connection, transaction);
227  if (!ecpg_check_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
228  return FALSE;
229  PQclear(res);
230  }
231 
232  return true;
233 }
char * name
Definition: extern.h:81
bool autocommit
Definition: extern.h:83
#define FALSE
Definition: c.h:218
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
Definition: fe-connect.c:5915
void ecpg_log(const char *format,...)
Definition: misc.c:261
void PQclear(PGresult *res)
Definition: fe-exec.c:650
PGconn * connection
Definition: extern.h:82
bool ecpg_init(const struct connection *con, const char *connection_name, const int lineno)
Definition: misc.c:105
bool ecpg_check_PQresult(PGresult *results, int lineno, PGconn *connection, enum COMPAT_MODE compat)
Definition: error.c:283
struct connection * ecpg_get_connection(const char *connection_name)
Definition: connect.c:74
PGresult * PQexec(PGconn *conn, const char *query)
Definition: fe-exec.c:1846
PGTransactionStatusType ECPGtransactionStatus ( const char *  connection_name)

Definition at line 183 of file misc.c.

References connection::connection, ecpg_get_connection(), NULL, 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:5915
PGconn * connection
Definition: extern.h:82
#define NULL
Definition: c.h:226
struct connection * ecpg_get_connection(const char *connection_name)
Definition: connect.c:74

Variable Documentation

FILE* debugstream = NULL
static

Definition at line 96 of file misc.c.

Referenced by ecpg_log(), and ECPGdebug().

bool ecpg_internal_regression_mode = false

Definition at line 30 of file misc.c.

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

struct var_list* ivlist = NULL

Definition at line 515 of file misc.c.

Referenced by ecpg_finish(), and ECPGset_var().

int simple_debug = 0
static

Definition at line 95 of file misc.c.

Referenced by ecpg_log(), and ECPGdebug().

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

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.