Skip to content

Commit

Permalink
[CBRD-24615] Result value error when using query cache in partition t…
Browse files Browse the repository at this point in the history
…able (#4030)

http://jira.cubrid.org/browse/CBRD-24615

This is a backport for 11.0 patch 10 (#4028)
  • Loading branch information
beyondykk9 authored Jan 10, 2023
1 parent 80adbb2 commit 0f060a7
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/transaction/locator_sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5159,6 +5159,10 @@ locator_insert_force (THREAD_ENTRY * thread_p, HFID * hfid, OID * class_oid, OID
"locator_insert_force: qexec_clear_list_cache_by_class failed for class { %d %d %d }\n",
real_class_oid.pageid, real_class_oid.slotid, real_class_oid.volid);
}
if (!OID_EQ (&real_class_oid, class_oid))
{
qmgr_add_modified_class (thread_p, class_oid);
}
qmgr_add_modified_class (thread_p, &real_class_oid);
}
#if 0 /* TODO - dead code; do not delete me */
Expand Down Expand Up @@ -5329,8 +5333,12 @@ locator_update_force (THREAD_ENTRY * thread_p, HFID * hfid, OID * class_oid, OID
REPL_INFO repl_info;
TDE_ALGORITHM tde_algo = TDE_ALGORITHM_NONE;

OID superclass_oid;

assert (class_oid != NULL && !OID_ISNULL (class_oid));

OID_SET_NULL (&superclass_oid);

/*
* While scanning objects, the given scancache does not fix the last
* accessed page. So, the object must be copied to the record descriptor.
Expand Down Expand Up @@ -5785,7 +5793,6 @@ locator_update_force (THREAD_ENTRY * thread_p, HFID * hfid, OID * class_oid, OID

if (pruning_type != DB_NOT_PARTITIONED_CLASS)
{
OID superclass_oid;
OID real_class_oid;
HFID real_hfid;
int granted;
Expand Down Expand Up @@ -5952,6 +5959,10 @@ locator_update_force (THREAD_ENTRY * thread_p, HFID * hfid, OID * class_oid, OID
"locator_update_force: qexec_clear_list_cache_by_class failed for class { %d %d %d }\n",
class_oid->pageid, class_oid->slotid, class_oid->volid);
}
if (!OID_EQ (&superclass_oid, class_oid))
{
qmgr_add_modified_class (thread_p, &superclass_oid);
}
qmgr_add_modified_class (thread_p, class_oid);
}
}
Expand Down Expand Up @@ -6246,12 +6257,35 @@ locator_delete_force_internal (THREAD_ENTRY * thread_p, HFID * hfid, OID * oid,
/* remove query result cache entries which are relevant with this class */
if (!QFILE_IS_LIST_CACHE_DISABLED)
{
OID superclass_oid;
OID real_class_oid;
HFID real_hfid;

if (qexec_clear_list_cache_by_class (thread_p, &class_oid) != NO_ERROR)
{
er_log_debug (ARG_FILE_LINE,
"locator_delete_force: qexec_clear_list_cache_by_class failed for class { %d %d %d }\n",
class_oid.pageid, class_oid.slotid, class_oid.volid);
}

OID_SET_NULL (&superclass_oid);

HFID_COPY (&real_hfid, hfid);
COPY_OID (&real_class_oid, &class_oid);

error_code =
partition_prune_update (thread_p, &class_oid, &copy_recdes, NULL, DB_PARTITIONED_CLASS, &real_class_oid,
&real_hfid, &superclass_oid);

if (error_code != NO_ERROR)
{
goto error;
}

if (!OID_EQ (&superclass_oid, &class_oid))
{
qmgr_add_modified_class (thread_p, &superclass_oid);
}
qmgr_add_modified_class (thread_p, &class_oid);
}
}
Expand Down

0 comments on commit 0f060a7

Please sign in to comment.