~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_class.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:
25
25
**
26
26
*****************************************************************************/
27
27
#include <drizzled/server_includes.h>
28
 
#include <drizzled/rpl_rli.h>
29
 
#include <drizzled/rpl_record.h>
 
28
#include <drizzled/replication/rli.h>
 
29
#include <drizzled/replication/record.h>
30
30
#include <drizzled/log_event.h>
31
31
#include <sys/stat.h>
32
32
#include <mysys/thr_alarm.h>
259
259
extern "C" int mysql_tmpfile(const char *prefix)
260
260
{
261
261
  char filename[FN_REFLEN];
262
 
  File fd = create_temp_file(filename, mysql_tmpdir, prefix,
 
262
  File fd = create_temp_file(filename, drizzle_tmpdir, prefix,
263
263
                             O_CREAT | O_EXCL | O_RDWR,
264
264
                             MYF(MY_WME));
265
265
  if (fd >= 0) {
2854
2854
  elements++;
2855
2855
  return(0);
2856
2856
}
 
2857
 
 
2858
/**
 
2859
  Close a connection.
 
2860
 
 
2861
  @param session                Thread handle
 
2862
  @param errcode        Error code to print to console
 
2863
  @param lock           1 if we have have to lock LOCK_thread_count
 
2864
 
 
2865
  @note
 
2866
    For the connection that is doing shutdown, this is called twice
 
2867
*/
 
2868
void close_connection(Session *session, uint32_t errcode, bool lock)
 
2869
{
 
2870
  st_vio *vio;
 
2871
  if (lock)
 
2872
    (void) pthread_mutex_lock(&LOCK_thread_count);
 
2873
  session->killed= Session::KILL_CONNECTION;
 
2874
  if ((vio= session->net.vio) != 0)
 
2875
  {
 
2876
    if (errcode)
 
2877
      net_send_error(session, errcode, ER(errcode)); /* purecov: inspected */
 
2878
    net_close(&(session->net));         /* vio is freed in delete session */
 
2879
  }
 
2880
  if (lock)
 
2881
    (void) pthread_mutex_unlock(&LOCK_thread_count);
 
2882
  return;;
 
2883
}