~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2008-11-13 02:56:15 UTC
  • mfrom: (575.4.10 devel)
  • Revision ID: brian@tangent.org-20081113025615-snhsi52yb2ivmx6f
Merging Monty's code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
/* Basic functions needed by many modules */
18
18
#include <drizzled/server_includes.h>
19
 
#include <drizzled/sql_select.h>
20
 
#include <mysys/my_dir.h>
21
 
#include <drizzled/error.h>
22
 
#include <drizzled/gettext.h>
23
 
#include <drizzled/nested_join.h>
 
19
#include <signal.h>
24
20
 
25
21
#if TIME_WITH_SYS_TIME
26
22
# include <sys/time.h>
32
28
#  include <time.h>
33
29
# endif
34
30
#endif
 
31
#include <mysys/my_pthread.h>
 
32
 
 
33
#include <drizzled/sql_select.h>
 
34
#include <mysys/my_dir.h>
 
35
#include <drizzled/error.h>
 
36
#include <drizzled/gettext.h>
 
37
#include <drizzled/nested_join.h>
 
38
#include <drizzled/sql_base.h>
 
39
#include <drizzled/show.h>
 
40
 
35
41
 
36
42
/**
37
43
  return true if the table was created explicitly.
6208
6214
}
6209
6215
 
6210
6216
 
6211
 
bool mysql_rm_tmp_tables(void)
 
6217
bool drizzle_rm_tmp_tables(void)
6212
6218
{
6213
6219
  uint32_t i, idx;
6214
6220
  char  filePath[FN_REFLEN], *tmpdir, filePathCopy[FN_REFLEN];
6222
6228
  session->thread_stack= (char*) &session;
6223
6229
  session->store_globals();
6224
6230
 
6225
 
  for (i=0; i<=mysql_tmpdir_list.max; i++)
 
6231
  for (i=0; i<=drizzle_tmpdir_list.max; i++)
6226
6232
  {
6227
 
    tmpdir=mysql_tmpdir_list.list[i];
 
6233
    tmpdir=drizzle_tmpdir_list.list[i];
6228
6234
    /* See if the directory exists */
6229
6235
    if (!(dirp = my_dir(tmpdir,MYF(MY_WME | MY_DONT_SORT))))
6230
6236
      continue;
6467
6473
/**
6468
6474
  @} (end of group Data_Dictionary)
6469
6475
*/
 
6476
 
 
6477
void kill_drizzle(void)
 
6478
{
 
6479
 
 
6480
#if defined(SIGNALS_DONT_BREAK_READ)
 
6481
  abort_loop=1;                                 // Break connection loops
 
6482
  close_server_sock();                          // Force accept to wake up
 
6483
#endif
 
6484
 
 
6485
#if defined(HAVE_PTHREAD_KILL)
 
6486
  pthread_kill(signal_thread, SIGTERM);
 
6487
#elif !defined(SIGNALS_DONT_BREAK_READ)
 
6488
  kill(current_pid, SIGTERM);
 
6489
#endif
 
6490
  shutdown_in_progress=1;                       // Safety if kill didn't work
 
6491
#ifdef SIGNALS_DONT_BREAK_READ
 
6492
  if (!kill_in_progress)
 
6493
  {
 
6494
    pthread_t tmp;
 
6495
    abort_loop=1;
 
6496
    if (pthread_create(&tmp,&connection_attrib, kill_server_thread,
 
6497
                           (void*) 0))
 
6498
      sql_print_error(_("Can't create thread to kill server"));
 
6499
  }
 
6500
#endif
 
6501
  return;;
 
6502
}