summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2003-07-01 13:17:03 -0400
committerunknown <vva@eagle.mysql.r18.ru>2003-07-01 13:17:03 -0400
commitf793def28ab11ee82cfccd3cd8c57d71b1b0d8dc (patch)
tree0d39862654f59971635345ef7907547cf0461a36 /client
parentf7e6d223c406b0a5ee18ab95e0bbc8eb99cee973 (diff)
downloadmariadb-git-f793def28ab11ee82cfccd3cd8c57d71b1b0d8dc.tar.gz
removed --table option (fixed Bug #671)
client/mysqlbinlog.cc: removed --table option
Diffstat (limited to 'client')
-rw-r--r--client/mysqlbinlog.cc54
1 files changed, 4 insertions, 50 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 75b875b4f4e..d6da9d81664 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -55,13 +55,11 @@ static ulonglong position = 0;
static bool use_remote = 0;
static short binlog_flags = 0;
static MYSQL* mysql = NULL;
-static const char* table = 0;
static void dump_local_log_entries(const char* logname);
static void dump_remote_log_entries(const char* logname);
static void dump_log_entries(const char* logname);
static void dump_remote_file(NET* net, const char* fname);
-static void dump_remote_table(NET* net, const char* db, const char* table);
static void die(const char* fmt, ...);
static MYSQL* safe_connect();
@@ -96,8 +94,6 @@ static struct my_option my_long_options[] =
{"short-form", 's', "Just show the queries, no extra info",
(gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"table", 't', "Get raw table dump using COM_TABLE_DUMB", (gptr*) &table,
- (gptr*) &table, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "Connect to the remote server as username",
(gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
@@ -252,35 +248,6 @@ static void dump_log_entries(const char* logname)
dump_local_log_entries(logname);
}
-static void dump_remote_table(NET* net, const char* db, const char* table)
-{
- char buf[1024];
- char * p = buf;
- uint table_len = (uint) strlen(table);
- uint db_len = (uint) strlen(db);
- if (table_len + db_len > sizeof(buf) - 2)
- die("Buffer overrun");
-
- *p++ = db_len;
- memcpy(p, db, db_len);
- p += db_len;
- *p++ = table_len;
- memcpy(p, table, table_len);
-
- if (simple_command(mysql, COM_TABLE_DUMP, buf, p - buf + table_len, 1))
- die("Error sending the table dump command");
-
- for (;;)
- {
- uint packet_len = my_net_read(net);
- if (packet_len == 0) break; // end of file
- if (packet_len == packet_error)
- die("Error reading packet in table dump");
- my_fwrite(result_file, (byte*)net->read_pos, packet_len, MYF(MY_WME));
- fflush(result_file);
- }
-}
-
static int check_master_version(MYSQL* mysql)
{
MYSQL_RES* res = 0;
@@ -516,7 +483,7 @@ int main(int argc, char** argv)
MY_INIT(argv[0]);
parse_args(&argc, (char***)&argv);
- if (!argc && !table)
+ if (!argc)
{
usage();
return -1;
@@ -525,22 +492,9 @@ int main(int argc, char** argv)
if (use_remote)
mysql = safe_connect();
- if (table)
- {
- if (!use_remote)
- die("You must specify connection parameter to get table dump");
- char* db = (char*) table;
- char* tbl = (char*) strchr(table, '.');
- if (!tbl)
- die("You must use database.table syntax to specify the table");
- *tbl++ = 0;
- dump_remote_table(&mysql->net, db, tbl);
- }
- else
- {
- while (--argc >= 0)
- dump_log_entries(*(argv++));
- }
+ while (--argc >= 0)
+ dump_log_entries(*(argv++));
+
if (result_file != stdout)
my_fclose(result_file, MYF(0));
if (use_remote)