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

Go to the source code of this file.

Classes

struct  object_rm_bind_s
 
struct  object_res_bind_s
 
struct  object_resultset_s_
 
struct  object_resultset_pool_s
 

Typedefs

typedef struct object_rm_bind_s OBJECT_RM_BIND
 
typedef struct object_res_bind_s OBJECT_RES_BIND
 
typedef struct object_resultset_s_ OBJECT_RESULTSET
 
typedef struct object_resultset_pool_s OBJECT_RESULTSET_POOL
 

Functions

static int rm_api_get_count (API_RESULTSET_META *impl, int *count)
 
static int rm_api_get_info (API_RESULTSET_META *impl, int index, CI_RMETA_INFO_TYPE type, void *arg, size_t size)
 
static void or_rm_bind_destroyf (BH_BIND *bind)
 
static int or_rm_bind_create (OBJECT_RESULTSET *or, OBJECT_RM_BIND **rrm_bind)
 
static void or_rm_bind_destroy (OBJECT_RM_BIND *rm_bind)
 
static int res_api_get_resultset_metadata (API_RESULTSET *impl, API_RESULTSET_META **rimpl)
 
static int res_api_fetch (API_RESULTSET *impl, int offset, CI_FETCH_POSITION pos)
 
static int res_api_tell (API_RESULTSET *impl, int *offset)
 
static int res_api_clear_updates (API_RESULTSET *impl)
 
static int res_api_delete_row (API_RESULTSET *impl)
 
static int res_api_get_value (API_RESULTSET *impl, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *is_null)
 
