CUBRID Engine  latest
esql_cli.c File Reference
#include "system.h"
#include "dbi.h"
#include "db.h"
#include "config.h"
#include <unistd.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include "misc_string.h"
#include "error_manager.h"
#include "system_parameter.h"
#include "cubrid_esql.h"
#include "memory_alloc.h"
#include "parser.h"
#include "esql_gadget.h"
#include "environment_variable.h"
#include "authenticate.h"
#include "dbtype.h"
#include "object_primitive.h"

Go to the source code of this file.

Classes

struct  pointer
 
struct  repetitive
 
struct  dynamic
 
struct  cs_stmt_id
 
struct  cursor
 
struct  uci_env_stack_entry
 

Macros

#define _ESQL_KERNEL_
 
#define UCI_OPT_UNSAFE_NULL   0x0001
 
#define REPETITIVE_EXPANSION_UNIT   100 /* repetitive stmt table */
 
#define DYNAMIC_EXPANSION_UNIT   20 /* dynamically prepared stmts */
 
#define POINTER_EXPANSION_UNIT   10 /* pointers from DBI */
 
#define CS_STMT_ID_EXPANSION_UNIT   5 /* cs stmt ids for a cursor */
 
#define UCI_ENV_STACK_EXPANSION_UNIT   4 /* stack expansion unit */
 
#define DB_VALS_STCK_EXPANSION_UNIT   4 /* db values stack */
 
#define IS_NULL_INDICATED(ind)   ((ind) < 0) /* negative */
 
#define CHK_SQLCODE()
 
#define CHK_DBI_WARN()
 
#define CHECK_DBI(predicate, err_action)
 
#define IS_USER_DB_TYPE(t)   ((t) >= DB_TYPE_FIRST && (t) <= DB_TYPE_LAST)
 
#define STRING_C_TYPE(s)
 
#define AFFECT_OBJECTS(stmt_type)
 
#define HAS_RESULT(stmt_type)
 
#define SQLCA_NUM_AFFECTED_OBJECTS   sqlca.sqlerrd[2]
 
#define SQLCA_IS_WARNING   SQLWARN0
 
#define SQLCA_OUTPUT_TRUNC   SQLWARN1
 
#define SQLCA_NULL_IN_AGG   SQLWARN2
 
#define SQLCA_VARS_MISMATCH   SQLWARN3
 
#define SQLCA_NO_WHERE   SQLWARN4
 
#define SET_WARN_OUTPUT_TRUNC()
 
#define SET_WARN_NULL_IN_AGG()
 
#define SET_WARN_VARS_MISMATCH()
 
#define SET_WARN_NO_WHERE()
 
#define PUT_UCI_ERR_NOMOREMEMORY(size)
 
#define PUT_UCI_ERR_TOOFEWHOSTVARS(num_markers)
 
#define PUT_UCI_ERR_TOOMANYHOSTVARS(num_cols)
 
#define PUT_UCI_ERR_NULLINDNEEDED()
 
#define PUT_UCI_ERR_NOTPREPAREDSTMT()
 
#define PUT_UCI_ERR_NOTSELECTSTMT()
 
#define PUT_UCI_ERR_CURSORNOTOPENED()
 
#define PUT_UCI_ERR_CURSORSTILLOPEN()
 
#define PUT_UCI_ERR_MULTIPLEOBJECTS()
 
#define PUT_UCI_ERR_NOMARKALLOWED()
 
#define PUT_UCI_ERR_INVALIDDATATYPE()
 
#define PUT_UCI_ERR_INVALIDCSPOS()
 

Typedefs

typedef struct pointer POINTER
 
typedef struct repetitive REPETITIVE
 
typedef struct dynamic DYNAMIC
 
typedef struct cs_stmt_id CS_STMT_ID
 
typedef struct cursor CURSOR
 
typedef struct uci_env_stack_entry UCI_ENV_STACK_ENTRY
 

Functions

static void check_stack_size (void)
 
static void free_db_values (void)
 
static int uci_get_next_column (int cs_no, DB_VALUE *dbval)
 
static void uci_get_value_indirect (int cs_no, DB_INDICATOR *ind, void **bufp, int *sizep)
 
