Commit e30fd503 authored by monty@donna.mysql.fi's avatar monty@donna.mysql.fi

Cleanup

parent 6261dafb
...@@ -694,7 +694,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) ...@@ -694,7 +694,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
} }
if((int)skip_lines > 0) if((int)skip_lines > 0)
fprintf(file, " IGNORE %d LINES ", skip_lines); fprintf(file, " IGNORE %ld LINES ", (long) skip_lines);
if (num_fields) if (num_fields)
{ {
......
...@@ -92,6 +92,11 @@ int deny_severity = LOG_WARNING; ...@@ -92,6 +92,11 @@ int deny_severity = LOG_WARNING;
typedef fp_except fp_except_t; typedef fp_except fp_except_t;
#endif #endif
#ifdef _AIX41
extern "C" int initgroups(const char *,int);
#endif
/* We can't handle floating point expections with threads, so disable /* We can't handle floating point expections with threads, so disable
this on freebsd this on freebsd
*/ */
...@@ -144,7 +149,7 @@ static pthread_cond_t COND_handler_count; ...@@ -144,7 +149,7 @@ static pthread_cond_t COND_handler_count;
static uint handler_count; static uint handler_count;
#endif #endif
#ifdef __WIN__ #ifdef __WIN__
static bool opt_console=0; static bool opt_console=0,start_mode=0;
#endif #endif
#ifdef HAVE_BERKELEY_DB #ifdef HAVE_BERKELEY_DB
...@@ -1945,12 +1950,24 @@ The server will not act as a slave."); ...@@ -1945,12 +1950,24 @@ The server will not act as a slave.");
sql_print_error("After lock_thread_count"); sql_print_error("After lock_thread_count");
#endif #endif
#else #else
// remove the event, because it will not be valid anymore if (Service.IsNT())
Service.SetShutdownEvent(0); {
if(hEventShutdown) CloseHandle(hEventShutdown); if(start_mode)
// if it was started as service on NT try to stop the service {
if(Service.IsNT()) if (WaitForSingleObject(hEventShutdown,INFINITE)==WAIT_OBJECT_0)
Service.Stop(); Service.Stop();
}
else
{
Service.SetShutdownEvent(0);
if(hEventShutdown) CloseHandle(hEventShutdown);
}
}
else
{
Service.SetShutdownEvent(0);
if(hEventShutdown) CloseHandle(hEventShutdown);
}
#endif #endif
/* Wait until cleanup is done */ /* Wait until cleanup is done */
...@@ -2003,6 +2020,7 @@ int main(int argc, char **argv) ...@@ -2003,6 +2020,7 @@ int main(int argc, char **argv)
else if (argc == 1) // No arguments; start as a service else if (argc == 1) // No arguments; start as a service
{ {
// init service // init service
start_mode = 1;
long tmp=Service.Init(MYSQL_SERVICENAME,mysql_service); long tmp=Service.Init(MYSQL_SERVICENAME,mysql_service);
return 0; return 0;
} }
...@@ -2477,7 +2495,7 @@ enum options { ...@@ -2477,7 +2495,7 @@ enum options {
OPT_GEMINI_SKIP, OPT_INNODB_SKIP, OPT_GEMINI_SKIP, OPT_INNODB_SKIP,
OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_TEMP_POOL, OPT_TX_ISOLATION,
OPT_GEMINI_FLUSH_LOG, OPT_GEMINI_RECOVER, OPT_GEMINI_FLUSH_LOG, OPT_GEMINI_RECOVER,
OPT_GEMINI_UNBUFFERED_IO, OPT_SKIP_SAFEMALLOC, OPT_GEMINI_UNBUFFERED_IO, OPT_SKIP_SAFEMALLOC
}; };
static struct option long_options[] = { static struct option long_options[] = {
......
...@@ -210,7 +210,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, ...@@ -210,7 +210,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
{ {
if (item->with_sum_func) if (item->with_sum_func)
flag|=1; flag|=1;
else if (!item->const_item()) else if (!(flag & 2) && !item->const_item())
flag|=2; flag|=2;
} }
if (flag == 3) if (flag == 3)
...@@ -871,7 +871,6 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, ...@@ -871,7 +871,6 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
s->join=join; s->join=join;
if ((s->on_expr=tables->on_expr)) if ((s->on_expr=tables->on_expr))
{ {
// table->maybe_null=table->outer_join=1; // Mark for send fields
if (!table->file->records) if (!table->file->records)
{ // Empty table { // Empty table
s->key_dependent=s->dependent=0; s->key_dependent=s->dependent=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment