41 #define REPL_LOG_IS_NOT_EXISTS(tran_index) \ 42 (log_Gl.trantable.all_tdes[(tran_index)]->num_repl_records == 0) 43 #define REPL_LOG_IS_FULL(tran_index) \ 44 (log_Gl.trantable.all_tdes[(tran_index)]->num_repl_records \ 45 == log_Gl.trantable.all_tdes[(tran_index)]->cur_repl_record+1) 49 #if defined(SERVER_MODE) || defined(SA_MODE) 50 static int repl_log_info_alloc (
LOG_TDES * tdes,
int arr_size,
bool need_realloc);
53 #if defined(SERVER_MODE) || defined(SA_MODE) 66 repl_data_insert_log_dump (FILE * fp,
int length,
void *data)
74 fprintf (fp,
" class_name: %s\n", class_name);
75 fprintf (fp,
" pk_value: ");
82 #if defined (ENABLE_UNUSED_FUNCTION) 94 repl_data_udpate_log_dump (FILE * fp,
int length,
void *data)
97 repl_data_insert_log_dump (fp, length, data);
111 repl_data_delete_log_dump (FILE * fp,
int length,
void *data)
114 repl_data_insert_log_dump (fp, length, data);
130 repl_schema_log_dump (FILE * fp,
int length,
void *data)
133 char *class_name, *ddl;
139 fprintf (fp,
" type: %d\n", type);
140 fprintf (fp,
" class_name: %s\n", class_name);
141 fprintf (fp,
" DDL: %s\n", ddl);
163 repl_log_info_alloc (
LOG_TDES * tdes,
int arr_size,
bool need_realloc)
168 if (need_realloc ==
false)
170 i = arr_size *
DB_SIZEOF (LOG_REPL_RECORD);
231 LOG_REPL_RECORD *repl_rec;
252 repl_rec = (LOG_REPL_RECORD *) (&tdes->
repl_records[i]);
296 LOG_REPL_RECORD *repl_rec;
298 char *class_name =
NULL;
338 repl_rec->repl_type = log_type;
339 repl_rec->tde_encrypted =
false;
341 repl_rec->rcvindex = rcvindex;
358 COPY_OID (&repl_rec->inst_oid, inst_oid);
363 char *ptr_to_packed_key_value_size =
NULL;
364 int packed_key_len = 0;
393 ptr = (
char *) malloc (repl_rec->length);
402 #if !defined (NDEBUG) 404 memset (ptr, 0, repl_rec->length);
407 repl_rec->repl_data = ptr;
410 ptr_to_packed_key_value_size = ptr;
417 or_pack_int (ptr_to_packed_key_value_size, packed_key_len);
421 repl_rec->repl_data =
NULL;
422 repl_rec->length = 0;
424 repl_rec->must_flush = LOG_REPL_COMMIT_NEED_FLUSH;
473 if (recsp[i].must_flush == LOG_REPL_COMMIT_NEED_FLUSH &&
OID_EQ (&recsp[i].inst_oid, &repl_rec->inst_oid))
481 repl_rec->must_flush = LOG_REPL_NEED_FLUSH;
486 repl_rec->must_flush = LOG_REPL_NEED_FLUSH;
490 if (class_name !=
NULL)
514 LOG_REPL_RECORD *repl_rec;
516 int error =
NO_ERROR, strlen1, strlen2, strlen3, strlen4;
546 repl_rec->tde_encrypted =
false;
549 repl_rec->must_flush = LOG_REPL_COMMIT_NEED_FLUSH;
559 repl_rec->repl_data = (
char *) malloc (repl_rec->length);
560 if (repl_rec->repl_data ==
NULL)
566 ptr = repl_rec->repl_data;
576 "repl_log_insert_statement: repl_info_sbr { type %d, name %s, stmt_txt %s, user %s, " 588 repl_rec->must_flush = LOG_REPL_NEED_FLUSH;
633 repl_end_flush_mark (
THREAD_ENTRY * thread_p,
bool need_undo)
673 LOG_REPL_RECORD *repl_rec_arr;
679 if (
LSA_GT (&repl_rec_arr[i].lsa, start_lsa))
681 repl_rec_arr[
i].must_flush = LOG_REPL_DONT_NEED_FLUSH;
688 #if defined(CUBRID_DEBUG) 700 LOG_REPL_RECORD *repl_rec;
706 fprintf (stdout,
"REPLICATION LOG DUMP -- Memory\n");
709 fprintf (stdout,
"*************************************************\n");
711 fprintf (stdout,
"For the Trid : %d\n", (
int) tdes->
trid);
714 fprintf (stdout,
" RECORD # %d\n", rnum);
715 repl_rec = (LOG_REPL_RECORD *) (&tdes->
repl_records[rnum]);
716 fprintf (stdout,
" type: %s\n",
log_to_string (repl_rec->repl_type));
717 fprintf (stdout,
" OID: %d - %d - %d\n", repl_rec->inst_oid.volid, repl_rec->inst_oid.pageid,
718 repl_rec->inst_oid.slotid);
721 fprintf (stdout,
" class_name: %s\n", class_name);
722 fprintf (stdout,
" LSA: %lld | %d\n", repl_rec->lsa.pageid, repl_rec->lsa.offset);
724 fprintf (stdout,
"\n----------------------------------------------\n");
#define REPL_LOG_IS_NOT_EXISTS(tran_index)
void LSA_COPY(log_lsa *plsa1, const log_lsa *plsa2)
#define ASSERT_ERROR_AND_SET(error_code)
#define OID_SET_NULL(oidp)
LOG_TDES * LOG_FIND_TDES(int tran_index)
char * or_unpack_string_nocopy(char *ptr, char **string)
void _er_log_debug(const char *file_name, const int line_no, const char *fmt,...)
#define COPY_OID(dest_oid_ptr, src_oid_ptr)
const char * log_to_string(LOG_RECTYPE type)
int heap_get_class_tde_algorithm(THREAD_ENTRY *thread_p, const OID *class_oid, TDE_ALGORITHM *tde_algo)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
int or_packed_string_length(const char *string, int *strlen)
#define REPL_LOG_IS_FULL(tran_index)
#define OR_VALUE_ALIGNED_SIZE(value)
enum log_rectype LOG_RECTYPE
#define OID_EQ(oidp1, oidp2)
void db_value_print(const DB_VALUE *value)
bool LSA_ISNULL(const log_lsa *lsa_ptr)
char * or_unpack_int(char *ptr, int *number)
LOG_PRIOR_LSA_INFO prior_info
#define ER_LOG_UNKNOWN_TRANINDEX
int pr_clear_value(DB_VALUE *value)
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)
struct log_repl * repl_records
static void error(const char *msg)
static const int REPL_LOG_INFO_ALLOC_SIZE
char * or_pack_int(char *ptr, int number)
LOG_TDES * LOG_FIND_CURRENT_TDES(THREAD_ENTRY *thread_p=NULL)
#define LOG_FIND_THREAD_TRAN_INDEX(thrd)
#define free_and_init(ptr)
void LSA_SET_NULL(log_lsa *lsa_ptr)
char * or_pack_string_with_length(char *ptr, const char *string, int length)
bool LSA_GT(const log_lsa *plsa1, const log_lsa *plsa2)
bool prm_get_bool_value(PARAM_ID prm_id)
int heap_get_class_name(THREAD_ENTRY *thread_p, const OID *class_oid, char **class_name)