static REPETITIVEalloc_repetitive (int no, DB_SESSION *session, STATEMENT_ID stmt_id, CUBRID_STMT_TYPE stmt_type, DB_GADGET *gadget)
 
static REPETITIVEget_repetitive (int no)
 
static void free_repetitive (void)
 
static DYNAMICalloc_dynamic (int stmt_no, CUBRID_STMT_TYPE stmt_type, DB_SESSION *session, STATEMENT_ID stmt_id, int num_markers, DB_QUERY_TYPE *col_spec, char *stmt, int length)
 
static DYNAMICget_dynamic (int stmt_no)
 
static void free_dynamic (void)
 
static CURSORalloc_cursor (int no, DB_QUERY_RESULT *result)
 
static CURSORget_cursor (int no)
 
static void free_cursor (int no)
 
static POINTERput_pointer (CURSOR *cs, DB_VALUE *addr)
 
static void free_pointers (CURSOR *cs)
 
static void copy_column_spec_to_sqlda (DB_QUERY_TYPE *col_spec, CUBRIDDA *desc)
 
static void set_sqlca_err (void)
 
static int push_uci_environment (void)
 
static void pop_uci_environment (void)
 
static void drop_uci_env_stack (void)
 
static void clean_up (void)
 
void uci_startup (const char *pgm_name)
 
void uci_start (void *file_id, const char *filename, int lineno, unsigned int opt)
 
void uci_end (void)
 
void uci_stop (void)
 
long uci_get_sqlcode (void)
 
char uci_get_sqlwarn_0 (void)
 
void uci_connect (const char *db_name, const char *user_name, const char *passwd)
 
void uci_disconnect (void)
 
void uci_commit (void)
 
void uci_rollback (void)
 
void uci_static (int stmt_no, const char *stmt, int length, int num_out_vars)
 
void uci_open_cs (int cs_no, const char *stmt, int length, int stmt_no, int readonly)
 
void uci_fetch_cs (int cs_no, int num_out_vars)
 
void uci_delete_cs (int cs_no)
 
void uci_close_cs (int cs_no)
 
void uci_psh_curr_csr_oid (int cs_no)
 
void uci_prepare (int stmt_no, const char *stmt, int length)
 
void uci_describe (int stmt_no, CUBRIDDA *desc)
 
void uci_execute (int stmt_no, int num_out_vars)
 
void uci_execute_immediate (const char *stmt, int length)
 
void uci_object_describe (DB_OBJECT *obj, int num_attrs, const char **attr_names, CUBRIDDA *desc)
 
void uci_object_fetch (DB_OBJECT *obj, int num_attrs, const char **attr_names, int num_out_vars)
 
void uci_put_value (DB_INDICATOR *indicator, DB_TYPE type, int precision, int scale, DB_TYPE_C ctype, void *buf, int bufsize)
 
void uci_get_value (int cs_no, DB_INDICATOR *ind, void *buf, DB_TYPE_C type, int size, int *xferlen)
 
void uci_get_db_value (int cs_no, DB_VALUE *db_value_ptr)
 
void uci_put_descriptor (CUBRIDDA *desc)
 
void uci_get_descriptor (int cs_no, CUBRIDDA *desc)
 

Variables

unsigned int _uci_opt
 
CUBRIDCA sqlca
 
DB_INDICATOR uci_null_ind
 
DB_VALUEdefault_value
 
static char program_name [PATH_MAX]
 
struct {
   DB_VALUE *   db_values
 
   int   num_db_values
 
