48 #define IS_SUBSET(value) (value).sub.count >= 0 50 #define EXCHANGE_OR_VALUE(a,b) \ 58 #define CATCLS_INDEX_NAME "i__db_class_class_name" 59 #define CATCLS_INDEX_KEY 11 61 #define CATCLS_OID_TABLE_SIZE 1024 117 const int lang_buf_size,
char *timezone_checksum);
135 int is_primary_key,
int is_foreign_key);
198 if (catcls_Free_entry_list !=
NULL)
201 catcls_Free_entry_list = catcls_Free_entry_list->
next;
242 catcls_Free_entry_list = entry_p;
263 if (catcls_Class_oid_to_oid_hash_table ==
NULL)
289 if (catcls_Class_oid_to_oid_hash_table)
295 for (entry_p = catcls_Free_entry_list; entry_p; entry_p = next_p)
297 next_p = entry_p->
next;
300 catcls_Free_entry_list =
NULL;
301 catcls_Class_oid_to_oid_hash_table =
NULL;
319 #if defined (SERVER_MODE) 323 if (catcls_Class_oid_to_oid_hash_table)
325 entry_p = (
CATCLS_ENTRY *)
mht_get (catcls_Class_oid_to_oid_hash_table, (
void *) class_oid_p);
328 return &entry_p->
oid;
350 *already_exists =
true;
354 if (catcls_Class_oid_to_oid_hash_table)
363 if ((
void *) val_p != (
void *) entry_p)
367 *already_exists =
true;
371 *already_exists =
false;
389 if (catcls_Class_oid_to_oid_hash_table)
411 if (catcls_Class_oid_to_oid_hash_table)
413 entry_p = (
CATCLS_ENTRY *)
mht_get (catcls_Class_oid_to_oid_hash_table, (
void *) entry_class_oid);
436 return ((
char *) malloc (size));
452 value_p = (
OR_VALUE *) malloc (msize);
459 for (i = 0; i < size; i++)
483 for (i = 0; i <
count; i++)
539 for (i = 0; i < n_attrs; i++)
573 for (i = 0; i < n_attrs; i++)
644 for (att_repr_p = repr_p->
variable; att_repr_p->
id != index_key; att_repr_p++)
721 OID *class_oid_p, *oid_p;
842 if (id_val_p ==
NULL)
862 for (keys = (index_atts[4]).
sub.
value, j = 0; j < (index_atts[4]).
sub.
count; j++)
939 OR_VALUE *subset_p, *resolution_subset_p;
944 for (resolution_subset_p = resolution_p->
sub.
value, i = 0; i < resolution_p->
sub.
count; i++)
946 res_attrs = resolution_subset_p[
i].
sub.
value;
959 if (attr_name_space ==
db_get_int (&res_attrs[2].value))
1047 attr_val_p = &attrs[11].
value;
1144 if (resolution_p ==
NULL)
1164 resolution_p =
NULL;
1187 attr_val_p = &attrs[22].
value;
1233 DB_VALUE default_expr, val, db_value_default_expr_type, db_value_default_expr_format, db_value_default_expr_op;
1240 const char *default_expr_type_string =
NULL;
1241 const char *def_expr_format_string =
NULL;
1242 bool with_to_char =
false;
1278 attr_val_p = &attrs[6].
value;
1288 attr_val_p = &attrs[7].
value;
1306 attr_val_p = &attrs[1].
value;
1311 attr_val_p = &attrs[8].
value;
1342 or_val = &or_val[7];
1366 attr_val_p = &attrs[8].
value;
1368 if (att_props !=
NULL)
1370 size_t default_value_len = 0;
1371 const char *default_str_val =
NULL;
1389 with_to_char =
true;
1406 #if !defined(NDEBUG) 1413 def_expr_format_string =
db_get_string (&db_value_default_expr_format);
1422 if (default_expr_type_string ==
NULL)
1431 len =
strlen (default_expr_type_string);
1432 char *default_str_val_tmp =
NULL;
1439 len += ((default_expr_op_string ?
strlen (default_expr_op_string) : 0)
1441 + (def_expr_format_string ? strlen (def_expr_format_string) : 0));
1444 if (default_str_val_tmp ==
NULL)
1452 strcpy (default_str_val_tmp, default_expr_op_string);
1453 strcat (default_str_val_tmp,
"(");
1454 strcat (default_str_val_tmp, default_expr_type_string);
1455 if (def_expr_format_string)
1457 strcat (default_str_val_tmp,
", \'");
1458 strcat (default_str_val_tmp, def_expr_format_string);
1459 strcat (default_str_val_tmp,
"\'");
1461 strcat (default_str_val_tmp,
")");
1466 if (default_str_val_tmp ==
NULL)
1473 strcpy (default_str_val_tmp, default_expr_type_string);
1475 default_str_val = default_str_val_tmp;
1480 default_value_len = len;
1488 if (default_str_val !=
NULL)
1490 default_value_len =
strlen (default_str_val);
1498 char *str_val =
NULL;
1501 if (default_expr_type_string ==
NULL)
1510 len =
strlen (default_expr_type_string);
1515 (default_value_len + (default_value_len ? 1 : 0) + len +
strlen (
"ON UPDATE ")
1517 if (str_val ==
NULL)
1524 if (default_str_val !=
NULL)
1526 strcpy (str_val, default_str_val);
1527 strcat (str_val,
" ON UPDATE ");
1528 strcat (str_val, default_expr_type_string);
1532 strcpy (str_val,
"ON UPDATE ");
1533 strcat (str_val, default_expr_type_string);
1551 attr_val_p = &attrs[10].
value;
1597 start_ptr = buf->
ptr;
1616 attr_val = &attrs[1].
value;
1691 attr_val_p = &attrs[6].
value;
1738 seq_type->
data_readval (buf_p, &attrs[7].value, domain, -1,
true,
NULL, 0);
1820 attr_val_p = &attrs[4].
value;
1833 attr_val_p = &attrs[1].
value;
1905 attr_val_p = &attrs[2].
value;
2049 attr_val_p = &attrs[1].
value;
2059 attr_val_p = &attrs[2].
value;
2119 attr_val_p = &attrs[0].
value;
2132 attr_val_p = &attrs[3].
value;
2137 attr_val_p = &attrs[1].
value;
2194 attr_val_p = &attrs[1].
value;
2232 int key_size, att_cnt;
2237 int has_function_index = 0;
2245 for (i = 0, j = 0; i < seq_size; i += 2, j++)
2247 has_function_index = 0;
2258 attr_val_p = &attrs[1].
value;
2290 att_cnt = (key_size - 3) / 2;
2303 if (!is_primary_key && !is_foreign_key)
2337 int col_id, att_index_start;
2390 attr_val_p = &attrs[8].
value;
2399 has_function_index = 1;
2415 assert (col_id <= att_index_start);
2417 att_cnt = att_index_start + 1;
2423 if (subset_p ==
NULL)
2434 for (k = 0; k < att_cnt; k++)
2447 attr_val_p = &key_attrs[1].
value;
2458 attr_val_p = &key_attrs[3].
value;
2492 attr_val_p = &key_attrs[5].
value;
2548 if (has_function_index == 0)
2553 if (subset_p ==
NULL)
2564 for (k = 0; k < att_cnt; k++)
2575 attr_val_p = &key_attrs[1].
value;
2586 attr_val_p = &key_attrs[3].
value;
2603 for (k = 0; k < att_cnt; k++)
2606 attr_val_p = &key_attrs[4].
value;
2634 db_make_int (&attrs[9].value, has_function_index);
2668 if (expected_size == 0)
2676 if (subset_p ==
NULL)
2684 for (i = 0; i <
count; i++)
2686 error = (*reader) (thread_p, buf_p, &subset_p[
i]);
2711 if (expected_size == 0)
2718 if (oid_set_p ==
NULL)
2725 for (i = 0; i <
count; i++)
2783 if (expected_size == 0)
2808 if (property_vars[i].seq !=
NULL)
2810 property_vars[
i].
size =
set_size (property_vars[i].seq) / 2;
2811 n_size += property_vars[
i].
size;
2819 if (subset_p ==
NULL)
2837 if (property_vars[i].seq !=
NULL)
2841 property_vars[i].is_reverse, property_vars[i].is_primary_key,
2842 property_vars[i].is_foreign_key);
2849 idx += property_vars[
i].
size;
2887 int n_fixed, n_variable;
2911 fixed_p = repr_p->
fixed;
2917 n_attrs = n_fixed + n_variable;
2919 for (i = 0; i < n_fixed; i++)
2921 for (j = i; j < n_attrs; j++)
2923 if (fixed_p[i].
id == attrs[j].
id.
attrid)
2934 var_attrs = &attrs[n_fixed];
2935 for (i = 0; i < n_variable; i++)
2937 for (j = i; j < n_variable; j++)
2939 if (variable_p[i].
id == var_attrs[j].
id.
attrid)
2976 int n_fixed, n_variable;
2980 fixed_p = repr_p->
fixed;
2985 n_attrs = n_fixed + n_variable;
2997 for (i = 0; i < n_fixed; i++)
3007 var_attrs = &attrs[n_fixed];
3008 for (i = 0; i < n_variable; i++)
3032 OID *oid_p, class_oid;
3059 else if (scan_code ==
S_ERROR)
3067 if (subset_p !=
NULL)
3072 for (i = 0; i < size; i++)
3099 int n_fixed, n_variable;
3101 unsigned int repr_id_bits;
3102 char *bound_bits =
NULL;
3104 char *offset_p, *start_p;
3105 int i, pad, offset, header_size;
3108 fixed_p = repr_p->
fixed;
3114 n_attrs = n_fixed + n_variable;
3117 bound_bits = (
char *) malloc (bound_size);
3118 if (bound_bits ==
NULL)
3124 memset (bound_bits, 0, bound_size);
3128 repr_id_bits = repr_p->
id;
3143 offset_p = buf_p->
ptr;
3147 start_p = buf_p->
ptr;
3148 for (i = 0; i < n_fixed; i++)
3150 data_type = fixed_p[
i].
type;
3164 pad = (int) (buf_p->
ptr - start_p);
3165 if (pad < repr_p->fixed_length)
3183 var_attrs = &attrs[n_fixed];
3184 for (i = 0; i < n_variable; i++)
3187 offset = (int) (buf_p->
ptr - buf_p->
buffer - header_size);
3189 data_type = variable_p[
i].
type;
3197 offset = (int) (buf_p->
ptr - buf_p->
buffer - header_size);
3230 int n_fixed, n_variable;
3233 unsigned int repr_id_bits;
3234 char *bound_bits =
NULL;
3235 int bound_bits_flag =
false;
3237 int i, pad, size,
rc;
3241 fixed_p = repr_p->
fixed;
3247 n_attrs = n_fixed + n_variable;
3276 if (bound_bits_flag)
3279 bound_bits = (
char *) malloc (size);
3280 if (bound_bits ==
NULL)
3286 memset (bound_bits, 0, size);
3299 start_p = buf_p->
ptr;
3303 if (bound_bits_flag)
3308 buf_p->
ptr = start_p;
3309 for (i = 0; i < n_fixed; i++)
3311 data_type = fixed_p[
i].
type;
3324 pad = (int) (buf_p->
ptr - start_p);
3325 if (pad < repr_p->fixed_length)
3337 if (bound_bits_flag)
3343 var_attrs = &attrs[n_fixed];
3344 for (i = 0; i < n_variable; i++)
3346 data_type = variable_p[
i].
type;
3394 OR_BUF *buf_p, repr_buffer;
3415 buf_p = &repr_buffer;
3440 OR_BUF *buf_p, repr_buffer;
3443 if (value_p ==
NULL)
3450 buf_p = &repr_buffer;
3474 OR_BUF *buf_p, repr_buffer;
3491 if (value_p ==
NULL)
3501 buf_p = &repr_buffer;
3538 OID *class_oid_p, oid;
3545 bool is_scan_inited =
false;
3557 if (oid_set_p ==
NULL)
3566 if (cls_info_p ==
NULL)
3573 hfid_p = &cls_info_p->
ci_hfid;
3582 is_scan_inited =
true;
3584 for (i = 0; i < n_subset; i++)
3637 OID *class_oid_p, *oid_p;
3644 bool is_scan_inited =
false;
3659 if (cls_info_p ==
NULL)
3666 hfid_p = &cls_info_p->
ci_hfid;
3674 is_scan_inited =
true;
3676 for (i = 0; i < n_subset; i++)
3731 bool is_lock_inited =
false;
3743 is_lock_inited =
true;
3766 for (k = 1; k < subset_p[j].
sub.
count; k++)
3801 record.
data = (
char *) malloc (record.
length);
3864 #if defined(SERVER_MODE) 3865 bool is_lock_inited =
false;
3871 #if defined(SERVER_MODE) 3878 is_lock_inited =
true;
3889 if (value_p ==
NULL)
3972 old_chn =
or_chn (&old_record);
3974 if (old_value_p ==
NULL)
4003 for (k = 1; k < subset_p[j].
sub.
count; k++)
4038 record.
data = (
char *) malloc (record.
length);
4102 OID oid, *class_oid_p;
4107 bool is_scan_inited =
false;
4110 if (value_p ==
NULL)
4117 if (cls_info_p ==
NULL)
4122 hfid_p = &cls_info_p->
ci_hfid;
4128 is_scan_inited =
true;
4170 OID oid, *ct_class_oid_p;
4174 bool is_scan_inited =
false;
4189 if (cls_info_p ==
NULL)
4194 hfid_p = &cls_info_p->
ci_hfid;
4201 is_scan_inited =
true;
4257 OID oid, *catalog_class_oid_p;
4261 bool is_scan_inited =
false;
4274 if (value_p ==
NULL)
4281 if (cls_info_p ==
NULL)
4286 hfid_p = &cls_info_p->
ci_hfid;
4292 is_scan_inited =
true;
4335 OID *class_oid_p, tmp_oid;
4336 const char *class_name_p;
4342 char *
string =
NULL;
4343 int alloced_string = 0;
4346 if (thread_p ==
NULL)
4387 for (i = 0; i < n_atts; i++)
4400 attr_name_p = string;
4401 if (attr_name_p ==
NULL)
4407 for (a = 0; a < n_atts; a++)
4409 if (strcmp (atts[a].ca_name, attr_name_p) == 0)
4413 if (
string !=
NULL && alloced_string == 1)
4422 if (
string !=
NULL && alloced_string == 1)
4463 const int lang_buf_size,
char *timezone_checksum)
4471 const char *class_name =
"db_root";
4472 int charset_att_id = -1, lang_att_id = -1;
4473 int timezone_id = -1;
4476 bool scan_cache_inited =
false;
4477 bool attr_info_inited =
false;
4504 attr_info_inited =
true;
4507 scan_cache_inited =
true;
4515 for (i = 0; i < attr_info.num_values; i++)
4517 char *rec_attr_name_p, *
string =
NULL;
4518 int alloced_string = 0;
4519 bool set_break =
false;
4528 rec_attr_name_p = string;
4529 if (rec_attr_name_p ==
NULL)
4535 if (strcmp (
"charset", rec_attr_name_p) == 0)
4538 if (lang_att_id != -1)
4545 if (strcmp (
"lang", rec_attr_name_p) == 0)
4548 if (charset_att_id != -1)
4555 if (strcmp (
"timezone_checksum", rec_attr_name_p) == 0)
4561 if (
string !=
NULL && alloced_string == 1)
4566 if (set_break ==
true)
4572 if (charset_att_id == -1 || lang_att_id == -1 || timezone_id == -1)
4580 scan_cache_inited =
false;
4595 scan_cache_inited =
true;
4599 HEAP_ATTRVALUE *heap_value =
NULL;
4607 for (i = 0, heap_value = attr_info.values; i < attr_info.num_values; i++, heap_value++)
4609 if (heap_value->attrid == charset_att_id)
4621 else if (heap_value->attrid == lang_att_id)
4623 const char *lang_str =
NULL;
4624 size_t lang_str_len;
4636 lang_str_len = (lang_str !=
NULL) ?
strlen (lang_str) : 0;
4638 assert ((
int) lang_str_len < lang_buf_size);
4639 if (lang_str_len > 0)
4643 assert (lang_buf_size > 0);
4644 strncpy (lang_buf, lang_str, MIN (lang_str_len, lang_buf_size));
4646 lang_buf[MIN (lang_str_len, lang_buf_size)] =
'\0';
4648 else if (heap_value->attrid == timezone_id)
4650 const char *checksum =
NULL;
4651 size_t checksum_len;
4663 checksum_len = (checksum !=
NULL) ?
strlen (checksum) : 0;
4666 if (checksum_len > 0)
4670 strcpy (timezone_checksum, checksum);
4672 timezone_checksum[checksum_len] =
'\0';
4678 if (scan_cache_inited ==
true)
4681 scan_cache_inited =
false;
4683 if (attr_info_inited ==
true)
4686 attr_info_inited =
false;
4707 int n_subset, n_old_subset;
4717 bool is_scan_inited =
false;
4720 old_subset_p = old_value_p->
sub.
value;
4721 n_old_subset = old_value_p->
sub.
count;
4722 if (n_old_subset < 0)
4734 if (subset_p !=
NULL)
4738 else if (old_subset_p !=
NULL)
4740 class_oid_p = &old_subset_p[0].id.classoid;
4753 if (oid_set_p ==
NULL)
4765 if (n_old_subset > 0)
4771 if (cls_info_p ==
NULL)
4777 hfid_p = &cls_info_p->
ci_hfid;
4784 is_scan_inited =
true;
4786 n_min_subset = (n_subset > n_old_subset) ? n_old_subset : n_subset;
4788 for (i = 0; i < n_min_subset; i++)
4803 error =
catcls_update_instance (thread_p, &subset_p[i], oid_p, class_oid_p, hfid_p, &scan, force_in_place);
4819 if (n_old_subset > n_subset)
4821 for (i = n_old_subset - 1; i >= n_min_subset; i--)
4846 else if (n_old_subset < n_subset)
4849 for (i = n_min_subset, oid_p = &tmp_oid; i < n_subset; i++)
4918 const char *class_name =
"_db_collation";
4923 int coll_id_att_id = -1, coll_name_att_id = -1, charset_id_att_id = -1, checksum_att_id = -1;
4925 bool attr_info_inited =
false;
4926 bool scan_cache_inited =
false;
4952 attr_info_inited =
true;
4955 scan_cache_inited =
true;
4963 for (i = 0; i < attr_info.num_values; i++)
4965 char *rec_attr_name_p, *
string =
NULL;
4966 int alloced_string = 0;
4975 rec_attr_name_p = string;
4976 if (rec_attr_name_p ==
NULL)
4989 coll_name_att_id =
i;
4994 charset_id_att_id =
i;
4999 checksum_att_id =
i;
5003 if (
string !=
NULL && alloced_string == 1)
5008 if (att_id_cnt >= 4)
5014 if (att_id_cnt != 4)
5022 scan_cache_inited =
false;
5037 scan_cache_inited =
true;
5042 if (*db_collations ==
NULL)
5051 HEAP_ATTRVALUE *heap_value =
NULL;
5060 if (*coll_cnt >= max_coll_cnt)
5062 max_coll_cnt = max_coll_cnt * 2;
5065 if (db_collations ==
NULL)
5072 curr_coll = &((*db_collations)[(*coll_cnt)++]);
5075 for (i = 0, heap_value = attr_info.values; i < attr_info.num_values; i++, heap_value++)
5077 if (heap_value->attrid == coll_id_att_id)
5083 else if (heap_value->attrid == coll_name_att_id)
5085 const char *lang_str =
NULL;
5086 size_t lang_str_len;
5091 lang_str_len = (lang_str !=
NULL) ?
strlen (lang_str) : 0;
5092 lang_str_len = MIN (lang_str_len,
sizeof (curr_coll->
coll_name));
5094 strncpy (curr_coll->
coll_name, lang_str, lang_str_len);
5095 curr_coll->
coll_name[lang_str_len] =
'\0';
5097 else if (heap_value->attrid == charset_id_att_id)
5103 else if (heap_value->attrid == checksum_att_id)
5105 const char *checksum_str =
NULL;
5111 str_len = (checksum_str !=
NULL) ?
strlen (checksum_str) : 0;
5115 strncpy (curr_coll->
checksum, checksum_str, str_len);
5116 curr_coll->
checksum[str_len] =
'\0';
5122 if (scan_cache_inited ==
true)
5125 scan_cache_inited =
false;
5128 if (attr_info_inited ==
true)
5131 attr_info_inited =
false;
5156 time_t tmp_log_record_time = 0;
5157 int log_record_time_att_id = -1;
5160 bool attr_info_inited =
false;
5161 bool scan_cache_inited =
false;
5165 *log_record_time = 0;
5188 attr_info_inited =
true;
5191 scan_cache_inited =
true;
5199 for (i = 0; i < attr_info.num_values; i++)
5201 char *rec_attr_name_p, *
string =
NULL;
5202 int alloced_string = 0;
5211 rec_attr_name_p = string;
5212 if (rec_attr_name_p ==
NULL)
5218 if (strcmp (
"log_record_time", rec_attr_name_p) == 0)
5220 log_record_time_att_id =
i;
5222 if (
string !=
NULL && alloced_string == 1)
5230 if (
string !=
NULL && alloced_string == 1)
5236 if (log_record_time_att_id == -1)
5244 scan_cache_inited =
false;
5258 scan_cache_inited =
true;
5262 HEAP_ATTRVALUE *heap_value =
NULL;
5270 for (i = 0, heap_value = attr_info.values; i < attr_info.num_values; i++, heap_value++)
5272 if (heap_value->attrid == log_record_time_att_id)
5274 tmp_log_record_time = 0;
5278 tmp_datetime.
time /= 1000;
5286 if (tmp_log_record_time > *log_record_time)
5288 *log_record_time = tmp_log_record_time;
5295 if (scan_cache_inited ==
true)
5298 scan_cache_inited =
false;
5301 if (attr_info_inited ==
true)
5304 attr_info_inited =
false;
5307 if (error ==
NO_ERROR && num_record == 0)
5387 attr_val_p = &attrs[2].
value;
5392 attr_val_p = &attrs[3].
value;
5397 attr_val_p = &attrs[4].
value;
5405 attr_val_p = &attrs[5].
value;
static int catcls_update_instance(THREAD_ENTRY *thread_p, OR_VALUE *value_p, OID *oid, OID *class_oid, HFID *hfid, HEAP_SCANCACHE *scan, UPDATE_INPLACE_STYLE force_in_place)
#define OR_SET_VAR_OFFSET_SIZE(val, offset_size)
int data_readval(struct or_buf *buf, DB_VALUE *value, const tp_domain *domain, int size, bool copy, char *copy_buf, int copy_buf_len) const
#define LANG_MAX_COLLATIONS
#define OR_PUT_OFFSET(ptr, val)
void heap_scancache_end_modify(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
static OR_VALUE * catcls_allocate_or_value(int size)
cubthread::entry * thread_get_thread_entry_info(void)
CLS_INFO * catalog_get_class_info(THREAD_ENTRY *thread_p, OID *class_id_p, CATALOG_ACCESS_INFO *catalog_access_info_p)
int set_get_element_nocopy(DB_COLLECTION *set, int index, DB_VALUE *value)
int db_value_put_null(DB_VALUE *value)
DB_COLLECTION * db_get_set(const DB_VALUE *value)
#define LANG_SYS_COLLATION
int catcls_compile_catalog_classes(THREAD_ENTRY *thread_p)
PR_TYPE * tp_Type_id_map[]
DB_VALUE_COMPARE_RESULT tp_value_compare(const DB_VALUE *value1, const DB_VALUE *value2, int allow_coercion, int total_order)
static int catcls_convert_class_oid_to_oid(THREAD_ENTRY *thread_p, DB_VALUE *oid_val)
static int catcls_get_or_value_from_query_spec(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
static int catcls_convert_attr_id_to_name(THREAD_ENTRY *thread_p, OR_BUF *orbuf_p, OR_VALUE *value_p)
int catcls_find_and_set_cached_class_oid(THREAD_ENTRY *thread_p)
int heap_scancache_start_modify(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid, int op_type, MVCC_SNAPSHOT *mvcc_snapshot)
static int catcls_resolution_space(int name_space)
SCAN_CODE heap_get_visible_version(THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, int old_chn)
int or_get_json_schema(OR_BUF *buf, REFPTR(char, schema))
int locator_add_or_remove_index(THREAD_ENTRY *thread_p, RECDES *recdes, OID *inst_oid, OID *class_oid, int is_insert, int op_type, HEAP_SCANCACHE *scan_cache, bool datayn, bool need_replication, HFID *hfid, FUNC_PRED_UNPACK_INFO *func_preds, bool has_BU_lock, bool skip_checking_fk)
#define TP_IS_SET_TYPE(typenum)
void set_free(DB_COLLECTION *set)
static int catcls_find_oid_by_class_name(THREAD_ENTRY *thread_p, const char *name, OID *oid)
int db_get_int(const DB_VALUE *value)
int db_make_varchar(DB_VALUE *value, const int max_char_length, DB_CONST_C_CHAR str, const int char_str_byte_size, const int codeset, const int collation_id)
static int catcls_get_or_value_from_domain(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
#define csect_enter(a, b, c)
void oid_set_cached_class_oid(const int cache_id, const OID *oid)
#define OR_MVCC_REPID_MASK
const void * mht_put_if_not_exists(MHT_TABLE *ht, const void *key, void *data)
static int catcls_find_btid_of_class_name(THREAD_ENTRY *thread_p, BTID *btid)
int mht_rem(MHT_TABLE *ht, const void *key, int(*rem_func)(const void *key, void *data, void *args), void *func_args)
#define SM_FILTER_INDEX_ID
int classobj_get_prop(DB_SEQ *properties, const char *name, DB_VALUE *pvalue)
int db_get_enum_codeset(const DB_VALUE *value)
#define ASSERT_ERROR_AND_SET(error_code)
#define OR_MVCC_FLAG_VALID_INSID
DB_COLLECTION * set_create_sequence(int size)
#define DB_MAX_SPEC_LENGTH
int lock_object(THREAD_ENTRY *thread_p, const OID *oid, const OID *class_oid, LOCK lock, int cond_flag)
int heap_scancache_quick_start_root_hfid(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
#define OR_MVCC_FLAG_VALID_DELID
int catcls_get_db_collation(THREAD_ENTRY *thread_p, LANG_COLL_COMPAT **db_collations, int *coll_cnt)
#define OID_SET_NULL(oidp)
#define OR_MVCC_FLAG_SHIFT_BITS
int db_make_sequence(DB_VALUE *value, DB_C_SET *set)
const char * db_default_expression_string(DB_DEFAULT_EXPR_TYPE default_expr_type)
struct or_varinfo OR_VARINFO
static void catcls_apply_resolutions(OR_VALUE *value_p, OR_VALUE *resolution_p)
#define DB_MAX_PARTITION_EXPR_LENGTH
#define OR_BOUND_BIT_BYTES(count)
static int catcls_guess_record_length(OR_VALUE *value_p)
int set_size(DB_COLLECTION *set)
#define SM_PROPERTY_NUM_INDEX_FAMILY
static int catcls_get_or_value_from_method_argument(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
int heap_scancache_end(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
#define COPY_OID(dest_oid_ptr, src_oid_ptr)
#define OR_MVCC_MAX_HEADER_SIZE
static int catcls_delete_subset(THREAD_ENTRY *thread_p, OR_VALUE *value_p)
const char * oid_get_cached_class_name(const int cache_id)
int or_skip_set_header(OR_BUF *buf)
struct lang_coll_compat LANG_COLL_COMPAT
static int catcls_delete_instance(THREAD_ENTRY *thread_p, OID *oid, OID *class_oid, HFID *hfid, HEAP_SCANCACHE *scan)
int pr_free_ext_value(DB_VALUE *value)
#define OR_VAR_TABLE_SIZE(vars)
static OID * catcls_find_oid(THREAD_ENTRY *thread_p, OID *class_oid)
int catcls_delete_catalog_classes(THREAD_ENTRY *thread_p, const char *name, OID *class_oid)
BTREE_SEARCH xbtree_find_unique(THREAD_ENTRY *thread_p, BTID *btid, SCAN_OPERATION_TYPE scan_op_type, DB_VALUE *key, OID *class_oid, OID *oid, bool is_all_class_srch)
int db_make_string(DB_VALUE *value, DB_CONST_C_CHAR str)
int heap_scancache_start(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid, int cache_last_fix_page, int is_indexscan, MVCC_SNAPSHOT *mvcc_snapshot)
void mht_destroy(MHT_TABLE *ht)
bool pr_is_set_type(DB_TYPE type)
int catcls_finalize_class_oid_to_oid_hash_table(THREAD_ENTRY *thread_p)
static int catcls_free_entry_kv(const void *key, void *data, void *args)
int heap_attrinfo_start(THREAD_ENTRY *thread_p, const OID *class_oid, int requested_num_attrs, const ATTR_ID *attrids, HEAP_CACHE_ATTRINFO *attr_info)
PR_TYPE * pr_type_from_id(DB_TYPE id)
#define RECDES_INITIALIZER
static OR_VALUE * catcls_get_or_value_from_record(THREAD_ENTRY *thread_p, RECDES *record, OID *class_oid)
TP_DOMAIN * tp_domain_resolve_default(DB_TYPE type)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define csect_check_own(a, b)
static int catcls_get_or_value_from_method_signiture(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
#define OR_MVCC_FLAG_VALID_PREV_VERSION
int db_make_enumeration(DB_VALUE *value, unsigned short index, DB_CONST_C_CHAR str, int size, unsigned char codeset, const int collation_id)
static OR_VALUE * catcls_get_or_value_from_class_record(THREAD_ENTRY *thread_p, RECDES *record)
#define ER_LC_UNKNOWN_CLASSNAME
#define OR_MVCC_FLAG_MASK
#define OR_ENABLE_BOUND_BIT(bitptr, element)
static int catcls_get_or_value_from_resolution(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
int or_mvcc_get_repid_and_flags(OR_BUF *buf, int *error)
LC_FIND_CLASSNAME xlocator_find_class_oid(THREAD_ENTRY *thread_p, const char *classname, OID *class_oid, LOCK lock)
static int catcls_get_or_value_from_class(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
#define ER_OUT_OF_VIRTUAL_MEMORY
int or_chn(RECDES *record)
DB_TYPE db_value_type(const DB_VALUE *value)
const char * qdump_operator_type_string(OPERATOR_TYPE optype)
#define SINGLE_ROW_UPDATE
static int catcls_replace_entry_oid(THREAD_ENTRY *thread_p, OID *entry_class_oid, OID *entry_new_oid)
static int catcls_expand_or_value_by_def(OR_VALUE *value_p, CT_CLASS *def)
int or_put_int(OR_BUF *buf, int num)
int heap_update_logical(THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
int intl_identifier_casecmp(const char *str1, const char *str2)
#define DB_VALUE_DOMAIN_TYPE(value)
#define DB_MAX_IDENTIFIER_LENGTH
void heap_create_update_context(HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *oid_p, OID *class_oid_p, RECDES *recdes_p, HEAP_SCANCACHE *scancache_p, UPDATE_INPLACE_STYLE in_place)
int or_put_bigint(OR_BUF *buf, DB_BIGINT num)
static int catcls_put_or_value_into_record(THREAD_ENTRY *thread_p, OR_VALUE *value_p, int chn, RECDES *record, OID *class_oid)
static int catcls_get_or_value_from_attribute(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
static int catcls_insert_subset(THREAD_ENTRY *thread_p, OR_VALUE *value_p, OID *root_oid)
int catcls_get_apply_info_log_record_time(THREAD_ENTRY *thread_p, time_t *log_record_time)
#define OID_EQ(oidp1, oidp2)
int catcls_insert_catalog_classes(THREAD_ENTRY *thread_p, RECDES *record)
static int catcls_update_subset(THREAD_ENTRY *thread_p, OR_VALUE *value_p, OR_VALUE *old_value, bool *uflag, UPDATE_INPLACE_STYLE force_in_place)
static int catcls_get_or_value_from_indexes(DB_SEQ *seq, OR_VALUE *subset, int is_unique, int is_reverse, int is_primary_key, int is_foreign_key)
#define OR_MVCC_PREV_VERSION_LSA_SIZE
DB_VALUE * db_value_copy(DB_VALUE *value)
int heap_attrinfo_read_dbvalues(THREAD_ENTRY *thread_p, const OID *inst_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, HEAP_CACHE_ATTRINFO *attr_info)
#define DB_MAX_COMMENT_LENGTH
#define OR_MVCC_INSERT_HEADER_SIZE
void * mht_get(MHT_TABLE *ht, const void *key)
static int catcls_get_or_value_from_method_file(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
unsigned short db_get_enum_short(const DB_VALUE *value)
int db_string_truncate(DB_VALUE *value, const int precision)
struct disk_attribute * variable
static void catcls_free_sub_value(OR_VALUE *values, int count)
#define SM_PROPERTY_UNIQUE
#define SINGLE_ROW_DELETE
TP_DOMAIN * tp_domain_cache(TP_DOMAIN *transient)
#define db_private_free_and_init(thrd, ptr)
MHT_TABLE * mht_create(const char *name, int est_size, unsigned int(*hash_func)(const void *key, unsigned int ht_size), int(*cmp_func)(const void *key1, const void *key2))
static MHT_TABLE * catcls_Class_oid_to_oid_hash_table
void or_init(OR_BUF *buf, char *data, int length)
unsigned int oid_hash(const void *key_oid, unsigned int htsize)
static int catcls_get_object_set(THREAD_ENTRY *thread_p, OR_BUF *buf_p, int expected_size, OR_VALUE *value)
#define db_private_alloc(thrd, size)
#define CONST_CAST(dest_type, expr)
int set_get_element(DB_COLLECTION *set, int index, DB_VALUE *value)
struct disk_attribute * fixed
#define BIG_VAR_OFFSET_SIZE
need_clear_type need_clear
#define DB_MAX_CLASS_COMMENT_LENGTH
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
static CATCLS_ENTRY * catcls_allocate_entry(THREAD_ENTRY *thread_p)
int pr_clear_value(DB_VALUE *value)
int catcls_remove_entry(THREAD_ENTRY *thread_p, OID *class_oid)
void heap_create_delete_context(HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *oid_p, OID *class_oid_p, HEAP_SCANCACHE *scancache_p)
int oid_compare_equals(const void *key_oid1, const void *key_oid2)
#define CATCLS_INDEX_NAME
#define OR_CLEAR_BOUND_BIT(bitptr, element)
static int catcls_get_or_value_from_partition(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
int set_put_element(DB_COLLECTION *set, int index, DB_VALUE *value)
static void error(const char *msg)
time_t db_mktime(DB_DATE *date, DB_TIME *timeval)
static void catcls_free_or_value(OR_VALUE *value)
#define DB_DEFAULT_PRECISION
TP_DOMAIN * tp_domain_construct(DB_TYPE domain_type, DB_OBJECT *class_obj, int precision, int scale, TP_DOMAIN *setdomain)
SCAN_CODE heap_get_class_oid(THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid)
static int catcls_get_property_set(THREAD_ENTRY *thread_p, OR_BUF *buf_p, int expected_size, OR_VALUE *value_p)
static int catcls_expand_or_value_by_subset(THREAD_ENTRY *thread_p, OR_VALUE *value_p)
int or_seek(OR_BUF *buf, int psn)
#define HFID_IS_NULL(hfid)
int catalog_get_last_representation_id(THREAD_ENTRY *thread_p, OID *class_oid_p, REPR_ID *repr_id_p)
static CATCLS_ENTRY * catcls_Free_entry_list
bool db_value_is_null(const DB_VALUE *value)
static int catcls_initialize_class_oid_to_oid_hash_table(THREAD_ENTRY *thread_p, int num_entry)
int pr_clone_value(const DB_VALUE *src, DB_VALUE *dest)
#define SM_PROPERTY_INDEX
OID * db_get_oid(const DB_VALUE *value)
int valcnv_convert_value_to_string(DB_VALUE *value)
#define SM_PROPERTY_PRIMARY_KEY
int heap_delete_logical(THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
static void catcls_apply_component_type(OR_VALUE *value_p, int type)
#define csect_enter_as_reader(a, b, c)
#define free_and_init(ptr)
#define BTID_COPY(btid_ptr1, btid_ptr2)
static char * catcls_unpack_allocator(int size)
int or_get_attrname(RECDES *record, int attrid, char **string, int *alloced_string)
int locator_update_index(THREAD_ENTRY *thread_p, RECDES *new_recdes, RECDES *old_recdes, ATTR_ID *att_id, int n_att_id, OID *oid, OID *class_oid, int op_type, HEAP_SCANCACHE *scan_cache, REPL_INFO *repl_info)
static int catcls_reorder_attributes_by_repr(THREAD_ENTRY *thread_p, OR_VALUE *value_p)
#define ER_HEAP_UNKNOWN_OBJECT
OR_VARINFO * or_get_var_table(OR_BUF *buf, int nvars, char *(*allocator)(int))
enum intl_codeset INTL_CODESET
#define OR_NON_MVCC_HEADER_SIZE
int db_get_string_size(const DB_VALUE *value)
static int catcls_free_entry(CATCLS_ENTRY *entry_p)
#define SINGLE_ROW_INSERT
int or_put_data(OR_BUF *buf, const char *data, int length)
int catcls_get_server_compat_info(THREAD_ENTRY *thread_p, INTL_CODESET *charset_id_p, char *lang_buf, const int lang_buf_size, char *timezone_checksum)
#define DB_VALUE_TYPE(value)
int db_get_enum_collation(const DB_VALUE *value)
int mht_map(const MHT_TABLE *ht, int(*map_func)(const void *key, void *data, void *args), void *func_args)
int db_make_null(DB_VALUE *value)
#define SM_FUNCTION_INDEX_ID
#define SM_PROPERTY_FOREIGN_KEY
#define DB_IS_NULL(value)
int heap_assign_address(THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *oid, int expected_length)
#define OR_GET_OFFSET_SIZE(ptr)
int or_get_data(OR_BUF *buf, char *data, int length)
static int catcls_find_class_oid_by_class_name(THREAD_ENTRY *thread_p, const char *name, OID *class_oid)
DB_DATETIME * db_get_datetime(const DB_VALUE *value)
#define catalog_free_class_info_and_init(class_info_p)
int db_make_int(DB_VALUE *value, const int num)
int db_get_string_length(const DB_VALUE *value)
void heap_attrinfo_end(THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info)
int db_make_oid(DB_VALUE *value, const OID *oid)
#define OR_BOUND_BIT_FLAG
#define SM_PREFIX_INDEX_ID
static int catcls_expand_or_value_by_repr(OR_VALUE *value_p, OID *class_oid, DISK_REPR *rep)
SCAN_CODE heap_next(THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *next_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking)
#define SM_PROPERTY_REVERSE_INDEX
int or_get_value(OR_BUF *buf, DB_VALUE *value, struct tp_domain *domain, int expected, bool copy)
enum update_inplace_style UPDATE_INPLACE_STYLE
int heap_get_class_info(THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid_out, FILE_TYPE *ftype_out, char **classname_out)
int or_pad(OR_BUF *buf, int length)
int catcls_update_catalog_classes(THREAD_ENTRY *thread_p, const char *name, RECDES *record, OID *class_oid_p, UPDATE_INPLACE_STYLE force_in_place)
char * or_unpack_domain(char *ptr, struct tp_domain **domain_ptr, int *is_null)
struct or_value::or_sub sub
#define EXCHANGE_OR_VALUE(a, b)
#define SM_PROPERTY_REVERSE_UNIQUE
int heap_get_class_name(THREAD_ENTRY *thread_p, const OID *class_oid, char **class_name)
#define db_private_realloc(thrd, ptr, size)
static int catcls_insert_instance(THREAD_ENTRY *thread_p, OR_VALUE *value_p, OID *oid, OID *root_oid, OID *class_oid, HFID *hfid, HEAP_SCANCACHE *scan)
int(* CREADER)(THREAD_ENTRY *thread_p, OR_BUF *buf, OR_VALUE *value_p)
static int catcls_put_entry(THREAD_ENTRY *thread_p, CATCLS_ENTRY *entry, bool *already_exists)
char coll_name[COLL_NAME_SIZE]
static int catcls_get_subset(THREAD_ENTRY *thread_p, OR_BUF *buf_p, int expected_size, OR_VALUE *value_p, CREADER reader)
#define CATCLS_OID_TABLE_SIZE
#define catalog_free_representation_and_init(repr_p)
void tp_domain_free(TP_DOMAIN *dom)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)
int or_advance(OR_BUF *buf, int offset)
static int catcls_get_or_value_from_buffer(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p, DISK_REPR *rep)
#define OR_GET_BOUND_BIT(bitptr, element)
int get_disk_size_of_value(const DB_VALUE *value) const
static int catcls_put_or_value_into_buffer(OR_VALUE *value_p, int chn, OR_BUF *buf_p, OID *class_oid, DISK_REPR *rep)
static int catcls_get_or_value_from_method(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
int db_value_domain_init(DB_VALUE *value, const DB_TYPE type, const int precision, const int scale)
#define ER_SM_INVALID_PROPERTY
static int catcls_get_or_value_from_attrid(THREAD_ENTRY *thread_p, OR_BUF *buf_p, OR_VALUE *value_p)
SCAN_CODE heap_get_class_record(THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *recdes_p, HEAP_SCANCACHE *scan_cache, int ispeeking)
DISK_REPR * catalog_get_representation(THREAD_ENTRY *thread_p, OID *class_id_p, REPR_ID repr_id, CATALOG_ACCESS_INFO *catalog_access_info_p)