static int res_api_get_value_by_name (API_RESULTSET *impl, const char *name, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
 
static int res_api_update_value (API_RESULTSET *impl, int index, CI_TYPE type, void *addr, size_t len)
 
static int res_api_apply_update (API_RESULTSET *impl)
 
static void res_api_destroy (API_RESULTSET *impl)
 
static void or_res_bind_destroyf (BH_BIND *bind)
 
static int or_res_bind_create (OBJECT_RESULTSET *or, OBJECT_RES_BIND **rres_bind)
 
static void or_res_bind_destroy (OBJECT_RES_BIND *res_bind)
 
static int vt_api_get_index_by_name (void *impl, const char *name, int *ri)
 
static int vt_api_get_db_value (void *impl, int index, DB_VALUE *dbval)
 
static int vt_api_set_db_value (void *impl, int index, DB_VALUE *dbval)
 
static int vt_api_init_domain (void *impl, int index, DB_VALUE *value)
 
static void or_destroy (OBJECT_RESULTSET *or)
 
static int or_create (OID *oid, BIND_HANDLE conn, BH_INTERFACE *bh_ifs, OBJECT_RESULTSET **ror)
 
static int orp_ht_comparef (void *key1, void *key2, int *r)
 
static int orp_ht_hashf (void *key, unsigned int *rv)
 
static int orp_ht_keyf (void *elem, void **rk)
 
static int orp_api_get_object_resultset (API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid, API_RESULTSET **rref)
 
static int orp_oid_delete (API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid)
 
static int orp_oid_get_classname (API_OBJECT_RESULTSET_POOL *pool, CI_OID *xoid, char *name, size_t size)
 
static void orp_api_destroy (API_OBJECT_RESULTSET_POOL *pool)
 
static int apif_tell (DB_OBJECT *obj, int *pos)
 
static int apif_last_pos (DB_OBJECT *obj, int *pos)
 
int api_object_resultset_pool_create (BH_INTERFACE *ifs, BIND_HANDLE conn, API_OBJECT_RESULTSET_POOL **rpool)
 

Variables

static API_RESULTSET_META_IFS RM_IFS_
 
static API_RESULTSET_IFS RES_IFS_
 

Typedef Documentation

Definition at line 31 of file db_object.c.

Definition at line 32 of file db_object.c.

Definition at line 33 of file db_object.c.

Definition at line 30 of file db_object.c.

Function Documentation

static int apif_last_pos ( DB_OBJECT obj,
int *  pos 
)
static

Definition at line 1129 of file db_object.c.

References assert, db_get_int(), db_send(), NO_ERROR, and NULL.

static int apif_tell ( DB_OBJECT obj,
int *  pos 
)
static

Definition at line 1104 of file db_object.c.

References assert, db_get_int(), db_send(), NO_ERROR, and NULL.

static int or_res_bind_create ( OBJECT_RESULTSET or,
OBJECT_RES_BIND **  rres_bind 
)
static
static void or_res_bind_destroy ( OBJECT_RES_BIND res_bind)
static

Definition at line 644 of file db_object.c.

References API_FREE, assert, and NULL.

Referenced by or_create(), and or_res_bind_destroyf().

Here is the caller graph for this function:

static void or_res_bind_destroyf ( BH_BIND bind)
static

Definition at line 604 of file db_object.c.

References assert, NULL, object_res_bind_s::or, or_res_bind_destroy(), and object_resultset_s_::res_bind.

Referenced by or_res_bind_create().

Here is the caller graph for this function:

static int or_rm_bind_create ( OBJECT_RESULTSET or,
OBJECT_RM_BIND **  rrm_bind 
)
static

Definition at line 326 of file db_object.c.

References API_MALLOC, assert, ER_INTERFACE_NO_MORE_MEMORY, HANDLE_TYPE_RMETA, NO_ERROR, NULL, object_rm_bind_s::or, or_rm_bind_destroyf(), object_rm_bind_s::rm, and RM_IFS_.

Referenced by or_create().

Here is the caller graph for this function:

static void or_rm_bind_destroy ( OBJECT_RM_BIND rm_bind)
static

Definition at line 348 of file db_object.c.

References API_FREE, assert, and NULL.

Referenced by or_create(), and or_rm_bind_destroyf().

Here is the caller graph for this function:

static void or_rm_bind_destroyf ( BH_BIND bind)
static

Definition at line 310 of file db_object.c.

References assert, NULL, object_rm_bind_s::or, or_rm_bind_destroy(), and object_resultset_s_::rm_bind.

Referenced by or_rm_bind_create().

Here is the caller graph for this function:

static void orp_api_destroy ( API_OBJECT_RESULTSET_POOL pool)
static

Definition at line 1088 of file db_object.c.

References API_FREE, assert, hash_destroy(), object_resultset_pool_s::ht, NULL, and p.

Referenced by api_object_resultset_pool_create().

Here is the caller graph for this function:

static int orp_api_get_object_resultset ( API_OBJECT_RESULTSET_POOL pool,
CI_OID *  oid,
API_RESULTSET **  rref 
)
static
static int orp_ht_comparef ( void *  key1,
void *  key2,
int *  r 
)
static

Definition at line 922 of file db_object.c.

References assert, NO_ERROR, NULL, OID_EQ, and OID_GT.

Referenced by api_object_resultset_pool_create().

Here is the caller graph for this function:

static int orp_ht_hashf ( void *  key,
unsigned int *  rv 
)
static

Definition at line 940 of file db_object.c.

References assert, NO_ERROR, NULL, and OID_PSEUDO_KEY.

Referenced by api_object_resultset_pool_create().

Here is the caller graph for this function:

static int orp_ht_keyf ( void *  elem,
void **  rk 
)
static

Definition at line 957 of file db_object.c.

References assert, NO_ERROR, NULL, object_resultset_s_::oid, and object_rm_bind_s::or.

Referenced by api_object_resultset_pool_create().

Here is the caller graph for this function:

static int orp_oid_delete ( API_OBJECT_RESULTSET_POOL pool,
CI_OID *  oid 
)
static
static int orp_oid_get_classname ( API_OBJECT_RESULTSET_POOL pool,
CI_OID *  xoid,
char *  name,
size_t  size 
)
static

Definition at line 1048 of file db_object.c.

References assert, db_get_class_name(), hash_lookup(), object_resultset_pool_s::ht, NO_ERROR, NULL, p, ws_mop(), and xoid2oid().

Referenced by api_object_resultset_pool_create().

Here is the caller graph for this function:

static void res_api_destroy ( API_RESULTSET impl)
static

Definition at line 577 of file db_object.c.

References assert, NULL, object_rm_bind_s::or, and or_destroy().

static int res_api_fetch ( API_RESULTSET impl,
int  offset,
CI_FETCH_POSITION  pos 
)
static
static int res_api_get_resultset_metadata ( API_RESULTSET impl,
API_RESULTSET_META **  rimpl 
)
static

Definition at line 364 of file db_object.c.

References assert, NO_ERROR, NULL, object_rm_bind_s::or, and object_resultset_s_::rm_bind.

static int res_api_get_value ( API_RESULTSET impl,
int  index,
CI_TYPE  type,
void *  addr,
size_t  len,
size_t *  outlen,
bool is_null 
)
static
static int res_api_get_value_by_name ( API_RESULTSET impl,
const char *  name,
CI_TYPE  type,
void *  addr,
size_t  len,
size_t *  outlen,
bool isnull 
)
static
static int res_api_tell ( API_RESULTSET impl,
int *  offset 
)
static

Definition at line 409 of file db_object.c.

References assert, NO_ERROR, NULL, and object_rm_bind_s::or.

static int res_api_update_value ( API_RESULTSET impl,
int  index,
CI_TYPE  type,
void *  addr,
size_t  len 
)
static
static int rm_api_get_count ( API_RESULTSET_META impl,
int *  count 
)
static

Definition at line 121 of file db_object.c.

References assert, object_resultset_s_::nattrs, NO_ERROR, NULL, and object_rm_bind_s::or.

static int vt_api_get_db_value ( void *  impl,
int  index,
DB_VALUE dbval 
)
static

Definition at line 684 of file db_object.c.

References assert, object_resultset_s_::attr_index, db_get(), ER_INTERFACE_GENERIC, sm_attribute::header, sm_component::name, NO_ERROR, NULL, object_resultset_s_::obj, and object_rm_bind_s::or.

Referenced by or_create().

Here is the caller graph for this function:

static int vt_api_get_index_by_name ( void *  impl,
const char *  name,
int *  ri 
)
static

Definition at line 658 of file db_object.c.

References assert, object_resultset_s_::attr_index, db_attribute_name(), ER_INTERFACE_GENERIC, i, object_resultset_s_::nattrs, NO_ERROR, NULL, and object_rm_bind_s::or.

Referenced by or_create().

Here is the caller graph for this function:

static int vt_api_init_domain ( void *  impl,
int  index,
DB_VALUE value 
)
static

Definition at line 734 of file db_object.c.

References assert, object_resultset_s_::attr_index, db_attribute_domain(), db_domain_precision(), db_domain_scale(), db_value_domain_init(), NO_ERROR, NULL, object_rm_bind_s::or, p, and TP_DOMAIN_TYPE.

Referenced by or_create().

Here is the caller graph for this function:

static int vt_api_set_db_value ( void *  impl,
int  index,
DB_VALUE dbval 
)
static

Definition at line 706 of file db_object.c.

References assert, object_resultset_s_::attr_index, db_put(), ER_INTERFACE_GENERIC, sm_attribute::header, sm_component::name, NO_ERROR, NULL, object_resultset_s_::obj, and object_rm_bind_s::or.

Referenced by or_create().

Here is the caller graph for this function:

Variable Documentation

API_RESULTSET_IFS RES_IFS_
static
Initial value:
= {
}
static int res_api_fetch(API_RESULTSET *impl, int offset, CI_FETCH_POSITION pos)
Definition: db_object.c:382
static int res_api_tell(API_RESULTSET *impl, int *offset)
Definition: db_object.c:409
static int res_api_delete_row(API_RESULTSET *impl)
Definition: db_object.c:445
static int res_api_get_resultset_metadata(API_RESULTSET *impl, API_RESULTSET_META **rimpl)
Definition: db_object.c:364
static int res_api_get_value(API_RESULTSET *impl, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *is_null)
Definition: db_object.c:475
static int res_api_clear_updates(API_RESULTSET *impl)
Definition: db_object.c:425
static int res_api_get_value_by_name(API_RESULTSET *impl, const char *name, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
Definition: db_object.c:507
static int res_api_update_value(API_RESULTSET *impl, int index, CI_TYPE type, void *addr, size_t len)
Definition: db_object.c:533
static int res_api_apply_update(API_RESULTSET *impl)
Definition: db_object.c:558
static void res_api_destroy(API_RESULTSET *impl)
Definition: db_object.c:577

Definition at line 585 of file db_object.c.

Referenced by or_res_bind_create().

API_RESULTSET_META_IFS RM_IFS_
static
Initial value:
= {
}
static int rm_api_get_info(API_RESULTSET_META *impl, int index, CI_RMETA_INFO_TYPE type, void *arg, size_t size)
Definition: db_object.c:142
static int rm_api_get_count(API_RESULTSET_META *impl, int *count)
Definition: db_object.c:121

Definition at line 299 of file db_object.c.

Referenced by or_rm_bind_create().