   int   db_value_top
 
db_Value_table
 
static CURSORcursor_list = (CURSOR *) NULL
 
static REPETITIVErepetitive_stmts
 
static int num_repetitive_stmts = 0
 
static int last_repetitive
 
static DYNAMICdynamic_stmts
 
static int num_dynamic_stmts = 0
 
static int last_dynamic
 
static POINTERpointers
 
static int num_pointers = 0
 
static void * curr_file
 
static const char * curr_filename
 
static int curr_lineno
 
static DB_QUERY_RESULTcurr_result = (DB_QUERY_RESULT *) NULL
 
static int num_curr_result_columns = 0
 
static int curr_result_column = 0
 
static bool connected = false
 
static bool is_uci_start_state = false
 
static UCI_ENV_STACK_ENTRYuci_env_stack
 
static int num_uci_env_stack_entries = 0
 
static int uci_env_stack_top = -1
 

Macro Definition Documentation

#define _ESQL_KERNEL_

Definition at line 46 of file esql_cli.c.

#define AFFECT_OBJECTS (   stmt_type)
Value:

Definition at line 142 of file esql_cli.c.

Referenced by uci_execute(), uci_execute_immediate(), and uci_static().

#define CHECK_DBI (   predicate,
  err_action 
)
Value:
do { \
if(predicate) { /* error from dbi */ \
{ \
} \
{ \
} \
err_action; \
} \
} while(0)
#define ER_LK_UNILATERALLY_ABORTED
Definition: error_code.h:130
static void set_sqlca_err(void)
Definition: esql_cli.c:2658
#define CHK_DBI_WARN()
Definition: esql_cli.c:88
#define SQLCODE
Definition: cubrid_esql.h:60
if(extra_options)
Definition: dynamic_load.c:958
static void clean_up(void)
Definition: esql_cli.c:2789
#define ER_TM_SERVER_DOWN_UNILATERALLY_ABORTED
Definition: error_code.h:171

Definition at line 112 of file esql_cli.c.

Referenced by uci_commit(), uci_connect(), uci_delete_cs(), uci_disconnect(), uci_end(), uci_execute(), uci_execute_immediate(), uci_fetch_cs(), uci_get_db_value(), uci_get_next_column(), uci_get_value(), uci_object_describe(), uci_object_fetch(), uci_open_cs(), uci_prepare(), uci_psh_curr_csr_oid(), uci_rollback(), and uci_static().

#define CHK_DBI_WARN ( )
Value:
do { \
if (sql_warn.is_warning) \
{ \
if (sql_warn.null_in_agg) \
{ \
sql_warn.null_in_agg = false; \
} \
else if (sql_warn.no_where) \
{ \
sql_warn.no_where = false; \
} \
sql_warn.is_warning = false; \
} \
} \
while (0)
if(extra_options)
Definition: dynamic_load.c:958
else
while(1)
Definition: cnvlex.c:816
#define SET_WARN_NO_WHERE()
Definition: esql_cli.c:180
#define SET_WARN_NULL_IN_AGG()
Definition: esql_cli.c:171

Definition at line 88 of file esql_cli.c.

#define CS_STMT_ID_EXPANSION_UNIT   5 /* cs stmt ids for a cursor */

Definition at line 63 of file esql_cli.c.

#define DB_VALS_STCK_EXPANSION_UNIT   4 /* db values stack */

Definition at line 65 of file esql_cli.c.

Referenced by check_stack_size().

#define DYNAMIC_EXPANSION_UNIT   20 /* dynamically prepared stmts */

Definition at line 61 of file esql_cli.c.

Referenced by alloc_dynamic().

#define HAS_RESULT (   stmt_type)
#define IS_NULL_INDICATED (   ind)    ((ind) < 0) /* negative */

Definition at line 67 of file esql_cli.c.

Referenced by uci_put_value().

#define IS_USER_DB_TYPE (   t)    ((t) >= DB_TYPE_FIRST && (t) <= DB_TYPE_LAST)

Definition at line 131 of file esql_cli.c.

#define POINTER_EXPANSION_UNIT   10 /* pointers from DBI */

Definition at line 62 of file esql_cli.c.

Referenced by put_pointer().

#define PUT_UCI_ERR_CURSORNOTOPENED ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define ER_UCI_CURSOR_NOT_OPENED
Definition: error_code.h:546

Definition at line 216 of file esql_cli.c.

Referenced by uci_close_cs(), uci_delete_cs(), uci_fetch_cs(), uci_get_db_value(), uci_get_next_column(), and uci_psh_curr_csr_oid().

#define PUT_UCI_ERR_CURSORSTILLOPEN ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define ER_UCI_CURSOR_STILL_OPEN
Definition: error_code.h:547

