summaryrefslogtreecommitdiff
path: root/client/mysqlcheck.c
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-10-23 00:20:44 +0400
committerAlexander Nozdrin <alik@sun.com>2009-10-23 00:20:44 +0400
commit20eac04d7c43624cfd46a6a1b71d05342dc00481 (patch)
tree1d206a9ce7243a176e9558896ec0d8e377333eeb /client/mysqlcheck.c
parentc15f970dc87b076279c27c7a0c9a592fa4e7b72e (diff)
parent75116feb4b8976df3078f288f31fec7f46462461 (diff)
downloadmariadb-git-20eac04d7c43624cfd46a6a1b71d05342dc00481.tar.gz
Automerge from mysql-next-mr.
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r--client/mysqlcheck.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index e4561066f9d..1affea1d189 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -655,6 +655,17 @@ static int use_db(char *database)
return 0;
} /* use_db */
+static int disable_binlog()
+{
+ const char *stmt= "SET SQL_LOG_BIN=0";
+ if (mysql_query(sock, stmt))
+ {
+ fprintf(stderr, "Failed to %s\n", stmt);
+ fprintf(stderr, "Error: %s\n", mysql_error(sock));
+ return 1;
+ }
+ return 0;
+}
static int handle_request_for_tables(char *tables, uint length)
{
@@ -846,6 +857,14 @@ int main(int argc, char **argv)
if (dbConnect(current_host, current_user, opt_password))
exit(EX_MYSQLERR);
+ if (!opt_write_binlog)
+ {
+ if (disable_binlog()) {
+ first_error= 1;
+ goto end;
+ }
+ }
+
if (opt_auto_repair &&
my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64))
{