CUBRID Engine  latest
db_value_table.c File Reference
#include "config.h"
#include <string.h>
#include <assert.h>
#include "db_stub.h"
#include "api_util.h"
#include "dbi.h"
#include "db.h"
Include dependency graph for db_value_table.c:

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 Documentation

typedef struct value_area_s_ VALUE_AREA_

Definition at line 48 of file db_value_table.c.

Definition at line 31 of file db_value_table.c.

Function Documentation

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

static void vbt_api_destroy ( VALUE_BIND_TABLE table)
static
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
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
static int vbt_api_reset ( VALUE_BIND_TABLE tbl)
static
static int vbt_api_set_value ( VALUE_BIND_TABLE tbl,
int  index,
CI_TYPE  type,
void *  addr,
size_t  len 
)
static
static int vbt_api_set_value_by_name ( VALUE_BIND_TABLE tbl,
const char *  name,
CI_TYPE  type,
void *  addr,
size_t  len 
)
static
static int vbt_apply_updatesf_map ( void *  arg,
int  index,
VALUE_AREA va,
API_VALUE val 
)
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().

Here is the caller graph for this function:

static void vbt_dtor ( VALUE_AREA v,
API_VALUE aval 
)
static

Definition at line 915 of file db_value_table.c.

References API_FREE, and db_value_free().

Referenced by vbt_api_destroy().

Here is the caller graph for this function:

static int vbt_resetf_map ( void *  arg,
int  index,
VALUE_AREA va,
API_VALUE val 
)
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().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

Variable Documentation

VALUE_BIND_TABLE_IFS VB_IFS_
static
Initial value:
= {
}
static void vbt_api_destroy(VALUE_BIND_TABLE *table)
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_apply_updates(VALUE_BIND_TABLE *tbl)
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_reset(VALUE_BIND_TABLE *tbl)
static int vbt_api_set_value_by_name(VALUE_BIND_TABLE *tbl, const char *name, CI_TYPE type, void *addr, size_t len)

Definition at line 939 of file db_value_table.c.

Referenced by create_db_value_bind_table().