CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include "language_support.h"
#include "misc_string.h"
#include "util_func.h"
#include "dbi.h"
#include "esql_translate.h"
#include "memory_alloc.h"
#include "esql_misc.h"
Go to the source code of this file.
Classes | |
struct | when_desc |
Macros | |
#define | ESQL_FILE_ID_VAR_NAME "uci_esqlxc_file" |
#define | NOT_FOUND_MACRO_NAME "SQL_NOT_FOUND" |
#define | WARN_CHAR_MACRO_NAME "SQL_WARNING_CHAR" |
#define | REPETITIVE_SERIAL_NO (repetitive_no++) |
#define | FP c_out_stream |
Typedefs | |
typedef struct when_desc | WHEN_DESC |
Enumerations | |
enum | esql_msg { MSG_BAD_CASE = 1 } |
Functions | |
static void | emit_start (int leading_brace) |
static void | emit_end (void) |
static void | get_quasi_string (HOST_REF *ref, const char **buf_str, const char **bufsize_str) |
static void | tr_connect (HOST_REF *db_name, HOST_REF *user_name, HOST_REF *passwd) |
static void | tr_disconnect (void) |
static void | tr_commit (void) |
static void | tr_rollback (void) |
static void | tr_static (const char *stmt, int length, bool repeat, int num_in_vars, HOST_REF *in_vars, const char *in_desc_name, int num_out_vars, HOST_REF *out_vars, const char *out_desc_name) |
static void | tr_open_cs (int cs_no, const char *stmt, int length, int stmt_no, bool readonly, int num_in_vars, HOST_REF *in_vars, const char *desc_name) |
static void | tr_fetch_cs (int cs_no, int num_out_vars, HOST_REF *out_vars, const char *desc_name) |
static void | tr_update_cs (int cs_no, const char *text, int length, bool repetitive, int num_in_vars, HOST_REF *in_vars) |
static void | tr_delete_cs (int cs_no) |
static void | tr_close_cs (int cs_no) |
static void | tr_prepare_esql (int stmt_no, HOST_REF *stmt) |
static void | tr_describe (int stmt_no, const char *desc_name) |
static void | tr_execute (int stmt_no, int num_in_vars, HOST_REF *in_vars, const char *in_desc_name, int num_out_vars, HOST_REF *out_vars, const char *out_desc_name) |
static void | tr_execute_immediate (HOST_REF *stmt) |
static void | tr_object_describe (HOST_REF *obj, int num_attrs, const char **attr_names, const char *desc_name) |
static void | tr_object_fetch (HOST_REF *obj, int num_attrs, const char **attr_names, int num_out_vars, HOST_REF *out_vars, const char *desc_name) |
static void | tr_object_update (const char *set_expr, int length, bool repetitive, int num_in_vars, HOST_REF *in_vars) |
static void | tr_whenever (WHEN_CONDITION condition, WHEN_ACTION action, const char *name) |
static void | tr_set_out_stream (FILE *out_stream) |
static void | tr_set_line_terminator (const char *) |
static void | emit_put_db_value (HOST_REF *host) |
static void | emit_get_db_value (int cs_no, HOST_REF *host) |
static void | tr_print_n_string (char *stmt, int length) |
static void | emit_whenever (void) |
static char * | escape_string (const char *, int length, int *counter) |
Variables | |
static int | repetitive_no = 0 |
static FILE * | c_out_stream |
static const char * | NL = " " |
static WHEN_DESC | on_warning = { CONTINUE, (char *) NULL } |
static WHEN_DESC | on_error = { CONTINUE, (char *) NULL } |
static WHEN_DESC | on_not_found = { CONTINUE, (char *) NULL } |
static const char * | c_type_to_db_type_c [] |
ESQL_TRANSLATE_TABLE | esql_Translate_table |
#define ESQL_FILE_ID_VAR_NAME "uci_esqlxc_file" |
Definition at line 46 of file esql_translate.c.
Referenced by emit_start().
#define FP c_out_stream |
Definition at line 54 of file esql_translate.c.
Referenced by emit_end(), emit_get_db_value(), emit_put_db_value(), emit_start(), emit_whenever(), tr_close_cs(), tr_commit(), tr_connect(), tr_delete_cs(), tr_describe(), tr_disconnect(), tr_execute(), tr_execute_immediate(), tr_fetch_cs(), tr_object_describe(), tr_object_fetch(), tr_object_update(), tr_open_cs(), tr_prepare_esql(), tr_print_n_string(), tr_rollback(), tr_static(), and tr_update_cs().
#define NOT_FOUND_MACRO_NAME "SQL_NOT_FOUND" |
Definition at line 47 of file esql_translate.c.
Referenced by emit_whenever().
#define REPETITIVE_SERIAL_NO (repetitive_no++) |
Definition at line 53 of file esql_translate.c.
Referenced by tr_object_update(), tr_static(), and tr_update_cs().
#define WARN_CHAR_MACRO_NAME "SQL_WARNING_CHAR" |
Definition at line 48 of file esql_translate.c.
Referenced by emit_whenever().
enum esql_msg |
Enumerator | |
---|---|
MSG_BAD_CASE |
Definition at line 140 of file esql_translate.c.
|
static |
Definition at line 189 of file esql_translate.c.
References emit_line_directive(), emit_whenever(), FP, and NL.
Referenced by tr_close_cs(), tr_commit(), tr_connect(), tr_delete_cs(), tr_describe(), tr_disconnect(), tr_execute(), tr_execute_immediate(), tr_fetch_cs(), tr_object_describe(), tr_object_fetch(), tr_object_update(), tr_open_cs(), tr_prepare_esql(), tr_rollback(), tr_static(), and tr_update_cs().
|
static |
Definition at line 1373 of file esql_translate.c.
References C_TYPE_DB_VALUE, c_type_to_db_type_c, C_TYPE_VARBIT, C_TYPE_VARCHAR, C_TYPE_VARNCHAR, emit_line_directive(), FP, NL, pp_get_addr_expr(), pp_get_ind_addr_expr(), pp_get_input_size(), pp_get_output_size(), and pp_get_type().
Referenced by tr_execute(), tr_fetch_cs(), tr_object_fetch(), and tr_static().
|
static |
Definition at line 1121 of file esql_translate.c.
References C_TYPE_BASICSET, C_TYPE_BIGINT, C_TYPE_BIT, C_TYPE_CHAR_ARRAY, C_TYPE_CHAR_POINTER, C_TYPE_COLLECTION, C_TYPE_DATE, C_TYPE_DB_VALUE, C_TYPE_DOUBLE, C_TYPE_FLOAT, C_TYPE_INTEGER, C_TYPE_LONG, C_TYPE_MONETARY, C_TYPE_MULTISET, C_TYPE_NCHAR, C_TYPE_OBJECTID, C_TYPE_SEQUENCE, C_TYPE_SHORT, C_TYPE_SQLDA, C_TYPE_STRING_CONST, C_TYPE_TIME, C_TYPE_TIMESTAMP, C_TYPE_VARBIT, C_TYPE_VARCHAR, C_TYPE_VARNCHAR, emit_line_directive(), esql_yyverror(), EX_TRANS_SET, FP, MSG_BAD_CASE, NL, NULL, NUM_C_TYPES, pp_disable_varchar_length, pp_get_addr_expr(), pp_get_expr(), pp_get_ind_addr_expr(), pp_get_input_size(), pp_get_msg(), pp_get_precision(), pp_get_type(), pp_malloc(), and strlen.
Referenced by tr_execute(), tr_object_update(), tr_open_cs(), tr_static(), and tr_update_cs().
|
static |
Definition at line 174 of file esql_translate.c.
References emit_line_directive(), ESQL_FILE_ID_VAR_NAME, FP, NL, and pp_uci_opt.
Referenced by tr_close_cs(), tr_commit(), tr_connect(), tr_delete_cs(), tr_describe(), tr_disconnect(), tr_execute(), tr_execute_immediate(), tr_fetch_cs(), tr_object_describe(), tr_object_fetch(), tr_object_update(), tr_open_cs(), tr_prepare_esql(), tr_rollback(), tr_static(), and tr_update_cs().
|
static |
Definition at line 1415 of file esql_translate.c.
References when_desc::action, CALL, CONTINUE, emit_line_directive(), FP, GOTO, when_desc::name, NL, NOT_FOUND_MACRO_NAME, pp_enable_uci_trace, STOP, and WARN_CHAR_MACRO_NAME.
Referenced by emit_end().
|
static |
Definition at line 1518 of file esql_translate.c.
References NULL, and pp_malloc().
Referenced by tr_object_update(), tr_open_cs(), and tr_static().
|
static |
Definition at line 205 of file esql_translate.c.
References C_TYPE_CHAR_ARRAY, C_TYPE_CHAR_POINTER, C_TYPE_NCHAR, C_TYPE_STRING_CONST, C_TYPE_VARCHAR, C_TYPE_VARNCHAR, esql_yyverror(), EX_TRANS_SET, MSG_BAD_CASE, pp_get_addr_expr(), pp_get_expr(), pp_get_input_size(), pp_get_msg(), and pp_get_type().
Referenced by tr_connect(), tr_execute_immediate(), and tr_prepare_esql().
|
static |
Definition at line 696 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, NL, and pp_enable_uci_trace.
|
static |
Definition at line 337 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, NL, and pp_enable_uci_trace.
Definition at line 254 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, get_quasi_string(), NL, NULL, and pp_enable_uci_trace.
|
static |
Definition at line 674 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, NL, and pp_enable_uci_trace.
|
static |
Definition at line 753 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, and NL.
|
static |
Definition at line 324 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, and NL.
|
static |
Definition at line 779 of file esql_translate.c.
References emit_end(), emit_get_db_value(), emit_line_directive(), emit_put_db_value(), emit_start(), FP, i, NL, NULL, and pp_enable_uci_trace.
|
static |
Definition at line 854 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, get_quasi_string(), NL, and pp_enable_uci_trace.
|
static |
Definition at line 566 of file esql_translate.c.
References emit_end(), emit_get_db_value(), emit_line_directive(), emit_start(), FP, i, NL, NULL, and pp_enable_uci_trace.
|
static |
Definition at line 884 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, i, NL, and pp_get_expr().
|
static |
Definition at line 931 of file esql_translate.c.
References emit_end(), emit_get_db_value(), emit_line_directive(), emit_start(), FP, i, NL, NULL, pp_enable_uci_trace, and pp_get_expr().
|
static |
Definition at line 1018 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_put_db_value(), emit_start(), escape_string(), FP, free_and_init, i, NL, NULL, pp_enable_uci_trace, REPETITIVE_SERIAL_NO, and tr_print_n_string().
|
static |
Definition at line 487 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_put_db_value(), emit_start(), escape_string(), FP, free_and_init, i, NL, NULL, pp_enable_uci_trace, and tr_print_n_string().
|
static |
Definition at line 718 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, get_quasi_string(), NL, and pp_enable_uci_trace.
|
static |
Definition at line 448 of file esql_translate.c.
References emit_line_directive(), FP, and NULL.
Referenced by tr_object_update(), tr_open_cs(), tr_static(), and tr_update_cs().
|
static |
Definition at line 354 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_start(), FP, NL, and pp_enable_uci_trace.
|
static |
Definition at line 1109 of file esql_translate.c.
References NL.
|
static |
Definition at line 1098 of file esql_translate.c.
References c_out_stream.
|
static |
Definition at line 381 of file esql_translate.c.
References emit_end(), emit_get_db_value(), emit_line_directive(), emit_put_db_value(), emit_start(), escape_string(), FP, free_and_init, i, NL, NULL, pp_enable_uci_trace, REPETITIVE_SERIAL_NO, and tr_print_n_string().
|
static |
Definition at line 632 of file esql_translate.c.
References emit_end(), emit_line_directive(), emit_put_db_value(), emit_start(), FP, i, NL, pp_enable_uci_trace, REPETITIVE_SERIAL_NO, and tr_print_n_string().
|
static |
Definition at line 1063 of file esql_translate.c.
References when_desc::action, when_desc::name, NOT_FOUND, on_error, on_not_found, on_warning, SQLERROR, SQLWARNING, and STOP.
|
static |
Definition at line 66 of file esql_translate.c.
Referenced by tr_set_out_stream().
|
static |
Definition at line 111 of file esql_translate.c.
Referenced by emit_get_db_value().
ESQL_TRANSLATE_TABLE esql_Translate_table |
Definition at line 145 of file esql_translate.c.
Referenced by pp_add_whenever_to_scope(), pp_finish_whenever_scope(), and pp_startup().
|
static |
Definition at line 69 of file esql_translate.c.
Referenced by emit_end(), emit_get_db_value(), emit_put_db_value(), emit_start(), emit_whenever(), tr_close_cs(), tr_commit(), tr_connect(), tr_delete_cs(), tr_describe(), tr_disconnect(), tr_execute(), tr_execute_immediate(), tr_fetch_cs(), tr_object_describe(), tr_object_fetch(), tr_object_update(), tr_open_cs(), tr_prepare_esql(), tr_rollback(), tr_set_line_terminator(), tr_static(), and tr_update_cs().
Definition at line 73 of file esql_translate.c.
Referenced by disk_to_class(), init_db_attribute_list(), pt_get_all_attributes_and_types(), pt_get_all_showstmt_attributes_and_types(), showstmt_alloc_array_context(), showstmt_metadata_init(), and tr_whenever().
Definition at line 74 of file esql_translate.c.
Referenced by tr_whenever().
Definition at line 72 of file esql_translate.c.
Referenced by tr_whenever().
|
static |
Definition at line 63 of file esql_translate.c.