Definition at line 221 of file esql_cli.c.

Referenced by uci_open_cs().

#define PUT_UCI_ERR_INVALIDCSPOS ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
#define ER_QPROC_INVALID_CRSPOS
Definition: error_code.h:520
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)

Definition at line 241 of file esql_cli.c.

#define PUT_UCI_ERR_INVALIDDATATYPE ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define ER_UCI_INVALID_DATA_TYPE
Definition: error_code.h:550

Definition at line 236 of file esql_cli.c.

Referenced by uci_get_value_indirect().

#define PUT_UCI_ERR_MULTIPLEOBJECTS ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define ER_UCI_MULTIPLE_OBJECTS
Definition: error_code.h:548

Definition at line 226 of file esql_cli.c.

Referenced by uci_execute(), and uci_static().

#define PUT_UCI_ERR_NOMARKALLOWED ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define ER_UCI_NO_MARK_ALLOWED
Definition: error_code.h:549

Definition at line 231 of file esql_cli.c.

Referenced by uci_execute_immediate().

#define PUT_UCI_ERR_NOMOREMEMORY (   size)
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
ER_OUT_OF_VIRTUAL_MEMORY, 1, (size_t) (size))
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define ER_OUT_OF_VIRTUAL_MEMORY
Definition: error_code.h:50

Definition at line 186 of file esql_cli.c.

Referenced by alloc_cursor(), alloc_dynamic(), alloc_repetitive(), check_stack_size(), push_uci_environment(), put_pointer(), and uci_static().

#define PUT_UCI_ERR_NOTPREPAREDSTMT ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
#define ER_UCI_NOT_PREPARED_STMT
Definition: error_code.h:544
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)

Definition at line 206 of file esql_cli.c.

Referenced by uci_describe(), uci_execute(), and uci_open_cs().

#define PUT_UCI_ERR_NOTSELECTSTMT ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
#define ER_UCI_NOT_SELECT_STMT
Definition: error_code.h:545
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)

Definition at line 211 of file esql_cli.c.

Referenced by uci_open_cs().

#define PUT_UCI_ERR_NULLINDNEEDED ( )
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
#define ER_UCI_NULL_IND_NEEDED
Definition: error_code.h:543
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)

Definition at line 201 of file esql_cli.c.

Referenced by uci_get_value(), and uci_get_value_indirect().

#define PUT_UCI_ERR_TOOFEWHOSTVARS (   num_markers)
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
#define ER_UCI_TOO_FEW_HOST_VARS
Definition: error_code.h:541
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)

Definition at line 191 of file esql_cli.c.

Referenced by uci_execute(), and uci_open_cs().

#define PUT_UCI_ERR_TOOMANYHOSTVARS (   num_cols)
Value:
er_set(ER_ERROR_SEVERITY, __FILE__, __LINE__, \
#define ER_UCI_TOO_MANY_HOST_VARS
Definition: error_code.h:542
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)

Definition at line 196 of file esql_cli.c.

Referenced by uci_get_db_value(), and uci_get_next_column().

#define REPETITIVE_EXPANSION_UNIT   100 /* repetitive stmt table */

Definition at line 60 of file esql_cli.c.

Referenced by alloc_repetitive().

#define SET_WARN_NO_WHERE ( )
Value:
#define SQLCA_NO_WHERE
Definition: esql_cli.c:162
#define SQLCA_IS_WARNING
Definition: esql_cli.c:158
#define SQL_WARNING_CHAR
Definition: cubrid_esql.h:44

Definition at line 180 of file esql_cli.c.

#define SET_WARN_NULL_IN_AGG ( )
Value:
#define SQLCA_NULL_IN_AGG
Definition: esql_cli.c:160
#define SQLCA_IS_WARNING
Definition: esql_cli.c:158
#define SQL_WARNING_CHAR
Definition: cubrid_esql.h:44

Definition at line 171 of file esql_cli.c.

#define SET_WARN_OUTPUT_TRUNC ( )
Value:
#define SQLCA_OUTPUT_TRUNC
Definition: esql_cli.c:159
#define SQLCA_IS_WARNING
Definition: esql_cli.c:158
#define SQL_WARNING_CHAR
Definition: cubrid_esql.h:44

