~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_class.cc

  • Committer: Monty Taylor
  • Date: 2008-09-15 00:46:33 UTC
  • mfrom: (383.1.55 client-split)
  • Revision ID: monty@inaugust.com-20080915004633-fmjw27fi41cxs35w
Merged from client-split.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <mysys/thr_alarm.h>
29
29
#include <mysys/mysys_err.h>
30
30
#include <drizzled/drizzled_error_messages.h>
31
 
#include <vio/violite.h>
32
31
 
33
32
/*
34
33
  The following is used to initialise Table_ident with a internal
474
473
  peer_port= 0;                                 // For SHOW PROCESSLIST
475
474
  transaction.m_pending_rows_event= 0;
476
475
  transaction.on= 1;
477
 
#ifdef SIGNAL_WITH_VIO_CLOSE
478
 
  active_vio = 0;
479
 
#endif
480
476
  pthread_mutex_init(&LOCK_delete, MY_MUTEX_INIT_FAST);
481
477
 
482
478
  /* Variables with default values */
704
700
  /* Close connection */
705
701
  if (net.vio)
706
702
  {
707
 
    vio_delete(net.vio);
 
703
    net_close(&net);
708
704
    net_end(&net);
709
705
  }
710
706
  if (!cleanup_done)
793
789
    thr_alarm_kill(thread_id);
794
790
    if (!slave_thread)
795
791
      thread_scheduler.post_kill_notification(this);
796
 
#ifdef SIGNAL_WITH_VIO_CLOSE
797
 
    if (this != current_thd)
798
 
    {
799
 
      /*
800
 
        In addition to a signal, let's close the socket of the thread that
801
 
        is being killed. This is to make sure it does not block if the
802
 
        signal is lost. This needs to be done only on platforms where
803
 
        signals are not a reliable interruption mechanism.
804
 
 
805
 
        If we're killing ourselves, we know that we're not blocked, so this
806
 
        hack is not used.
807
 
      */
808
 
 
809
 
      close_active_vio();
810
 
    }
811
 
#endif    
812
792
  }
813
793
  if (mysys_var)
814
794
  {
1159
1139
                              Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF));
1160
1140
}
1161
1141
 
1162
 
#ifdef SIGNAL_WITH_VIO_CLOSE
1163
 
void THD::close_active_vio()
1164
 
{
1165
 
  safe_mutex_assert_owner(&LOCK_delete); 
1166
 
  if (active_vio)
1167
 
  {
1168
 
    vio_close(active_vio);
1169
 
    active_vio = 0;
1170
 
  }
1171
 
  return;
1172
 
}
1173
 
#endif
1174
 
 
1175
1142
 
1176
1143
struct Item_change_record: public ilink
1177
1144
{
1234
1201
}
1235
1202
 
1236
1203
 
1237
 
/**
1238
 
  Check that the endpoint is still available.
1239
 
*/
1240
 
 
1241
 
bool THD::vio_is_connected()
1242
 
{
1243
 
  uint bytes= 0;
1244
 
 
1245
 
  /* End of input is signaled by poll if the socket is aborted. */
1246
 
  if (vio_poll_read(net.vio, 0))
1247
 
    return true;
1248
 
 
1249
 
  /* Socket is aborted if signaled but no data is available. */
1250
 
  if (vio_peek_read(net.vio, &bytes))
1251
 
    return true;
1252
 
 
1253
 
  return bytes ? true : false;
1254
 
}
1255
 
 
1256
 
 
1257
1204
/*****************************************************************************
1258
1205
** Functions to provide a interface to select results
1259
1206
*****************************************************************************/