summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2001-02-06 22:32:19 +0200
committerunknown <monty@donna.mysql.com>2001-02-06 22:32:19 +0200
commit22913794f5ac9d3c6d3fe097dad20b2c082a3f22 (patch)
treee90fdf99267bed4cfce0abcc11654aee0fc775bd
parentd89bbf88807b17ff253110c8094f33b889b409ea (diff)
downloadmariadb-git-22913794f5ac9d3c6d3fe097dad20b2c082a3f22.tar.gz
Fixed makefiles for distribution
README: Cleanup sql-bench/Makefile.am: Remove deleted directory sql/mysqlbinlog.cc: Cleanup --help
-rw-r--r--README8
-rw-r--r--sql-bench/Makefile.am1
-rw-r--r--sql/mysqlbinlog.cc86
3 files changed, 63 insertions, 32 deletions
diff --git a/README b/README
index de6d2641bf0..b1f4ab52369 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-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).
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.
For a contributed user manual see http://www.turbolift.com/mysql.
-MySQL is brought to you by: Michael (Monty) Widenius at TcX
-DataKonsult AB.
+MySQL is brought to you by the MySQL team at MySQL 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.
************************************************************
diff --git a/sql-bench/Makefile.am b/sql-bench/Makefile.am
index 5dc3e0b4e42..3ee98ccdb19 100644
--- a/sql-bench/Makefile.am
+++ b/sql-bench/Makefile.am
@@ -40,7 +40,6 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/Data/ATIS/*.* $(distdir)/Data/ATIS
$(INSTALL_DATA) $(srcdir)/Data/Wisconsin/*.* $(distdir)/Data/Wisconsin
$(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)/limits/*.* $(distdir)/limits
$(INSTALL_DATA) $(srcdir)/Comments/*.* $(distdir)/Comments
diff --git a/sql/mysqlbinlog.cc b/sql/mysqlbinlog.cc
index b09decf1c86..563250d9e30 100644
--- a/sql/mysqlbinlog.cc
+++ b/sql/mysqlbinlog.cc
@@ -45,18 +45,19 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
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
- {"debug", optional_argument, 0, '#'}
+ {"debug", optional_argument, 0, '#'},
#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,...);
@@ -81,15 +82,16 @@ static void dump_remote_table(NET* net, const char* db, const char* table);
static void die(const char* fmt, ...);
static MYSQL* safe_connect();
- void sql_print_error(const char *format,...)
- {
+
+void sql_print_error(const char *format,...)
+{
va_list args;
va_start(args, format);
fprintf(stderr, "ERROR: ");
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
va_end(args);
- }
+}
static void die(const char* fmt, ...)
{
@@ -102,19 +104,39 @@ static void die(const char* fmt, ...)
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()
{
+ 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("Options:\n\
--s,--short-form just show the queries, no extra info\n\
--o,--offset=N skip the first N entries\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 use this password to connect to remote server\n\
--j,--position=N start reading the binlog at postion N\n\
--t,--table=name get raw table dump using COM_TABLE_DUMB \n\
--?,--help this message\n");
+ puts("Options:");
+#ifndef DBUG_OFF
+ printf("-#, --debug[=...] Output debug log. (%s)\n",
+ default_dbug_option);
+#endif
+ printf("\
+-?, --help Display this help and exit\n\
+-s, --short-form Just show the queries, no extra info\n\
+-o, --offset=N Skip the first N entries\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)
@@ -151,7 +173,7 @@ static int parse_args(int *argc, char*** argv)
{
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)
{
switch(c)
@@ -197,6 +219,10 @@ static int parse_args(int *argc, char*** argv)
table = my_strdup(optarg, MYF(0));
break;
+ case 'V':
+ print_version();
+ exit(0);
+
case '?':
default:
usage();
@@ -208,7 +234,6 @@ static int parse_args(int *argc, char*** argv)
(*argc)-=optind;
(*argv)+=optind;
-
return 0;
}
@@ -349,24 +374,31 @@ static void dump_local_log_entries(const char* logname)
if (my_b_read(file, (byte*) magic, sizeof(magic)))
die("I/O error reading binlog magic number");
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)
{
char llbuff[21];
+ my_off_t old_off = my_b_tell(file);
+
Log_event* ev = Log_event::read_log_event(file, 0);
if (!ev)
{
if (file->error)
die("\
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
break;
}
if (rec_count >= offset)
+ {
+ if (!short_form)
+ printf("# at %s\n",llstr(old_off,llbuff));
+
ev->print(stdout, short_form);
+ }
rec_count++;
delete ev;
}