mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
compiler warnings
This commit is contained in:
parent
651f61fc1f
commit
7ca3fc4ff0
10 changed files with 28 additions and 29 deletions
|
@ -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++)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue