~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2010-11-08 20:00:45 UTC
  • mto: (1921.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1916.
  • Revision ID: brian@tangent.org-20101108200045-wgysfvli5mtduszd
EnapsulateĀ Kill.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
  first_successful_insert_id_in_cur_stmt(0),
172
172
  limit_found_rows(0),
173
173
  _global_read_lock(NONE),
 
174
  _killed(NOT_KILLED),
174
175
  some_tables_deleted(false),
175
176
  no_errors(false),
176
177
  password(false),
197
198
  memory::init_sql_alloc(&main_mem_root, memory::ROOT_MIN_BLOCK_SIZE, 0);
198
199
  thread_stack= NULL;
199
200
  count_cuted_fields= CHECK_FIELD_ERROR_FOR_NULL;
200
 
  killed= NOT_KILLED;
201
201
  col_access= 0;
202
202
  tmp_table= 0;
203
203
  used_tables= 0;
332
332
{
333
333
  assert(cleanup_done == false);
334
334
 
335
 
  killed= KILL_CONNECTION;
 
335
  setKilled(KILL_CONNECTION);
336
336
#ifdef ENABLE_WHEN_BINLOG_WILL_BE_ABLE_TO_PREPARE
337
337
  if (transaction.xid_state.xa_state == XA_PREPARED)
338
338
  {
410
410
  LOCK_delete.unlock();
411
411
}
412
412
 
413
 
void Session::awake(Session::killed_state state_to_set)
 
413
void Session::awake(Session::killed_state_t state_to_set)
414
414
{
415
415
  this->checkSentry();
416
416
  safe_mutex_assert_owner(&LOCK_delete);
417
417
 
418
 
  killed= state_to_set;
 
418
  setKilled(state_to_set);
419
419
  if (state_to_set != Session::KILL_QUERY)
420
420
  {
421
421
    scheduler->killSession(this);
533
533
 
534
534
  prepareForQueries();
535
535
 
536
 
  while (! client->haveError() && killed != KILL_CONNECTION)
 
536
  while (not client->haveError() && getKilled() != KILL_CONNECTION)
537
537
  {
538
 
    if (! executeStatement())
 
538
    if (not executeStatement())
539
539
      break;
540
540
  }
541
541
 
577
577
    DRIZZLE_CONNECTION_START(thread_id);
578
578
    char error_message_buff[DRIZZLE_ERRMSG_SIZE];
579
579
 
580
 
    killed= Session::KILL_CONNECTION;
 
580
    setKilled(Session::KILL_CONNECTION);
581
581
 
582
582
    status_var.aborted_connects++;
583
583
 
678
678
  if (client->readCommand(&l_packet, &packet_length) == false)
679
679
    return false;
680
680
 
681
 
  if (killed == KILL_CONNECTION)
 
681
  if (getKilled() == KILL_CONNECTION)
682
682
    return false;
683
683
 
684
684
  if (packet_length == 0)
764
764
  }
765
765
 
766
766
  if (result == false)
 
767
  {
767
768
    my_error(killed_errno(), MYF(0));
 
769
  }
768
770
  else if ((result == true) && do_release)
769
 
    killed= Session::KILL_CONNECTION;
 
771
  {
 
772
    setKilled(Session::KILL_CONNECTION);
 
773
  }
770
774
 
771
775
  return result;
772
776
}
1608
1612
  plugin_sessionvar_cleanup(this);
1609
1613
 
1610
1614
  /* If necessary, log any aborted or unauthorized connections */
1611
 
  if (killed || client->wasAborted())
 
1615
  if (getKilled() || client->wasAborted())
1612
1616
  {
1613
1617
    status_var.aborted_threads++;
1614
1618
  }
1615
1619
 
1616
1620
  if (client->wasAborted())
1617
1621
  {
1618
 
    if (! killed && variables.log_warnings > 1)
 
1622
    if (not getKilled() && variables.log_warnings > 1)
1619
1623
    {
1620
1624
      SecurityContext *sctx= &security_ctx;
1621
1625
 
1631
1635
  /* Close out our connection to the client */
1632
1636
  if (should_lock)
1633
1637
    LOCK_thread_count.lock();
1634
 
  killed= Session::KILL_CONNECTION;
 
1638
 
 
1639
  setKilled(Session::KILL_CONNECTION);
 
1640
 
1635
1641
  if (client->isConnected())
1636
1642
  {
1637
1643
    if (errcode)
1641
1647
    }
1642
1648
    client->close();
1643
1649
  }
 
1650
 
1644
1651
  if (should_lock)
 
1652
  {
1645
1653
    (void) LOCK_thread_count.unlock();
 
1654
  }
1646
1655
}
1647
1656
 
1648
1657
void Session::reset_for_next_command()