CUBRID Engine
latest
|
#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 |
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 REPETITIVE * | alloc_repetitive (int no, DB_SESSION *session, STATEMENT_ID stmt_id, CUBRID_STMT_TYPE stmt_type, DB_GADGET *gadget) |
static REPETITIVE * | get_repetitive (int no) |
static void | free_repetitive (void) |
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 DYNAMIC * | get_dynamic (int stmt_no) |
static void | free_dynamic (void) |
static CURSOR * | alloc_cursor (int no, DB_QUERY_RESULT *result) |
static CURSOR * | get_cursor (int no) |
static void | free_cursor (int no) |
static POINTER * | put_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_VALUE * | default_value |
static char | program_name [PATH_MAX] |
struct { | |
DB_VALUE * db_values | |
int num_db_values | |
int db_value_top | |
} | db_Value_table |
static CURSOR * | cursor_list = (CURSOR *) NULL |
static REPETITIVE * | repetitive_stmts |
static int | num_repetitive_stmts = 0 |
static int | last_repetitive |
static DYNAMIC * | dynamic_stmts |
static int | num_dynamic_stmts = 0 |
static int | last_dynamic |
static POINTER * | pointers |
static int | num_pointers = 0 |
static void * | curr_file |
static const char * | curr_filename |
static int | curr_lineno |
static DB_QUERY_RESULT * | curr_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_ENTRY * | uci_env_stack |
static int | num_uci_env_stack_entries = 0 |
static int | uci_env_stack_top = -1 |
#define _ESQL_KERNEL_ |
Definition at line 46 of file esql_cli.c.
#define AFFECT_OBJECTS | ( | stmt_type | ) |
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 | |||
) |
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 | ( | ) |
Definition at line 88 of file esql_cli.c.
#define CHK_SQLCODE | ( | ) |
Definition at line 77 of file esql_cli.c.
Referenced by check_stack_size(), uci_close_cs(), uci_commit(), uci_connect(), uci_delete_cs(), uci_describe(), uci_disconnect(), uci_execute(), uci_execute_immediate(), uci_fetch_cs(), uci_get_db_value(), uci_get_value(), uci_get_value_indirect(), uci_object_describe(), uci_object_fetch(), uci_open_cs(), uci_prepare(), uci_psh_curr_csr_oid(), uci_put_value(), uci_rollback(), and uci_static().
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 | ) |
Definition at line 148 of file esql_cli.c.
Referenced by uci_describe(), uci_execute(), and uci_static().
#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 | ( | ) |
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 | ( | ) |
Definition at line 221 of file esql_cli.c.
Referenced by uci_open_cs().
#define PUT_UCI_ERR_INVALIDCSPOS | ( | ) |
Definition at line 241 of file esql_cli.c.
#define PUT_UCI_ERR_INVALIDDATATYPE | ( | ) |
Definition at line 236 of file esql_cli.c.
Referenced by uci_get_value_indirect().
#define PUT_UCI_ERR_MULTIPLEOBJECTS | ( | ) |
Definition at line 226 of file esql_cli.c.
Referenced by uci_execute(), and uci_static().
#define PUT_UCI_ERR_NOMARKALLOWED | ( | ) |
Definition at line 231 of file esql_cli.c.
Referenced by uci_execute_immediate().
#define PUT_UCI_ERR_NOMOREMEMORY | ( | size | ) |
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 | ( | ) |
Definition at line 206 of file esql_cli.c.
Referenced by uci_describe(), uci_execute(), and uci_open_cs().
#define PUT_UCI_ERR_NOTSELECTSTMT | ( | ) |
Definition at line 211 of file esql_cli.c.
Referenced by uci_open_cs().
#define PUT_UCI_ERR_NULLINDNEEDED | ( | ) |
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 | ) |
Definition at line 191 of file esql_cli.c.
Referenced by uci_execute(), and uci_open_cs().
#define PUT_UCI_ERR_TOOMANYHOSTVARS | ( | num_cols | ) |
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 | ( | ) |
Definition at line 180 of file esql_cli.c.
#define SET_WARN_NULL_IN_AGG | ( | ) |
Definition at line 171 of file esql_cli.c.
#define SET_WARN_OUTPUT_TRUNC | ( | ) |
#define SET_WARN_VARS_MISMATCH | ( | ) |
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] |
Definition at line 157 of file esql_cli.c.
Referenced by pop_uci_environment(), uci_close_cs(), uci_execute(), uci_execute_immediate(), uci_fetch_cs(), uci_open_cs(), uci_start(), and uci_static().
#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 | ) |
Definition at line 134 of file esql_cli.c.
Referenced by uci_get_descriptor().
#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 struct cs_stmt_id CS_STMT_ID |
typedef struct repetitive REPETITIVE |
typedef struct uci_env_stack_entry UCI_ENV_STACK_ENTRY |
|
static |
Definition at line 2380 of file esql_cli.c.
References curr_file, cursor_list, cursor::fetched_tuples, cursor::file_id, cursor::next, cursor::no, NULL, cursor::num_pointers, cursor::num_stmt_ids, PUT_UCI_ERR_NOMOREMEMORY, cursor::result, and set_sqlca_err().
Referenced by free_dynamic(), and uci_open_cs().
|
static |
Definition at line 2233 of file esql_cli.c.
References dynamic::column_spec, curr_file, db_close_session(), db_query_format_free(), DYNAMIC_EXPANSION_UNIT, dynamic::file_id, get_dynamic(), last_dynamic, NULL, num_dynamic_stmts, dynamic::num_markers, PUT_UCI_ERR_NOMOREMEMORY, dynamic::saved_length, dynamic::saved_stmt, dynamic::session, set_sqlca_err(), dynamic::stmt_id, dynamic::stmt_no, dynamic::stmt_type, and strdup().
Referenced by uci_prepare().
|
static |
Definition at line 2103 of file esql_cli.c.
References curr_file, repetitive::file_id, repetitive::gadget, last_repetitive, repetitive::no, NULL, num_repetitive_stmts, PUT_UCI_ERR_NOMOREMEMORY, REPETITIVE_EXPANSION_UNIT, repetitive::session, set_sqlca_err(), repetitive::stmt_id, and repetitive::stmt_type.
Referenced by uci_static().
|
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().
|
static |
Definition at line 2789 of file esql_cli.c.
References connected, drop_uci_env_stack(), er_errid(), ER_LK_UNILATERALLY_ABORTED, ER_TM_SERVER_DOWN_UNILATERALLY_ABORTED, free_cursor(), free_db_values(), free_dynamic(), free_pointers(), free_repetitive(), and NULL.
Referenced by pr_midxkey_compare_element().
|
static |
Definition at line 2621 of file esql_cli.c.
References db_domain_precision(), db_domain_scale(), db_query_format_domain(), db_query_format_name(), db_query_format_next(), db_query_format_size(), DB_TYPE_DB_VALUE, DB_TYPE_NULL, i, NULL, cubridda::sqldesc, cubridvar::sqllen, cubridda::sqlmax, cubridvar::sqlname, cubridvar::sqlprec, cubridvar::sqlscale, cubridvar::sqltype, cubridda::sqlvar, and TP_DOMAIN_TYPE.
Referenced by uci_describe(), and uci_object_describe().
|
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().
|
static |
Definition at line 2443 of file esql_cli.c.
References curr_file, db_close_session(), db_query_end(), free_and_init, free_pointers(), i, cursor::next, NULL, cursor::num_stmt_ids, cursor::result, cs_stmt_id::session, and cursor::stmt_ids.
Referenced by clean_up(), uci_close_cs(), uci_commit(), and uci_rollback().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
static |
Definition at line 2735 of file esql_cli.c.
References curr_file, curr_filename, curr_lineno, db_Value_table, free_db_values(), if(), uci_env_stack_entry::saved_curr_file, uci_env_stack_entry::saved_curr_filename, uci_env_stack_entry::saved_curr_lineno, uci_env_stack_entry::saved_db_value_top, uci_env_stack_entry::saved_db_values, uci_env_stack_entry::saved_num_db_values, uci_env_stack_entry::saved_sqlca_sqlwarn, SQLCA_NUM_AFFECTED_OBJECTS, SQLCODE, SQLERRMC, SQLERRML, cubridca::sqlwarn, and uci_env_stack_top.
Referenced by uci_execute(), uci_execute_immediate(), uci_open_cs(), and uci_static().
|
static |
Definition at line 2682 of file esql_cli.c.
References curr_file, curr_filename, curr_lineno, db_Value_table, ER_OUT_OF_VIRTUAL_MEMORY, NO_ERROR, NULL, num_uci_env_stack_entries, PUT_UCI_ERR_NOMOREMEMORY, uci_env_stack_entry::saved_curr_file, uci_env_stack_entry::saved_curr_filename, uci_env_stack_entry::saved_curr_lineno, uci_env_stack_entry::saved_db_value_top, uci_env_stack_entry::saved_db_values, uci_env_stack_entry::saved_num_db_values, uci_env_stack_entry::saved_sqlca_sqlwarn, set_sqlca_err(), cubridca::sqlwarn, UCI_ENV_STACK_EXPANSION_UNIT, and uci_env_stack_top.
Referenced by uci_start().
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().
|
static |
Definition at line 2658 of file esql_cli.c.
References assert, er_errid(), er_msg(), NO_ERROR, NULL, SQLCODE, SQLERRMC, SQLERRML, and strlen.
Referenced by alloc_cursor(), alloc_dynamic(), alloc_repetitive(), check_stack_size(), push_uci_environment(), put_pointer(), uci_close_cs(), uci_delete_cs(), uci_describe(), uci_execute(), uci_execute_immediate(), uci_fetch_cs(), uci_get_db_value(), uci_get_next_column(), uci_get_value(), uci_get_value_indirect(), uci_open_cs(), uci_psh_curr_csr_oid(), uci_put_value(), and uci_static().
void uci_close_cs | ( | int | cs_no | ) |
Definition at line 1211 of file esql_cli.c.
References CHK_SQLCODE, cursor::fetched_tuples, free_cursor(), get_cursor(), NULL, PUT_UCI_ERR_CURSORNOTOPENED, set_sqlca_err(), and SQLCA_NUM_AFFECTED_OBJECTS.
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().
Definition at line 611 of file esql_cli.c.
References au_get_public_user_name(), CHECK_DBI, CHK_SQLCODE, connected, db_login(), db_restart(), error(), program_name, and uci_disconnect().
void uci_delete_cs | ( | int | cs_no | ) |
Definition at line 1176 of file esql_cli.c.
References CHECK_DBI, CHK_SQLCODE, db_drop(), db_get_object(), db_query_get_tuple_oid(), get_cursor(), NULL, PUT_UCI_ERR_CURSORNOTOPENED, cursor::result, set_sqlca_err(), SQL_NOT_FOUND, and SQLCODE.
void uci_describe | ( | int | stmt_no, |
CUBRIDDA * | desc | ||
) |
Definition at line 1328 of file esql_cli.c.
References CHK_SQLCODE, dynamic::column_spec, copy_column_spec_to_sqlda(), get_dynamic(), HAS_RESULT, NULL, PUT_UCI_ERR_NOTPREPAREDSTMT, set_sqlca_err(), cubridda::sqlcmd, cubridda::sqldesc, and dynamic::stmt_type.
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().
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_execute | ( | int | stmt_no, |
int | num_out_vars | ||
) |
Definition at line 1367 of file esql_cli.c.
References AFFECT_OBJECTS, CHECK_DBI, CHK_SQLCODE, curr_result_column, db_execute_and_keep_statement(), db_push_values(), db_query_column_count(), db_query_first_tuple(), db_query_tuple_count(), db_Value_table, free_pointers(), get_dynamic(), HAS_RESULT, is_uci_start_state, NULL, num_curr_result_columns, dynamic::num_markers, pop_uci_environment(), PUT_UCI_ERR_MULTIPLEOBJECTS, PUT_UCI_ERR_NOTPREPAREDSTMT, PUT_UCI_ERR_TOOFEWHOSTVARS, dynamic::session, set_sqlca_err(), SET_WARN_VARS_MISMATCH, SQL_NOT_FOUND, SQLCA_NUM_AFFECTED_OBJECTS, SQLCODE, dynamic::stmt_id, and dynamic::stmt_type.
void uci_execute_immediate | ( | const char * | stmt, |
int | length | ||
) |
Definition at line 1460 of file esql_cli.c.
References AFFECT_OBJECTS, assert, CHECK_DBI, CHK_SQLCODE, db_close_session(), db_compile_statement(), db_execute_statement(), db_get_statement_type(), db_number_of_input_markers(), db_open_buffer(), db_push_values(), db_query_end(), er_errid(), error(), is_uci_start_state, NO_ERROR, NULL, pop_uci_environment(), PUT_UCI_ERR_NOMARKALLOWED, set_sqlca_err(), SQL_NOT_FOUND, SQLCA_NUM_AFFECTED_OBJECTS, and SQLCODE.
void uci_fetch_cs | ( | int | cs_no, |
int | num_out_vars | ||
) |
Definition at line 1125 of file esql_cli.c.
References CHECK_DBI, CHK_SQLCODE, cursor::curr_column, DB_CURSOR_END, db_query_column_count(), db_query_next_tuple(), cursor::fetched_tuples, free_pointers(), get_cursor(), NULL, cursor::num_columns, PUT_UCI_ERR_CURSORNOTOPENED, cursor::result, set_sqlca_err(), SET_WARN_VARS_MISMATCH, SQL_NOT_FOUND, SQLCA_NUM_AFFECTED_OBJECTS, and SQLCODE.
void uci_get_db_value | ( | int | cs_no, |
DB_VALUE * | db_value_ptr | ||
) |
Definition at line 1985 of file esql_cli.c.
References CHECK_DBI, CHK_SQLCODE, cursor::curr_column, curr_result, curr_result_column, db_query_get_tuple_value(), error(), get_cursor(), NULL, cursor::num_columns, num_curr_result_columns, put_pointer(), PUT_UCI_ERR_CURSORNOTOPENED, PUT_UCI_ERR_TOOMANYHOSTVARS, cursor::result, set_sqlca_err(), SQL_NOT_FOUND, and SQLCODE.
void uci_get_descriptor | ( | int | cs_no, |
CUBRIDDA * | desc | ||
) |
Definition at line 2072 of file esql_cli.c.
References i, NULL, cubridvar::sqlctype, cubridvar::sqldata, cubridvar::sqlind, cubridvar::sqllen, cubridda::sqlvar, STRING_C_TYPE, uci_get_value(), and uci_get_value_indirect().
|
static |
Definition at line 1762 of file esql_cli.c.
References CHECK_DBI, cursor::curr_column, curr_result, curr_result_column, db_query_get_tuple_value(), error(), get_cursor(), NULL, cursor::num_columns, num_curr_result_columns, put_pointer(), PUT_UCI_ERR_CURSORNOTOPENED, PUT_UCI_ERR_TOOMANYHOSTVARS, cursor::result, set_sqlca_err(), SQL_NOT_FOUND, and SQLCODE.
Referenced by uci_get_value(), and uci_get_value_indirect().
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 | ||
) |
Definition at line 1830 of file esql_cli.c.
References _uci_opt, CHECK_DBI, CHK_SQLCODE, DB_TYPE_C_CHAR, DB_TYPE_C_VARCHAR, db_value_get(), error(), NULL, PUT_UCI_ERR_NULLINDNEEDED, set_sqlca_err(), SET_WARN_OUTPUT_TRUNC, uci_get_next_column(), and UCI_OPT_UNSAFE_NULL.
Referenced by uci_get_descriptor().
|
static |
Definition at line 1905 of file esql_cli.c.
References _uci_opt, CHK_SQLCODE, CONST_CAST, db_get_string(), db_get_string_size(), DB_IS_NULL, DB_TYPE_BIT, DB_TYPE_CHAR, DB_TYPE_NCHAR, DB_TYPE_VARBIT, DB_TYPE_VARCHAR, DB_TYPE_VARNCHAR, DB_VALUE_TYPE, PUT_UCI_ERR_INVALIDDATATYPE, PUT_UCI_ERR_NULLINDNEEDED, set_sqlca_err(), uci_get_next_column(), and UCI_OPT_UNSAFE_NULL.
Referenced by uci_get_descriptor().
void uci_object_describe | ( | DB_OBJECT * | obj, |
int | num_attrs, | ||
const char ** | attr_names, | ||
CUBRIDDA * | desc | ||
) |
Definition at line 1548 of file esql_cli.c.
References CHECK_DBI, CHK_SQLCODE, copy_column_spec_to_sqlda(), db_object_describe(), db_query_format_free(), error(), and NULL.
void uci_object_fetch | ( | DB_OBJECT * | obj, |
int | num_attrs, | ||
const char ** | attr_names, | ||
int | num_out_vars | ||
) |
Definition at line 1580 of file esql_cli.c.
References CHECK_DBI, CHK_SQLCODE, curr_result_column, db_object_fetch(), db_query_column_count(), db_query_first_tuple(), error(), num_curr_result_columns, and SET_WARN_VARS_MISMATCH.
void uci_open_cs | ( | int | cs_no, |
const char * | stmt, | ||
int | length, | ||
int | stmt_no, | ||
int | readonly | ||
) |
Definition at line 995 of file esql_cli.c.
References alloc_cursor(), assert, CHECK_DBI, CHK_SQLCODE, CUBRID_STMT_SELECT, db_close_session(), db_compile_statement(), db_execute_and_keep_statement(), db_get_statement_type(), db_include_oid(), db_number_of_input_markers(), db_open_buffer(), db_push_values(), db_Value_table, er_errid(), error(), get_cursor(), get_dynamic(), is_uci_start_state, NO_ERROR, NULL, dynamic::num_markers, pop_uci_environment(), PUT_UCI_ERR_CURSORSTILLOPEN, PUT_UCI_ERR_NOTPREPAREDSTMT, PUT_UCI_ERR_NOTSELECTSTMT, PUT_UCI_ERR_TOOFEWHOSTVARS, dynamic::session, set_sqlca_err(), SET_WARN_VARS_MISMATCH, SQL_NOT_FOUND, SQLCA_NUM_AFFECTED_OBJECTS, SQLCODE, dynamic::stmt_id, and dynamic::stmt_type.
void uci_prepare | ( | int | stmt_no, |
const char * | stmt, | ||
int | length | ||
) |
Definition at line 1273 of file esql_cli.c.
References alloc_dynamic(), assert, CHECK_DBI, CHK_SQLCODE, db_close_session(), db_compile_statement(), db_get_query_type_list(), db_get_statement_type(), db_number_of_input_markers(), db_open_buffer(), db_query_format_free(), er_errid(), error(), NO_ERROR, and NULL.
void uci_psh_curr_csr_oid | ( | int | cs_no | ) |
Definition at line 1235 of file esql_cli.c.
References CHECK_DBI, check_stack_size(), CHK_SQLCODE, db_query_get_tuple_oid(), db_Value_table, get_cursor(), NULL, PUT_UCI_ERR_CURSORNOTOPENED, cursor::result, set_sqlca_err(), SQL_NOT_FOUND, and SQLCODE.
void uci_put_descriptor | ( | CUBRIDDA * | desc | ) |
Definition at line 2051 of file esql_cli.c.
References for(), i, cubridvar::sqlctype, cubridvar::sqldata, cubridda::sqldesc, cubridvar::sqlind, cubridvar::sqllen, cubridvar::sqlprec, cubridvar::sqlscale, cubridvar::sqltype, cubridda::sqlvar, and uci_put_value().
void uci_put_value | ( | DB_INDICATOR * | indicator, |
DB_TYPE | type, | ||
int | precision, | ||
int | scale, | ||
DB_TYPE_C | ctype, | ||
void * | buf, | ||
int | bufsize | ||
) |
Definition at line 1689 of file esql_cli.c.
References check_stack_size(), CHK_SQLCODE, DB_DEFAULT_PRECISION, db_make_null(), DB_TYPE_C_CHAR, DB_TYPE_C_NCHAR, DB_TYPE_C_VARCHAR, DB_TYPE_C_VARNCHAR, DB_TYPE_DB_VALUE, db_value_clone(), db_value_domain_init(), db_value_put(), db_Value_table, IS_NULL_INDICATED, NO_ERROR, set_sqlca_err(), and strlen.
Referenced by uci_put_descriptor().
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().
void uci_start | ( | void * | file_id, |
const char * | filename, | ||
int | lineno, | ||
unsigned int | opt | ||
) |
Definition at line 491 of file esql_cli.c.
References _uci_opt, curr_file, curr_filename, curr_lineno, db_value_clear(), db_Value_table, i, is_uci_start_state, NO_ERROR, push_uci_environment(), SQLCA_IS_WARNING, SQLCA_NO_WHERE, SQLCA_NULL_IN_AGG, SQLCA_NUM_AFFECTED_OBJECTS, SQLCA_OUTPUT_TRUNC, SQLCA_VARS_MISMATCH, SQLCODE, SQLERRMC, SQLERRML, SQLFILE, and SQLLINE.
Referenced by uci_stop().
void uci_startup | ( | const char * | pgm_name | ) |
Definition at line 446 of file esql_cli.c.
References db_Value_table, i, NULL, program_name, cubridca::sqlcabc, cubridca::sqlcaid, cubridca::sqlcode, cubridca::sqlerrd, cubridca::sqlerrm, cubridca::sqlerrmc, cubridca::sqlerrml, cubridca::sqlerrp, cubridca::sqlext, cubridca::sqlfile, cubridca::sqlline, cubridca::sqlwarn, cubridca::sqlwarn0, cubridca::sqlwarn1, cubridca::sqlwarn2, cubridca::sqlwarn3, cubridca::sqlwarn4, cubridca::sqlwarn5, cubridca::sqlwarn6, cubridca::sqlwarn7, and uci_null_ind.
void uci_static | ( | int | stmt_no, |
const char * | stmt, | ||
int | length, | ||
int | num_out_vars | ||
) |
Definition at line 733 of file esql_cli.c.
References AFFECT_OBJECTS, alloc_repetitive(), assert, attr_val::attr_desc, db_gadget::attrs, CHECK_DBI, CHK_SQLCODE, CUBRID_STMT_INSERT, curr_result_column, db_close_session(), db_compile_statement(), db_execute_statement(), db_gadget_bind(), db_gadget_create(), db_gadget_destroy(), db_gadget_exec(), db_get_db_value_query_result(), db_get_parser(), db_get_statement(), db_get_statement_type(), db_make_object(), db_open_buffer(), db_push_values(), db_query_column_count(), db_query_first_tuple(), db_query_tuple_count(), db_Value_table, er_errid(), error(), parser_context::error_msgs, free_and_init, free_pointers(), repetitive::gadget, get_repetitive(), HAS_RESULT, i, is_uci_start_state, sm_descriptor::name, parser_node::next, NO_ERROR, parser_node::node_type, NULL, num_curr_result_columns, parser, pop_uci_environment(), pt_attrs_part(), pt_class_part(), pt_evaluate_tree_having_serial(), pt_from_entity_part(), pt_get_name(), PT_HOST_VAR, PT_INSERT, pt_is_expr_node, pt_is_value_node, pt_length_of_list(), pt_value_to_db(), pt_values_part(), PUT_UCI_ERR_MULTIPLEOBJECTS, PUT_UCI_ERR_NOMOREMEMORY, repetitive::session, set_sqlca_err(), SET_WARN_VARS_MISMATCH, SQL_NOT_FOUND, SQLCA_NUM_AFFECTED_OBJECTS, SQLCODE, repetitive::stmt_id, and repetitive::stmt_type.
void uci_stop | ( | void | ) |
Definition at line 563 of file esql_cli.c.
References connected, NULL, SQLERRMC, uci_disconnect(), uci_rollback(), and uci_start().
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().
|
static |
Definition at line 399 of file esql_cli.c.
Referenced by clean_up(), uci_connect(), uci_disconnect(), and uci_stop().
|
static |
Definition at line 389 of file esql_cli.c.
Referenced by alloc_cursor(), alloc_dynamic(), alloc_repetitive(), free_cursor(), get_cursor(), get_dynamic(), get_repetitive(), pop_uci_environment(), push_uci_environment(), and uci_start().
|
static |
Definition at line 390 of file esql_cli.c.
Referenced by pop_uci_environment(), push_uci_environment(), and uci_start().
|
static |
Definition at line 391 of file esql_cli.c.
Referenced by pop_uci_environment(), push_uci_environment(), and uci_start().
|
static |
Definition at line 394 of file esql_cli.c.
Referenced by uci_get_db_value(), and uci_get_next_column().
|
static |
Definition at line 396 of file esql_cli.c.
Referenced by uci_execute(), uci_get_db_value(), uci_get_next_column(), uci_object_fetch(), and uci_static().
Definition at line 362 of file esql_cli.c.
Referenced by alloc_cursor().
struct { ... } db_Value_table |
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().
DB_VALUE* default_value |
Definition at line 348 of file esql_cli.c.
Referenced by boot_define_serial(), do_add_attribute(), do_add_attribute_from_select_column(), do_change_att_schema_only(), do_evaluate_default_expr(), emit_attribute_def(), pt_check_data_default(), pt_check_default_vclass_query_spec(), pt_fold_const_expr(), pt_sm_attribute_default_value_to_node(), and smt_add_constraint().
|
static |
Definition at line 374 of file esql_cli.c.
Referenced by get_dynamic().
|
static |
Definition at line 402 of file esql_cli.c.
Referenced by uci_end(), uci_execute(), uci_execute_immediate(), uci_open_cs(), uci_start(), and uci_static().
|
static |
Definition at line 380 of file esql_cli.c.
Referenced by alloc_dynamic(), and get_dynamic().
|
static |
Definition at line 371 of file esql_cli.c.
Referenced by alloc_repetitive(), and get_repetitive().
|
static |
Definition at line 395 of file esql_cli.c.
Referenced by uci_execute(), uci_get_db_value(), uci_get_next_column(), uci_object_fetch(), and uci_static().
int num_db_values |
Definition at line 357 of file esql_cli.c.
|
static |
Definition at line 375 of file esql_cli.c.
Referenced by alloc_dynamic(), free_dynamic(), and get_dynamic().
|
static |
Definition at line 384 of file esql_cli.c.
Referenced by free_pointers(), and put_pointer().
|
static |
Definition at line 366 of file esql_cli.c.
Referenced by alloc_repetitive(), free_repetitive(), and get_repetitive().
|
static |
Definition at line 406 of file esql_cli.c.
Referenced by drop_uci_env_stack(), and push_uci_environment().
|
static |
Definition at line 383 of file esql_cli.c.
Referenced by free_pointers(), and put_pointer().
|
static |
Definition at line 351 of file esql_cli.c.
Referenced by uci_connect(), and uci_startup().
|
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.
|
static |
Definition at line 405 of file esql_cli.c.
|
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().