Definition at line 167 of file esql_cli.c.

Referenced by uci_get_value().

#define SET_WARN_VARS_MISMATCH ( )
Value:
#define SQLCA_VARS_MISMATCH
Definition: esql_cli.c:161
#define SQLCA_IS_WARNING
Definition: esql_cli.c:158
#define SQL_WARNING_CHAR
Definition: cubrid_esql.h:44

Definition at line 175 of file esql_cli.c.

Referenced by uci_execute(), uci_fetch_cs(), uci_object_fetch(), uci_open_cs(), and uci_static().

#define SQLCA_IS_WARNING   SQLWARN0

Definition at line 158 of file esql_cli.c.

Referenced by uci_start().

#define SQLCA_NO_WHERE   SQLWARN4

Definition at line 162 of file esql_cli.c.

Referenced by uci_start().

#define SQLCA_NULL_IN_AGG   SQLWARN2

Definition at line 160 of file esql_cli.c.

Referenced by uci_start().

#define SQLCA_NUM_AFFECTED_OBJECTS   sqlca.sqlerrd[2]
#define SQLCA_OUTPUT_TRUNC   SQLWARN1

Definition at line 159 of file esql_cli.c.

Referenced by uci_start().

#define SQLCA_VARS_MISMATCH   SQLWARN3

Definition at line 161 of file esql_cli.c.

Referenced by uci_start().

#define STRING_C_TYPE (   s)
#define UCI_ENV_STACK_EXPANSION_UNIT   4 /* stack expansion unit */

Definition at line 64 of file esql_cli.c.

Referenced by push_uci_environment().

#define UCI_OPT_UNSAFE_NULL   0x0001

Definition at line 57 of file esql_cli.c.

Referenced by uci_get_value(), and uci_get_value_indirect().

Typedef Documentation

typedef struct cs_stmt_id CS_STMT_ID
typedef struct cursor CURSOR
typedef struct dynamic DYNAMIC
typedef struct pointer POINTER
typedef struct repetitive REPETITIVE

Function Documentation

static CURSOR * alloc_cursor ( int  no,
DB_QUERY_RESULT result 
)
static
static DYNAMIC * alloc_dynamic ( int  stmt_no,
CUBRID_STMT_TYPE  stmt_type,
DB_SESSION session,
STATEMENT_ID  stmt_id,
int  num_markers,
DB_QUERY_TYPE col_spec,
char *  stmt,
int  length 
)
static
static REPETITIVE * alloc_repetitive ( int  no,
DB_SESSION session,
STATEMENT_ID  stmt_id,
CUBRID_STMT_TYPE  stmt_type,
DB_GADGET gadget 
)
static
static void check_stack_size ( void  )
static

Definition at line 1608 of file esql_cli.c.

References CHK_SQLCODE, DB_VALS_STCK_EXPANSION_UNIT, db_Value_table, NULL, PUT_UCI_ERR_NOMOREMEMORY, and set_sqlca_err().

Referenced by uci_psh_curr_csr_oid(), and uci_put_value().

Here is the caller graph for this function:

static void clean_up ( void  )
static
static void drop_uci_env_stack ( void  )
static

Definition at line 2770 of file esql_cli.c.

References free_and_init, num_uci_env_stack_entries, and uci_env_stack_top.

Referenced by clean_up(), and uci_disconnect().

Here is the caller graph for this function:

static void free_cursor ( int  no)
static
static void free_db_values ( void  )
static

Definition at line 1656 of file esql_cli.c.

References db_value_clear(), and db_Value_table.

Referenced by clean_up(), pop_uci_environment(), and uci_disconnect().

Here is the caller graph for this function:

static void free_dynamic ( void  )
static

Definition at line 2339 of file esql_cli.c.

References alloc_cursor(), dynamic::column_spec, db_close_session(), db_query_format_free(), free_and_init, i, NULL, num_dynamic_stmts, dynamic::saved_stmt, and dynamic::session.

Referenced by clean_up(), uci_commit(), and uci_rollback().

Here is the caller graph for this function:

