Skip to content

Commit

Permalink
[CBRD-25207] count(*) value is incorrect after no-logging option load…
Browse files Browse the repository at this point in the history
…db (#4908) (#4976)

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

This is a back port for 11.2.8
  • Loading branch information
beyondykk9 authored Feb 23, 2024
1 parent 45952d0 commit 3215c7c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/base/xserver_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ extern int xlogtb_reset_isolation (THREAD_ENTRY * thread_p, TRAN_ISOLATION isola
extern LOG_LSA *log_get_final_restored_lsa (void);
extern float log_get_db_compatibility (void);
extern int log_set_no_logging (void);
extern bool log_is_no_logging (void);
extern bool logtb_has_updated (THREAD_ENTRY * thread_p);


Expand Down
14 changes: 13 additions & 1 deletion src/transaction/log_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,18 @@ log_set_no_logging (void)
return error_code;
}

/*
* This function is for an external interface
* to process statistical information of the B-tree index header.
* In a no logging environment, the statistical information of the B-tree index header
* should not depend on the updated log. This is a function to check this.
*/
bool
log_is_no_logging (void)
{
return log_No_logging;
}

/*
* log_initialize - Initialize the log manager
*
Expand Down Expand Up @@ -3855,7 +3867,7 @@ log_sysop_commit_internal (THREAD_ENTRY * thread_p, LOG_REC_SYSOP_END * log_reco
}

if ((LSA_ISNULL (&tdes->tail_lsa) || LSA_LE (&tdes->tail_lsa, LOG_TDES_LAST_SYSOP_PARENT_LSA (tdes)))
&& log_record->type == LOG_SYSOP_END_COMMIT)
&& (log_record->type == LOG_SYSOP_END_COMMIT || log_No_logging))
{
/* No change. */
assert (LSA_ISNULL (&LOG_TDES_LAST_SYSOP (tdes)->posp_lsa));
Expand Down
2 changes: 1 addition & 1 deletion src/transaction/log_tran_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -5042,7 +5042,7 @@ logtb_reflect_global_unique_stats_to_btree (THREAD_ENTRY * thread_p)
stats = (GLOBAL_UNIQUE_STATS *) lf_hash_iterate (&it))
{
/* reflect only if some changes were logged */
if (!LSA_ISNULL (&stats->last_log_lsa))
if (log_is_no_logging () || !LSA_ISNULL (&stats->last_log_lsa))
{
error = btree_reflect_global_unique_statistics (thread_p, stats, false);
if (error != NO_ERROR)
Expand Down

0 comments on commit 3215c7c

Please sign in to comment.