57 #if defined(ENABLE_SYSTEMTAP) 72 #define LOCATOR_GUESS_HT_SIZE LOCATOR_GUESS_NUM_NESTED_REFERENCES * 2 74 #define CLASSNAME_CACHE_SIZE 1024 145 LOCK class_lock,
bool quit_on_errors);
152 DB_VALUE * key_value,
int err_code,
const char *err_msg);
161 HEAP_SCANCACHE * scan_cache,
int op_type,
int has_index,
int *force_count,
170 OID * new_obj_oid,
OID * partition_oid,
bool need_locking);
173 #if defined(ENABLE_UNUSED_FUNCTION) 174 static void locator_increase_catalog_count (
THREAD_ENTRY * thread_p,
OID * cls_oid);
175 static void locator_decrease_catalog_count (
THREAD_ENTRY * thread_p,
OID * cls_oid);
179 OID * class_oid,
int is_insert,
int op_type,
183 OID * class_oid,
int is_insert,
int op_type,
187 bool skip_checking_fk);
192 #if defined(ENABLE_UNUSED_FUNCTION) 251 char *classname =
NULL;
269 if (locator_Mht_classnames !=
NULL)
275 locator_Mht_classnames =
279 if (locator_Mht_classnames ==
NULL)
331 (void)
mht_put (locator_Mht_classnames, entry->
e_name, entry);
373 if (locator_Mht_classnames ==
NULL)
389 locator_Mht_classnames =
NULL;
414 for (i = 0; i < num_classes; ++
i)
462 if (classname ==
NULL)
490 else if (entry !=
NULL)
523 if (old_action ==
NULL)
624 (void)
mht_put (locator_Mht_classnames, entry->
e_name, entry);
763 if (classname ==
NULL)
799 else if (entry !=
NULL)
836 if (old_action ==
NULL)
898 return classname_delete;
922 if (oldname ==
NULL || newname ==
NULL)
1063 else if (entry !=
NULL)
1146 #if !defined(NDEBUG) 1216 if (old_action ==
NULL)
1316 if (savep_lsa ==
NULL)
1375 #if !defined(NDEBUG) 1423 while (savep_lsa ==
NULL 1436 if (savep_lsa ==
NULL 1465 #if !defined(NDEBUG) 1516 #if !defined(NDEBUG) 1725 int *class_no_p = (
int *) args;
1727 const char *str_action;
1733 fprintf (outfp,
" %2d %s ", *class_no_p, (
char *) key);
1735 key_size =
strlen ((
char *) key);
1736 for (i = 0; i < (29 - key_size); i++)
1738 fprintf (outfp,
" ");
1740 fprintf (outfp,
"TRAN_INDEX = %d\n", entry->
e_tran_index);
1743 while (action !=
NULL)
1748 str_action =
"LC_CLASSNAME_RESERVE";
1751 str_action =
"LC_CLASSNAME_DELETED";
1754 str_action =
"LC_CLASSNAME_EXIST";
1757 str_action =
"LC_CLASSNAME_RESERVED_RENAME";
1760 str_action =
"LC_CLASSNAME_DELETED_RENAME";
1764 str_action =
"UNKNOWN";
1767 fprintf (outfp,
" action = %s, OID = %d|%d|%d, Save_Lsa = %lld|%d\n", str_action, action->
oid.
volid,
1769 action = action->
prev;
1820 class_oid->
volid = -2;
1859 const char *classname;
1860 char *heap_classname;
1873 classname = (
char *) name;
1877 || heap_classname ==
NULL)
1894 if (heap_classname != classname)
1898 class_oid->
pageid, class_oid->
slotid, classname, heap_classname);
1929 char *classname =
NULL;
1935 if (mvcc_snapshot ==
NULL)
2045 const char *classname)
2054 if (classname !=
NULL)
2090 reqclasses = lockset->
classes;
2092 #if defined(CUBRID_DEBUG) 2093 i = (
sizeof (*lockset) + (lockset->
num_reqobjs * (
sizeof (*reqclasses) +
sizeof (*reqobjs))));
2099 "locator_find_lockset_missing_class_oids: *** SYSTEM ERROR. Requesting area is incorrect,\n" 2100 " either area is too small %d (expect at least %d),\n pointer to classes %p (expected %p), or\n" 2101 " pointer to objects %p (expected >= %p) are incorrect\n", lockset->
length, i, lockset->
classes,
2119 if (reqobjs[i].class_index != -1 ||
OID_ISNULL (&reqobjs[i].
oid))
2149 if (
OID_EQ (&class_oid, &reqclasses[j].oid))
2172 int chn,
int guess_chn,
SCAN_CODE scan,
int tran_index)
2212 #if !defined(NDEBUG) 2318 int guess_chn = chn;
2377 OID * class_oid,
int class_chn,
int prefetching,
LC_COPYAREA ** fetch_area)
2382 int copyarea_length;
2389 bool object_locked =
false;
2390 int is_mvcc_disabled_class = -1;
2394 bool object_need_locking =
true;
2395 bool skip_fetch_version_type_check =
false;
2401 skip_fetch_version_type_check =
true;
2406 skip_fetch_version_type_check =
true;
2409 switch (fetch_version_type)
2413 if (mvcc_snapshot ==
NULL)
2422 mvcc_snapshot = &mvcc_snapshot_dirty;
2426 mvcc_snapshot =
NULL;
2438 if (class_oid ==
NULL)
2441 class_oid = &tmp_oid;
2445 #if !defined (NDEBUG) 2518 object_need_locking ? lock :
NULL_LOCK, operation_type);
2521 if (object_need_locking)
2523 object_need_locking =
false;
2525 if (is_mvcc_disabled_class == 1)
2527 if (lock > NULL_LOCK)
2530 object_locked =
true;
2536 object_locked =
true;
2542 object_locked =
true;
2625 prefetch_des.
obj = &nxobj.
obj;
2638 error_code =
heap_prefetch (thread_p, class_oid, oid, &prefetch_des);
2774 OID * class_oid,
int *nobjects,
int *nfetched,
OID * last_oid,
LC_COPYAREA ** fetch_area)
2782 int copyarea_length;
2818 if (*nobjects == -1)
2830 switch (fetch_version_type)
2834 if (mvcc_snapshot ==
NULL)
2847 mvcc_snapshot = &mvcc_snapshot_dirty;
2851 mvcc_snapshot =
NULL;
2862 error_code =
heap_scancache_start (thread_p, &scan_cache, hfid, class_oid,
true,
false, mvcc_snapshot);
2880 if (*fetch_area ==
NULL)
2910 #if !defined(NDEBUG) 2914 offset += round_length;
2915 recdes.
data += round_length;
2916 recdes.
area_size -= round_length +
sizeof (*obj);
2935 copyarea_length = (*fetch_area)->length;
2943 if ((-recdes.
length) > copyarea_length)
2968 *nobjects = *nfetched = -1;
2974 *nobjects = *nfetched;
2992 *nobjects = *nfetched = -1;
3009 if (*nobjects <= *nfetched)
3011 *nobjects = *nfetched + 10;
3023 if (*fetch_area !=
NULL)
3025 prefetch_des.
mobjs = mobjs;
3026 prefetch_des.
obj = &obj;
3027 prefetch_des.
offset = &offset;
3028 prefetch_des.
recdes = &recdes;
3053 int copyarea_length;
3060 if (mvcc_snapshot ==
NULL)
3069 reqclasses = lockset->
classes;
3205 ||
OID_ISNULL (&reqclasses[reqobjs[i].class_index].oid))
3220 if (
OID_EQ (&reqobjs[i].oid, &reqclasses[j].oid))
3227 if (j < lockset->num_classes_of_reqobjs)
3321 if (*fetch_area !=
NULL)
3324 prefetch_des.
obj = &nxobj.
obj;
3368 bool quit_on_errors)
3371 int max_refs, ref_num;
3373 int stack_actual_size;
3375 int oid_list_size = 0;
3386 int i, tmp_ref_num, number;
3388 HL_HEAPID heap_id = HL_NULL_HEAPID;
3396 struct ht_obj_info *ht_obj;
3413 if (lockset ==
NULL)
3418 stack = (
int *) malloc (
sizeof (*stack) * max_stack);
3427 if (lc_ht_permoids ==
NULL)
3434 if (heap_id == HL_NULL_HEAPID)
3440 stack_actual_size = 0;
3444 reqclasses = lockset->
classes;
3456 reqobjs->
chn = level;
3457 stack[stack_actual_size++] = lockset->
num_reqobjs++;
3461 if (mvcc_snapshot ==
NULL)
3477 while (stack_actual_size > 0)
3479 ref_num = stack[--stack_actual_size];
3528 if (i < lockset->num_classes_of_reqobjs)
3566 if (prune_level >= 0 && level > prune_level)
3592 if (oid_list ==
NULL || number <= 0)
3596 for (i = 0; i < number; i++)
3603 ht_obj = (
struct ht_obj_info *)
mht_get (lc_ht_permoids, &oid_list[i]);
3606 tmp_ref_num = ht_obj->ref_num;
3607 if (lockset->
objects[tmp_ref_num].
chn > level)
3615 stack[stack_actual_size++] = tmp_ref_num;
3626 if (stack_actual_size >= max_stack)
3631 max_stack += number;
3637 new_ptr = realloc (stack,
sizeof (*stack) * max_stack);
3638 if (new_ptr ==
NULL)
3641 sizeof (*stack) * max_stack);
3642 if (quit_on_errors ==
false)
3649 stack = (
int *) new_ptr;
3663 if (new_ptr ==
NULL)
3665 if (quit_on_errors ==
false)
3679 ht_obj = (
struct ht_obj_info *)
db_fixed_alloc (heap_id,
sizeof (*ht_obj));
3682 if (quit_on_errors ==
false)
3689 COPY_OID (&ht_obj->oid, &oid_list[i]);
3690 ht_obj->ref_num = tmp_ref_num;
3692 if (
mht_put (lc_ht_permoids, &ht_obj->oid, ht_obj) != ht_obj)
3694 if (quit_on_errors ==
false)
3711 reqobjs->
chn = level;
3713 stack[stack_actual_size++] = lockset->
num_reqobjs++;
3720 if (oid_list !=
NULL)
3736 to_reqobjs = reqobjs = lockset->
objects;
3742 if (to_reqobjs != reqobjs)
3744 memcpy (to_reqobjs, reqobjs,
sizeof (*reqobjs));
3765 if (oid_list !=
NULL)
3769 if (lc_ht_permoids !=
NULL)
3772 lc_ht_permoids =
NULL;
3778 if (lockset !=
NULL)
3783 if (heap_id != HL_NULL_HEAPID)
3814 LOCK lock,
int quit_on_errors,
int prune_level,
LC_LOCKSET ** lockset,
3830 if (*lockset ==
NULL)
3842 for (i = 0; i < (*lockset)->num_reqobjs; i++)
3844 if (
OID_EQ (oid, &(*lockset)->objects[i].oid))
3846 (*lockset)->objects[
i].chn = chn;
3854 for (i = 0; i < (*lockset)->num_classes_of_reqobjs; i++)
3856 if (
OID_EQ (class_oid, &(*lockset)->classes[i].oid))
3858 (*lockset)->classes[
i].chn = class_chn;
3892 OID * class_oid,
int class_chn,
int need_fetching,
int prefetching,
LC_COPYAREA ** fetch_area)
3897 if (need_fetching && fetch_area !=
NULL)
3902 if (class_oid ==
NULL)
3904 class_oid = &tmp_oid;
3917 if (need_fetching && fetch_area !=
NULL)
3920 class_oid, class_chn, prefetching, fetch_area);
3986 const OID * class_oid,
int op_type)
4035 bool clear_pcontext =
false;
4037 int classrepr_cacheindex = -1;
4059 for (i = 0; i < idx_info.
num_btids; i++)
4061 index = &(index_attrinfo.last_classrepr->indexes[
i]);
4070 if (key_dbvalue ==
NULL)
4098 if (classrepr ==
NULL)
4106 clear_pcontext =
true;
4130 char *val_print =
NULL;
4134 (val_print ? val_print :
"unknown value"));
4141 if (key_dbvalue == &dbvalue)
4162 if (key_dbvalue == &dbvalue)
4169 if (clear_pcontext ==
true)
4173 if (classrepr !=
NULL)
4193 int oid_cnt, force_count,
i;
4200 bool is_upd_scan_init;
4207 int *keys_prefix_length =
NULL;
4215 if (mvcc_snapshot ==
NULL)
4227 for (fkref = index->
fk; fkref !=
NULL; fkref = fkref->
next)
4294 is_upd_scan_init =
false;
4303 bool lob_exist =
false;
4327 else if (oid_cnt == 0)
4332 if (is_upd_scan_init ==
false)
4353 is_upd_scan_init =
true;
4356 HEAP_ATTRVALUE *value;
4363 for (i = 0; i < attr_info.num_values; i++)
4365 value = &attr_info.values[
i];
4375 for (i = 0; i < oid_cnt; i++)
4377 OID *oid_ptr = &(oid_list.
oidp[
i]);
4418 &force_count,
NULL,
false);
4437 for (k = 0; k < num_attrs; ++k)
4471 if (is_upd_scan_init)
4505 if (keys_prefix_length)
4539 int oid_cnt, force_count,
i;
4546 bool is_upd_scan_init;
4553 int *keys_prefix_length =
NULL;
4561 if (mvcc_snapshot ==
NULL)
4572 for (fkref = index->
fk; fkref !=
NULL; fkref = fkref->
next)
4641 is_upd_scan_init =
false;
4676 else if (oid_cnt == 0)
4681 if (is_upd_scan_init ==
false)
4690 is_upd_scan_init =
true;
4698 for (i = 0; i < oid_cnt; i++)
4700 OID *oid_ptr = &(oid_list.
oidp[
i]);
4741 for (k = 0; k < num_attrs; ++k)
4775 if (is_upd_scan_init)
4806 if (keys_prefix_length)
4855 int op_type,
HEAP_SCANCACHE * scan_cache,
int *force_count,
int pruning_type,
4858 bool dont_check_fk,
bool use_bulk_logging)
4865 bool is_cached =
false;
4873 bool skip_checking_fk;
4880 COPY_OID (&real_class_oid, class_oid);
4882 local_scan_cache = scan_cache;
4883 local_func_preds = func_preds;
4891 partition_prune_insert (thread_p, class_oid, recdes, scan_cache, pcontext, pruning_type, &real_class_oid,
4892 &real_hfid, &superclass_oid);
4910 if (pcontext !=
NULL)
4916 bool has_func_idx = (func_preds !=
NULL);
4920 if (ins_cache ==
NULL)
4936 local_func_preds =
NULL;
5023 char *rep_dir_offset;
5054 update_context.force_non_mvcc =
true;
5070 assert (isold_object ==
true);
5072 #if !defined(NDEBUG) 5101 true, &real_hfid, local_func_preds, has_BU_lock,
5114 if (has_index && !skip_checking_fk)
5118 &cache_attr_copyarea);
5128 recdes = &new_recdes;
5148 #if defined(ENABLE_UNUSED_FUNCTION) 5150 locator_increase_catalog_count (thread_p, &real_class_oid);
5159 "locator_insert_force: qexec_clear_list_cache_by_class failed for class { %d %d %d }\n",
5172 COPY_OID (class_oid, &real_class_oid);
5176 if (cache_attr_copyarea !=
NULL)
5218 if (context !=
NULL)
5224 if (ins_cache ==
NULL)
5234 locator_insert_force (thread_p, new_class_hfid, new_class_oid, &new_obj_oid, recdes, has_index, op_type,
5251 locator_insert_force (thread_p, new_class_hfid, new_class_oid, &new_obj_oid, recdes, has_index, op_type,
5253 NULL,
false,
false);
5265 mvcc_reev_data, &new_obj_oid, new_class_oid, need_locking);
5315 char *rep_dir_offset;
5316 char *classname =
NULL;
5317 char *old_classname =
NULL;
5324 bool is_cached =
false;
5328 bool no_data_new_address =
false;
5377 if (old_classname !=
NULL && old_classname != classname)
5407 RECDES old_record, *old_recdes;
5410 old_recdes = &old_record;
5468 #if !defined(NDEBUG) 5533 #if !defined(NDEBUG) 5566 local_scan_cache = scan_cache;
5576 COPY_OID (&real_class_oid, class_oid);
5589 if (oldrecdes ==
NULL)
5626 no_data_new_address =
true;
5653 oldrecdes = ©_recdes;
5669 #if defined (SERVER_MODE) 5735 if (has_index && oldrecdes ==
NULL)
5753 oldrecdes = ©_recdes;
5762 no_data_new_address =
true;
5794 COPY_OID (&real_class_oid, class_oid);
5796 partition_prune_update (thread_p, class_oid, recdes, pcontext, pruning_type, &real_class_oid, &real_hfid,
5816 if (!
OID_EQ (class_oid, &real_class_oid))
5834 locator_move_record (thread_p, hfid, class_oid, oid, &real_class_oid, &real_hfid, recdes, scan_cache,
5835 op_type, has_index, force_count, pcontext, mvcc_reev_data, need_locking);
5838 COPY_OID (class_oid, &real_class_oid);
5852 local_scan_cache, &repl_info);
5871 if (no_data_new_address)
5881 true,
true, hfid,
NULL,
false,
false);
5895 &cache_attr_copyarea);
5903 recdes = &new_record;
5936 repl_add_update_lsa (thread_p, oid);
5939 #if defined(ENABLE_UNUSED_FUNCTION) 5940 if (isold_object ==
false)
5942 locator_increase_catalog_count (thread_p, class_oid);
5952 "locator_update_force: qexec_clear_list_cache_by_class failed for class { %d %d %d }\n",
5963 if (old_classname !=
NULL && old_classname != classname)
5968 if (cache_attr_copyarea !=
NULL)
6023 OID * new_obj_oid,
OID * partition_oid,
bool need_locking)
6026 mvcc_reev_data,
FOR_MOVE, new_obj_oid, partition_oid, need_locking);
6060 bool deleted =
false;
6074 isold_object =
true;
6078 if (need_locking ==
false)
6081 mvcc_reev_data =
NULL;
6101 isold_object =
false;
6108 isold_object =
false;
6128 if (isold_object ==
false)
6193 if (isold_object ==
true && has_index)
6227 true, hfid,
NULL,
false,
false);
6233 scan_cache,
true,
true, hfid,
NULL,
false);
6252 "locator_delete_force: qexec_clear_list_cache_by_class failed for class { %d %d %d }\n",
6287 #if defined(ENABLE_UNUSED_FUNCTION) 6291 locator_decrease_catalog_count (thread_p, &class_oid);
6314 HEAP_ATTRVALUE *value;
6315 bool attr_info_inited;
6318 bool scan_cache_inited;
6325 attr_info_inited =
false;
6326 scan_cache_inited =
false;
6334 attr_info_inited =
true;
6337 for (i = 0; i < attr_info.num_values; i++)
6339 value = &attr_info.values[
i];
6358 scan_cache_inited =
true;
6365 recdes = ©_recdes;
6373 if (attr_info_inited)
6377 if (scan_cache_inited)
6403 int scan_cache_inited = 0;
6430 int first_update_obj = -1, last_update_obj = -1;
6437 for (i = 0; i < mobjs->
num_objs; i++)
6442 last_update_obj =
i;
6443 if (first_update_obj == -1)
6445 first_update_obj =
i;
6449 if (last_update_obj == -1)
6464 for (i = 0; i < mobjs->
num_objs; i++)
6476 if (!scan_cache_inited)
6485 scan_cache_inited = 1;
6534 scan_cache_inited = 0;
6542 if (!it.second.is_unique ())
6562 if (scan_cache_inited)
6590 DB_VALUE * key_value,
int err_code,
const char *err_msg)
6596 int packed_length = 0, round_length;
6597 int prev_offset, prev_length;
6605 int new_length, nw_pagesize;
6608 prev_length = (*copy_area)->length;
6611 new_length = prev_length +
CEIL_PTVDIV (packed_length - recdes->
area_size, nw_pagesize) * nw_pagesize;
6614 if (new_copy_area ==
NULL)
6621 recdes->
data = new_copy_area->
mem + prev_offset;
6623 *copy_area = new_copy_area;
6644 #if !defined(NDEBUG) 6648 recdes->
data += round_length;
6649 recdes->
area_size -= round_length +
sizeof (*reply_obj);
6669 int last_repr_id = -1;
6687 if (last_repr_id == 0)
6737 old_chn =
or_chn (old_recdes);
6762 char *ptr, *start_ptr;
6764 start_ptr = ptr = force_area->
mem + obj->
offset;
6767 return (
int) (ptr - start_ptr);
6794 int pruning_type = 0;
6795 int num_continue_on_error = 0;
6797 int packed_key_value_len;
6818 for (i = 0; i < mobjs->
num_objs; i++)
6834 if (
HFID_EQ (&prev_hfid, &obj->
hfid) !=
true && force_scancache !=
NULL)
6837 force_scancache =
NULL;
6840 if (force_scancache ==
NULL)
6849 force_scancache = &scan_cache;
6901 &force_count,
NULL,
true);
6929 num_continue_on_error++;
6940 if (force_scancache !=
NULL)
6947 if (num_continue_on_error > 0)
6962 if (force_scancache !=
NULL)
6994 int pruning_type = 0;
7009 for (i = 0; i < mobjs->
num_objs; i++)
7025 force_scancache = &scan_cache;
7040 bool topop_started =
false;
7050 topop_started =
true;
7094 &force_count,
NULL,
true);
7117 bool need_to_abort_oneobj =
false;
7123 need_to_abort_oneobj =
true;
7132 need_to_abort_oneobj =
true;
7155 if (force_scancache !=
NULL)
7158 force_scancache =
NULL;
7181 if (force_scancache !=
NULL)
7211 RECDES * new_recdes,
const int copyarea_length_hint,
int lob_create_flag)
7214 int copyarea_length = copyarea_length_hint <= 0 ?
DB_PAGESIZE : copyarea_length_hint;
7224 if (copyarea ==
NULL)
7232 new_recdes->
data = copyarea->
mem;
7246 copyarea_length = copyarea->
length;
7251 char *allocated_data =
NULL;
7252 size_t allocated_size = 0;
7254 if (allocated_data !=
NULL)
7256 assert (allocated_size > (
size_t) copyarea_length);
7261 if (copyarea ==
NULL)
7265 std::memcpy (copyarea->
mem, allocated_data, build_record.
get_size ());
7267 free (allocated_data);
7271 new_recdes->
data = copyarea->
mem;
7313 HEAP_SCANCACHE * scan_cache,
int *force_count,
bool not_check_fk,
7337 if (attr_info !=
NULL)
7339 COPY_OID (&class_oid, &attr_info->class_oid);
7347 if (rec_descriptor !=
NULL)
7349 copy_recdes = *rec_descriptor;
7377 if (saved_mvcc_snapshot !=
NULL)
7415 old_recdes = ©_recdes;
7425 if (copyarea ==
NULL)
7435 locator_insert_force (thread_p, &class_hfid, &class_oid, oid, &new_recdes,
true, op_type, scan_cache,
7453 locator_update_force (thread_p, &class_hfid, &class_oid, oid, old_recdes, &new_recdes, has_index,
7454 att_id, n_att_id, op_type, scan_cache, force_count, not_check_fk, repl_info,
7455 pruning_type, pcontext, mvcc_reev_data, force_update_inplace, need_locking);
7462 if (copyarea !=
NULL)
7473 locator_delete_force (thread_p, &class_hfid, oid,
true, op_type, scan_cache, force_count, mvcc_reev_data,
7513 for (i = 0; i < pos; i++)
7515 index = &(index_attrinfo->last_classrepr->indexes[
i]);
7551 has_BU_lock, skip_checking_fk);
7576 int is_insert,
int op_type,
HEAP_SCANCACHE * scan_cache,
bool datayn,
7581 datayn, need_replication, hfid, func_preds,
FOR_MOVE, has_BU_lock,
7611 int is_insert,
int op_type,
HEAP_SCANCACHE * scan_cache,
bool datayn,
7614 bool skip_checking_fk)
7630 bool use_mvcc =
false;
7633 bool classname_was_alloced =
false;
7641 #if defined(ENABLE_SYSTEMTAP) 7653 #if defined(SERVER_MODE) 7673 else if (num_found < 0)
7693 #if defined(ENABLE_SYSTEMTAP) 7694 if (classname ==
NULL)
7696 char *heap_class_name =
NULL;
7703 classname = heap_class_name;
7704 classname_was_alloced =
true;
7710 for (i = 0; i < num_btids; i++)
7712 index = &(index_attrinfo.last_classrepr->indexes[
i]);
7722 else if (ev_res !=
V_TRUE)
7733 (func_preds ? &func_preds[i] :
NULL), NULL);
7734 if (key_dbvalue == NULL)
7742 if (scan_cache == NULL)
7744 unique_stat_info =
NULL;
7755 unique_stat_info =
NULL;
7761 p_mvcc_rec_header = mvcc_rec_header;
7776 #if defined(ENABLE_SYSTEMTAP) 7777 CUBRID_IDX_INSERT_START (classname, index->
btname);
7798 btree_insert (thread_p, &btid, key_dbvalue, class_oid, inst_oid, op_type, unique_stat_info,
7799 &unique_pk, p_mvcc_rec_header);
7801 #if defined(ENABLE_SYSTEMTAP) 7802 CUBRID_IDX_INSERT_END (classname, index->
btname, (error_code !=
NO_ERROR));
7807 #if defined(ENABLE_SYSTEMTAP) 7808 CUBRID_IDX_DELETE_START (classname, index->
btname);
7811 if (use_mvcc ==
true)
7824 btree_mvcc_delete (thread_p, &btid, key_dbvalue, class_oid, inst_oid, op_type, unique_stat_info,
7825 &unique_pk, p_mvcc_rec_header);
7837 #if defined(ENABLE_SYSTEMTAP) 7838 CUBRID_IDX_DELETE_END (classname, index->
btname, 1);
7844 #if defined(ENABLE_SYSTEMTAP) 7845 CUBRID_IDX_DELETE_END (classname, index->
btname, (error_code !=
NO_ERROR));
7938 if (key_dbvalue == &dbvalue)
7949 if (key_dbvalue == &dbvalue)
7955 #if defined(ENABLE_SYSTEMTAP) 7956 if (classname !=
NULL && classname_was_alloced)
7965 #if defined(ENABLE_UNUSED_FUNCTION) 7987 num_atts = index->
n_atts;
7991 for (i = 0; i < num_atts; i++)
7996 if (set_domain ==
NULL)
8000 domain = set_domain;
8009 domain = domain->
next;
8031 for (td = set_domain, next =
NULL; td !=
NULL; td = next)
8063 HL_HEAPID old_pri_heap_id = HL_NULL_HEAPID;
8066 if (or_pred ==
NULL || class_oid ==
NULL || recs ==
NULL || inst_oids ==
NULL || num_insts <= 0 || results ==
NULL 8073 error_code =
fpcache_claim (thread_p, btid, or_pred, &pred_filter);
8089 filter_eval_func =
eval_fnc (thread_p, pred_filter->
pred, &single_node_type);
8092 for (i = 0; i < num_insts; i++)
8102 results[
i] = (*filter_eval_func) (thread_p, pred_filter->
pred,
NULL, inst_oids[
i]);
8153 int new_num_found, old_num_found;
8154 BTID new_btid, old_btid;
8155 int pk_btid_index = -1;
8159 bool new_isnull, old_isnull;
8162 int i, j, k, num_btids, old_num_btids, unique_pk;
8163 bool found_btid =
true;
8173 bool do_delete_only =
false;
8174 bool do_insert_only =
false;
8177 bool same_key =
true;
8179 bool use_mvcc =
false;
8190 #if defined(ENABLE_SYSTEMTAP) 8191 char *classname =
NULL;
8192 bool is_started =
false;
8203 #if defined(SERVER_MODE) 8222 if (new_num_found < 0)
8226 new_attrinfo = &space_attrinfo[0];
8230 if (old_num_found < 0)
8235 old_attrinfo = &space_attrinfo[1];
8237 if (new_num_found != old_num_found)
8239 if (new_num_found > 0)
8243 if (old_num_found > 0)
8250 if (new_num_found == 0)
8253 if (repl_info !=
NULL)
8268 new_attrinfo = &space_attrinfo[0];
8269 old_attrinfo = &space_attrinfo[1];
8286 if (old_attrinfo->last_classrepr->n_indexes != new_attrinfo->last_classrepr->n_indexes)
8292 #if defined(ENABLE_SYSTEMTAP) 8300 for (i = 0; i < num_btids; i++)
8302 index = &(new_attrinfo->last_classrepr->indexes[
i]);
8315 for (j = 0; j < n_att_id && !found_btid; j++)
8317 for (k = 0; k < index->
n_atts && !found_btid; k++)
8334 do_delete_only =
false;
8335 do_insert_only =
false;
8338 inst_oids[0] = inst_oids[1] =
oid;
8339 recs[0] = old_recdes;
8340 recs[1] = new_recdes;
8349 if (ev_results[0] !=
V_TRUE)
8351 if (ev_results[1] !=
V_TRUE)
8360 do_insert_only =
true;
8365 if (ev_results[1] !=
V_TRUE)
8368 do_delete_only =
true;
8372 if (found_btid ==
false)
8390 if ((new_key ==
NULL) || (old_key ==
NULL))
8403 if (scan_cache ==
NULL)
8405 unique_stat_info =
NULL;
8416 unique_stat_info =
NULL;
8423 if (pr_type ==
NULL)
8441 if ((new_isnull && !old_isnull) || (old_isnull && !new_isnull))
8447 if (!(new_isnull && old_isnull))
8465 #if defined(ENABLE_SYSTEMTAP) 8466 CUBRID_IDX_UPDATE_START (classname, index->
btname);
8470 if (!same_key || do_delete_only || do_insert_only)
8478 p_mvcc_rec_header = mvcc_rec_header;
8510 btree_mvcc_delete (thread_p, &old_btid, old_key, class_oid, oid, op_type, unique_stat_info,
8511 &unique_pk, p_mvcc_rec_header);
8534 if ((do_insert_only ==
true))
8554 btree_insert (thread_p, &old_btid, new_key, class_oid, oid, op_type, unique_stat_info,
8555 &unique_pk, p_mvcc_rec_header);
8588 btree_update (thread_p, &old_btid, old_key, new_key, class_oid, oid, op_type,
8589 unique_stat_info, &unique_pk, p_mvcc_rec_header);
8600 #if defined(ENABLE_SYSTEMTAP) 8601 CUBRID_IDX_UPDATE_END (classname, index->
btname, 0);
8608 assert (do_insert_only ==
false && do_delete_only ==
false);
8613 if (pk_btid_index == i)
8630 if (pk_btid_index == i)
8685 if (pk_btid_index == i && repl_old_key ==
NULL)
8691 if (new_key == &new_dbvalue)
8696 if (old_key == &old_dbvalue)
8703 if (pk_btid_index != -1)
8707 if (repl_old_key ==
NULL)
8712 aligned_oldbuf,
NULL, &key_domain);
8713 if (repl_old_key ==
NULL)
8721 if (pr_type ==
NULL)
8740 if (repl_old_key == &old_dbvalue)
8751 repl_old_key =
NULL;
8766 if (repl_info !=
NULL)
8775 #if defined(ENABLE_SYSTEMTAP) 8776 if (classname !=
NULL)
8786 if (new_key == &new_dbvalue)
8791 if (old_key == &old_dbvalue)
8797 if (repl_old_key !=
NULL)
8804 if (new_attrinfo !=
NULL)
8809 if (old_attrinfo !=
NULL)
8814 #if defined(ENABLE_SYSTEMTAP) 8815 if (is_started ==
true)
8817 CUBRID_IDX_UPDATE_END (classname, index->
btname, 1);
8819 if (classname !=
NULL)
8846 OID inst_oid, *p_inst_oid = &inst_oid;
8847 int key_index,
i, num_btids, num_found, dummy_unique, key_found;
8848 RECDES copy_rec, *p_copy_rec = ©_rec;
8865 if (mvcc_snapshot ==
NULL)
8886 error_code =
heap_scancache_start (thread_p, &scan_cache, hfid, class_oid,
false,
false, mvcc_snapshot);
8915 if (dbvalue_ptr == &dbvalue)
8921 scan =
heap_next (thread_p, hfid, class_oid, &inst_oid, ©_rec, &scan_cache,
COPY);
8929 new_area = (
char *) realloc (copy_rec.
data, -(copy_rec.
length));
8930 if (new_area ==
NULL)
8937 copy_rec.
data = new_area;
8948 if (key_found ==
false)
8950 for (i = 0; i < num_btids; i++)
8952 if (dbvalue_ptr == &dbvalue)
8961 if (dbvalue_ptr ==
NULL)
8970 index = &(index_attrinfo.last_classrepr->indexes[key_index]);
8982 heap_attrvalue_get_key (thread_p, key_index, &index_attrinfo, ©_rec, &inst_btid, &dbvalue, aligned_buf,
8987 if (key_found ==
false || dbvalue_ptr ==
NULL)
8998 &p_copy_rec, &ev_res);
9039 if (dbvalue_ptr == &dbvalue)
9106 COPY_OID (&((*notify->
obj)->class_oid), class_oid);
9109 (*notify->
obj)->
hfid = NULL_HFID;
9110 (*notify->
obj)->length = -1;
9113 (*notify->
obj)->offset = -1;
9139 bool more_synch =
false;
9142 if (*synch_area ==
NULL)
9153 prefetch_des.
mobjs = mobjs;
9154 prefetch_des.
obj = &obj;
9155 prefetch_des.
offset = &offset;
9156 prefetch_des.
recdes = &recdes;
9167 else if (recdes.
area_size >= SSIZEOF (*obj))
9179 #if defined(SERVER_MODE) 9203 #if defined(SERVER_MODE) 9204 lock_remove_all_inst_locks (thread_p, tran_index, class_oid,
X_LOCK);
9214 bool clear_key =
false;
9217 #if defined(SERVER_MODE) 9246 #if defined(SERVER_MODE) 9247 lock_remove_all_inst_locks (thread_p, tran_index, class_oid,
X_LOCK);
9277 ATTR_ID * attr_ids,
int *atts_prefix_length,
const char *btname,
bool repair)
9281 OID inst_oid, *p_inst_oid = &inst_oid;
9288 int num_btree_oids = 0;
9289 int num_heap_oids = 0;
9298 char *classname =
NULL;
9306 #if defined(SERVER_MODE) 9309 bool is_scancache_started =
false;
9310 bool is_attrinfo_started =
false;
9311 bool is_bt_checkscan_started =
false;
9314 if (mvcc_snapshot ==
NULL)
9322 #if defined(SERVER_MODE) 9333 is_scancache_started =
true;
9339 is_attrinfo_started =
true;
9341 classrepr = attr_info.last_classrepr;
9342 if (classrepr ==
NULL)
9347 for (i = 0; i < classrepr->
n_indexes; i++)
9357 index = &(attr_info.last_classrepr->indexes[index_id]);
9369 is_bt_checkscan_started =
true;
9375 while ((scan =
heap_next (thread_p, hfid, class_oid, &inst_oid, &record, &scan_cache,
COPY)) ==
S_SUCCESS)
9386 else if (ev_res !=
V_TRUE)
9399 || (key =
heap_attrvalue_get_key (thread_p, index_id, &attr_info, &record, &btid_info, &dbvalue, aligned_buf,
9449 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*",
9450 class_oid->
volid, class_oid->
pageid, class_oid->
slotid, (key_dmp) ? key_dmp :
"_NULL_KEY",
9466 isallvalid = isvalid;
9473 if (key == &dbvalue)
9487 is_bt_checkscan_started =
false;
9491 is_attrinfo_started =
false;
9541 if (
btree_prepare_bts (thread_p, &bt_scan, btid, &isid, &key_val_range,
NULL, class_oid,
NULL,
NULL,
false,
NULL)
9559 num_btree_oids += oid_cnt;
9560 for (i = 0; i < oid_cnt; i++)
9589 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*",
9611 if (num_heap_oids != num_btree_oids)
9623 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*", class_oid->
volid,
9638 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*", class_oid->
volid,
9645 if (key == &dbvalue)
9666 if (is_bt_checkscan_started)
9671 if (is_attrinfo_started)
9702 ATTR_ID * attr_ids,
const char *btname,
bool repair)
9705 OID inst_oid, *p_inst_oid = &inst_oid;
9714 int num_btree_oids = 0, num_heap_oids = 0, num_nulls = 0;
9717 int num_classes, scancache_inited = 0, attrinfo_inited = 0;
9724 char *classname =
NULL;
9728 int partition_local_index = 0;
9730 #if defined(SERVER_MODE) 9733 int btree_oid_cnt, btree_null_cnt, btree_key_cnt;
9735 bool bt_checkscan_inited =
false;
9738 if (mvcc_snapshot ==
NULL)
9746 #if defined(SERVER_MODE) 9754 &partition_local_index) !=
NO_ERROR 9755 || class_oids ==
NULL || hfids ==
NULL || num_classes < 1)
9757 if (class_oids !=
NULL)
9775 if (scan_cache ==
NULL)
9781 if (partition_local_index == 1)
9783 if (num_classes == 1)
9786 COPY_OID (&class_oids[0], cls_oid);
9796 for (j = 0; j < num_classes; j++)
9799 class_oid = &class_oids[j];
9813 index = &(attr_info.last_classrepr->indexes[index_id]);
9816 attrinfo_inited = 1;
9823 bt_checkscan_inited =
true;
9825 inst_oid.
volid = hfid->vfid.volid;
9829 while ((scan =
heap_next (thread_p, hfid, class_oid, &inst_oid, &peek, &scan_cache[j],
PEEK)) ==
S_SUCCESS)
9840 else if (ev_res !=
V_TRUE)
9898 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*",
9899 class_oid->volid, class_oid->pageid, class_oid->slotid,
9900 (key_dmp) ? key_dmp :
"_NULL_KEY", inst_oid.
volid, inst_oid.
pageid, inst_oid.
slotid,
9915 isallvalid = isvalid;
9922 if (key == &dbvalue)
9935 bt_checkscan_inited =
false;
9939 attrinfo_inited = 0;
9981 if (
btree_prepare_bts (thread_p, &bt_scan, btid, &isid, &key_val_range,
NULL,
NULL,
NULL,
NULL,
false,
NULL) !=
10005 num_btree_oids += oid_cnt;
10006 for (i = 0; i < oid_cnt; i++)
10034 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*",
10035 class_oid->volid, class_oid->pageid, class_oid->slotid, oid_area[i].
volid, oid_area[i].
pageid,
10061 for (j = 0, found = 0; found == 0 && class_oids !=
NULL && j < num_classes; j++)
10063 if (
OID_EQ (&cl_oid, &(class_oids[j])))
10081 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*",
10082 class_oid->volid, class_oid->pageid, class_oid->slotid, oid_area[i].
volid, oid_area[i].
pageid,
10109 #if defined(SA_MODE) 10117 if (num_heap_oids != num_btree_oids + num_nulls)
10129 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*", class_oid->volid,
10130 class_oid->pageid, class_oid->slotid, num_heap_oids, num_btree_oids, num_nulls, btid->
vfid.
volid,
10141 #if defined(SA_MODE) 10142 if (num_heap_oids != btree_oid_cnt)
10154 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*", class_oid->volid,
10155 class_oid->pageid, class_oid->slotid, num_heap_oids, btree_oid_cnt, btid->
vfid.
volid, btid->
vfid.
fileid,
10166 if (num_nulls != btree_null_cnt)
10178 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*", class_oid->volid,
10179 class_oid->pageid, class_oid->slotid, num_nulls, btree_null_cnt, btid->
vfid.
volid, btid->
vfid.
fileid,
10190 if (btree_oid_cnt != btree_null_cnt + btree_key_cnt)
10202 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*", class_oid->volid,
10203 class_oid->pageid, class_oid->slotid, btree_oid_cnt, btree_null_cnt, btree_key_cnt, btid->
vfid.
volid,
10218 (btname) ? btname :
"*UNKNOWN-INDEX*", (classname) ? classname :
"*UNKNOWN-CLASS*", class_oid->volid,
10219 class_oid->pageid, class_oid->slotid);
10225 for (j = 0; j < scancache_inited; j++)
10266 if (attrinfo_inited)
10271 for (j = 0; j < scancache_inited; j++)
10281 if (bt_checkscan_inited)
10307 char *btname =
NULL;
10308 int *attrs_prefix_length =
NULL;
10343 if (attrids ==
NULL)
10357 attrs_prefix_length = (
int *) malloc (n_attrs *
sizeof (
int));
10358 if (attrs_prefix_length ==
NULL)
10398 if (attrs_prefix_length)
10430 if (mvcc_snapshot ==
NULL)
10513 if (mvcc_snapshot ==
NULL)
10635 int stack_actual_size;
10644 int num_original_classes;
10668 if (max_stack < 10)
10672 max_oid_list = max_stack;
10674 stack = (
int *) malloc (
sizeof (*stack) * max_stack);
10681 oid_list = (
OID *) malloc (
sizeof (*oid_list) * max_oid_list);
10682 if (oid_list ==
NULL)
10694 for (i = 0; i < num_original_classes; i++)
10732 stack_actual_size = 0;
10733 stack[stack_actual_size++] =
i;
10739 while (stack_actual_size > 0)
10742 ref_num = stack[--stack_actual_size];
10821 for (k = 0; k < max_oid_list && !
OID_ISNULL (&oid_list[k]); k++)
10843 if (stack_actual_size >= max_stack)
10846 max_stack = max_stack * 2;
10847 new_ptr = realloc (stack,
sizeof (*stack) * max_stack);
10848 if (new_ptr ==
NULL)
10851 sizeof (*stack) * max_stack);
10860 stack = (
int *) new_ptr;
10866 if (new_ptr ==
NULL)
10876 lockhint = *lockhint_subclasses = (
LC_LOCKHINT *) new_ptr;
10884 stack[stack_actual_size++] = lockhint->
num_classes;
10934 stack[stack_actual_size++] = j;
11019 OID * guessed_class_oids,
int *guessed_class_chns,
bool quit_on_errors,
11024 const char *classname;
11028 bool allneed_subclasses =
false;
11032 #if !defined(NDEBUG) 11036 *fetch_area =
NULL;
11044 if (*hlock ==
NULL)
11055 for (i = 0; i < num_classes && (allfind ==
LC_CLASSNAME_EXIST || quit_on_errors ==
false); i++)
11057 classname = many_classnames[
i];
11063 if (many_need_subclasses[i])
11065 allneed_subclasses =
true;
11068 n = (*hlock)->num_classes;
11081 (*hlock)->classes[n].lock = many_locks[
i];
11082 (*hlock)->classes[n].need_subclasses = many_need_subclasses[
i];
11133 if ((*hlock)->classes[n].lock !=
NULL_LOCK)
11135 tmp_lock = (*hlock)->classes[n].lock;
11173 #if !defined(NDEBUG) 11175 assert (check_own >= 1);
11188 if (guessed_class_oids !=
NULL &&
OID_EQ (&(*hlock)->classes[n].oid, &guessed_class_oids[i]))
11190 (*hlock)->classes[n].chn = guessed_class_chns[
i];
11194 (*hlock)->num_classes = n;
11214 for (i = 0; i < (*hlock)->num_classes; i++)
11223 for (j = i + 1; j < (*hlock)->num_classes; j++)
11225 if (
OID_EQ (&(*hlock)->classes[i].oid, &(*hlock)->classes[j].oid))
11229 (*hlock)->classes[
i].lock =
lock_Conv[(*hlock)->classes[
i].lock][(*hlock)->classes[j].lock];
11232 if ((*hlock)->classes[i].need_subclasses == 0)
11234 (*hlock)->classes[
i].need_subclasses = (*hlock)->classes[j].need_subclasses;
11247 if (allneed_subclasses ==
true && (allfind ==
LC_CLASSNAME_EXIST || quit_on_errors ==
false))
11260 if (quit_on_errors ==
true)
11296 int copyarea_length;
11300 *fetch_area =
NULL;
11484 if (*fetch_area !=
NULL)
11487 prefetch_des.
obj = &nxobj.
obj;
11522 for (class_oidset = oidset->
classes; class_oidset !=
NULL; class_oidset = class_oidset->
next)
11524 for (oid = class_oidset->
oids; oid !=
NULL; oid = oid->
next)
11547 #if defined(ENABLE_UNUSED_FUNCTION) 11559 locator_increase_catalog_count (
THREAD_ENTRY * thread_p,
OID * cls_oid)
11565 if (cls_infop ==
NULL)
11601 locator_decrease_catalog_count (
THREAD_ENTRY * thread_p,
OID * cls_oid)
11607 if (cls_infop ==
NULL)
11651 error_code = repl_log_insert_statement (thread_p, (
REPL_INFO_SBR *) repl_info->
info);
11690 int *attr_ids,
OID * pk_cls_oid,
BTID * pk_btid,
char *fk_name)
11702 if (mvcc_snapshot ==
NULL)
11712 error_code =
heap_scancache_start (thread_p, &scan_cache, hfid, cls_oid,
false,
false, mvcc_snapshot);
11743 if (key_val ==
NULL)
11752 if (key_val == &tmpval)
11791 int *instance_lock_timeout,
OID * class_oid,
LOCK * class_lock,
int *nobjects,
11792 int *nfetched,
int *nfailed_instance_locks,
OID * last_oid,
LC_COPYAREA ** fetch_area,
11801 int copyarea_length;
11807 if (fetch_area ==
NULL)
11811 *fetch_area =
NULL;
11813 if (nfailed_instance_locks ==
NULL)
11817 *nfailed_instance_locks = 0;
11845 if (*nobjects == -1)
11856 error_code =
heap_scancache_start (thread_p, &scan_cache, hfid, class_oid,
true,
false, mvcc_snapshot);
11868 if (*fetch_area ==
NULL)
11883 if (instance_lock && (*instance_lock !=
NULL_LOCK))
11885 int lock_result = 0;
11887 scan =
heap_next (thread_p, hfid, class_oid, &oid, &recdes, &scan_cache,
COPY);
11893 if (instance_lock_timeout ==
NULL)
11901 *instance_lock_timeout);
11906 (*nfailed_instance_locks)++;
11913 (*nfailed_instance_locks)++;
11920 scan =
heap_next (thread_p, hfid, class_oid, &oid, &recdes, &scan_cache,
COPY);
11937 #if !defined(NDEBUG) 11941 offset += round_length;
11942 recdes.
data += round_length;
11943 recdes.
area_size -= round_length +
sizeof (*obj);
11956 copyarea_length = (*fetch_area)->length;
11964 if ((-recdes.
length) > copyarea_length)
11983 *nobjects = *nfetched = -1;
11988 *nobjects = *nfetched;
11995 *nobjects = *nfetched = -1;
12011 if (*nobjects <= *nfetched)
12013 *nobjects = *nfetched + 10;
12025 if (*fetch_area !=
NULL)
12027 prefetch_des.
mobjs = mobjs;
12028 prefetch_des.
obj = &obj;
12029 prefetch_des.
offset = &offset;
12030 prefetch_des.
recdes = &recdes;
12043 if (*fetch_area !=
NULL)
12046 *fetch_area =
NULL;
12082 int nobjects = 0, nfetched = 0,
i = 0;
12084 bool scancache_inited =
false;
12085 bool attrinfo_inited =
false;
12088 MVCCID threshold_mvccid;
12115 scancache_inited =
true;
12117 tdes->lock_global_oldest_visible_mvccid ();
12132 attrinfo_inited =
true;
12134 while (nobjects != nfetched)
12136 int nfailed_instances = 0;
12140 &nfailed_instances, &last_oid, &fetch_area,
NULL);
12146 if (nfailed_instances != 0)
12153 if (fetch_area ==
NULL)
12208 if (attrinfo_inited)
12212 if (scancache_inited)
12237 for (i = 0; i < num_ignore_error_count; i++)
12239 if (ignore_error_list[i] == error_code)
12260 bool has_function_indexes)
12266 if (scan_cache !=
NULL)
12274 if (scan_cache ==
NULL)
12286 if (has_function_indexes)
12295 scan_cache->
n_indexes = attr_info.last_classrepr->n_indexes;
12373 BTID tmp_btid = *btid;
12386 goto free_and_return;
12388 attr_info_p = &attr_info;
12393 goto free_and_return;
12395 bt_checkscan_p = &bt_checkscan;
12403 goto free_and_return;
12410 goto free_and_return;
12413 pr_share_value (key, &key_val_range.
key1);
12414 pr_share_value (key, &key_val_range.
key2);
12424 if (key == &dbvalue)
12429 if (bt_checkscan_p)
12526 #if !defined(NDEBUG) 12530 assert (check_own >= 1);
12577 repl_start_flush_mark (thread_p);
12581 repl_end_flush_mark (thread_p,
false);
12596 #if defined (SERVER_MODE) 12645 bool is_scan_end =
false;
12646 bool is_parent_scancache_started =
false;
12647 bool is_part_scancache_started =
false;
12648 bool is_pcontext_inited =
false;
12649 int force_count = -1;
12672 is_parent_scancache_started =
true;
12681 is_pcontext_inited =
true;
12685 tdes->lock_global_oldest_visible_mvccid ();
12688 for (i = 0; i < no_oids; i++)
12709 is_part_scancache_started =
true;
12722 is_scan_end =
false;
12723 while (!is_scan_end)
12750 else if (scan ==
S_END)
12765 is_scan_end =
true;
12783 inst_oid.
slotid = slotid;
12811 if (is_part_scancache_started ==
true)
12814 is_part_scancache_started =
false;
12827 if (is_parent_scancache_started ==
true)
12831 if (is_part_scancache_started ==
true)
12835 if (is_pcontext_inited ==
true)
12873 bool lock_acquired =
false;
12896 lock_acquired =
true;
12907 lock_acquired =
true;
12962 snapshot_res = tran_snapshot->
snapshot_fnc (thread_p, &recdes_header, tran_snapshot);
13048 if (recdes ==
NULL && mvcc_reev_data !=
NULL)
13051 recdes = &recdes_local;
13056 if (class_oid ==
NULL)
13058 class_oid = &class_oid_local;
13061 if (scan_cache && ispeeking ==
COPY && recdes !=
NULL)
13069 heap_init_get_context (thread_p, &context, oid, class_oid, recdes, scan_cache, ispeeking, old_chn);
13187 if (class_oid ==
NULL)
13190 class_oid = &class_oid_local;
13193 if (scan_cache && ispeeking ==
COPY && recdes !=
NULL)
13293 if (scan_cache && ispeeking ==
COPY && recdes !=
NULL)
13302 heap_init_get_context (thread_p, &context, oid, class_oid, recdes, scan_cache, ispeeking, old_chn);
13327 if (mvcc_reev_data_p ==
NULL)
13332 assert (mvcc_header_p !=
NULL && curr_row_version_oid_p !=
NULL);
13337 switch (mvcc_reev_data_p->
type)
13341 curr_row_version_oid_p, recdes);
13398 mvcc_cond_reeval = mvcc_cond_reeval->
next)
13402 mvcc_reev_data->
curr_upddel == mvcc_cond_reeval);
13441 for (; assign !=
NULL; assign = assign->
next)
13520 bool scan_cache_inited =
false;
13524 cls_oid = &mvcc_cond_reeval->
cls_oid;
13528 recdesp = &temp_recdes;
13535 scan_cache_inited =
true;
13547 oid_inst = mvcc_cond_reeval->
inst_oid;
13577 if (scan_cache_inited)
13659 else if (lock_mode <=
S_LOCK)
13714 const std::vector<record_descriptor> &
recdes,
int has_index,
int op_type,
13719 size_t accumulated_records_size = 0;
13720 size_t heap_max_page_size;
13722 std::vector<RECDES> recdes_array;
13723 std::vector<VPID> heap_pages_array;
13729 if (recdes.size () == 0)
13740 for (
size_t i = 0;
i < recdes.size ();
i++)
13742 local_record = recdes[
i].get_recdes ();
13749 error_code =
locator_insert_force (thread_p, hfid, class_oid, &dummy_oid, &local_record, has_index,
13750 op_type, scan_cache, force_count, pruning_type, pcontext, func_preds,
13751 force_in_place,
NULL, has_BU_lock, dont_check_fk,
false);
13762 >= heap_max_page_size)
13764 VPID new_page_vpid;
13771 error_code =
heap_alloc_new_page (thread_p, hfid, *class_oid, &home_hint_p, &new_page_vpid);
13778 for (
size_t j = 0; j < recdes_array.size (); j++)
13780 error_code =
locator_insert_force (thread_p, hfid, class_oid, &dummy_oid, &recdes_array[j], has_index,
13781 op_type, scan_cache, force_count, pruning_type, pcontext,
13782 func_preds, force_in_place, &home_hint_p, has_BU_lock,
13783 dont_check_fk,
true);
13788 if (home_hint_p.
pgptr)
13812 heap_pages_array.push_back (new_page_vpid);
13815 recdes_array.clear ();
13816 accumulated_records_size = 0;
13825 recdes_array.push_back (local_record);
13827 accumulated_records_size += record_overhead;
13832 for (
size_t i = 0;
i < recdes_array.size ();
i++)
13835 error_code =
locator_insert_force (thread_p, hfid, class_oid, &dummy_oid, &recdes_array[
i], has_index, op_type,
13836 scan_cache, force_count, pruning_type, pcontext, func_preds, force_in_place,
13837 NULL, has_BU_lock, dont_check_fk,
false);
13855 != error_filter_array.end ())
static int locator_eval_filter_predicate(THREAD_ENTRY *thread_p, BTID *btid, OR_PREDICATE *or_pred, OID *class_oid, OID **inst_oids, int num_insts, RECDES **recs, DB_LOGICAL *results)
SCAN_CODE heap_get_record_data_when_all_ready(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context)
DISK_ISVALID btree_keyoid_checkscan_check(THREAD_ENTRY *thread_p, BTREE_CHECKSCAN *btscan, OID *cls_oid, DB_VALUE *key, OID *oid)
static int locator_find_lockset_missing_class_oids(THREAD_ENTRY *thread_p, LC_LOCKSET *lockset)
static int locator_filter_errid(THREAD_ENTRY *thread_p, int num_ignore_error_count, int *ignore_error_list)
int locator_delete_force(THREAD_ENTRY *thread_p, HFID *hfid, OID *oid, int has_index, int op_type, HEAP_SCANCACHE *scan_cache, int *force_count, MVCC_REEV_DATA *mvcc_reev_data, bool need_locking)
void heap_scancache_end_modify(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
DB_VALUE * heap_attrvalue_get_key(THREAD_ENTRY *thread_p, int btid_index, HEAP_CACHE_ATTRINFO *idx_attrinfo, RECDES *recdes, BTID *btid, DB_VALUE *db_value, char *buf, FUNC_PRED_UNPACK_INFO *func_indx_pred, TP_DOMAIN **key_domain)
#define OR_PUT_OID(ptr, oid)
int heap_object_upgrade_domain(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *upd_scancache, HEAP_CACHE_ATTRINFO *attr_info, OID *oid, const ATTR_ID att_id)
LC_LOCKSET_CLASSOF * classes
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 xlocator_lock_and_fetch_all(THREAD_ENTRY *thread_p, const HFID *hfid, LOCK *instance_lock, int *instance_lock_timeout, OID *class_oid, LOCK *class_lock, int *nobjects, int *nfetched, int *nfailed_instance_locks, OID *last_oid, LC_COPYAREA **fetch_area, MVCC_SNAPSHOT *mvcc_snapshot)
int db_value_put_null(DB_VALUE *value)
static bool locator_notify_decache(const OID *class_oid, const OID *oid, void *notify_area)
int locator_drop_transient_class_name_entries(THREAD_ENTRY *thread_p, LOG_LSA *savep_lsa)
#define MVCC_IS_HEADER_DELID_VALID(rec_header_p)
int heap_get_class_oid_from_page(THREAD_ENTRY *thread_p, PAGE_PTR page_p, OID *class_oid)
void log_append_repl_info(THREAD_ENTRY *thread_p, LOG_TDES *tdes, bool is_commit)
#define MVCC_GET_INSID(header)
#define MVCC_SET_PREVIOUS_VERSION_LSA(header, new_lsa)
static DISK_ISVALID locator_repair_btree_by_delete(THREAD_ENTRY *thread_p, OID *class_oid, BTID *btid, OID *inst_oid)
MVCC_SNAPSHOT * logtb_get_mvcc_snapshot(THREAD_ENTRY *thread_p)
#define pgbuf_ordered_fix(thread_p, req_vpid, fetch_mode, requestmode, req_watcher)
int xlocator_assign_oid_batch(THREAD_ENTRY *thread_p, LC_OIDSET *oidset)
BTREE_ISCAN_OID_LIST * next_list
int catalog_delete(THREAD_ENTRY *thread_p, OID *class_oid_p)
update_mvcc_reev_assignment * curr_assigns
LC_FIND_CLASSNAME xlocator_delete_class_name(THREAD_ENTRY *thread_p, const char *classname)
void or_class_tde_algorithm(RECDES *record, TDE_ALGORITHM *tde_algo)
unsigned int mht_1strhash(const void *key, const unsigned int ht_size)
#define CLASSNAME_CACHE_SIZE
LC_LOCKHINT * locator_reallocate_lockhint(LC_LOCKHINT *lockhint, int max_classes)
LOCATOR_CLASSNAME_ACTION e_current
#define ER_MVCC_SERIALIZABLE_CONFLICT
static int locator_add_or_remove_index_for_moving(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)
void set_external_buffer(char *buf, std::size_t buf_size)
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)
const block_allocator CSTYLE_BLOCK_ALLOCATOR
static int locator_prefetch_index_page(THREAD_ENTRY *thread_p, OID *class_oid, RECDES *classrec, RECDES *recdes, int btid_index, HEAP_CACHE_ATTRINFO *attr_info)
static int locator_delete_force_for_moving(THREAD_ENTRY *thread_p, HFID *hfid, OID *oid, int has_index, int op_type, HEAP_SCANCACHE *scan_cache, int *force_count, MVCC_REEV_DATA *mvcc_reev_data, OID *new_obj_oid, OID *partition_oid, bool need_locking)
#define LC_PRIOR_ONEOBJ_PTR_IN_COPYAREA(oneobj_ptr)
int locator_start_force_scan_cache(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid, const OID *class_oid, int op_type)
void LSA_COPY(log_lsa *plsa1, const log_lsa *plsa2)
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 heap_attrinfo_delete_lob(THREAD_ENTRY *thread_p, RECDES *recdes, HEAP_CACHE_ATTRINFO *attr_info)
int qexec_clear_list_cache_by_class(THREAD_ENTRY *thread_p, const OID *class_oid)
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)
void locator_free_copy_area(LC_COPYAREA *copyarea)
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE7
bool logtb_check_class_for_rr_isolation_err(const OID *class_oid)
int or_replace_rep_id(RECDES *record, int repid)
int heap_prepare_object_page(THREAD_ENTRY *thread_p, const OID *oid, PGBUF_WATCHER *page_watcher_p, PGBUF_LATCH_MODE latch_mode)
int partition_load_pruning_context(THREAD_ENTRY *thread_p, const OID *class_oid, int pruning_type, PRUNING_CONTEXT *pinfo)
CLS_INFO * catalog_update_class_info(THREAD_ENTRY *thread_p, OID *class_id_p, CLS_INFO *class_info_p, CATALOG_ACCESS_INFO *catalog_access_info_p, bool skip_logging)
SCAN_CODE heap_prepare_get_context(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, bool is_heap_scan, NON_EXISTENT_HANDLING non_ex_handling_type)
#define ER_HEAP_NODATA_NEWADDRESS
LOG_LSA * log_get_append_lsa(void)
int xlocator_does_exist(THREAD_ENTRY *thread_p, OID *oid, int chn, LOCK lock, LC_FETCH_VERSION_TYPE fetch_version_type, OID *class_oid, int class_chn, int need_fetching, int prefetching, LC_COPYAREA **fetch_area)
#define LC_START_ONEOBJ_PTR_IN_COPYAREA(manyobjs_ptr)
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE3
bool mvcc_is_mvcc_disabled_class(const OID *class_oid)
#define csect_enter(a, b, c)
#define LC_FLAG_HAS_INDEX
int mht_rem(MHT_TABLE *ht, const void *key, int(*rem_func)(const void *key, void *data, void *args), void *func_args)
DISK_ISVALID locator_check_btree_entries(THREAD_ENTRY *thread_p, BTID *btid, HFID *hfid, OID *class_oid, int n_attr_ids, ATTR_ID *attr_ids, int *atts_prefix_length, const char *btname, bool repair)
bool xlocator_notify_isolation_incons(THREAD_ENTRY *thread_p, LC_COPYAREA **synch_area)
LC_COPYAREA * locator_reallocate_copy_area_by_length(LC_COPYAREA *old_area, int new_length)
MVCCID logtb_find_current_mvccid(THREAD_ENTRY *thread_p)
int xlocator_fetch_lockset(THREAD_ENTRY *thread_p, LC_LOCKSET *lockset, LC_COPYAREA **fetch_area)
REPR_ID heap_get_class_repr_id(THREAD_ENTRY *thread_p, OID *class_oid)
void set_filters(upddel_mvcc_cond_reeval &ureev)
MULTI_RANGE_OPT multi_range_opt
int xlocator_fetch_lockhint_classes(THREAD_ENTRY *thread_p, LC_LOCKHINT *lockhint, LC_COPYAREA **fetch_area)
char * or_pack_string(char *ptr, const char *string)
multi_index_unique_stats * m_index_stats
const void * mht_put(MHT_TABLE *ht, const void *key, void *data)
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE5
int xbtree_get_unique_pk(THREAD_ENTRY *thread_p, BTID *btid)
void lock_notify_isolation_incons(THREAD_ENTRY *thread_p, bool(*fun)(const OID *class_oid, const OID *oid, void *args), void *args)
PGBUF_WATCHER home_page_watcher
#define ASSERT_ERROR_AND_SET(error_code)
int num_classes_processed
#define OR_MVCC_FLAG_VALID_INSID
#define assert_release(e)
int lock_demote_class_lock(THREAD_ENTRY *thread_p, const OID *oid, LOCK lock, LOCK *ex_lock)
#define LOG_CHECK_LOG_APPLIER(thread_p)
void scan_init_index_scan(INDX_SCAN_ID *isidp, struct btree_iscan_oid_list *oid_list, MVCC_SNAPSHOT *mvcc_snapshot)
int xtran_server_start_topop(THREAD_ENTRY *thread_p, LOG_LSA *topop_lsa)
int btree_insert(THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *cls_oid, OID *oid, int op_type, btree_unique_stats *unique_stat_info, int *unique, MVCC_REC_HEADER *p_mvcc_rec_header)
static DB_LOGICAL locator_mvcc_reev_cond_and_assignment(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, MVCC_REEV_DATA *mvcc_reev_data_p, MVCC_REC_HEADER *mvcc_header_p, const OID *curr_row_version_oid_p, RECDES *recdes)
#define LC_FIND_ONEOBJ_PTR_IN_COPYAREA(manyobjs_ptr, obj_num)
int catcls_remove_entry(THREAD_ENTRY *thread_p, OID *class_oid)
int or_mvcc_get_header(RECDES *record, MVCC_REC_HEADER *mvcc_header)
#define ER_LC_INCONSISTENT_CLASSNAME_TYPE2
int lock_object(THREAD_ENTRY *thread_p, const OID *oid, const OID *class_oid, LOCK lock, int cond_flag)
SCAN_CODE locator_lock_and_get_object_with_evaluation(THREAD_ENTRY *thread_p, OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, int old_chn, MVCC_REEV_DATA *mvcc_reev_data, NON_EXISTENT_HANDLING non_ex_handling_type)
void log_sysop_start(THREAD_ENTRY *thread_p)
#define OR_MVCC_FLAG_VALID_DELID
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE2
int xlocator_fetch_all(THREAD_ENTRY *thread_p, const HFID *hfid, LOCK *lock, LC_FETCH_VERSION_TYPE fetch_version_type, OID *class_oid, int *nobjects, int *nfetched, OID *last_oid, LC_COPYAREA **fetch_area)
#define OID_SET_NULL(oidp)
void locator_free_lockhint(LC_LOCKHINT *lockhint)
DB_LOGICAL(* PR_EVAL_FNC)(THREAD_ENTRY *thread_p, const PRED_EXPR *, val_descr *, OID *)
DISK_ISVALID not_vacuumed_res
bool btree_multicol_key_is_null(DB_VALUE *key)
static DB_LOGICAL locator_mvcc_reev_cond_assigns(THREAD_ENTRY *thread_p, OID *class_oid, const OID *oid, HEAP_SCANCACHE *scan_cache, RECDES *recdes, MVCC_UPDDEL_REEV_DATA *mvcc_reev_data)
LOG_TDES * LOG_FIND_TDES(int tran_index)
#define OR_FIXED_ATTRIBUTES_OFFSET(ptr, nvars)
TP_DOMAIN * tp_domain_copy(const TP_DOMAIN *domain, bool check_cache)
enum lc_prefetch_flags LC_PREFETCH_FLAGS
int xlocator_redistribute_partition_data(THREAD_ENTRY *thread_p, OID *class_oid, int no_oids, OID *oid_list)
#define LSA_AS_ARGS(lsa_ptr)
int xrepl_set_info(THREAD_ENTRY *thread_p, REPL_INFO *repl_info)
static void locator_incr_num_transient_classnames(int tran_index)
LC_LOCKSET_REQOBJ * objects
#define MVCC_CLEAR_FLAG_BITS(rec_header_p, flag)
#define BTID_IS_EQUAL(b1, b2)
void btree_init_temp_key_value(bool *clear_flag, DB_VALUE *key_value)
SCAN_CODE heap_get_last_version(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context)
DISK_ISVALID locator_check_by_class_oid(THREAD_ENTRY *thread_p, OID *cls_oid, HFID *hfid, BTID *index_btid, bool repair)
#define LC_FETCH_IS_MVCC_VERSION_NEEDED(fetch_type)
#define MVCC_SET_DELID(header, mvcc_id)
void btree_keyoid_checkscan_end(THREAD_ENTRY *thread_p, BTREE_CHECKSCAN *btscan)
MVCC_SATISFIES_SNAPSHOT_RESULT mvcc_satisfies_dirty(THREAD_ENTRY *thread_p, MVCC_REC_HEADER *rec_header, MVCC_SNAPSHOT *snapshot)
int heap_scancache_end_when_scan_will_resume(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
static int locator_drop_class_name_entry(THREAD_ENTRY *thread_p, const char *classname, LOG_LSA *savep_lsa)
int xlocator_force(THREAD_ENTRY *thread_p, LC_COPYAREA *force_area, int num_ignore_error, int *ignore_error_list)
void xcache_remove_by_oid(THREAD_ENTRY *thread_p, const OID *oid)
#define PTR_ALIGN(addr, boundary)
void lock_unlock_object_donot_move_to_non2pl(THREAD_ENTRY *thread_p, const OID *oid, const OID *class_oid, LOCK lock)
int catalog_update(THREAD_ENTRY *thread_p, RECDES *record_p, OID *class_oid_p)
void locator_free_lockset(LC_LOCKSET *lockset)
void or_class_hfid(RECDES *record, HFID *hfid)
PRUNING_SCAN_CACHE * locator_get_partition_scancache(PRUNING_CONTEXT *pcontext, const OID *class_oid, const HFID *hfid, int op_type, bool has_function_indexes)
static int locator_repl_get_key_value(DB_VALUE *key_value, LC_COPYAREA *force_area, LC_COPYAREA_ONEOBJ *obj)
bool LSA_LT(const log_lsa *plsa1, const log_lsa *plsa2)
#define er_log_debug(...)
HL_HEAPID db_change_private_heap(THREAD_ENTRY *thread_p, HL_HEAPID heap_id)
int xlocator_remove_class_from_index(THREAD_ENTRY *thread_p, OID *class_oid, BTID *btid, HFID *hfid)
DB_VALUE_COMPARE_RESULT btree_compare_key(DB_VALUE *key1, DB_VALUE *key2, TP_DOMAIN *key_domain, int do_coercion, int total_order, int *start_colp)
bool heap_does_exist(THREAD_ENTRY *thread_p, OID *class_oid, const OID *oid)
int heap_scancache_end(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
tx_transient_class_registry m_modified_classes
static bool locator_was_index_already_applied(HEAP_CACHE_ATTRINFO *index_attrinfo, BTID *btid, int pos)
void * db_fixed_alloc(HL_HEAPID heap_id, size_t size)
#define ER_CT_INVALID_REPRID
filter_info * range_filter
void pgbuf_log_redo_new_page(THREAD_ENTRY *thread_p, PAGE_PTR page_new, int data_size, PAGE_TYPE ptype_new)
int heap_attrinfo_start_with_index(THREAD_ENTRY *thread_p, OID *class_oid, RECDES *class_recdes, HEAP_CACHE_ATTRINFO *attr_info, HEAP_IDX_ELEMENTS_INFO *idx_info)
#define COPY_OID(dest_oid_ptr, src_oid_ptr)
LOCK lock_get_object_lock(const OID *oid, const OID *class_oid)
static void locator_repl_add_error_to_copyarea(LC_COPYAREA **copy_area, RECDES *recdes, LC_COPYAREA_ONEOBJ *obj, DB_VALUE *key_value, int err_code, const char *err_msg)
int btree_range_scan_select_visible_oids(THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
LC_CLASS_OIDSET * classes
LC_LOCKHINT * locator_allocate_lockhint(int max_classes, bool quit_on_errors)
SCAN_CODE heap_get_mvcc_header(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, MVCC_REC_HEADER *mvcc_header)
int catalog_insert(THREAD_ENTRY *thread_p, RECDES *record_p, OID *class_oid_p, OID *rep_dir_p)
std::size_t get_size(void) const
#define MVCC_GET_PREV_VERSION_LSA(header)
#define MVCC_SET_INSID(header, mvcc_id)
void db_destroy_fixed_heap(HL_HEAPID heap_id)
int heap_chnguess_put(THREAD_ENTRY *thread_p, const OID *oid, int tran_index, int chn)
int pr_free_ext_value(DB_VALUE *value)
void heap_log_postpone_heap_append_pages(THREAD_ENTRY *thread_p, const HFID *hfid, const OID *class_oid, const std::vector< VPID > &heap_pages_array)
int btree_keyoid_checkscan_start(THREAD_ENTRY *thread_p, BTID *btid, BTREE_CHECKSCAN *btscan)
int xlocator_fetch(THREAD_ENTRY *thread_p, OID *oid, int chn, LOCK lock, LC_FETCH_VERSION_TYPE fetch_version_type, LC_FETCH_VERSION_TYPE initial_fetch_version_type, OID *class_oid, int class_chn, int prefetching, LC_COPYAREA **fetch_area)
SCAN_CODE locator_lock_and_get_object(THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, LOCK lock, int ispeeking, int old_chn, NON_EXISTENT_HANDLING non_ex_handling_type)
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)
void log_append_redo_data2(THREAD_ENTRY *thread_p, LOG_RCVINDEX rcvindex, const VFID *vfid, PAGE_PTR pgptr, PGLENGTH offset, int length, const void *data)
void or_class_rep_dir(RECDES *record, OID *rep_dir_p)
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)
static void locator_generate_class_pseudo_oid(THREAD_ENTRY *thread_p, OID *class_oid)
LC_FIND_CLASSNAME xlocator_reserve_class_names(THREAD_ENTRY *thread_p, const int num_classes, const char **classnames, OID *class_oids)
void mht_destroy(MHT_TABLE *ht)
void locator_dump_class_names(THREAD_ENTRY *thread_p, FILE *out_fp)
void partition_clear_pruning_context(PRUNING_CONTEXT *pinfo)
int boot_find_root_heap(HFID *root_hfid_p)
#define LC_RECDES_TO_GET_ONEOBJ(copy_area_ptr, oneobj_ptr, recdes_ptr)
QPROC_QUALIFICATION qualification
int locator_initialize(THREAD_ENTRY *thread_p)
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
int or_get_unique_hierarchy(THREAD_ENTRY *thread_p, RECDES *record, int attrid, BTID *btid, OID **class_oids, HFID **hfids, int *num_classes, int *partition_local_index)
DISK_ISVALID btree_find_key(THREAD_ENTRY *thread_p, BTID *btid, OID *oid, DB_VALUE *key, bool *clear_key)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
QPROC_QUALIFICATION * qualification
static int locator_check_foreign_key(THREAD_ENTRY *thread_p, HFID *hfid, OID *class_oid, OID *inst_oid, RECDES *recdes, RECDES *new_recdes, bool *is_cached, LC_COPYAREA **copyarea)
#define csect_check_own(a, b)
int logtb_get_global_unique_stats(THREAD_ENTRY *thread_p, BTID *btid, int *num_oids, int *num_nulls, int *num_keys)
#define OR_MVCC_FLAG_VALID_PREV_VERSION
LOCK locator_get_lock_mode_from_op_type(SCAN_OPERATION_TYPE op_type)
#define HEAP_HEADER_AND_CHAIN_SLOTID
int heap_attrinfo_read_dbvalues_without_oid(THREAD_ENTRY *thread_p, RECDES *recdes, HEAP_CACHE_ATTRINFO *attr_info)
int btree_update(THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *old_key, DB_VALUE *new_key, OID *cls_oid, OID *oid, int op_type, btree_unique_stats *unique_stat_info, int *unique, MVCC_REC_HEADER *p_mvcc_rec_header)
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE8
#define ER_LC_PARTIALLY_FAILED_TO_FLUSH
static int lockhint_subclasses(SM_TEMPLATE *temp, SM_CLASS *class_)
#define ER_LC_UNKNOWN_CLASSNAME
int or_packed_string_length(const char *string, int *strlen)
BTREE_ISCAN_OID_LIST oid_list
LOCATOR_CLASSNAME_ACTION * prev
DISK_ISVALID disk_is_page_sector_reserved_with_debug_crash(THREAD_ENTRY *thread_p, VOLID volid, PAGEID pageid, bool debug_crash)
void heap_clean_get_context(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context)
#define OID_IS_ROOTOID(oidp)
BTID * heap_indexinfo_get_btid(int btid_index, HEAP_CACHE_ATTRINFO *attrinfo)
void release_buffer(char *&data, std::size_t &size)
int partition_prune_unique_btid(PRUNING_CONTEXT *pcontext, DB_VALUE *key, OID *class_oid, HFID *class_hfid, BTID *btid)
#define LC_REPL_RECDES_FOR_ONEOBJ(copy_area_ptr, oneobj_ptr, key_length, recdes_ptr)
#define ER_OUT_OF_VIRTUAL_MEMORY
LC_COPYAREA_MANYOBJS * mobjs
int or_chn(RECDES *record)
#define LC_FLAG_HAS_UNIQUE_INDEX
int locator_rv_redo_rename(THREAD_ENTRY *thread_p, LOG_RCV *rcv)
int heap_get_class_name_alloc_if_diff(THREAD_ENTRY *thread_p, const OID *class_oid, char *guess_classname, char **classname_out)
#define OR_VALUE_ALIGNED_SIZE(value)
TRAN_ISOLATION logtb_find_current_isolation(THREAD_ENTRY *thread_p)
#define SINGLE_ROW_UPDATE
void fpcache_remove_by_class(THREAD_ENTRY *thread_p, const OID *class_oid)
SCAN_CODE heap_attrinfo_transform_to_disk(THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, RECDES *old_recdes, record_descriptor *new_recdes)
#define pgbuf_replace_watcher(thread_p, old_watcher, new_watcher)
int fetch_peek_dbval(THREAD_ENTRY *thread_p, REGU_VARIABLE *regu_var, val_descr *vd, OID *class_oid, OID *obj_oid, QFILE_TUPLE tpl, DB_VALUE **peek_dbval)
int heap_update_logical(THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
#define DB_VALUE_DOMAIN_TYPE(value)
HEAP_SCANCACHE * ptr_scancache
int or_mvcc_set_header(RECDES *record, MVCC_REC_HEADER *mvcc_rec_header)
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)
#define LC_ONEOBJ_GET_INDEX_FLAG(obj)
LC_COPYAREA * locator_allocate_copy_area_by_length(int min_length)
#define ER_LC_INCONSISTENT_CLASSNAME_TYPE1
void heap_create_insert_context(HEAP_OPERATION_CONTEXT *context, HFID *hfid_p, OID *class_oid_p, RECDES *recdes_p, HEAP_SCANCACHE *scancache_p)
static int locator_get_num_transient_classnames(int tran_index)
multi_index_unique_stats m_multiupd_stats
void lock_unlock_object(THREAD_ENTRY *thread_p, const OID *oid, const OID *class_oid, LOCK lock, bool force)
static SCAN_CODE locator_return_object_assign(THREAD_ENTRY *thread_p, LOCATOR_RETURN_NXOBJ *assign, OID *class_oid, OID *oid, int chn, int guess_chn, SCAN_CODE scan, int tran_index)
int xlocator_repl_force(THREAD_ENTRY *thread_p, LC_COPYAREA *force_area, LC_COPYAREA **reply_area)
int n_oids_read_last_iteration
OR_PREDICATE * filter_predicate
#define HFID_SET_NULL(hfid)
TRAN_STATE xtran_server_end_topop(THREAD_ENTRY *thread_p, LOG_RESULT_TOPOP result, LOG_LSA *topop_lsa)
LC_FIND_CLASSNAME xlocator_rename_class_name(THREAD_ENTRY *thread_p, const char *oldname, const char *newname, OID *class_oid)
#define OID_EQ(oidp1, oidp2)
int or_replace_chn(RECDES *record, int chn)
#define heap_classrepr_free_and_init(class_repr, idxp)
int heap_attrinfo_read_dbvalues(THREAD_ENTRY *thread_p, const OID *inst_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, HEAP_CACHE_ATTRINFO *attr_info)
int locator_attribute_info_force(THREAD_ENTRY *thread_p, const HFID *hfid, OID *oid, HEAP_CACHE_ATTRINFO *attr_info, ATTR_ID *att_id, int n_att_id, LC_COPYAREA_OPERATION operation, int op_type, HEAP_SCANCACHE *scan_cache, int *force_count, bool not_check_fk, REPL_INFO_TYPE repl_info, int pruning_type, PRUNING_CONTEXT *pcontext, FUNC_PRED_UNPACK_INFO *func_preds, MVCC_REEV_DATA *mvcc_reev_data, UPDATE_INPLACE_STYLE force_update_inplace, RECDES *rec_descriptor, bool need_locking)
int heap_alloc_new_page(THREAD_ENTRY *thread_p, HFID *hfid, OID class_oid, PGBUF_WATCHER *home_hint_p, VPID *new_page_vpid)
#define TP_DOMAIN_TYPE(dom)
int heap_insert_logical(THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context, PGBUF_WATCHER *home_hint_p)
filter_info * data_filter
unsigned has_partition_info
update_mvcc_reev_assignment * next
int btree_online_index_dispatcher(THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *cls_oid, OID *oid, int unique, BTREE_OP_PURPOSE purpose, LOG_LSA *undo_nxlsa)
void * mht_get(MHT_TABLE *ht, const void *key)
void locator_finalize(THREAD_ENTRY *thread_p)
const char * er_msg(void)
int heap_attrinfo_clear_dbvalues(HEAP_CACHE_ATTRINFO *attr_info)
upddel_mvcc_cond_reeval * mvcc_cond_reev_list
#define MVCC_IS_FLAG_SET(rec_header_p, flags)
int heap_indexinfo_get_attrs_prefix_length(int btid_index, HEAP_CACHE_ATTRINFO *attrinfo, int *attrs_prefix_length, int len_attrs_prefix_length)
HEAP_SCANCACHE scan_cache
int scan_init_iss(INDX_SCAN_ID *isidp)
#define ER_OBJ_OBJECT_NOT_FOUND
PGLENGTH db_network_page_size(void)
int lock_subclass(THREAD_ENTRY *thread_p, const OID *subclass_oid, const OID *superclass_oid, LOCK lock, int cond_flag)
DB_VALUE * heap_attrinfo_generate_key(THREAD_ENTRY *thread_p, int n_atts, int *att_ids, int *atts_prefix_length, HEAP_CACHE_ATTRINFO *attr_info, RECDES *recdes, DB_VALUE *db_valuep, char *buf, FUNCTION_INDEX_INFO *func_index_info, TP_DOMAIN *midxkey_domain)
int xlocator_get_reserved_class_name_oid(THREAD_ENTRY *thread_p, const char *classname, OID *class_oid)
#define LC_NEXT_ONEOBJ_PTR_IN_COPYAREA(oneobj_ptr)
bool LSA_ISNULL(const log_lsa *lsa_ptr)
#define SINGLE_ROW_DELETE
#define MVCC_IS_REC_INSERTED_BY_ME(thread_p, rec_header_p)
int heap_vpid_next(THREAD_ENTRY *thread_p, const HFID *hfid, PAGE_PTR pgptr, VPID *next_vpid)
static const int LOCATOR_GUESS_NUM_NESTED_REFERENCES
btree_unique_stats & get_stats_of(const BTID &index)
void locator_end_force_scan_cache(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache)
int xchksum_insert_repl_log_and_demote_table_lock(THREAD_ENTRY *thread_p, REPL_INFO *repl_info, const OID *class_oidp)
DB_VALUE * pr_make_ext_value(void)
TP_DOMAIN * tp_domain_cache(TP_DOMAIN *transient)
struct lc_class_oidset * next
int heap_estimate_num_objects(THREAD_ENTRY *thread_p, const HFID *hfid)
#define db_private_free_and_init(thrd, ptr)
int xlocator_fetch_all_reference_lockset(THREAD_ENTRY *thread_p, OID *oid, int chn, OID *class_oid, int class_chn, LOCK lock, int quit_on_errors, int prune_level, LC_LOCKSET **lockset, LC_COPYAREA **fetch_area)
int xlocator_demote_class_lock(THREAD_ENTRY *thread_p, const OID *class_oid, LOCK lock, LOCK *ex_lock)
#define ISCAN_OID_BUFFER_CAPACITY
mvcc_scan_reev_data * select_reev_data
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))
void partition_init_pruning_context(PRUNING_CONTEXT *pinfo)
int curr_extra_assign_cnt
int logtb_tran_update_unique_stats(THREAD_ENTRY *thread_p, const BTID *btid, int n_keys, int n_oids, int n_nulls, bool write_to_log)
#define db_private_free(thrd, ptr)
int btree_prepare_bts(THREAD_ENTRY *thread_p, BTREE_SCAN *bts, BTID *btid, INDX_SCAN_ID *index_scan_id_p, key_val_range *kv_range, FILTER_INFO *filter, const OID *match_class_oid, DB_BIGINT *key_limit_upper, DB_BIGINT *key_limit_lower, bool need_to_check_null, void *bts_other)
static DB_LOGICAL locator_mvcc_reevaluate_filters(THREAD_ENTRY *thread_p, MVCC_SCAN_REEV_DATA *mvcc_reev_data, const OID *oid, RECDES *recdes)
int btree_physical_delete(THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *oid, OID *class_oid, int *unique, int op_type, btree_unique_stats *unique_stat_info)
unsigned int oid_hash(const void *key_oid, unsigned int htsize)
#define MVCC_REC_HEADER_INITIALIZER
#define db_private_alloc(thrd, size)
PGBUF_WATCHER page_watcher
regu_variable_list_node * rest_regu_list
LOCATOR_INDEX_ACTION_FLAG
OR_PARTITION * partitions
static int locator_check_primary_key_update(THREAD_ENTRY *thread_p, OR_INDEX *index, DB_VALUE *key)
need_clear_type need_clear
#define CEIL_PTVDIV(dividend, divisor)
void btree_scan_clear_key(BTREE_SCAN *btree_scan)
static int locator_guess_sub_classes(THREAD_ENTRY *thread_p, LC_LOCKHINT **lockhint_subclasses)
OR_CLASSREP * heap_classrepr_get(THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *class_recdes, REPR_ID reprid, int *idx_incache)
static MHT_TABLE * locator_Mht_classnames
LC_COPYAREA_ONEOBJ ** obj
#define ER_LOG_UNKNOWN_TRANINDEX
int pr_clear_value(DB_VALUE *value)
void qmgr_add_modified_class(THREAD_ENTRY *thread_p, const OID *class_oid_p)
bool locator_Dont_check_foreign_key
int heap_scan_cache_allocate_area(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache_p, int size)
bool is_scan_cache_started
static const INT32 locator_Pseudo_pageid_first
int logtb_tran_prepare_count_optim_classes(THREAD_ENTRY *thread_p, const char **classes, LC_PREFETCH_FLAGS *flags, int n_classes)
static SCAN_CODE locator_lock_and_get_object_internal(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, LOCK lock_mode)
bool has_errors_filtered_for_insert(std::vector< int > error_filter_array)
char * or_unpack_mem_value(char *buf, DB_VALUE *value)
char * or_pack_mem_value(char *ptr, DB_VALUE *value, int *packed_len_except_alignment)
void log_sysop_abort(THREAD_ENTRY *thread_p)
upddel_mvcc_cond_reeval * next
static LC_LOCKSET * locator_all_reference_lockset(THREAD_ENTRY *thread_p, OID *oid, int prune_level, LOCK inst_lock, LOCK class_lock, bool quit_on_errors)
#define MVCC_SET_FLAG_BITS(rec_header_p, flag)
int heap_vacuum_all_objects(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *upd_scancache, MVCCID threshold_mvccid)
DB_LOGICAL update_logical_result(THREAD_ENTRY *thread_p, DB_LOGICAL ev_res, int *qualification)
#define LC_RECDES_IN_COPYAREA(copy_area_ptr, recdes_ptr)
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)
static const HFID NULL_HFID
MVCCID logtb_get_current_mvccid(THREAD_ENTRY *thread_p)
#define ER_BTREE_UNIQUE_FAILED
int fetch_val_list(THREAD_ENTRY *thread_p, regu_variable_list_node *regu_list, val_descr *vd, OID *class_oid, OID *obj_oid, QFILE_TUPLE tpl, int peek)
static void error(const char *msg)
LC_COPYAREA * locator_allocate_copy_area_by_attr_info(THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, RECDES *old_recdes, RECDES *new_recdes, const int copyarea_length_hint, int lob_create_flag)
#define VPID_ISNULL(vpid_ptr)
const recdes & get_recdes(void) const
int xlocator_check_fk_validity(THREAD_ENTRY *thread_p, OID *cls_oid, HFID *hfid, TP_DOMAIN *key_type, int n_attrs, int *attr_ids, OID *pk_cls_oid, BTID *pk_btid, char *fk_name)
int heap_chnguess_get(THREAD_ENTRY *thread_p, const OID *oid, int tran_index)
DISK_ISVALID locator_check_class_names(THREAD_ENTRY *thread_p)
int heap_prefetch(THREAD_ENTRY *thread_p, OID *class_oid, const OID *oid, LC_COPYAREA_DESC *prefetch)
char * or_pack_int(char *ptr, int number)
STATIC_INLINE void perfmon_inc_stat(THREAD_ENTRY *thread_p, PERF_STAT_ID psid) __attribute__((ALWAYS_INLINE))
MVCCID get_global_oldest_visible() const
PRUNING_SCAN_CACHE * partition_new_scancache(PRUNING_CONTEXT *pcontext)
TP_DOMAIN * tp_domain_construct(DB_TYPE domain_type, DB_OBJECT *class_obj, int precision, int scale, TP_DOMAIN *setdomain)
LOG_TDES * LOG_FIND_CURRENT_TDES(THREAD_ENTRY *thread_p=NULL)
int mht_dump(THREAD_ENTRY *thread_p, FILE *out_fp, const MHT_TABLE *ht, const int print_id_opt, int(*print_func)(THREAD_ENTRY *thread_p, FILE *fp, const void *key, void *data, void *args), void *func_args)
SCAN_CODE heap_get_class_oid(THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid)
DISK_ISVALID locator_check_class(THREAD_ENTRY *thread_p, OID *class_oid, RECDES *peek, HFID *class_hfid, BTID *index_btid, bool repair)
#define LOG_FIND_THREAD_TRAN_INDEX(thrd)
LC_FIND_CLASSNAME xlocator_find_lockhint_class_oids(THREAD_ENTRY *thread_p, int num_classes, const char **many_classnames, LOCK *many_locks, int *many_need_subclasses, LC_PREFETCH_FLAGS *many_flags, OID *guessed_class_oids, int *guessed_class_chns, bool quit_on_errors, LC_LOCKHINT **hlock, LC_COPYAREA **fetch_area)
#define HFID_IS_NULL(hfid)
SCAN_CODE locator_get_object(THREAD_ENTRY *thread_p, const OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, SCAN_OPERATION_TYPE op_type, LOCK lock_mode, int ispeeking, int chn)
bool db_value_is_null(const DB_VALUE *value)
char * or_class_name(RECDES *record)
bool locator_manyobj_flag_is_set(LC_COPYAREA_MANYOBJS *copyarea, enum MULTI_UPDATE_FLAG muf)
static int locator_defence_drop_class_name_entry(const void *name, void *ent, void *args)
static DISK_ISVALID locator_check_unique_btree_entries(THREAD_ENTRY *thread_p, BTID *btid, OID *cls_oid, RECDES *classrec, ATTR_ID *attr_ids, const char *btname, bool repair)
int xlocator_get_class(THREAD_ENTRY *thread_p, OID *class_oid, int class_chn, const OID *oid, LOCK lock, int prefetching, LC_COPYAREA **fetch_area)
void lock_unlock_classes_lock_hint(THREAD_ENTRY *thread_p, LC_LOCKHINT *lockhint)
int pr_clone_value(const DB_VALUE *src, DB_VALUE *dest)
int log_add_to_modified_class_list(THREAD_ENTRY *thread_p, const char *classname, const OID *class_oid)
PR_EVAL_FNC eval_fnc(THREAD_ENTRY *thread_p, const PRED_EXPR *pr, DB_TYPE *single_node_type)
void heap_init_get_context(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, const OID *oid, OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int ispeeking, int old_chn)
#define ER_LC_BADFORCE_OPERATION
float prm_get_float_value(PARAM_ID prm_id)
int heap_delete_logical(THREAD_ENTRY *thread_p, HEAP_OPERATION_CONTEXT *context)
int xlocator_assign_oid(THREAD_ENTRY *thread_p, const HFID *hfid, OID *perm_oid, int expected_length, OID *class_oid, const char *classname)
int catcls_delete_catalog_classes(THREAD_ENTRY *thread_p, const char *name, OID *class_oid)
#define LOCATOR_GUESS_HT_SIZE
LC_FIND_CLASSNAME xlocator_find_class_oid(THREAD_ENTRY *thread_p, const char *classname, OID *class_oid, LOCK lock)
MVCC_SNAPSHOT * mvcc_snapshot
void lock_demote_read_class_lock_for_checksumdb(THREAD_ENTRY *thread_p, int tran_index, const OID *class_oid)
int lock_object_wait_msecs(THREAD_ENTRY *thread_p, const OID *oid, const OID *class_oid, LOCK lock, int cond_flag, int wait_msecs)
#define csect_enter_as_reader(a, b, c)
int btree_find_foreign_key(THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *class_oid, OID *found_oid)
int btree_range_scan(THREAD_ENTRY *thread_p, BTREE_SCAN *bts, BTREE_RANGE_SCAN_PROCESS_KEY_FUNC *key_func)
#define free_and_init(ptr)
int heap_scancache_quick_start_with_class_hfid(THREAD_ENTRY *thread_p, HEAP_SCANCACHE *scan_cache, const HFID *hfid)
bool heap_attrinfo_check_unique_index(THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, ATTR_ID *att_id, int n_att_id)
#define DB_ALIGN(offset, align)
#define BTID_COPY(btid_ptr1, btid_ptr2)
static int locator_repl_prepare_force(THREAD_ENTRY *thread_p, LC_COPYAREA_ONEOBJ *obj, RECDES *old_recdes, RECDES *recdes, DB_VALUE *key_value, HEAP_SCANCACHE *force_scancache)
void LSA_SET_NULL(log_lsa *lsa_ptr)
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)
int locator_multi_insert_force(THREAD_ENTRY *thread_p, HFID *hfid, OID *class_oid, const std::vector< record_descriptor > &recdes, int has_index, int op_type, HEAP_SCANCACHE *scan_cache, int *force_count, int pruning_type, PRUNING_CONTEXT *pcontext, FUNC_PRED_UNPACK_INFO *func_preds, UPDATE_INPLACE_STYLE force_in_place, bool dont_check_fk)
bool pgbuf_is_page_fixed_by_thread(THREAD_ENTRY *thread_p, const VPID *vpid_p)
int lock_classes_lock_hint(THREAD_ENTRY *thread_p, LC_LOCKHINT *lockhint)
int heap_attrinfo_start_with_btid(THREAD_ENTRY *thread_p, OID *class_oid, BTID *btid, HEAP_CACHE_ATTRINFO *attr_info)
HEAP_SCANCACHE area_scancache
#define QFILE_IS_LIST_CACHE_DISABLED
static int locator_add_or_remove_index_internal(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 replyn, HFID *hfid, FUNC_PRED_UNPACK_INFO *func_preds, LOCATOR_INDEX_ACTION_FLAG idx_action_flag, bool has_BU_lock, bool skip_checking_fk)
#define ER_HEAP_UNKNOWN_OBJECT
#define MVCC_GET_DELID(header)
static int locator_area_op_to_pruning_type(LC_COPYAREA_OPERATION op)
#define BTREE_END_OF_SCAN(bts)
int catcls_insert_catalog_classes(THREAD_ENTRY *thread_p, RECDES *record)
#define HFID_EQ(hfid_ptr1, hfid_ptr2)
#define LC_IS_FLUSH_UPDATE(operation)
int orc_subclasses_from_record(RECDES *record, int *array_size, OID **array_ptr)
#define LC_MANYOBJS_PTR_IN_COPYAREA(copy_areaptr)
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE1
SCAN_CODE heap_attrinfo_transform_to_disk_except_lob(THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, RECDES *old_recdes, record_descriptor *new_recdes)
int locator_delete_lob_force(THREAD_ENTRY *thread_p, OID *class_oid, OID *oid, RECDES *recdes)
static SCAN_CODE locator_lock_and_return_object(THREAD_ENTRY *thread_p, LOCATOR_RETURN_NXOBJ *assign, OID *class_oid, OID *oid, int chn, LOCK lock_mode, SCAN_OPERATION_TYPE op_type)
void log_sysop_attach_to_outer(THREAD_ENTRY *thread_p)
#define SINGLE_ROW_INSERT
int btree_get_pkey_btid(THREAD_ENTRY *thread_p, OID *cls_oid, BTID *pkey_btid)
void log_sysop_commit(THREAD_ENTRY *thread_p)
static bool locator_is_exist_class_name_entry(THREAD_ENTRY *thread_p, LOCATOR_CLASSNAME_ENTRY *entry)
static int redistribute_partition_data(THREAD_ENTRY *thread_p, OID *class_oid, int no_oids, OID *oid_list)
SCAN_CODE spage_next_record(PAGE_PTR page_p, PGSLOTID *out_slot_id_p, RECDES *record_descriptor_p, int is_peeking)
upddel_mvcc_cond_reeval ** curr_extra_assign_reev
int btree_multicol_key_has_null(DB_VALUE *key)
SCAN_OPERATION_TYPE locator_decide_operation_type(LOCK lock_mode, LC_FETCH_VERSION_TYPE fetch_version_type)
const container_type & get_map() const
#define PGBUF_ORDERED_NULL_HFID
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)
char * pr_valstring(const DB_VALUE *val)
#define ER_LC_INCONSISTENT_CLASSNAME_TYPE4
LC_LOCKSET * locator_reallocate_lockset(LC_LOCKSET *lockset, int max_reqobjs)
HL_HEAPID db_create_fixed_heap(int req_size, int recs_per_chunk)
#define DB_IS_NULL(value)
int heap_assign_address(THREAD_ENTRY *thread_p, const HFID *hfid, OID *class_oid, OID *oid, int expected_length)
int locator_insert_force(THREAD_ENTRY *thread_p, HFID *hfid, OID *class_oid, OID *oid, RECDES *recdes, int has_index, int op_type, HEAP_SCANCACHE *scan_cache, int *force_count, int pruning_type, PRUNING_CONTEXT *pcontext, FUNC_PRED_UNPACK_INFO *func_preds, UPDATE_INPLACE_STYLE force_in_place, PGBUF_WATCHER *home_hint_p, bool has_BU_lock, bool dont_check_fk, bool use_bulk_logging)
int partition_prune_insert(THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, PRUNING_CONTEXT *pcontext, int pruning_type, OID *pruned_class_oid, HFID *pruned_hfid, OID *superclass_oid)
DB_LOGICAL eval_data_filter(THREAD_ENTRY *thread_p, OID *oid, RECDES *recdesp, HEAP_SCANCACHE *scan_cache, FILTER_INFO *filterp)
mvcc_update_reev_data * upddel_reev_data
static int locator_check_primary_key_delete(THREAD_ENTRY *thread_p, OR_INDEX *index, DB_VALUE *key)
static int locator_permoid_class_name(THREAD_ENTRY *thread_p, const char *classname, const OID *class_oid)
int qexec_clear_pred_context(THREAD_ENTRY *thread_p, pred_expr_with_context *pred_filter, bool dealloc_dbvalues)
int num_transient_classnames
int locator_savepoint_transient_class_name_entries(THREAD_ENTRY *thread_p, LOG_LSA *savep_lsa)
int spage_slot_size(void)
static int locator_force_for_multi_update(THREAD_ENTRY *thread_p, LC_COPYAREA *force_area)
void map(const map_func_type &func) const
char * strdup(const char *str)
heap_cache_attrinfo * attr_cache
MVCC_SNAPSHOT_FUNC snapshot_fnc
int lock_has_lock_on_object(const OID *oid, const OID *class_oid, LOCK lock)
int num_classes_of_reqobjs_processed
bool heap_is_big_length(int length)
static INT32 locator_Pseudo_pageid_crt
int btree_keyval_search(THREAD_ENTRY *thread_p, BTID *btid, SCAN_OPERATION_TYPE scan_op_type, BTREE_SCAN *bts, key_val_range *kv_range, OID *class_oid, FILTER_INFO *filter, INDX_SCAN_ID *isidp, bool is_all_class_srch)
static int locator_force_drop_class_name_entry(const void *name, void *ent, void *args)
static int locator_print_class_name(THREAD_ENTRY *thread_p, FILE *outfp, const void *key, void *ent, void *args)
int heap_indexinfo_get_attrids(int btid_index, HEAP_CACHE_ATTRINFO *attrinfo, ATTR_ID *attrids)
#define catalog_free_class_info_and_init(class_info_p)
static DB_LOGICAL locator_mvcc_reeval_scan_filters(THREAD_ENTRY *thread_p, const OID *oid, HEAP_SCANCACHE *scan_cache, RECDES *recdes, UPDDEL_MVCC_COND_REEVAL *mvcc_cond_reeval, bool is_upddel)
void heap_attrinfo_end(THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info)
OR_INDEX_STATUS index_status
#define TP_ARE_COMPARABLE_KEY_TYPES(key1_type, key2_type)
int heap_init_func_pred_unpack_info(THREAD_ENTRY *thread_p, HEAP_CACHE_ATTRINFO *attr_info, const OID *class_oid, FUNC_PRED_UNPACK_INFO **func_indx_preds)
HEAP_SCANCACHE * scan_cache
static void locator_decr_num_transient_classnames(int tran_index)
int heap_scancache_quick_start(HEAP_SCANCACHE *scan_cache)
static int locator_move_record(THREAD_ENTRY *thread_p, HFID *old_hfid, OID *old_class_oid, OID *obj_oid, OID *new_class_oid, HFID *new_class_hfid, RECDES *recdes, HEAP_SCANCACHE *scan_cache, int op_type, int has_index, int *force_count, PRUNING_CONTEXT *context, MVCC_REEV_DATA *mvcc_reev_data, bool need_locking)
LC_COPYAREA_MANYOBJS * mobjs
enum mvcc_satisfies_snapshot_result MVCC_SATISFIES_SNAPSHOT_RESULT
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)
int heap_indexinfo_get_num_attrs(int btid_index, HEAP_CACHE_ATTRINFO *attrinfo)
bool log_does_allow_replication(void)
LOG_LSA * xrepl_log_get_append_lsa(void)
int num_classes_of_reqobjs
int heap_get_indexinfo_of_btid(THREAD_ENTRY *thread_p, const OID *class_oid, const BTID *btid, BTREE_TYPE *type, int *num_attrs, ATTR_ID **attr_ids, int **attrs_prefix_length, char **btnamepp, int *func_index_col_id)
int xlocator_upgrade_instances_domain(THREAD_ENTRY *thread_p, OID *class_oid, int att_id)
enum update_inplace_style UPDATE_INPLACE_STYLE
int heap_attrinfo_set(const OID *inst_oid, ATTR_ID attrid, DB_VALUE *attr_val, HEAP_CACHE_ATTRINFO *attr_info)
int heap_get_class_info(THREAD_ENTRY *thread_p, const OID *class_oid, HFID *hfid_out, FILE_TYPE *ftype_out, char **classname_out)
void lock_unlock_objects_lock_set(THREAD_ENTRY *thread_p, LC_LOCKSET *lockset)
#define LC_IS_FLUSH_INSERT(operation)
int num_reqobjs_processed
static const INT32 locator_Pseudo_pageid_last
#define pgbuf_ordered_unfix(thread_p, watcher_object)
#define SINGLE_ROW_MODIFY
LC_LOCKSET * locator_allocate_lockset(int max_reqobjs, LOCK reqobj_inst_lock, LOCK reqobj_class_lock, int quit_on_errors)
static int locator_delete_force_internal(THREAD_ENTRY *thread_p, HFID *hfid, OID *oid, int has_index, int op_type, HEAP_SCANCACHE *scan_cache, int *force_count, MVCC_REEV_DATA *mvcc_reev_data, LOCATOR_INDEX_ACTION_FLAG idx_action_flag, OID *new_obj_oid, OID *partition_oid, bool need_locking)
PGBUF_LATCH_MODE latch_mode
static int locator_savepoint_class_name_entry(const char *classname, LOG_LSA *savep_lsa)
BTREE_ISCAN_OID_LIST * oid_list
static int locator_check_class_on_heap(const void *name, void *ent, void *args)
int heap_nonheader_page_capacity()
void btree_set_mvcc_header_ids_for_update(THREAD_ENTRY *thread_p, bool do_delete_only, bool do_insert_only, MVCCID *mvcc_id, MVCC_REC_HEADER *mvcc_rec_header)
int heap_get_class_name(THREAD_ENTRY *thread_p, const OID *class_oid, char **class_name)
PRUNING_SCAN_CACHE * partition_get_scancache(PRUNING_CONTEXT *pcontext, const OID *partition_oid)
#define ER_TDE_CIPHER_IS_NOT_LOADED
DISK_ISVALID locator_check_all_entries_of_all_btrees(THREAD_ENTRY *thread_p, bool repair)
#define pgbuf_ordered_unfix_and_init(thread_p, page, pg_watcher)
int mht_compare_strings_are_equal(const void *key1, const void *key2)
#define VPID_SET_NULL(vpid_ptr)
#define ER_INDEX_FOUND_NOT_VACUUMED
heap_cache_attrinfo * curr_attrinfo
upddel_mvcc_cond_reeval * curr_upddel
SCAN_CODE heap_get_visible_version_internal(THREAD_ENTRY *thread_p, HEAP_GET_CONTEXT *context, bool is_heap_scan)
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE6
int heap_get_referenced_by(THREAD_ENTRY *thread_p, OID *class_oid, const OID *obj_oid, RECDES *recdes, int *max_oid_cnt, OID **oid_list)
static DISK_ISVALID locator_repair_btree_by_insert(THREAD_ENTRY *thread_p, OID *class_oid, BTID *btid, DB_VALUE *key, OID *inst_oid)
#define PGBUF_INIT_WATCHER(w, rank, hfid)
#define HFID_COPY(hfid_ptr1, hfid_ptr2)
int btree_check_foreign_key(THREAD_ENTRY *thread_p, OID *cls_oid, HFID *hfid, OID *oid, DB_VALUE *keyval, int n_attrs, OID *pk_cls_oid, BTID *pk_btid, const char *fk_name)
LC_COPYAREA_OPERATION operation
void tp_domain_free(TP_DOMAIN *dom)
UPDATE_INPLACE_STYLE update_in_place
int catcls_update_catalog_classes(THREAD_ENTRY *thread_p, const char *name, RECDES *record, OID *class_oid_p, UPDATE_INPLACE_STYLE force_in_place)
regu_variable_node * regu_right
LC_LOCKHINT_CLASS * classes
int btree_mvcc_delete(THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *class_oid, OID *oid, int op_type, btree_unique_stats *unique_stat_info, int *unique, MVCC_REC_HEADER *p_mvcc_rec_header)
int fpcache_retire(THREAD_ENTRY *thread_p, OID *class_oid, BTID *btid, pred_expr_with_context *filter_pred)
#define HEAP_IS_UPDATE_INPLACE(update_inplace_style)
HEAP_SCANCACHE scan_cache
HEAP_CACHE_ATTRINFO * cache_pred
#define ER_LC_INCONSISTENT_CLASSNAME_TYPE3
#define ER_FK_CANT_DELETE_INSTANCE
func_pred_unpack_info * func_index_pred
#define HEAP_ISVALID_OID(thread_p, oid)
#define BTREE_SET_UNIQUE_VIOLATION_ERROR(THREAD, KEY, OID, C_OID, BTID, BTNM)
#define BTREE_INIT_SCAN(bts)
#define ER_MVCC_NOT_SATISFIED_REEVALUATION
int partition_prune_update(THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *recdes, PRUNING_CONTEXT *pcontext, int pruning_type, OID *pruned_class_oid, HFID *pruned_hfid, OID *superclass_oid)
static int locator_update_force(THREAD_ENTRY *thread_p, HFID *hfid, OID *class_oid, OID *oid, RECDES *ikdrecdes, RECDES *recdes, int has_index, ATTR_ID *att_id, int n_att_id, int op_type, HEAP_SCANCACHE *scan_cache, int *force_count, bool not_check_fk, REPL_INFO_TYPE repl_info_type, int pruning_type, PRUNING_CONTEXT *pcontext, MVCC_REEV_DATA *mvcc_reev_data, UPDATE_INPLACE_STYLE force_in_place, bool need_locking)
int fpcache_claim(THREAD_ENTRY *thread_p, BTID *btid, or_predicate *or_pred, pred_expr_with_context **filter_pred)
#define ISCAN_OID_BUFFER_SIZE
static LC_FIND_CLASSNAME xlocator_reserve_class_name(THREAD_ENTRY *thread_p, const char *classname, OID *class_oid)
#define ER_LC_INCONSISTENT_BTREE_ENTRY_TYPE4
SCAN_CODE heap_get_class_record(THREAD_ENTRY *thread_p, const OID *class_oid, RECDES *recdes_p, HEAP_SCANCACHE *scan_cache, int ispeeking)
static int locator_prefetch_index_page_internal(THREAD_ENTRY *thread_p, BTID *btid, OID *class_oid, RECDES *classrec, RECDES *recdes)