static void free_pointers ( CURSOR cs)
static

Definition at line 2579 of file esql_cli.c.

References db_value_clear(), free_and_init, i, NULL, cursor::num_pointers, num_pointers, p, cursor::pointers, and pointers.

Referenced by clean_up(), free_cursor(), uci_commit(), uci_execute(), uci_fetch_cs(), uci_rollback(), and uci_static().

Here is the caller graph for this function:

static void free_repetitive ( void  )
static

Definition at line 2197 of file esql_cli.c.

References db_close_session(), db_gadget_destroy(), free_and_init, repetitive::gadget, i, NULL, num_repetitive_stmts, and repetitive::session.

Referenced by clean_up(), and uci_disconnect().

Here is the caller graph for this function:

static CURSOR * get_cursor ( int  no)
static

Definition at line 2419 of file esql_cli.c.

References curr_file, cursor::file_id, cursor::next, cursor::no, and NULL.

Referenced by uci_close_cs(), uci_delete_cs(), uci_fetch_cs(), uci_get_db_value(), uci_get_next_column(), uci_open_cs(), and uci_psh_curr_csr_oid().

Here is the caller graph for this function:

static DYNAMIC * get_dynamic ( int  stmt_no)
static

Definition at line 2305 of file esql_cli.c.

References curr_file, dynamic_stmts, i, last_dynamic, NULL, and num_dynamic_stmts.

Referenced by alloc_dynamic(), uci_describe(), uci_execute(), and uci_open_cs().

Here is the caller graph for this function:

static REPETITIVE * get_repetitive ( int  no)
static

Definition at line 2155 of file esql_cli.c.

References curr_file, i, last_repetitive, NULL, num_repetitive_stmts, and repetitive_stmts.

Referenced by uci_static().

Here is the caller graph for this function:

static POINTER * put_pointer ( CURSOR cs,
DB_VALUE addr 
)
static

Definition at line 2516 of file esql_cli.c.

References NULL, cursor::num_pointers, num_pointers, POINTER_EXPANSION_UNIT, cursor::pointers, pointers, PUT_UCI_ERR_NOMOREMEMORY, set_sqlca_err(), and pointer::value_copy.

Referenced by uci_get_db_value(), and uci_get_next_column().

Here is the caller graph for this function:

void uci_commit ( void  )

Definition at line 676 of file esql_cli.c.

References CHECK_DBI, CHK_SQLCODE, db_commit_transaction(), error(), free_cursor(), free_dynamic(), free_pointers(), and NULL.

Referenced by uci_disconnect().

Here is the caller graph for this function:

void uci_connect ( const char *  db_name,
const char *  user_name,
const char *  passwd 
)
void uci_disconnect ( void  )

Definition at line 639 of file esql_cli.c.

References CHECK_DBI, CHK_SQLCODE, connected, db_shutdown(), drop_uci_env_stack(), free_db_values(), free_repetitive(), prm_get_commit_on_shutdown(), uci_commit(), and uci_rollback().

Referenced by uci_connect(), and uci_stop().

Here is the caller graph for this function:

void uci_end ( void  )

Definition at line 542 of file esql_cli.c.

References CHECK_DBI, db_query_end(), is_uci_start_state, and NULL.

void uci_get_descriptor ( int  cs_no,
CUBRIDDA desc 
)
long uci_get_sqlcode ( void  )

Definition at line 583 of file esql_cli.c.

References cubridca::sqlcode.

char uci_get_sqlwarn_0 ( void  )

Definition at line 593 of file esql_cli.c.

References cubridca::sqlwarn, and cubridca::sqlwarn0.

void uci_get_value ( int  cs_no,
DB_INDICATOR ind,
void *  buf,
DB_TYPE_C  type,
int  size,
int *  xferlen 
)
static void uci_get_value_indirect ( int  cs_no,
DB_INDICATOR ind,
void **  bufp,
int *  sizep 
)
static
void uci_object_describe ( DB_OBJECT obj,
int  num_attrs,
const char **  attr_names,
CUBRIDDA desc 
)
void uci_object_fetch ( DB_OBJECT obj,
int  num_attrs,
const char **  attr_names,
int  num_out_vars 
)
void uci_put_value ( DB_INDICATOR indicator,
DB_TYPE  type,
int  precision,
int  scale,
DB_TYPE_C  ctype,
void *  buf,
int  bufsize 
)
void uci_rollback ( void  )

