37 #ifndef UNIV_HOTBACKUP
84 if (log_ptr == NULL) {
108 if (end_ptr < ptr + 1) {
118 if (end_ptr < ptr + 2) {
155 if (end_ptr < ptr + 2) {
163 if (offset >= UNIV_PAGE_SIZE) {
178 if (UNIV_LIKELY_NULL(page_zip)) {
198 if (UNIV_UNLIKELY(val > 0xFFUL)) {
202 if (UNIV_LIKELY_NULL(page_zip)) {
211 if (UNIV_UNLIKELY(val > 0xFFFFUL)) {
215 if (UNIV_LIKELY_NULL(page_zip)) {
225 if (UNIV_LIKELY_NULL(page_zip)) {
273 if (log_ptr == NULL) {
308 if (log_ptr == NULL) {
324 #ifndef UNIV_HOTBACKUP
338 ut_a(len < UNIV_PAGE_SIZE);
340 memcpy(ptr, str, len);
359 ut_ad(len <= UNIV_PAGE_SIZE);
364 if (log_ptr == NULL) {
400 if (end_ptr < ptr + 4) {
410 if (UNIV_UNLIKELY(offset >= UNIV_PAGE_SIZE)
411 || UNIV_UNLIKELY(len + offset > UNIV_PAGE_SIZE)) {
417 if (end_ptr < ptr + len) {
423 if (UNIV_LIKELY_NULL(page_zip)) {
427 memcpy(page + offset, ptr, len);
433 #ifndef UNIV_HOTBACKUP
450 const byte* log_start;
456 log_start = log_ptr =
mlog_open(mtr, 11 + size);
462 log_end = log_ptr + 11 + size;
467 ulint total = 11 + size + (n + 2) * 2;
473 log_start = log_ptr =
mlog_open(mtr, alloc);
477 log_end = log_ptr + alloc;
485 for (i = 0; i < n; i++) {
490 field = dict_index_get_nth_field(index, i);
495 && (col->
len > 255 || col->
mtype == DATA_BLOB)) {
500 if (col->
prtype & DATA_NOT_NULL) {
503 if (log_ptr + 2 > log_end) {
505 ut_a(total > (ulint) (log_ptr - log_start));
506 total -= log_ptr - log_start;
511 log_start = log_ptr =
mlog_open(mtr, alloc);
515 log_end = log_ptr + alloc;
524 }
else if (log_ptr + size > log_end) {
548 ut_ad(comp == FALSE || comp == TRUE);
551 if (end_ptr < ptr + 4) {
559 if (end_ptr < ptr + n * 2) {
568 DICT_HDR_SPACE, 0, n);
570 ind->
n_uniq = (
unsigned int) n_uniq;
572 ut_a(n_uniq + DATA_ROLL_PTR <= n);
576 for (i = 0; i < n; i++) {
584 ((len + 1) & 0x7fff) <= 1
585 ? DATA_BINARY : DATA_FIXBINARY,
586 len & 0x8000 ? DATA_NOT_NULL : 0,
590 dict_table_get_nth_col(table, i),
599 ut_a(DATA_ROLL_PTR_LEN
602 ind->
fields[DATA_TRX_ID - 1 + n_uniq].
col
603 = &table->
cols[n + DATA_TRX_ID];
604 ind->
fields[DATA_ROLL_PTR - 1 + n_uniq].
col
605 = &table->
cols[n + DATA_ROLL_PTR];
UNIV_INTERN byte * mlog_parse_nbytes(ulint type, byte *ptr, byte *end_ptr, byte *page, void *page_zip)
UNIV_INLINE void mach_write_to_4(byte *b, ulint n)
UNIV_INLINE ulint dict_index_get_n_fields(const dict_index_t *index)
UNIV_INLINE void mlog_close(mtr_t *mtr, byte *ptr)
UNIV_INTERN void mlog_write_string(byte *ptr, const byte *str, ulint len, mtr_t *mtr)
UNIV_INLINE ibool dict_table_is_comp(const dict_table_t *table)
UNIV_INLINE void mach_write_to_8(byte *b, ib_uint64_t n)
UNIV_INTERN void mlog_write_ulint(byte *ptr, ulint val, byte type, mtr_t *mtr)
UNIV_INTERN void dict_index_add_col(dict_index_t *index, const dict_table_t *table, dict_col_t *col, ulint prefix_len)
UNIV_INTERN dict_index_t * dict_mem_index_create(const char *table_name, const char *index_name, ulint space, ulint type, ulint n_fields)
UNIV_INLINE ulint mtr_get_log_mode(mtr_t *mtr)
UNIV_INLINE byte * mach_ull_parse_compressed(byte *ptr, byte *end_ptr, ib_uint64_t *val)
UNIV_INLINE ulint mach_ull_write_compressed(byte *b, ib_uint64_t n)
#define MLOG_BIGGEST_TYPE
UNIV_INTERN byte * mlog_open_and_write_index(mtr_t *mtr, const byte *rec, dict_index_t *index, byte type, ulint size)
UNIV_INLINE const dict_col_t * dict_index_get_nth_col(const dict_index_t *index, ulint pos)
UNIV_INTERN byte * mlog_parse_string(byte *ptr, byte *end_ptr, byte *page, void *page_zip)
UNIV_INLINE ulint dict_index_get_n_unique_in_tree(const dict_index_t *index)
UNIV_INLINE void dyn_push_string(dyn_array_t *arr, const byte *str, ulint len)
#define MLOG_WRITE_STRING
UNIV_INLINE byte * mlog_write_initial_log_record_fast(const byte *ptr, byte type, byte *log_ptr, mtr_t *mtr)
UNIV_INLINE ulint page_rec_is_comp(const rec_t *rec)
UNIV_INTERN void mlog_write_ull(byte *ptr, ib_uint64_t val, mtr_t *mtr)
UNIV_INTERN byte * mach_parse_compressed(byte *ptr, byte *end_ptr, ulint *val)
UNIV_INTERN dict_table_t * dict_mem_table_create(const char *name, ulint space, ulint n_cols, ulint flags)
UNIV_INLINE ulint page_offset(const void *ptr) __attribute__((const ))
UNIV_INTERN void mlog_catenate_string(mtr_t *mtr, const byte *str, ulint len)
UNIV_INTERN void dict_table_add_system_columns(dict_table_t *table, mem_heap_t *heap)
UNIV_INLINE const dict_col_t * dict_field_get_col(const dict_field_t *field)
UNIV_INTERN ulint fil_page_get_type(const byte *page)
UNIV_INTERN void dict_mem_table_add_col(dict_table_t *table, mem_heap_t *heap, const char *name, ulint mtype, ulint prtype, ulint len)
UNIV_INLINE void mach_write_to_1(byte *b, ulint n)
UNIV_INLINE byte * mlog_open(mtr_t *mtr, ulint size)
UNIV_INTERN void mlog_write_initial_log_record(const byte *ptr, byte type, mtr_t *mtr)
#define DYN_ARRAY_DATA_SIZE
UNIV_INLINE ulint mach_write_compressed(byte *b, ulint n)
UNIV_INLINE void mach_write_to_2(byte *b, ulint n)
UNIV_INTERN byte * mlog_parse_initial_log_record(byte *ptr, byte *end_ptr, byte *type, ulint *space, ulint *page_no)
UNIV_INTERN byte * mlog_parse_index(byte *ptr, const byte *end_ptr, ibool comp, dict_index_t **index)
#define MLOG_SINGLE_REC_FLAG
UNIV_INLINE ulint mach_read_from_2(const byte *b) __attribute__((nonnull
UNIV_INTERN void mlog_log_string(byte *ptr, ulint len, mtr_t *mtr)
A block in a dynamically allocated array. NOTE! Do not access the fields of the struct directly: the ...