forked from MariaDB/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
180 changed files
with
10,539 additions
and
2,460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#include <my_global.h> | ||
#include <m_string.h> | ||
#include <my_sys.h> | ||
#include <my_pthread.h> | ||
#ifdef HAVE_PWD_H | ||
#include <pwd.h> | ||
#endif | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
|
||
void my_exit(int c) | ||
{ | ||
my_end(0); | ||
exit(c); | ||
} | ||
|
||
void do_usage() | ||
{ | ||
printf("Usage:\n" | ||
" %s <user> log <filename>\n" | ||
" %s <user> exec <command> <args>\n", | ||
my_progname, my_progname); | ||
my_exit(1); | ||
} | ||
|
||
void do_log(const char *logfile) | ||
{ | ||
FILE *f; | ||
uchar buf[4096]; | ||
int size; | ||
|
||
if (!logfile) | ||
do_usage(); | ||
|
||
f= my_fopen(logfile, O_WRONLY|O_APPEND|O_CREAT, MYF(MY_WME)); | ||
if (!f) | ||
my_exit(1); | ||
|
||
while ((size= my_fread(stdin, buf, sizeof(buf), MYF(MY_WME))) > 0) | ||
if ((int)my_fwrite(f, buf, size, MYF(MY_WME)) != size) | ||
my_exit(1); | ||
|
||
my_fclose(f, MYF(0)); | ||
my_exit(0); | ||
} | ||
|
||
void do_exec(char *args[]) | ||
{ | ||
if (!args[0]) | ||
do_usage(); | ||
|
||
my_end(0); | ||
execvp(args[0], args); | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
struct passwd *user_info; | ||
MY_INIT(argv[0]); | ||
|
||
if (argc < 3) | ||
do_usage(argv[0]); | ||
|
||
user_info= my_check_user(argv[1], MYF(0)); | ||
if (user_info ? my_set_user(argv[1], user_info, MYF(MY_WME)) | ||
: my_errno == EINVAL) | ||
my_exit(1); | ||
|
||
if (strcmp(argv[2], "log") == 0) | ||
do_log(argv[3]); | ||
|
||
if (strcmp(argv[2], "exec") == 0) | ||
do_exec(argv+3); | ||
|
||
my_end(0); | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
set @event_scheduler_save= @@global.event_scheduler; | ||
set @slow_query_log_save= @@global.slow_query_log; | ||
set global event_scheduler= on; | ||
set global slow_query_log= on; | ||
set global long_query_time=0.2; | ||
create table t1 (i int); | ||
insert into t1 values (0); | ||
create event ev on schedule at CURRENT_TIMESTAMP + INTERVAL 1 second do update t1 set i=1+sleep(0.5); | ||
FOUND /update t1 set i=1/ in mysqld-slow.log | ||
drop table t1; | ||
set global event_scheduler= @event_scheduler_save; | ||
set global slow_query_log= @slow_query_log_save; | ||
set global long_query_time= @@session.long_query_time; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.