Definition at line 697 of file esql_cli.c.

References CHECK_DBI, CHK_SQLCODE, db_abort_transaction(), error(), free_cursor(), free_dynamic(), free_pointers(), and NULL.

Referenced by uci_disconnect(), and uci_stop().

Here is the caller graph for this function:

void uci_start ( void *  file_id,
const char *  filename,
int  lineno,
unsigned int  opt 
)
void uci_stop ( void  )

Definition at line 563 of file esql_cli.c.

References connected, NULL, SQLERRMC, uci_disconnect(), uci_rollback(), and uci_start().

Variable Documentation

unsigned int _uci_opt

Definition at line 345 of file esql_cli.c.

Referenced by uci_get_value(), uci_get_value_indirect(), and uci_start().

bool connected = false
static

Definition at line 399 of file esql_cli.c.

Referenced by clean_up(), uci_connect(), uci_disconnect(), and uci_stop().

const char* curr_filename
static

Definition at line 390 of file esql_cli.c.

Referenced by pop_uci_environment(), push_uci_environment(), and uci_start().

int curr_lineno
static

Definition at line 391 of file esql_cli.c.

Referenced by pop_uci_environment(), push_uci_environment(), and uci_start().

DB_QUERY_RESULT* curr_result = (DB_QUERY_RESULT *) NULL
static

Definition at line 394 of file esql_cli.c.

Referenced by uci_get_db_value(), and uci_get_next_column().

int curr_result_column = 0
static
CURSOR* cursor_list = (CURSOR *) NULL
static

Definition at line 362 of file esql_cli.c.

Referenced by alloc_cursor().

int db_value_top

Definition at line 358 of file esql_cli.c.

DB_VALUE* db_values

Definition at line 356 of file esql_cli.c.

Referenced by qdata_evaluate_aggregate_list().

DYNAMIC* dynamic_stmts
static

Definition at line 374 of file esql_cli.c.

Referenced by get_dynamic().

bool is_uci_start_state = false
static
int last_dynamic
static

Definition at line 380 of file esql_cli.c.

Referenced by alloc_dynamic(), and get_dynamic().

int last_repetitive
static

Definition at line 371 of file esql_cli.c.

Referenced by alloc_repetitive(), and get_repetitive().

int num_curr_result_columns = 0
static
int num_db_values

Definition at line 357 of file esql_cli.c.

int num_dynamic_stmts = 0
static

Definition at line 375 of file esql_cli.c.

Referenced by alloc_dynamic(), free_dynamic(), and get_dynamic().

int num_pointers = 0
static

Definition at line 384 of file esql_cli.c.

Referenced by free_pointers(), and put_pointer().

int num_repetitive_stmts = 0
static

Definition at line 366 of file esql_cli.c.

Referenced by alloc_repetitive(), free_repetitive(), and get_repetitive().

int num_uci_env_stack_entries = 0
static

Definition at line 406 of file esql_cli.c.

Referenced by drop_uci_env_stack(), and push_uci_environment().

POINTER* pointers
static

Definition at line 383 of file esql_cli.c.

Referenced by free_pointers(), and put_pointer().

char program_name[PATH_MAX]
static

Definition at line 351 of file esql_cli.c.

Referenced by uci_connect(), and uci_startup().

REPETITIVE* repetitive_stmts
static

Definition at line 365 of file esql_cli.c.

Referenced by get_repetitive().

CUBRIDCA sqlca

Definition at line 346 of file esql_cli.c.

UCI_ENV_STACK_ENTRY* uci_env_stack
static

Definition at line 405 of file esql_cli.c.

int uci_env_stack_top = -1
static

Definition at line 407 of file esql_cli.c.

Referenced by drop_uci_env_stack(), pop_uci_environment(), and push_uci_environment().

DB_INDICATOR uci_null_ind

Definition at line 347 of file esql_cli.c.

Referenced by uci_startup().