Merge lp:~dveeden/mysql-server/mysql-5.5-bug60878 into lp:~mysql/mysql-server/mysql-trunk

Proposed by Daniël van Eeden
Status: Needs review
Proposed branch: lp:~dveeden/mysql-server/mysql-5.5-bug60878
Merge into: lp:~mysql/mysql-server/mysql-trunk
Diff against target: 46 lines (+23/-6)
1 file modified
client/mysqladmin.cc (+23/-6)
To merge this branch: bzr merge lp:~dveeden/mysql-server/mysql-5.5-bug60878
Reviewer Review Type Date Requested Status
Oracle/MySQL Engineering Pending
Review via email: mp+57919@code.launchpad.net

Description of the change

Fix for Bug #60878
http://bugs.mysql.com/bug.php?id=60878

Adds extra argument to mysqladmin flush-logs to specify which log should be flushed.

To post a comment you must log in.
3449. By Daniël van Eeden

Adjust version, this is supported from 5.5.3 according to
the docs, not since 5.5.0.

3450. By Daniël van Eeden

Update help info

3451. By Daniël van Eeden

Merge from mysql-5.5 branch

3452. By Daniël van Eeden

Fix typo

Unmerged revisions

3452. By Daniël van Eeden

Fix typo

3451. By Daniël van Eeden

Merge from mysql-5.5 branch

3450. By Daniël van Eeden

Update help info

3449. By Daniël van Eeden

Adjust version, this is supported from 5.5.3 according to
the docs, not since 5.5.0.

3448. By Daniël van Eeden

Add specific log flushing to mysqladmin (Bug #60878)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/mysqladmin.cc'
2--- client/mysqladmin.cc 2011-02-11 14:38:34 +0000
3+++ client/mysqladmin.cc 2011-04-18 20:45:59 +0000
4@@ -869,11 +869,28 @@
5 }
6 case ADMIN_FLUSH_LOGS:
7 {
8- if (mysql_refresh(mysql,REFRESH_LOG))
9- {
10- my_printf_error(0, "refresh failed; error: '%s'", error_flags,
11- mysql_error(mysql));
12- return -1;
13+ if ((argc == 2) && ((strcasecmp(argv[1],"binary") == 0)
14+ || (strcasecmp(argv[1],"engine") == 0)
15+ || (strcasecmp(argv[1],"error") == 0)
16+ || (strcasecmp(argv[1],"general") == 0)
17+ || (strcasecmp(argv[1],"relay") == 0)
18+ || (strcasecmp(argv[1],"slow") == 0))) {
19+ char buff[42];
20+ sprintf(buff,"FLUSH /*!50503 %s */ LOGS",argv[1]);
21+ if (mysql_query(mysql,buff))
22+ {
23+ my_printf_error(0, "refresh failed; error: '%s'", error_flags,
24+ mysql_error(mysql));
25+ return -1;
26+ }
27+ argc--; argv++;
28+ } else {
29+ if (mysql_refresh(mysql,REFRESH_LOG))
30+ {
31+ my_printf_error(0, "refresh failed; error: '%s'", error_flags,
32+ mysql_error(mysql));
33+ return -1;
34+ }
35 }
36 break;
37 }
38@@ -1104,7 +1121,7 @@
39 drop databasename Delete a database and all its tables\n\
40 extended-status Gives an extended status message from the server\n\
41 flush-hosts Flush all cached hosts\n\
42- flush-logs Flush all logs\n\
43+ flush-logs logtype Flush all logs or logs of just one logtype\n\
44 flush-status Clear status variables\n\
45 flush-tables Flush all tables\n\
46 flush-threads Flush the thread cache\n\

Subscribers

People subscribed via source and target branches

to status/vote changes: