summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-06-03 19:08:30 +0300
committerSergei Petrunia <sergey@mariadb.com>2022-06-07 20:43:11 +0300
commit1de18a836f1abbe76632337f9296f402bbdf4cfc (patch)
tree9d514e8897b91c0aec73454c69f216054c61f7fe
parent31811cf81d2d82d0260322c8c1bf7b2e046a4712 (diff)
downloadmariadb-git-1de18a836f1abbe76632337f9296f402bbdf4cfc.tar.gz
Updated aria_dump_log
- Print correct server version for header - Updated version number - One can now specify file name last (without -f)
-rw-r--r--storage/maria/aria_dump_log.c10
-rw-r--r--storage/maria/ma_loghandler.c4
2 files changed, 9 insertions, 5 deletions
diff --git a/storage/maria/aria_dump_log.c b/storage/maria/aria_dump_log.c
index 17af368c424..e64c97fcda3 100644
--- a/storage/maria/aria_dump_log.c
+++ b/storage/maria/aria_dump_log.c
@@ -66,7 +66,7 @@ static struct my_option my_long_options[] =
static void print_version(void)
{
- printf("%s Ver 1.0 for %s on %s\n",
+ printf("%s Ver 1.1 for %s on %s\n",
my_progname_short, SYSTEM_TYPE, MACHINE_TYPE);
}
@@ -78,8 +78,9 @@ static void usage(void)
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
puts("and you are welcome to modify and redistribute it under the GPL license\n");
- puts("Dump content of aria log pages.");
- printf("\nUsage: %s -f file OPTIONS\n", my_progname_short);
+ puts("Dump the raw content of aria log pages.");
+ puts("For a logical dump, use aria_read_log");
+ printf("\nUsage: %s OPTIONS aria_log_file\n", my_progname_short);
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
@@ -115,6 +116,9 @@ static void get_options(int *argc,char ***argv)
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
+ if (opt_file == NULL && *argc == 1)
+ opt_file= **argv;
+
if (opt_file == NULL)
{
usage();
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 86e7fa93eaa..710fde2801e 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -1219,12 +1219,12 @@ void translog_interpret_file_header(LOGHANDLER_FILE_INFO *desc,
ptr+= 4;
desc->mysql_version= uint4korr(ptr);
ptr+= 4;
- desc->server_id= uint4korr(ptr + 4);
+ desc->server_id= uint4korr(ptr);
ptr+= 4;
desc->page_size= uint2korr(ptr) + 1;
ptr+= 2;
desc->file_number= uint3korr(ptr);
- ptr+=3;
+ ptr+= 3;
desc->max_lsn= lsn_korr(ptr);
}