From 8f7418ffaffb763e435b29eee5707c66d5615e73 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 8 Jul 2013 15:34:41 -0300 Subject: Cygwin Fix for the Hercules SQL Update Check Also modified the output (i think its sightly improved), also added a console command to skip updates so no need to go add the query yourself 'sql update skip ' Signed-off-by: shennetsind --- src/common/console.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/common/console.c') diff --git a/src/common/console.c b/src/common/console.c index a9ea0386f..66f8d914a 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -17,6 +17,7 @@ #include "../common/mutex.h" #include "../common/timer.h" #include "../common/strlib.h" + #include "../common/sql.h" #endif #include @@ -106,6 +107,13 @@ CPCMD(malloc_usage) { unsigned int val = (unsigned int)iMalloc->usage(); ShowInfo("malloc_usage: %.2f MB\n",(double)(val)/1024); } +CPCMD(skip) { + if( !line ) { + ShowDebug("usage example: sql update skip 2013-02-14--16-15.sql\n"); + return; + } + Sql_HerculesUpdateSkip(console->SQL, line); +} #define CP_DEF_C(x) { #x , NULL , NULL, NULL } #define CP_DEF_C2(x,y) { #x , NULL , #y, NULL } #define CP_DEF_S(x,y) { #x , console_parse_ ## x , #y, NULL } @@ -123,6 +131,9 @@ void console_load_defaults(void) { CP_DEF_S(mem_report,server), CP_DEF_S(malloc_usage,server), CP_DEF_S(exit,server), + CP_DEF_C(sql), + CP_DEF_C2(update,sql), + CP_DEF_S(skip,update), }; unsigned int i, len = ARRAYLENGTH(default_list); struct CParseEntry *cmd; @@ -375,6 +386,9 @@ void console_parse_init(void) { iTimer->add_timer_interval(iTimer->gettick() + 1000, console->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ } +void console_setSQL(Sql *SQL) { + console->SQL = SQL; +} #endif /* CONSOLE_INPUT */ void console_init (void) { @@ -413,5 +427,7 @@ void console_defaults(void) { console->load_defaults = console_load_defaults; console->parse_list_subs = console_parse_list_subs; console->addCommand = console_parse_create; + console->setSQL = console_setSQL; + console->SQL = NULL; #endif } -- cgit v1.2.3-60-g2f50