@@ -102,9 +102,12 @@ enum commands {
102
102
ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS,
103
103
ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE,
104
104
ADMIN_START_ALL_SLAVES, ADMIN_STOP_ALL_SLAVES,
105
- ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD, ADMIN_FLUSH_SLOW_LOG,
105
+ ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD, ADMIN_FLUSH_BINARY_LOG,
106
+ ADMIN_FLUSH_ENGINE_LOG, ADMIN_FLUSH_ERROR_LOG, ADMIN_FLUSH_GENERAL_LOG,
107
+ ADMIN_FLUSH_RELAY_LOG, ADMIN_FLUSH_SLOW_LOG,
106
108
ADMIN_FLUSH_TABLE_STATISTICS, ADMIN_FLUSH_INDEX_STATISTICS,
107
109
ADMIN_FLUSH_USER_STATISTICS, ADMIN_FLUSH_CLIENT_STATISTICS,
110
+ ADMIN_FLUSH_USER_RESOURCES,
108
111
ADMIN_FLUSH_ALL_STATUS, ADMIN_FLUSH_ALL_STATISTICS
109
112
};
110
113
static const char *command_names[]= {
@@ -116,9 +119,10 @@ static const char *command_names[]= {
116
119
" ping" , " extended-status" , " flush-status" ,
117
120
" flush-privileges" , " start-slave" , " stop-slave" ,
118
121
" start-all-slaves" , " stop-all-slaves" ,
119
- " flush-threads" , " old-password" , " flush-slow-log" ,
122
+ " flush-threads" , " old-password" , " flush-binary-log" , " flush-engine-log" ,
123
+ " flush-error-log" , " flush-general-log" , " flush-relay-log" , " flush-slow-log" ,
120
124
" flush-table-statistics" , " flush-index-statistics" ,
121
- " flush-user-statistics" , " flush-client-statistics" ,
125
+ " flush-user-statistics" , " flush-client-statistics" , " flush-user-resources " ,
122
126
" flush-all-status" , " flush-all-statistics" ,
123
127
NullS
124
128
};
@@ -916,6 +920,56 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
916
920
}
917
921
break ;
918
922
}
923
+ case ADMIN_FLUSH_BINARY_LOG:
924
+ {
925
+ if (mysql_query (mysql, " flush binary logs" ))
926
+ {
927
+ my_printf_error (0 , " flush failed; error: '%s'" , error_flags,
928
+ mysql_error (mysql));
929
+ return -1 ;
930
+ }
931
+ break ;
932
+ }
933
+ case ADMIN_FLUSH_ENGINE_LOG:
934
+ {
935
+ if (mysql_query (mysql," flush engine logs" ))
936
+ {
937
+ my_printf_error (0 , " flush failed; error: '%s'" , error_flags,
938
+ mysql_error (mysql));
939
+ return -1 ;
940
+ }
941
+ break ;
942
+ }
943
+ case ADMIN_FLUSH_ERROR_LOG:
944
+ {
945
+ if (mysql_query (mysql, " flush error logs" ))
946
+ {
947
+ my_printf_error (0 , " flush failed; error: '%s'" , error_flags,
948
+ mysql_error (mysql));
949
+ return -1 ;
950
+ }
951
+ break ;
952
+ }
953
+ case ADMIN_FLUSH_GENERAL_LOG:
954
+ {
955
+ if (mysql_query (mysql, " flush general logs" ))
956
+ {
957
+ my_printf_error (0 , " flush failed; error: '%s'" , error_flags,
958
+ mysql_error (mysql));
959
+ return -1 ;
960
+ }
961
+ break ;
962
+ }
963
+ case ADMIN_FLUSH_RELAY_LOG:
964
+ {
965
+ if (mysql_query (mysql, " flush relay logs" ))
966
+ {
967
+ my_printf_error (0 , " flush failed; error: '%s'" , error_flags,
968
+ mysql_error (mysql));
969
+ return -1 ;
970
+ }
971
+ break ;
972
+ }
919
973
case ADMIN_FLUSH_SLOW_LOG:
920
974
{
921
975
if (mysql_query (mysql," flush slow logs" ))
@@ -986,6 +1040,16 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
986
1040
}
987
1041
break ;
988
1042
}
1043
+ case ADMIN_FLUSH_USER_RESOURCES:
1044
+ {
1045
+ if (mysql_query (mysql, " flush user_resources" ))
1046
+ {
1047
+ my_printf_error (0 , " flush failed; error: '%s'" , error_flags,
1048
+ mysql_error (mysql));
1049
+ return -1 ;
1050
+ }
1051
+ break ;
1052
+ }
989
1053
case ADMIN_FLUSH_CLIENT_STATISTICS:
990
1054
{
991
1055
if (mysql_query (mysql," flush client_statistics" ))
@@ -1309,12 +1373,18 @@ static void usage(void)
1309
1373
flush-index-statistics Flush index statistics\n \
1310
1374
flush-logs Flush all logs\n \
1311
1375
flush-privileges Reload grant tables (same as reload)\n \
1376
+ flush-binary-log Flush binary log\n \
1377
+ flush-engine-log Flush engine log(s)\n \
1378
+ flush-error-log Flush error log\n \
1379
+ flush-general-log Flush general log\n \
1380
+ flush-relay-log Flush relay log\n \
1312
1381
flush-slow-log Flush slow query log\n \
1313
- flush-status Clear status variables\n \
1382
+ flush-status Clear status variables\n \
1314
1383
flush-table-statistics Clear table statistics\n \
1315
1384
flush-tables Flush all tables\n \
1316
1385
flush-threads Flush the thread cache\n \
1317
1386
flush-user-statistics Flush user statistics\n \
1387
+ flush-user-resources Flush user resources\n \
1318
1388
kill id,id,... Kill mysql threads" );
1319
1389
#if MYSQL_VERSION_ID >= 32200
1320
1390
puts (" \
0 commit comments