209 #define API_VAL_CCI_BIND_FLAG_GET 0x01 210 #define API_VAL_CCI_BIND_FLAG_SET 0x02 266 size_t len,
size_t * outlen,
bool * is_null);
282 size_t * outlen,
bool * isnull);
321 size_t * outlen,
bool * isnull);
337 static void xoid2oidstr (
const CI_OID * xoid,
char *oidbuf);
338 static int oidstr2xoid (
const char *oidstr, CI_CONNECTION conn, CI_OID * xoid);
359 static int xcol_create (CI_TYPE type, CI_CONNECTION conn, CI_COLLECTION * rcol);
364 static int cci_set_to_xcol (CI_CONNECTION conn, T_CCI_SET tset, CI_COLLECTION * col);
365 static int xcol_copy (CI_COLLECTION col, CI_COLLECTION * rcol);
419 case CCI_ER_NO_ERROR:
423 case CCI_ER_CON_HANDLE:
424 case CCI_ER_NO_MORE_MEMORY:
425 case CCI_ER_COMMUNICATION:
426 case CCI_ER_NO_MORE_DATA:
427 case CCI_ER_TRAN_TYPE:
428 case CCI_ER_STRING_PARAM:
429 case CCI_ER_TYPE_CONVERSION:
430 case CCI_ER_BIND_INDEX:
432 case CCI_ER_PARAM_NAME:
433 case CCI_ER_COLUMN_INDEX:
434 case CCI_ER_SCHEMA_TYPE:
437 case CCI_ER_ALLOC_CON_HANDLE:
438 case CCI_ER_REQ_HANDLE:
439 case CCI_ER_INVALID_CURSOR_POS:
440 case CCI_ER_HOSTNAME:
442 case CCI_ER_SET_INDEX:
443 case CCI_ER_DELETED_TUPLE:
444 case CCI_ER_SAVEPOINT_CMD:
445 case CCI_ER_THREAD_RUNNING:
446 case CCI_ER_ISOLATION_LEVEL:
447 case CCI_ER_BIND_ARRAY_SIZE:
449 case CCI_ER_NOT_BIND:
478 case CCI_ER_NOT_IMPLEMENTED:
592 if (pv->
type == CI_TYPE_COLLECTION)
616 case CCI_U_TYPE_NULL:
618 case CCI_U_TYPE_CHAR:
620 case CCI_U_TYPE_STRING:
621 return CI_TYPE_VARCHAR;
622 case CCI_U_TYPE_NCHAR:
623 return CI_TYPE_NCHAR;
624 case CCI_U_TYPE_VARNCHAR:
625 return CI_TYPE_VARNCHAR;
628 case CCI_U_TYPE_VARBIT:
629 return CI_TYPE_VARBIT;
630 case CCI_U_TYPE_NUMERIC:
631 return CI_TYPE_NUMERIC;
632 case CCI_U_TYPE_BIGINT:
633 case CCI_U_TYPE_UBIGINT:
634 return CI_TYPE_BIGINT;
636 case CCI_U_TYPE_UINT:
638 case CCI_U_TYPE_SHORT:
639 case CCI_U_TYPE_USHORT:
640 return CI_TYPE_SHORT;
641 case CCI_U_TYPE_MONETARY:
642 return CI_TYPE_MONETARY;
643 case CCI_U_TYPE_FLOAT:
644 return CI_TYPE_FLOAT;
645 case CCI_U_TYPE_DOUBLE:
646 return CI_TYPE_DOUBLE;
647 case CCI_U_TYPE_DATE:
649 case CCI_U_TYPE_TIME:
651 case CCI_U_TYPE_TIMESTAMP:
652 return CI_TYPE_TIMESTAMP;
653 case CCI_U_TYPE_DATETIME:
654 return CI_TYPE_DATETIME;
656 case CCI_U_TYPE_MULTISET:
657 case CCI_U_TYPE_SEQUENCE:
658 return CI_TYPE_COLLECTION;
659 case CCI_U_TYPE_OBJECT:
661 case CCI_U_TYPE_RESULTSET:
680 return CCI_U_TYPE_NULL;
682 return CCI_U_TYPE_BIGINT;
684 return CCI_U_TYPE_INT;
686 return CCI_U_TYPE_SHORT;
688 return CCI_U_TYPE_FLOAT;
690 return CCI_U_TYPE_DOUBLE;
692 return CCI_U_TYPE_CHAR;
693 case CI_TYPE_VARCHAR:
694 return CCI_U_TYPE_STRING;
696 return CCI_U_TYPE_NCHAR;
697 case CI_TYPE_VARNCHAR:
698 return CCI_U_TYPE_VARNCHAR;
700 return CCI_U_TYPE_BIT;
702 return CCI_U_TYPE_VARBIT;
704 return CCI_U_TYPE_TIME;
706 return CCI_U_TYPE_DATE;
707 case CI_TYPE_TIMESTAMP:
708 return CCI_U_TYPE_TIMESTAMP;
709 case CI_TYPE_DATETIME:
710 return CCI_U_TYPE_DATETIME;
711 case CI_TYPE_MONETARY:
712 return CCI_U_TYPE_MONETARY;
713 case CI_TYPE_NUMERIC:
714 return CCI_U_TYPE_NUMERIC;
716 return CCI_U_TYPE_OBJECT;
717 case CI_TYPE_COLLECTION:
718 return CCI_U_TYPE_SEQUENCE;
722 return CCI_U_TYPE_NULL;
741 if (pv->
type != type)
747 if (type == CI_TYPE_NULL)
752 else if (type == CI_TYPE_COLLECTION)
761 *(CI_COLLECTION *) addr = col;
762 *outlen =
sizeof (CI_COLLECTION);
767 memcpy (addr, pv->
ptr, pv->
len);
787 if (pv->
type == CI_TYPE_COLLECTION)
789 CI_COLLECTION col = *(CI_COLLECTION *) pv->
ptr;
800 memcpy (pv->
ptr, addr, len);
809 memcpy (ptr, addr, len);
810 ((
char *) ptr)[len] = 0;
835 *len =
sizeof (INT64);
843 *len =
sizeof (short);
847 *len =
sizeof (float);
851 case CI_TYPE_MONETARY:
852 *len =
sizeof (double);
856 case CI_TYPE_VARCHAR:
858 case CI_TYPE_VARNCHAR:
861 case CI_TYPE_NUMERIC:
867 case CI_TYPE_TIMESTAMP:
868 case CI_TYPE_DATETIME:
869 *len =
sizeof (CI_TIME);
873 *len =
sizeof (CI_OID);
876 case CI_TYPE_COLLECTION:
877 *len =
sizeof (CI_COLLECTION);
902 bind->
atype = CCI_A_TYPE_STR;
905 if ((type != CI_TYPE_NULL && (ptr ==
NULL || len <= 0)))
918 if (len < SSIZEOF (
int))
922 bind->
atype = CCI_A_TYPE_INT;
928 if (len < SSIZEOF (
short))
933 bind->
atype = CCI_A_TYPE_INT;
944 if (len < SSIZEOF (
float))
948 bind->
atype = CCI_A_TYPE_FLOAT;
954 if (len < SSIZEOF (
float))
959 bind->
atype = CCI_A_TYPE_DOUBLE;
965 case CI_TYPE_VARCHAR:
967 case CI_TYPE_VARNCHAR:
973 bind->
atype = CCI_A_TYPE_STR;
986 bind->
atype = CCI_A_TYPE_BIT;
1004 case CI_TYPE_TIMESTAMP:
1005 case CI_TYPE_DATETIME:
1006 if (len < SSIZEOF (CI_TIME))
1011 bind->
atype = CCI_A_TYPE_DATE;
1016 case CI_TYPE_MONETARY:
1017 if (len < SSIZEOF (
double))
1022 bind->
atype = CCI_A_TYPE_DOUBLE;
1027 case CI_TYPE_NUMERIC:
1034 bind->
atype = CCI_A_TYPE_STR;
1054 bind->
atype = CCI_A_TYPE_STR;
1064 case CI_TYPE_COLLECTION:
1065 if (len < SSIZEOF (CI_COLLECTION *))
1073 T_CCI_SET tset =
NULL;
1079 bind->
atype = CCI_A_TYPE_SET;
1086 bind->
atype = CCI_A_TYPE_SET;
1109 memset (bind, 0,
sizeof (*bind));
1159 res = cci_bind_param (req_handle, index, bind.
atype, bind.
value, utype, CCI_BIND_PTR);
1184 size_t * outlen,
bool * is_null)
1198 res = cci_get_data (req_handle, index, bind.
atype, bind.
value, &indicator);
1205 if (indicator == -1)
1218 if (type == CI_TYPE_OID)
1227 else if (bind.
atype == CCI_A_TYPE_BIT)
1237 else if (bind.
atype == CCI_A_TYPE_STR)
1239 if (indicator + 1 > (ssize_t) len)
1244 *outlen = indicator;
1246 ((
char *) addr)[indicator] = 0;
1248 else if (bind.
atype == CCI_A_TYPE_SET)
1256 *(CI_COLLECTION *) addr = col;
1312 res = cci_set_get (tset, i + 1, bind.
atype, bind.
value, &indicator);
1320 if (indicator == -1)
1323 type = CI_TYPE_NULL;
1329 if (type == CI_TYPE_OID)
1333 len =
sizeof (*xoid);
1343 else if (bind.
atype == CCI_A_TYPE_BIT)
1354 else if (bind.
atype == CCI_A_TYPE_STR)
1356 len = indicator + 1;
1364 ((
char *) ptr)[indicator] = 0;
1366 else if (bind.
atype == CCI_A_TYPE_SET)
1370 len =
sizeof (CI_COLLECTION *);
1385 *(CI_COLLECTION *) ptr = col;
1455 res = cci_cursor_update (req_handle, offset, index, bind.
atype, bind.
value, err_buf);
1540 if (pos == CI_FETCH_POSITION_FIRST)
1544 else if (pos == CI_FETCH_POSITION_CURRENT)
1548 else if (pos == CI_FETCH_POSITION_LAST)
1557 res = cci_cursor (pres->
req_handle, origin + offset, CCI_CURSOR_FIRST, pres->
err_buf);
1563 pres->
offset = origin + offset;
1602 if (indexer ==
NULL)
1608 res = indexer->
ifs->
length (indexer, &len);
1614 for (i = 0; i < len; i++)
1702 res = indexer->
ifs->
get (indexer, index - 1, &va, (
API_VALUE **) (&av));
1746 for (i = 0; i < pres->
num_col; i++)
1748 if (strcmp (name, pres->
col_info[i].col_name) == 0)
1775 bool val_created =
false;
1801 res = indexer->
ifs->
get (indexer, index - 1, &va, (
API_VALUE **) (&av));
1928 T_CCI_COL_INFO *col_info;
1929 T_CCI_CUBRID_STMT cmd_type;
1934 col_info = cci_get_result_info (req_handle, &cmd_type, &num_col);
1935 if (col_info ==
NULL)
1948 pres->
RM.bind.dtor =
NULL;
1950 pres->
RM.ifs = rmifs;
2044 if (index <= 0 || index > prmeta->
bp->
num_col)
2051 case CI_RMETA_INFO_COL_LABEL:
2053 p = prmeta->
bp->
col_info[index - 1].real_attr;
2054 p = p ? p : (
char *)
"";
2061 strcpy ((
char *) arg, p);
2064 case CI_RMETA_INFO_COL_NAME:
2066 p = prmeta->
bp->
col_info[index - 1].col_name;
2067 p = p ? p : (
char *)
"";
2074 strcpy ((
char *) arg, p);
2077 case CI_RMETA_INFO_COL_TYPE:
2079 T_CCI_U_TYPE utype = prmeta->
bp->
col_info[index - 1].type;
2081 if (len <
sizeof (CI_TYPE))
2089 case CI_RMETA_INFO_PRECISION:
2091 if (len <
sizeof (
int))
2096 *(
int *) arg = prmeta->
bp->
col_info[index - 1].precision;
2099 case CI_RMETA_INFO_SCALE:
2101 if (len <
sizeof (
int))
2106 *(
int *) arg = prmeta->
bp->
col_info[index - 1].scale;
2109 case CI_RMETA_INFO_TABLE_NAME:
2111 p = prmeta->
bp->
col_info[index - 1].class_name;
2112 p = p ? p : (
char *)
"";
2118 strcpy ((
char *) arg, p);
2121 case CI_RMETA_INFO_IS_AUTO_INCREMENT:
2125 case CI_RMETA_INFO_IS_NULLABLE:
2127 if (len <
sizeof (
int))
2132 *(
int *) arg = prmeta->
bp->
col_info[index - 1].is_non_null ? 0 : 1;
2135 case CI_RMETA_INFO_IS_WRITABLE:
2137 if (len <
sizeof (
int))
2203 (void) cci_close_req_handle (pstmt->
req_handle);
2218 memset (pstmt, 0,
sizeof (*pstmt));
2222 pstmt->
pconn = pconn;
2224 pstmt->
PM.bind.dtor =
NULL;
2227 pstmt->
BR.bind.dtor =
NULL;
2245 int res, nres, num_query;
2246 T_CCI_QUERY_RESULT *query_result;
2248 ex_flag = CCI_EXEC_QUERY_ALL;
2250 res = cci_execute (pstmt->
req_handle, ex_flag, 0, err_buf);
2257 res = cci_execute_result (pstmt->
req_handle, &query_result, err_buf);
2328 else if (res == CCI_ER_NO_MORE_DATA)
2386 for (i = 0; pstmt->
num_col; i++)
2456 if (index < parg->
nadded)
2506 T_CCI_QUERY_RESULT *query_result;
2516 if (sql_stmt ==
NULL)
2525 sql_stmt[
i] = bi->
sql;
2554 T_CCI_QUERY_RESULT *query_result;
2565 for (i = 0; i < pstmt->
num_col; i++)
2597 int res = CCI_ER_NO_ERROR;
2614 if (res != CCI_ER_NO_ERROR)
2638 for (i = 0; i < pstmt->
num_col; i++)
2874 size_t * outlen,
bool * isnull)
3000 names =
API_CALLOC (1,
sizeof (
char *) * (nattrs + 1));
3002 values =
API_MALLOC (
sizeof (
void *) * nattrs);
3010 for (i = 0; i <
nattrs; i++)
3059 for (i = 0; i <
nattrs; i++)
3217 int res, req_handle;
3304 int pageid, slotid, volid;
3310 slotid = (xoid->d2 >> 16) & 0xffff;
3311 volid = xoid->d2 & 0xffff;
3313 sprintf (oidstr,
"@%d|%d|%d", pageid, slotid, volid);
3328 char *
p = (
char *) oidstr, *end_p;
3329 int pageid, slotid, volid;
3344 if (result != 0 || *end_p !=
'|')
3351 if (result != 0 || *end_p !=
'|')
3358 if (result != 0 || *end_p !=
'\0')
3364 xoid->d2 = ((slotid << 16) & 0xffff0000) | volid;
3380 CI_OID *oid1, *oid2;
3386 oid1 = (CI_OID *) key1;
3387 oid2 = (CI_OID *) key2;
3389 if (oid1->d1 > oid2->d1)
3393 else if (oid1->d1 == oid2->d1)
3395 if (oid1->d2 > oid2->d2)
3399 else if (oid1->d2 == oid2->d2)
3425 CI_OID *oid = (CI_OID *) key;
3430 *rv = (
unsigned int) (oid->d1 + oid->d2);
3476 GLO_OFFSET *obj = (GLO_OFFSET *) elem;
3494 GLO_OFFSET *obj = (GLO_OFFSET *) elem;
3542 pool->
pconn = pconn;
3585 if (col->
type != CI_TYPE_NULL && type != CI_TYPE_NULL && col->
type != type)
3615 if (type != CI_TYPE_NULL && col->
type == CI_TYPE_NULL)
3640 if (col->
type != CI_TYPE_NULL && type != CI_TYPE_NULL && col->
type != type)
3880 bind = &binds[
index];
3901 T_CCI_SET tset =
nullptr;
3925 indicators =
API_CALLOC (size,
sizeof (
int));
3928 if (values ==
NULL || indicators ==
NULL || binds ==
NULL)
3946 for (i = 0; i < size; i++)
3949 indicators[
i] = (binds[
i].
atype == CCI_U_TYPE_NULL);
3954 res = cci_set_make (&tset, utype, size, values, indicators);
3980 for (i = 0; i < size; i++)
4011 utype = cci_set_element_type (tset);
4021 for (i = 0; i < size; i++)
4083 for (i = 0; i < size; i++)
4119 *rcol = (CI_COLLECTION) rco;
4203 const char *user_name,
const char *password)
4208 res = cci_connect ((
char *) host, port, (
char *) databasename, (
char *) user_name, (
char *) password);
4279 case CI_CONNECTION_OPTION_LOCK_TIMEOUT:
4280 case CI_CONNECTION_OPTION_TRAN_ISOLATION_LV:
4281 case CI_CONNECTION_OPTION_AUTOCOMMIT:
4282 if (size !=
sizeof (
int))
4287 if (option == CI_CONNECTION_OPTION_LOCK_TIMEOUT)
4289 res = cci_set_db_parameter (pconn->
conn_handle, CCI_PARAM_LOCK_TIMEOUT, arg, &pconn->
err_buf);
4291 else if (option == CI_CONNECTION_OPTION_TRAN_ISOLATION_LV)
4293 res = cci_set_db_parameter (pconn->
conn_handle, CCI_PARAM_ISOLATION_LEVEL, arg, &pconn->
err_buf);
4295 else if (option == CI_CONNECTION_OPTION_AUTOCOMMIT)
4297 res = cci_set_db_parameter (pconn->
conn_handle, CCI_PARAM_AUTO_COMMIT, arg, &pconn->
err_buf);
4305 if (option == CI_CONNECTION_OPTION_AUTOCOMMIT)
4312 case CI_CONNECTION_OPTION_CLIENT_VERSION:
4313 case CI_CONNECTION_OPTION_SERVER_VERSION:
4337 case CI_CONNECTION_OPTION_LOCK_TIMEOUT:
4338 case CI_CONNECTION_OPTION_TRAN_ISOLATION_LV:
4339 case CI_CONNECTION_OPTION_AUTOCOMMIT:
4340 if (size !=
sizeof (
int))
4345 if (option == CI_CONNECTION_OPTION_LOCK_TIMEOUT)
4347 res = cci_get_db_parameter (pconn->
conn_handle, CCI_PARAM_LOCK_TIMEOUT, arg, &pconn->
err_buf);
4349 else if (option == CI_CONNECTION_OPTION_TRAN_ISOLATION_LV)
4351 res = cci_get_db_parameter (pconn->
conn_handle, CCI_PARAM_ISOLATION_LEVEL, arg, &pconn->
err_buf);
4353 else if (option == CI_CONNECTION_OPTION_AUTOCOMMIT)
4355 res = cci_get_db_parameter (pconn->
conn_handle, CCI_PARAM_AUTO_COMMIT, arg, &pconn->
err_buf);
4364 case CI_CONNECTION_OPTION_CLIENT_VERSION:
4366 int mj, mi, pa, res;
4369 res = cci_get_version (&mj, &mi, &pa);
4375 sprintf (buf,
"cci %d.%d.%d", mj, mi, pa);
4376 strncpy (arg, buf, size);
4380 case CI_CONNECTION_OPTION_SERVER_VERSION:
4446 strncpy (msg, pconn->
err_buf.err_msg, size);
4481 memcpy (bsi->
sql, sql, len);
4558 #define API_EXEC_PRE() \ 4560 if (pstmt->status & CI_STMT_STATUS_EXECUTED) \ 4562 res = complete_statement (pstmt); \ 4563 if (res != NO_ERROR) \ 4565 pstmt->status &= ~CI_STMT_STATUS_EXECUTED; \ 4568 if (pstmt->pconn->autocommit && pstmt->pconn->n_need_complete > 0) \ 4570 res = complete_connection (pstmt->pconn); \ 4571 if (res != NO_ERROR) \ 4573 assert (pstmt->pconn->n_need_complete == 0); \ 4577 #define API_EXEC_POST(has_result) \ 4579 if (pstmt->pconn->autocommit && !(has_result)) \ 4582 cci_end_tran (pstmt->pconn->conn_handle, CCI_TRAN_COMMIT, \ 4583 &pstmt->pconn->err_buf); \ 4585 return err_from_cci (res); \ 4603 int req_handle = -1;
4622 pp_flag |= CCI_PREPARE_UPDATABLE;
4635 (void) cci_close_req_handle (req_handle);
4643 (void) cci_close_req_handle (req_handle);
4685 for (i = 0; i < pstmt->
num_col; i++)
4804 case CI_STATEMENT_OPTION_HOLD_CURSORS_OVER_COMMIT:
4808 case CI_STATEMENT_OPTION_UPDATABLE_RESULT:
4812 case CI_STATEMENT_OPTION_GET_GENERATED_KEYS:
4816 case CI_STATEMENT_OPTION_ASYNC_QUERY:
4820 case CI_STATEMENT_OPTION_EXEC_CONTINUE_ON_ERROR:
4821 case CI_STATEMENT_OPTION_LAZY_EXEC:
4849 case CI_STATEMENT_OPTION_UPDATABLE_RESULT:
4853 case CI_STATEMENT_OPTION_ASYNC_QUERY:
4854 case CI_STATEMENT_OPTION_EXEC_CONTINUE_ON_ERROR:
4855 case CI_STATEMENT_OPTION_LAZY_EXEC:
4856 case CI_STATEMENT_OPTION_GET_GENERATED_KEYS:
4857 case CI_STATEMENT_OPTION_HOLD_CURSORS_OVER_COMMIT:
4882 T_CCI_COL_INFO *col_info;
4883 T_CCI_CUBRID_STMT cmd_type;
4899 pp_flag = CCI_PREPARE_UPDATABLE;
4909 col_info = cci_get_result_info (pstmt->
req_handle, &cmd_type, &num_col);
4910 if (col_info ==
NULL)
5024 size_t * outlen,
bool * isnull)
5124 pv->
type = CI_TYPE_NULL;
5361 if (err_code !=
NULL)
5366 if (err_msg !=
NULL)
5372 strncpy (err_msg, msg, buf_size);
5410 case CI_PMETA_INFO_MODE:
5411 if (size <
sizeof (
int))
5419 case CI_PMETA_INFO_COL_TYPE:
5420 if (size <
sizeof (
int))
5428 case CI_PMETA_INFO_PRECISION:
5429 if (size <
sizeof (
int))
5434 *(
int *) arg = pm->
bptr->
col_info[index - 1].precision;
5437 case CI_PMETA_INFO_SCALE:
5438 if (size <
sizeof (
int))
5446 case CI_PMETA_INFO_NULLABLE:
5447 if (size <
sizeof (
int))
5452 *(
int *) arg = pm->
bptr->
col_info[index - 1].is_non_null ? 0 : 1;
static int ci_collection_new_impl(CI_CONNECTION conn, CI_COLLECTION *coll)
int bh_root_unlock(int rrid)
#define dlisth_insert_before(ih, bh)
static int stmt_execute_batch_sql(STATEMENT_IMPL *pstmt)
#define dlisth_insert_after(ih, bh)
#define ER_INTERFACE_RESULTSET_CLOSED
static int ci_conn_get_error_impl(COMMON_API_STRUCTURE *conn, int *err, char *msg, size_t size)
#define ER_INTERFACE_IS_NOT_BATCH_STATEMENT
static int api_ores_fetch(API_RESULTSET *res, int offset, CI_FETCH_POSITION pos)
static int get_value_from_req_handle(CI_CONNECTION conn, int req_handle, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *is_null)
int(* bind_get_first_child)(BH_INTERFACE *ifs, BH_BIND *bind, BH_BIND **pchild)
static int create_cci_object(CCI_OBJECT_POOL *pool, CI_OID *oid, CCI_OBJECT **cobj)
static int api_val_bind_param(CI_CONNECTION conn, int req_handle, API_VAL *pv, int index)
static int ci_stmt_clear_batch_impl(COMMON_API_STRUCTURE *stmt)
static void opool_destroy(API_OBJECT_RESULTSET_POOL *poo)
API_OBJECT_RESULTSET_POOL ifs
int hash_insert(hash_table *ht, void *elem)
static int xcol_copy(CI_COLLECTION col, CI_COLLECTION *rcol)
static API_RESULTSET_META_IFS ORMETA_IFS_
static int ci_batch_res_query_count_impl(COMMON_API_STRUCTURE *br, int *count)
int bh_root_release(int rrid)
#define ER_INTERFACE_NOT_EXECUTED
static int api_col_update(API_COLLECTION *col, long pos, CI_TYPE type, void *ptr, size_t size)
int(* bind_graft)(BH_INTERFACE *ifs, BH_BIND *bind, BH_BIND *on_bind)
void hash_destroy(hash_table *ht, ht_destroyf dtor)
static int opool_oid_get_classname(API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid, char *name, size_t size)
#define ER_INTERFACE_DBMS
COMMON_API_STRUCTURE_HEADER
static int ci_conn_connect_impl(COMMON_API_STRUCTURE *conn, const char *host, unsigned short port, const char *databasename, const char *user_name, const char *password)
static int opool_ght_keyf(void *elem, void **rk)
int hash_lookup(hash_table *ht, void *key, void **relem)
int(* lookup)(BH_INTERFACE *ifs, BIND_HANDLE bh, BH_BIND **bind)
static int api_ores_update_value(API_RESULTSET *res, int index, CI_TYPE type, void *addr, size_t len)
int bh_root_lock(int rrid, BH_INTERFACE **bhifs)
COMMON_API_STRUCTURE * parent
union api_val_cci_bind_s::@0 redirect
#define ER_INTERFACE_NOT_SUPPORTED_OPERATION
int hash_delete(hash_table *ht, void *key, void **relem)
static void on_close_opool_res(RESULTSET_IMPL *impl, void *arg)
int array_indexer_create(int nvalue, VALUE_INDEXER **rvi)
static int api_qres_fetch(API_RESULTSET *res, int offset, CI_FETCH_POSITION pos)
static int statement_execute(STATEMENT_IMPL *pstmt, T_CCI_ERROR *err_buf)
#define ER_INTERFACE_BROKER
void(* bh_destroyf)(BH_BIND *bind)
bool opt_updatable_result
static void api_col_destroy(API_COLLECTION *col)
void(* destroy)(VALUE_INDEXER *indexer, void(*df)(VALUE_AREA *va, API_VALUE *db))
#define ER_INTERFACE_RESULTSET_NOT_UPDATABLE
static int ci_stmt_execute_batch_impl(COMMON_API_STRUCTURE *stmt, CI_BATCH_RESULT *br)
static void on_close_statement_res(RESULTSET_IMPL *impl, void *arg)
#define ER_INTERFACE_IS_BATCH_STATEMENT
static void destroy_cci_object(CCI_OBJECT *obj)
static int stmt_execute_batch_array(STATEMENT_IMPL *pstmt)
static int opool_ht_comparef(void *key1, void *key2, int *r)
CUBRID_API_FUNCTION_TABLE Cubrid_api_function_table
static int api_val_cursor_update(CI_CONNECTION conn, int req_handle, int offset, int index, API_VAL *av, T_CCI_ERROR *err_buf)
COMMON_API_STRUCTURE_HEADER
static int complete_statement(STATEMENT_IMPL *pstmt)
static int ci_stmt_get_parameter_impl(COMMON_API_STRUCTURE *stmt, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
static int ci_conn_get_option_impl(COMMON_API_STRUCTURE *conn, CI_CONNECTION_OPTION option, void *arg, size_t size)
static int ci_stmt_affected_rows_impl(COMMON_API_STRUCTURE *stmt, int *out)
int bh_root_acquire(int *rrid, BH_ROOT_TYPE rt)
static int ci_stmt_get_start_line_impl(COMMON_API_STRUCTURE *stmt, int *line)
static int ci_stmt_set_option_impl(COMMON_API_STRUCTURE *stmt, CI_STATEMENT_OPTION option, void *arg, size_t size)
static int get_value_from_tset(T_CCI_U_TYPE utype, T_CCI_SET tset, CI_TYPE type, CI_CONNECTION conn, int i, API_VAL **pv)
static int ci_get_connection_opool_impl(COMMON_API_STRUCTURE *pst, API_OBJECT_RESULTSET_POOL **rpool)
#define ER_INTERFACE_NOT_ENOUGH_DATA_SIZE
static int complete_connection(CONNECTION_IMPL *impl)
static int ci_stmt_prepare_impl(COMMON_API_STRUCTURE *stmt, const char *sql, size_t len)
int(* bind_get_next_sibling)(BH_INTERFACE *ifs, BH_BIND *bind, BH_BIND **psibling)
static int ci_conn_set_option_impl(COMMON_API_STRUCTURE *conn, CI_CONNECTION_OPTION option, void *arg, size_t size)
#define ER_INTERFACE_IS_NOT_PREPARED_STATEMENT
void(* on_close)(RESULTSET_IMPL *pres, void *arg)
static int api_ores_delete_row(API_RESULTSET *res)
#define ER_INTERFACE_INVALID_NAME
static int api_qres_get_value(API_RESULTSET *res, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *is_null)
static void xoid2oidstr(const CI_OID *xoid, char *oidbuf)
struct VALUE_AREA VALUE_AREA
#define ER_INTERFACE_HAS_NO_RESULT_SET
static int ci_stmt_get_first_error_impl(COMMON_API_STRUCTURE *stmt, int *line, int *col, int *errcode, char *err_msg, size_t size)
static int xcol_to_cci_set(CI_COLLECTION col, T_CCI_SET *tset)
static int api_col_get_elem_domain_info(API_COLLECTION *col, long pos, CI_TYPE *type, int *precision, int *scale)
static int opool_oid_delete(API_OBJECT_RESULTSET_POOL *poo, CI_OID *oid)
int(* oid_delete)(API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid)
static int api_ormeta_get_info(API_RESULTSET_META *rm, int index, CI_RMETA_INFO_TYPE type, void *arg, size_t size)
static int add_batch_params_mapf(void *arg, int index, VALUE_AREA *va, API_VALUE *val)
static int ci_stmt_execute_immediate_impl(COMMON_API_STRUCTURE *stmt, char *sql, size_t len, CI_RESULTSET *rs, int *r)
static void api_val_cci_bind_init(API_VAL_CCI_BIND *bind, CI_CONNECTION conn, int flag)
static int api_val_cci_bind_bind(CI_TYPE type, void *ptr, int len, API_VAL_CCI_BIND *bind)
static int opool_create(CONNECTION_IMPL *pconn, CCI_OBJECT_POOL **rpool)
static void api_val_dtor(VALUE_AREA *va, API_VALUE *val)
static int add_batch_params_restore_mapf(void *arg, int index, VALUE_AREA *va, API_VALUE *val)
#define ER_INTERFACE_CANNOT_BATCH_EXECUTE
#define ER_INTERFACE_GENERIC
static int get_value_from_api_val(const API_VAL *pv, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
static int api_qrmeta_get_info(API_RESULTSET_META *rm, int index, CI_RMETA_INFO_TYPE type, void *arg, size_t size)
T_CCI_CUBRID_STMT cmd_type
int(* bind_to_handle)(BH_INTERFACE *ifs, BH_BIND *bind, BIND_HANDLE *bh)
static void resultset_impl_dtor(BH_BIND *bind)
static void init_statement_impl(STATEMENT_IMPL *pstmt, CONNECTION_IMPL *pconn)
static int ci_stmt_get_option_impl(COMMON_API_STRUCTURE *stmt, CI_STATEMENT_OPTION option, void *arg, size_t size)
#define ER_INTERFACE_NO_MORE_RESULT
static API_COLLECTION_IFS COL_IFS_
#define dlisth_delete(h_)
COMMON_API_STRUCTURE_HEADER
static int ci_stmt_get_parameter_metadata_impl(COMMON_API_STRUCTURE *stmt, CI_PARAMETER_METADATA *r)
static int api_col_insert(API_COLLECTION *col, long pos, CI_TYPE type, void *ptr, size_t size)
static int api_qres_clear_updates(API_RESULTSET *res)
static int ci_batch_res_get_result_impl(COMMON_API_STRUCTURE *br, int index, int *ret, int *nr)
static int ci_create_connection_impl(CI_CONNECTION *conn)
static API_RESULTSET_IFS ORES_IFS_
static int api_ores_clear_updates(API_RESULTSET *res)
static int lazy_bind_qres_rmeta(RESULTSET_IMPL *pres)
static void api_val_cci_bind_clear(API_VAL_CCI_BIND *bind)
struct API_VALUE API_VALUE
int(* map)(VALUE_INDEXER *indexer, int(*mapf)(void *, int, VALUE_AREA *, API_VALUE *), void *arg)
static int ci_stmt_get_resultset_impl(COMMON_API_STRUCTURE *stmt, CI_RESULTSET *r)
static int api_qres_tell(API_RESULTSET *res, int *offset)
static int create_resultset_impl(CI_CONNECTION conn, BH_INTERFACE *bh, int req_handle, T_CCI_ERROR *err_buf, COMMON_API_STRUCTURE *parent, bool updatable, void *arg, void(*on_close)(RESULTSET_IMPL *, void *), API_RESULTSET_IFS *resifs, API_RESULTSET_META_IFS *rmifs, RESULTSET_IMPL **rpres)
int str_to_int32(int *ret_p, char **end_p, const char *str_p, int base)
static void api_qres_destroy(API_RESULTSET *res)
int curr_query_result_index
static int lazy_bind_pstmt_pmeta(STATEMENT_IMPL *pstmt)
#define ER_INTERFACE_IS_PREPARED_STATEMENT
static int api_col_length(API_COLLECTION *col, int *len)
static int ci_stmt_add_batch_query_impl(COMMON_API_STRUCTURE *stmt, const char *sql, size_t len)
int(* oid_get_classname)(API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid, char *name, size_t size)
static int opool_ht_keyf(void *elem, void **rk)
static int api_ormeta_get_count(API_RESULTSET_META *rm, int *count)
static int bind_api_structure(BH_INTERFACE *bh, COMMON_API_STRUCTURE *s, COMMON_API_STRUCTURE *parent, BIND_HANDLE *handle)
static int ci_pmeta_get_info_impl(COMMON_API_STRUCTURE *pmeta, int index, CI_PMETA_INFO_TYPE type, void *arg, size_t size)
static int api_qres_update_value(API_RESULTSET *res, int index, CI_TYPE type, void *addr, size_t len)
static void statement_impl_dtor(BH_BIND *bind)
static int api_qres_delete_row(API_RESULTSET *res)
static int ci_stmt_set_parameter_impl(COMMON_API_STRUCTURE *stmt, int index, CI_TYPE type, void *val, size_t size)
static int ci_err_set_impl(int err_code)
static API_RESULTSET_META_IFS QRMETA_IFS_
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
static int ci_conn_create_statement_impl(COMMON_API_STRUCTURE *conn, CI_STATEMENT *stmt)
int(* check)(VALUE_INDEXER *indexer, int index, CHECK_PURPOSE pup)
static int err_from_cci(int err)
int(* delete)(VALUE_INDEXER *indexer, int index, VALUE_AREA **rva, API_VALUE **rval)
static int api_ores_apply_update(API_RESULTSET *res)
static int api_ores_tell(API_RESULTSET *res, int *offset)
static T_CCI_U_TYPE type_to_cci_u_type(CI_TYPE type)
static int opool_ht_hashf(void *key, unsigned int *rv)
static void opool_ht_elem_dtor(void *elem)
static int api_ores_get_resultset_metadata(API_RESULTSET *res, API_RESULTSET_META **rimpl)
#define API_VAL_CCI_BIND_FLAG_SET
static int api_col_get_elem(API_COLLECTION *col, long pos, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
static int api_col_delete(API_COLLECTION *col, long pos)
T_CCI_COL_INFO * col_info
static int api_qres_apply_update(API_RESULTSET *res)
static int ci_stmt_get_query_type_impl(COMMON_API_STRUCTURE *stmt, CUBRID_STMT_TYPE *type)
int(* get)(VALUE_INDEXER *indexer, int index, VALUE_AREA **rva, API_VALUE **rv)
static int get_type_value_size(CI_TYPE type, int *len)
int(* get_object_resultset)(API_OBJECT_RESULTSET_POOL *pool, CI_OID *oid, API_RESULTSET **rres)
int list_indexer_create(VALUE_INDEXER **rvi)
static int api_qres_get_value_by_name(API_RESULTSET *res, const char *name, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
static int ci_conn_commit_impl(COMMON_API_STRUCTURE *conn)
T_CCI_QUERY_RESULT * query_result
int(* insert)(VALUE_INDEXER *indexer, int index, VALUE_AREA *va, API_VALUE *dval)
static int ci_stmt_next_result_impl(COMMON_API_STRUCTURE *stmt, bool *exist_result)
static int statement_get_reshandle_or_affectedrows(BH_INTERFACE *bh, STATEMENT_IMPL *pstmt)
static int api_qres_get_resultset_metadata(API_RESULTSET *res, API_RESULTSET_META **rimpl)
static void connection_impl_dtor(BH_BIND *bind)
static CI_TYPE cci_u_type_to_type(T_CCI_U_TYPE utype)
T_CCI_COL_INFO * col_info
static int api_ores_get_value(API_RESULTSET *res, int index, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *is_null)
static void api_ores_destroy(API_RESULTSET *res)
static void opool_ght_elem_dtor(void *elem)
static int xcol_elem_cci_bind_mapf(void *arg, int index, VALUE_AREA *va, API_VALUE *av)
void(* destroy)(API_OBJECT_RESULTSET_POOL *pool)
#define ER_INTERFACE_PARAM_IS_NOT_SET
static int cci_set_to_xcol(CI_CONNECTION conn, T_CCI_SET tset, CI_COLLECTION *col)
#define API_VAL_CCI_BIND_FLAG_GET
static int ores_apply_updatef(void *arg, int index, VALUE_AREA *va, API_VALUE *v)
static void init_connection_impl(CONNECTION_IMPL *impl, int rid, CI_CONNECTION conn, BH_INTERFACE *bh, int conn_handle, CCI_OBJECT_POOL *pool)
#define dlisth_is_empty(h)
int(* destroy_handle)(BH_INTERFACE *ifs, BIND_HANDLE bh)
int(* alloc_handle)(BH_INTERFACE *ifs, BH_BIND *bind, BIND_HANDLE *bh)
enum impl_handle_type IMPL_HANDLE_TYPE
static int oidstr2xoid(const char *oidstr, CI_CONNECTION conn, CI_OID *xoid)
static int api_qrmeta_get_count(API_RESULTSET_META *rm, int *count)
static void xcol_elem_dtor(VALUE_AREA *va, API_VALUE *av)
int(* set)(VALUE_INDEXER *indexer, int index, VALUE_AREA *va, API_VALUE *val)
static int set_value_to_api_val(API_VAL *pv, CI_TYPE type, void *addr, size_t len)
static int ci_batch_res_get_error_impl(COMMON_API_STRUCTURE *br, int index, int *err_code, char *err_msg, size_t buf_size)
static API_RESULTSET_IFS QRES_IFS_
static int ci_conn_close_impl(COMMON_API_STRUCTURE *conn)
static int ci_stmt_get_resultset_metadata_impl(COMMON_API_STRUCTURE *stmt, CI_RESULTSET_METADATA *r)
#define ER_INTERFACE_INVALID_ARGUMENT
#define API_EXEC_POST(has_result)
int(* length)(VALUE_INDEXER *indexer, int *len)
static int ci_stmt_register_out_parameter_impl(COMMON_API_STRUCTURE *stmt, int index)
static int opool_get_object_resultset(API_OBJECT_RESULTSET_POOL *poo, CI_OID *oid, API_RESULTSET **rres)
static int stmt_complete_batch(STATEMENT_IMPL *pstmt)
#define ER_INTERFACE_CANNOT_CLEAR_BATCH
static int ci_stmt_get_next_error_impl(COMMON_API_STRUCTURE *stmt, int *line, int *col, int *errcode, char *err_msg, size_t size)
static int api_ores_get_value_by_name(API_RESULTSET *res, const char *name, CI_TYPE type, void *addr, size_t len, size_t *outlen, bool *isnull)
VALUE_INDEXER * updated_values
static void xcol_destroy(CI_COLLECTION col)
static int ci_conn_rollback_impl(COMMON_API_STRUCTURE *conn)
int hash_new(int bucket_sz, ht_hashf hashf, ht_keyf keyf, ht_comparef comparef, hash_table **rht)
static int xcol_create(CI_TYPE type, CI_CONNECTION conn, CI_COLLECTION *rcol)
#define ER_INTERFACE_NO_MORE_MEMORY
static int ci_stmt_execute_impl(COMMON_API_STRUCTURE *stmt, CI_RESULTSET *rs, int *r)
static int ci_stmt_add_batch_impl(COMMON_API_STRUCTURE *stmt)
static int ci_pmeta_get_count_impl(COMMON_API_STRUCTURE *pmeta, int *count)
T_CCI_CUBRID_STMT cmd_type
static int qres_apply_updatef(void *arg, int index, VALUE_AREA *va, API_VALUE *v)