Commit 22913794 authored by unknown's avatar unknown

Fixed makefiles for distribution


README:
  Cleanup
sql-bench/Makefile.am:
  Remove deleted directory
sql/mysqlbinlog.cc:
  Cleanup --help
parent d89bbf88
This is a release of MySQL, a basically free SQL database server (more This is a release of MySQL, a GPL (free) SQL database server (more
licence information in the PUBLIC file and in the reference manual). licence information in the PUBLIC file and in the reference manual).
Please read the Upgrading section in the manual if emigration from Please read the Upgrading section in the manual if emigration from
...@@ -30,10 +30,10 @@ Docs/mysql.info and as PostScript in Docs/manual.ps. ...@@ -30,10 +30,10 @@ Docs/mysql.info and as PostScript in Docs/manual.ps.
For a contributed user manual see http://www.turbolift.com/mysql. For a contributed user manual see http://www.turbolift.com/mysql.
MySQL is brought to you by: Michael (Monty) Widenius at TcX MySQL is brought to you by the MySQL team at MySQL AB
DataKonsult AB.
For the other contributors see the Credits appendix in the manual. For a list of developers and other contributors, see the Credits appendix
in the manual.
************************************************************ ************************************************************
......
...@@ -40,7 +40,6 @@ dist-hook: ...@@ -40,7 +40,6 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/Data/ATIS/*.* $(distdir)/Data/ATIS $(INSTALL_DATA) $(srcdir)/Data/ATIS/*.* $(distdir)/Data/ATIS
$(INSTALL_DATA) $(srcdir)/Data/Wisconsin/*.* $(distdir)/Data/Wisconsin $(INSTALL_DATA) $(srcdir)/Data/Wisconsin/*.* $(distdir)/Data/Wisconsin
$(INSTALL_DATA) $(srcdir)/Results/*-* $(distdir)/Results $(INSTALL_DATA) $(srcdir)/Results/*-* $(distdir)/Results
$(INSTALL_DATA) $(srcdir)/Results-linux/*-* $(distdir)/Results-linux
$(INSTALL_DATA) $(srcdir)/Results-win32/*-* $(distdir)/Results-win32 $(INSTALL_DATA) $(srcdir)/Results-win32/*-* $(distdir)/Results-win32
$(INSTALL_DATA) $(srcdir)/limits/*.* $(distdir)/limits $(INSTALL_DATA) $(srcdir)/limits/*.* $(distdir)/limits
$(INSTALL_DATA) $(srcdir)/Comments/*.* $(distdir)/Comments $(INSTALL_DATA) $(srcdir)/Comments/*.* $(distdir)/Comments
......
...@@ -45,18 +45,19 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace"; ...@@ -45,18 +45,19 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
static struct option long_options[] = static struct option long_options[] =
{ {
{"short-form", no_argument, 0, 's'},
{"table", required_argument, 0, 't'},
{"offset", required_argument,0, 'o'},
{"help", no_argument, 0, '?'},
{"host", required_argument,0, 'h'},
{"port", required_argument,0, 'P'},
{"user", required_argument,0, 'u'},
{"password", required_argument,0, 'p'},
{"position", required_argument,0, 'j'},
#ifndef DBUG_OFF #ifndef DBUG_OFF
{"debug", optional_argument, 0, '#'} {"debug", optional_argument, 0, '#'},
#endif #endif
{"help", no_argument, 0, '?'},
{"host", required_argument, 0, 'h'},
{"offset", required_argument, 0, 'o'},
{"password", required_argument, 0, 'p'},
{"port", required_argument, 0, 'P'},
{"position", required_argument, 0, 'j'},
{"short-form", no_argument, 0, 's'},
{"table", required_argument, 0, 't'},
{"user", required_argument, 0, 'u'},
{"version", no_argument, 0, 'V'},
}; };
void sql_print_error(const char *format,...); void sql_print_error(const char *format,...);
...@@ -81,15 +82,16 @@ static void dump_remote_table(NET* net, const char* db, const char* table); ...@@ -81,15 +82,16 @@ static void dump_remote_table(NET* net, const char* db, const char* table);
static void die(const char* fmt, ...); static void die(const char* fmt, ...);
static MYSQL* safe_connect(); static MYSQL* safe_connect();
void sql_print_error(const char *format,...)
{ void sql_print_error(const char *format,...)
{
va_list args; va_list args;
va_start(args, format); va_start(args, format);
fprintf(stderr, "ERROR: "); fprintf(stderr, "ERROR: ");
vfprintf(stderr, format, args); vfprintf(stderr, format, args);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
va_end(args); va_end(args);
} }
static void die(const char* fmt, ...) static void die(const char* fmt, ...)
{ {
...@@ -102,19 +104,39 @@ static void die(const char* fmt, ...) ...@@ -102,19 +104,39 @@ static void die(const char* fmt, ...)
exit(1); exit(1);
} }
static void print_version()
{
printf("%s Ver 1.1 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
}
static void usage() static void usage()
{ {
print_version();
puts("By Sasha, for your professional use\n\
This software comes with NO WARRANTY: see the file PUBLIC for details\n");
printf("\
Dumps a MySQL binary log in a format usable for viewing or for pipeing to\n\
the mysql command line client\n\n");
printf("Usage: %s [options] log-files\n",my_progname); printf("Usage: %s [options] log-files\n",my_progname);
printf("Options:\n\ puts("Options:");
-s,--short-form just show the queries, no extra info\n\ #ifndef DBUG_OFF
-o,--offset=N skip the first N entries\n\ printf("-#, --debug[=...] Output debug log. (%s)\n",
-h,--host=server get the binlog from server\n\ default_dbug_option);
-P,--port=port use port to connect to the remove server\n\ #endif
-u,--user=username connect to the remove server as username\n\ printf("\
-p,--password=password use this password to connect to remote server\n\ -?, --help Display this help and exit\n\
-j,--position=N start reading the binlog at postion N\n\ -s, --short-form Just show the queries, no extra info\n\
-t,--table=name get raw table dump using COM_TABLE_DUMB \n\ -o, --offset=N Skip the first N entries\n\
-?,--help this message\n"); -h, --host=server Get the binlog from server\n\
-P, --port=port Use port to connect to the remove server\n\
-u, --user=username Connect to the remove server as username\n\
-p, --password=password Password to connect to remote server\n\
-j, --position=N Start reading the binlog at position N\n\
-t, --table=name Get raw table dump using COM_TABLE_DUMB\n\
-V, --version Print version and exit.\n\
");
} }
static void dump_remote_file(NET* net, const char* fname) static void dump_remote_file(NET* net, const char* fname)
...@@ -151,7 +173,7 @@ static int parse_args(int *argc, char*** argv) ...@@ -151,7 +173,7 @@ static int parse_args(int *argc, char*** argv)
{ {
int c, opt_index = 0; int c, opt_index = 0;
while((c = getopt_long(*argc, *argv, "so:#::h:j:u:p:P:t:?", long_options, while((c = getopt_long(*argc, *argv, "so:#::h:j:u:p:P:t:?V", long_options,
&opt_index)) != EOF) &opt_index)) != EOF)
{ {
switch(c) switch(c)
...@@ -197,6 +219,10 @@ static int parse_args(int *argc, char*** argv) ...@@ -197,6 +219,10 @@ static int parse_args(int *argc, char*** argv)
table = my_strdup(optarg, MYF(0)); table = my_strdup(optarg, MYF(0));
break; break;
case 'V':
print_version();
exit(0);
case '?': case '?':
default: default:
usage(); usage();
...@@ -208,7 +234,6 @@ static int parse_args(int *argc, char*** argv) ...@@ -208,7 +234,6 @@ static int parse_args(int *argc, char*** argv)
(*argc)-=optind; (*argc)-=optind;
(*argv)+=optind; (*argv)+=optind;
return 0; return 0;
} }
...@@ -349,24 +374,31 @@ static void dump_local_log_entries(const char* logname) ...@@ -349,24 +374,31 @@ static void dump_local_log_entries(const char* logname)
if (my_b_read(file, (byte*) magic, sizeof(magic))) if (my_b_read(file, (byte*) magic, sizeof(magic)))
die("I/O error reading binlog magic number"); die("I/O error reading binlog magic number");
if(memcmp(magic, BINLOG_MAGIC, 4)) if(memcmp(magic, BINLOG_MAGIC, 4))
die("Bad magic number"); die("Bad magic number; The file is probably not a MySQL binary log");
} }
while(1) while(1)
{ {
char llbuff[21]; char llbuff[21];
my_off_t old_off = my_b_tell(file);
Log_event* ev = Log_event::read_log_event(file, 0); Log_event* ev = Log_event::read_log_event(file, 0);
if (!ev) if (!ev)
{ {
if (file->error) if (file->error)
die("\ die("\
Could not read entry at offset %s : Error in log format or read error", Could not read entry at offset %s : Error in log format or read error",
llstr(my_b_tell(file),llbuff)); llstr(old_off,llbuff));
// file->error == 0 means EOF, that's OK, we break in this case // file->error == 0 means EOF, that's OK, we break in this case
break; break;
} }
if (rec_count >= offset) if (rec_count >= offset)
{
if (!short_form)
printf("# at %s\n",llstr(old_off,llbuff));
ev->print(stdout, short_form); ev->print(stdout, short_form);
}
rec_count++; rec_count++;
delete ev; delete ev;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment