CUBRID Engine
latest
|
#include "config.h"
#include <string.h>
#include <assert.h>
#include "db_stub.h"
#include "api_util.h"
#include "dbi.h"
#include "db.h"
Go to the source code of this file.
Classes | |
struct | value_bind_table_s_ |
struct | value_area_s_ |
Typedefs | |
typedef struct value_bind_table_s_ | VALUE_BIND_TABLE_ |
typedef struct value_area_s_ | VALUE_AREA_ |
Functions | |
static int | value_to_db_value (CI_TYPE type, void *addr, size_t len, DB_VALUE *val, bool domain_initialized) |
static int | db_value_to_value (BIND_HANDLE conn, const DB_VALUE *val, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull) |
static int | vbt_lazy_init_db_value (VALUE_BIND_TABLE_ *vbt, int index, CHECK_PURPOSE pup, VALUE_AREA **rva, DB_VALUE **rv) |
static int | vbt_api_get_value (VALUE_BIND_TABLE *tbl, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull) |
static int | vbt_api_set_value (VALUE_BIND_TABLE *tbl, int index, CI_TYPE type, void *addr, size_t len) |
static int | vbt_api_get_value_by_name (VALUE_BIND_TABLE *tbl, const char *name, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull) |
static int | vbt_api_set_value_by_name (VALUE_BIND_TABLE *tbl, const char *name, CI_TYPE type, void *addr, size_t len) |
static int | vbt_apply_updatesf_map (void *arg, int index, VALUE_AREA *va, API_VALUE *val) |
static int | vbt_api_apply_updates (VALUE_BIND_TABLE *tbl) |
static int | vbt_resetf_map (void *arg, int index, VALUE_AREA *va, API_VALUE *val) |
static int | vbt_api_reset (VALUE_BIND_TABLE *tbl) |
static void | vbt_dtor (VALUE_AREA *v, API_VALUE *aval) |
static void | vbt_api_destroy (VALUE_BIND_TABLE *table) |
int | db_type_to_type (DB_TYPE dt, CI_TYPE *xt) |
int | type_to_db_type (CI_TYPE xt, DB_TYPE *dt) |
void | xoid2oid (CI_OID *xoid, OID *oid) |
void | oid2xoid (OID *oid, BIND_HANDLE conn, CI_OID *xoid) |
int | coerce_value_to_db_value (CI_TYPE type, void *addr, size_t len, DB_VALUE *dbval, bool domain_initialized) |
int | coerce_db_value_to_value (const DB_VALUE *dbval, BIND_HANDLE conn, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull) |
int | create_db_value_bind_table (int nvalue, void *impl, int auto_apply, BIND_HANDLE conn_handle, int(*get_index_by_name)(void *, const char *, int *), int(*get_db_value)(void *, int, DB_VALUE *), int(*set_db_value)(void *, int, DB_VALUE *), int(*init_domain)(void *, int, DB_VALUE *), VALUE_BIND_TABLE **rtable) |
Variables | |
static VALUE_BIND_TABLE_IFS | VB_IFS_ |
typedef struct value_area_s_ VALUE_AREA_ |
Definition at line 48 of file db_value_table.c.
typedef struct value_bind_table_s_ VALUE_BIND_TABLE_ |
Definition at line 31 of file db_value_table.c.
int coerce_db_value_to_value | ( | const DB_VALUE * | dbval, |
BIND_HANDLE | conn, | ||
CI_TYPE | type, | ||
void * | addr, | ||
size_t | len, | ||
size_t * | outlen, | ||
bool * | isnull | ||
) |
Definition at line 1177 of file db_value_table.c.
References db_value_to_value(), ER_INTERFACE_INVALID_ARGUMENT, and NULL.
Referenced by col_api_get_elem(), and stmt_get_parameter_internal().
int coerce_value_to_db_value | ( | CI_TYPE | type, |
void * | addr, | ||
size_t | len, | ||
DB_VALUE * | dbval, | ||
bool | domain_initialized | ||
) |
Definition at line 1155 of file db_value_table.c.
References ER_INTERFACE_INVALID_ARGUMENT, NULL, and value_to_db_value().
Referenced by col_api_insert(), col_api_update(), and stmt_set_parameter_internal().
int create_db_value_bind_table | ( | int | nvalue, |
void * | impl, | ||
int | auto_apply, | ||
BIND_HANDLE | conn_handle, | ||
int(*)(void *, const char *, int *) | get_index_by_name, | ||
int(*)(void *, int, DB_VALUE *) | get_db_value, | ||
int(*)(void *, int, DB_VALUE *) | set_db_value, | ||
int(*)(void *, int, DB_VALUE *) | init_domain, | ||
VALUE_BIND_TABLE ** | rtable | ||
) |
Definition at line 1206 of file db_value_table.c.
References API_FREE, API_MALLOC, array_indexer_create(), assert, value_bind_table_s_::auto_apply, value_bind_table_s_::conn_handle, ER_INTERFACE_NO_MORE_MEMORY, value_bind_table_s_::get_db_value, value_bind_table_s_::get_index_by_name, value_bind_table_s::ifs, value_bind_table_s_::impl, value_bind_table_s_::indexer, value_bind_table_s_::init_domain, NO_ERROR, NULL, value_bind_table_s_::set_db_value, value_bind_table_s_::tbl, and VB_IFS_.
int db_type_to_type | ( | DB_TYPE | dt, |
CI_TYPE * | xt | ||
) |
Definition at line 959 of file db_value_table.c.
References DB_TYPE_BIGINT, DB_TYPE_BIT, DB_TYPE_BLOB, DB_TYPE_CHAR, DB_TYPE_CLOB, DB_TYPE_DATE, DB_TYPE_DATETIME, DB_TYPE_DOUBLE, DB_TYPE_ELO, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_MONETARY, DB_TYPE_MULTISET, DB_TYPE_NCHAR, DB_TYPE_NULL, DB_TYPE_NUMERIC, DB_TYPE_OBJECT, DB_TYPE_OID, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_TYPE_SHORT, DB_TYPE_STRING, DB_TYPE_TIME, DB_TYPE_TIMESTAMP, DB_TYPE_VARBIT, DB_TYPE_VARNCHAR, ER_INTERFACE_GENERIC, ER_INTERFACE_INVALID_ARGUMENT, NO_ERROR, and NULL.
Referenced by api_rmeta_get_info(), col_api_get_elem_domain_info(), pmeta_get_info_internal(), and rm_api_get_info().
|
static |
Definition at line 340 of file db_value_table.c.
References api_collection_create_from_db_value(), assert, db_date_decode(), db_get_object(), db_get_oid(), db_get_string(), db_identifier(), db_make_null(), db_time_decode(), db_timestamp_decode_ses(), DB_TYPE_BIGINT, DB_TYPE_C_BIT, DB_TYPE_C_CHAR, DB_TYPE_C_DATE, DB_TYPE_C_DOUBLE, DB_TYPE_C_FLOAT, DB_TYPE_C_INT, DB_TYPE_C_MONETARY, DB_TYPE_C_NCHAR, DB_TYPE_C_SHORT, DB_TYPE_C_TIME, DB_TYPE_C_TIMESTAMP, DB_TYPE_C_VARBIT, DB_TYPE_C_VARCHAR, DB_TYPE_C_VARNCHAR, DB_TYPE_CHAR, DB_TYPE_DOUBLE, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_MONETARY, DB_TYPE_NCHAR, DB_TYPE_NULL, DB_TYPE_NUMERIC, DB_TYPE_OBJECT, DB_TYPE_OID, DB_TYPE_SHORT, DB_TYPE_VARCHAR, DB_TYPE_VARNCHAR, db_value_clear(), DB_VALUE_DOMAIN_TYPE, db_value_get(), db_value_type(), ER_GENERIC_ERROR, ER_INTERFACE_GENERIC, ER_INTERFACE_INVALID_ARGUMENT, ER_INTERFACE_NOT_SUPPORTED_OPERATION, NO_ERROR, NULL, numeric_coerce_string_to_num(), and oid2xoid().
Referenced by coerce_db_value_to_value(), and vbt_api_get_value().
void oid2xoid | ( | OID * | oid, |
BIND_HANDLE | conn, | ||
CI_OID * | xoid | ||
) |
Definition at line 1138 of file db_value_table.c.
References db_identifier::pageid, db_identifier::slotid, and db_identifier::volid.
Referenced by db_value_to_value().
int type_to_db_type | ( | CI_TYPE | xt, |
DB_TYPE * | dt | ||
) |
Definition at line 1045 of file db_value_table.c.
References DB_TYPE_BIGINT, DB_TYPE_BIT, DB_TYPE_CHAR, DB_TYPE_DATE, DB_TYPE_DATETIME, DB_TYPE_DOUBLE, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_MONETARY, DB_TYPE_NCHAR, DB_TYPE_NULL, DB_TYPE_NUMERIC, DB_TYPE_OBJECT, DB_TYPE_SEQUENCE, DB_TYPE_SHORT, DB_TYPE_TIME, DB_TYPE_TIMESTAMP, DB_TYPE_VARBIT, DB_TYPE_VARCHAR, ER_INTERFACE_GENERIC, ER_INTERFACE_INVALID_ARGUMENT, NO_ERROR, and NULL.
Referenced by value_to_db_value().
|
static |
Definition at line 83 of file db_value_table.c.
References api_collection_set_to_db_value(), api_er_set, ARG_FILE_LINE, db_c_date::day, DB_CURRENCY_DEFAULT, db_datetime_encode(), db_domain_precision(), db_domain_scale(), db_get_date(), db_get_time(), db_make_date(), db_make_monetary(), db_make_null(), db_make_oid(), db_make_time(), db_object(), db_timestamp_encode_ses(), DB_TYPE_C_BIGINT, DB_TYPE_C_BIT, DB_TYPE_C_CHAR, DB_TYPE_C_DATE, DB_TYPE_C_DATETIME, DB_TYPE_C_DOUBLE, DB_TYPE_C_FLOAT, DB_TYPE_C_INT, DB_TYPE_C_MONETARY, DB_TYPE_C_NCHAR, DB_TYPE_C_OBJECT, DB_TYPE_C_SHORT, DB_TYPE_C_TIME, DB_TYPE_C_TIMESTAMP, DB_TYPE_C_VARBIT, DB_TYPE_C_VARCHAR, DB_TYPE_C_VARNCHAR, db_type_to_db_domain(), db_value_clear(), db_value_domain_init(), db_value_put(), db_value::domain, ER_ERROR_SEVERITY, ER_INTERFACE_GENERIC, ER_INTERFACE_INVALID_ARGUMENT, db_c_time::hour, db_object::lock, db_c_time::minute, db_c_date::month, NO_ERROR, NULL, NULL_LOCK, pr_clone_value(), db_c_time::second, type_to_db_type(), xoid2oid(), and db_c_date::year.
Referenced by coerce_value_to_db_value(), and vbt_api_set_value().
|
static |
Definition at line 844 of file db_value_table.c.
References assert, value_bind_table_s_::auto_apply, value_indexer_s::ifs, value_bind_table_s_::indexer, value_indexer_ifs_s::map, NO_ERROR, NULL, and vbt_apply_updatesf_map().
|
static |
Definition at line 931 of file db_value_table.c.
References API_FREE, assert, value_indexer_ifs_s::destroy, value_indexer_s::ifs, value_bind_table_s_::indexer, NULL, and vbt_dtor().
|
static |
Definition at line 682 of file db_value_table.c.
References assert, CHECK_FOR_GET, value_bind_table_s_::conn_handle, db_value_to_value(), value_bind_table_s_::get_db_value, value_bind_table_s_::impl, NO_ERROR, NULL, value_area_s_::val_read, and vbt_lazy_init_db_value().
|
static |
Definition at line 768 of file db_value_table.c.
References assert, value_bind_table_s_::get_index_by_name, value_bind_table_ifs_s::get_value, value_bind_table_s::ifs, value_bind_table_s_::impl, NO_ERROR, NULL, and value_bind_table_s_::tbl.
|
static |
Definition at line 896 of file db_value_table.c.
References assert, value_indexer_s::ifs, value_bind_table_s_::indexer, value_indexer_ifs_s::map, NULL, and vbt_resetf_map().
|
static |
Definition at line 721 of file db_value_table.c.
References assert, value_bind_table_s_::auto_apply, CHECK_FOR_SET, value_bind_table_s_::impl, value_area_s_::need_apply, NO_ERROR, NULL, value_bind_table_s_::set_db_value, value_to_db_value(), and vbt_lazy_init_db_value().
|
static |
Definition at line 792 of file db_value_table.c.
References assert, value_bind_table_s_::get_index_by_name, value_bind_table_s::ifs, value_bind_table_s_::impl, NO_ERROR, NULL, value_bind_table_ifs_s::set_value, and value_bind_table_s_::tbl.
|
static |
Definition at line 815 of file db_value_table.c.
References assert, value_bind_table_s_::impl, value_area_s_::need_apply, NO_ERROR, NULL, and value_bind_table_s_::set_db_value.
Referenced by vbt_api_apply_updates().
|
static |
Definition at line 915 of file db_value_table.c.
References API_FREE, and db_value_free().
Referenced by vbt_api_destroy().
|
static |
Definition at line 621 of file db_value_table.c.
References API_CALLOC, API_FREE, assert, value_indexer_ifs_s::check, db_value_create(), db_value_free(), ER_INTERFACE_NO_MORE_MEMORY, value_indexer_ifs_s::get, value_indexer_s::ifs, value_bind_table_s_::impl, value_bind_table_s_::indexer, value_bind_table_s_::init_domain, NO_ERROR, NULL, and value_indexer_ifs_s::set.
Referenced by vbt_api_get_value(), and vbt_api_set_value().
|
static |
Definition at line 865 of file db_value_table.c.
References API_FREE, assert, db_value_free(), value_indexer_s::ifs, value_bind_table_s_::indexer, NO_ERROR, NULL, and value_indexer_ifs_s::set.
Referenced by vbt_api_reset().
void xoid2oid | ( | CI_OID * | xoid, |
OID * | oid | ||
) |
Definition at line 1121 of file db_value_table.c.
References assert, NULL, db_identifier::pageid, db_identifier::slotid, and db_identifier::volid.
Referenced by orp_api_get_object_resultset(), orp_oid_delete(), orp_oid_get_classname(), and value_to_db_value().
|
static |
Definition at line 939 of file db_value_table.c.
Referenced by create_db_value_bind_table().