diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index 804993c90a5..35ae71ecb1c 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -222,7 +222,7 @@ static int really_execute_checkpoint(void) */ LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 5]; log_array[TRANSLOG_INTERNAL_PARTS + 0].str= - checkpoint_start_log_horizon_char; + (uchar*) checkpoint_start_log_horizon_char; log_array[TRANSLOG_INTERNAL_PARTS + 0].length= total_rec_length= sizeof(checkpoint_start_log_horizon_char); for (i= 0; i < (sizeof(record_pieces)/sizeof(record_pieces[0])); i++) diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index 8afd277d9e1..4eb97e6578a 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -1008,20 +1008,19 @@ int maria_create(const char *name, enum data_file_type datafile_type, log_data[0]= test(flags & HA_DONT_TOUCH_DATA); int2store(log_data + 1, kfile_size_before_extension); int2store(log_data + 1 + 2, share.base.keystart); - log_array[TRANSLOG_INTERNAL_PARTS + 0].str= name; + log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (uchar *)name; /* we store the end-zero, for Recovery to just pass it to my_create() */ - log_array[TRANSLOG_INTERNAL_PARTS + 0].length= - strlen(log_array[TRANSLOG_INTERNAL_PARTS + 0].str) + 1; + log_array[TRANSLOG_INTERNAL_PARTS + 0].length= strlen(name) + 1; log_array[TRANSLOG_INTERNAL_PARTS + 1].str= log_data; /* symlink description is also needed for re-creation by Recovery: */ - log_array[TRANSLOG_INTERNAL_PARTS + 2].str= - (ci->data_file_name ? ci->data_file_name : empty_string); - log_array[TRANSLOG_INTERNAL_PARTS + 2].length= - strlen(log_array[TRANSLOG_INTERNAL_PARTS + 2].str) + 1; - log_array[TRANSLOG_INTERNAL_PARTS + 3].str= - (ci->index_file_name ? ci->index_file_name : empty_string); - log_array[TRANSLOG_INTERNAL_PARTS + 3].length= - strlen(log_array[TRANSLOG_INTERNAL_PARTS + 3].str) + 1; + { + const char *s= ci->data_file_name ? ci->data_file_name : empty_string; + log_array[TRANSLOG_INTERNAL_PARTS + 2].str= (uchar*)s; + log_array[TRANSLOG_INTERNAL_PARTS + 2].length= strlen(s) + 1; + s= ci->index_file_name ? ci->index_file_name : empty_string; + log_array[TRANSLOG_INTERNAL_PARTS + 3].str= (uchar*)s; + log_array[TRANSLOG_INTERNAL_PARTS + 3].length= strlen(s) + 1; + } for (k= TRANSLOG_INTERNAL_PARTS; k < (sizeof(log_array)/sizeof(log_array[0])); k++) total_rec_length+= (translog_size_t) log_array[k].length; @@ -1349,9 +1348,9 @@ int _ma_update_state_lsns_sub(MARIA_SHARE *share, LSN lsn, TrID create_trid, int res; LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 1]; /* table name is logged only for information */ - log_array[TRANSLOG_INTERNAL_PARTS + 0].str= share->open_file_name; + log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (uchar*)share->open_file_name; log_array[TRANSLOG_INTERNAL_PARTS + 0].length= - strlen(log_array[TRANSLOG_INTERNAL_PARTS + 0].str) + 1; + strlen(share->open_file_name) + 1; if ((res= translog_write_record(&lsn, LOGREC_IMPORTED_TABLE, &dummy_transaction_object, NULL, (translog_size_t) diff --git a/storage/maria/ma_delete_table.c b/storage/maria/ma_delete_table.c index 43e15b614aa..ea047b6706b 100644 --- a/storage/maria/ma_delete_table.c +++ b/storage/maria/ma_delete_table.c @@ -85,7 +85,7 @@ int maria_delete_table(const char *name) */ LSN lsn; LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 1]; - log_array[TRANSLOG_INTERNAL_PARTS + 0].str= name; + log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (uchar*)name; log_array[TRANSLOG_INTERNAL_PARTS + 0].length= strlen(name) + 1; if (unlikely(translog_write_record(&lsn, LOGREC_REDO_DROP_TABLE, &dummy_transaction_object, NULL, diff --git a/storage/maria/ma_rename.c b/storage/maria/ma_rename.c index e9501d21350..f238423ee69 100644 --- a/storage/maria/ma_rename.c +++ b/storage/maria/ma_rename.c @@ -69,9 +69,9 @@ int maria_rename(const char *old_name, const char *new_name) LSN lsn; LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 2]; uint old_name_len= strlen(old_name)+1, new_name_len= strlen(new_name)+1; - log_array[TRANSLOG_INTERNAL_PARTS + 0].str= old_name; + log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (uchar*)old_name; log_array[TRANSLOG_INTERNAL_PARTS + 0].length= old_name_len; - log_array[TRANSLOG_INTERNAL_PARTS + 1].str= new_name; + log_array[TRANSLOG_INTERNAL_PARTS + 1].str= (uchar*)new_name; log_array[TRANSLOG_INTERNAL_PARTS + 1].length= new_name_len; /* For this record to be of any use for Recovery, we need the upper diff --git a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c index a56f7d64118..06d9a00c04c 100644 --- a/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c +++ b/storage/maria/unittest/ma_test_loghandler_first_lsn-t.c @@ -113,7 +113,7 @@ int main(int argc __attribute__((unused)), char *argv[]) int4store(long_tr_id, 0); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; if (translog_write_record(&lsn, LOGREC_FIXED_RECORD_0LSN_EXAMPLE, diff --git a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c index 238a9ec9cbb..64f486b8cf1 100644 --- a/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c +++ b/storage/maria/unittest/ma_test_loghandler_max_lsn-t.c @@ -104,7 +104,7 @@ int main(int argc __attribute__((unused)), char *argv[]) /* write more then 1 file */ int4store(long_tr_id, 0); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; for(i= 0; i < LOG_FILE_SIZE/6; i++) { diff --git a/storage/maria/unittest/ma_test_loghandler_noflush-t.c b/storage/maria/unittest/ma_test_loghandler_noflush-t.c index 54294936cc3..973dfd03bcf 100644 --- a/storage/maria/unittest/ma_test_loghandler_noflush-t.c +++ b/storage/maria/unittest/ma_test_loghandler_noflush-t.c @@ -93,7 +93,7 @@ int main(int argc __attribute__((unused)), char *argv[]) int4store(long_tr_id, 0); long_tr_id[5]= 0xff; - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; if (translog_write_record(&first_lsn, LOGREC_FIXED_RECORD_0LSN_EXAMPLE, diff --git a/storage/maria/unittest/ma_test_loghandler_nologs-t.c b/storage/maria/unittest/ma_test_loghandler_nologs-t.c index e126ff31f3a..34508d1d751 100644 --- a/storage/maria/unittest/ma_test_loghandler_nologs-t.c +++ b/storage/maria/unittest/ma_test_loghandler_nologs-t.c @@ -90,7 +90,7 @@ int main(int argc __attribute__((unused)), char *argv[]) /* write more then 1 file */ int4store(long_tr_id, 0); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; if (translog_write_record(&lsn, LOGREC_FIXED_RECORD_0LSN_EXAMPLE, @@ -98,7 +98,7 @@ int main(int argc __attribute__((unused)), char *argv[]) TRANSLOG_INTERNAL_PARTS + 1, parts, NULL, NULL)) { - fprintf(stderr, "Can't write record #%lu\n", (ulong) 0); + fprintf(stderr, "Can't write record #0\n"); translog_destroy(); exit(1); } @@ -111,7 +111,7 @@ int main(int argc __attribute__((unused)), char *argv[]) TRANSLOG_INTERNAL_PARTS + 1, parts, NULL, NULL)) { - fprintf(stderr, "Can't write record #%lu\n", (ulong) 0); + fprintf(stderr, "Can't write record #0\n"); translog_destroy(); exit(1); } @@ -164,7 +164,7 @@ int main(int argc __attribute__((unused)), char *argv[]) ok(1, "Log init OK"); int4store(long_tr_id, 0); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; if (translog_write_record(&lsn, LOGREC_FIXED_RECORD_0LSN_EXAMPLE, @@ -172,7 +172,7 @@ int main(int argc __attribute__((unused)), char *argv[]) TRANSLOG_INTERNAL_PARTS + 1, parts, NULL, NULL)) { - fprintf(stderr, "Can't write record #%lu\n", (ulong) 0); + fprintf(stderr, "Can't write record #0\n"); translog_destroy(); exit(1); } diff --git a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c index 16f672d66ca..bfbba5407c1 100644 --- a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c +++ b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c @@ -131,7 +131,7 @@ int main(int argc __attribute__((unused)), char *argv[]) } my_close(file1.file, MYF(MY_WME)); int4store(long_tr_id, 0); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; dummy_transaction_object.first_undo_lsn= TRANSACTION_LOGGED_LONG_ID; if (translog_write_record(&lsn, diff --git a/storage/maria/unittest/ma_test_loghandler_purge-t.c b/storage/maria/unittest/ma_test_loghandler_purge-t.c index 0c3be2f2428..d37b45bc3ca 100644 --- a/storage/maria/unittest/ma_test_loghandler_purge-t.c +++ b/storage/maria/unittest/ma_test_loghandler_purge-t.c @@ -90,7 +90,7 @@ int main(int argc __attribute__((unused)), char *argv[]) /* write more then 1 file */ int4store(long_tr_id, 0); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; if (translog_write_record(&lsn, LOGREC_FIXED_RECORD_0LSN_EXAMPLE, @@ -136,7 +136,7 @@ int main(int argc __attribute__((unused)), char *argv[]) ok(1, "First file is removed"); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_buffer; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_buffer; parts[TRANSLOG_INTERNAL_PARTS + 0].length= LONG_BUFFER_SIZE; if (translog_write_record(&lsn, LOGREC_VARIABLE_RECORD_0LSN_EXAMPLE, @@ -160,7 +160,7 @@ int main(int argc __attribute__((unused)), char *argv[]) ok(1, "Second and third files are not removed"); int4store(long_tr_id, 0); - parts[TRANSLOG_INTERNAL_PARTS + 0].str= (char*)long_tr_id; + parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id; parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6; if (translog_write_record(&lsn, LOGREC_FIXED_RECORD_0LSN_EXAMPLE,