~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2009-01-28 19:37:25 UTC
  • mfrom: (779.3.11 devel)
  • Revision ID: brian@tangent.org-20090128193725-pz7g7dnp2dx0863e
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
553
553
  protocol= &protocol_text;                     // Default protocol
554
554
  protocol_text.init(this);
555
555
 
556
 
  const Query_id& query_id= Query_id::get_query_id();
 
556
  const Query_id& local_query_id= Query_id::get_query_id();
557
557
  tablespace_op= false;
558
558
  tmp= sql_rnd();
559
 
  randominit(&rand, tmp + (ulong) &rand, tmp + query_id.value());
 
559
  randominit(&rand, tmp + (ulong) &rand, tmp + local_query_id.value());
560
560
  substitute_null_with_insert_id = false;
561
561
  thr_lock_info_init(&lock_info); /* safety: will be reset after start */
562
562
  thr_lock_owner_init(&main_lock_id, &lock_info);
2496
2496
 
2497
2497
  @param session                Thread handle
2498
2498
  @param errcode        Error code to print to console
2499
 
  @param lock           1 if we have have to lock LOCK_thread_count
 
2499
  @param should_lock 1 if we have have to lock LOCK_thread_count
2500
2500
 
2501
2501
  @note
2502
2502
    For the connection that is doing shutdown, this is called twice
2503
2503
*/
2504
 
void Session::close_connection(uint32_t errcode, bool lock)
 
2504
void Session::close_connection(uint32_t errcode, bool should_lock)
2505
2505
{
2506
2506
  st_vio *vio;
2507
 
  if (lock)
 
2507
  if (should_lock)
2508
2508
    (void) pthread_mutex_lock(&LOCK_thread_count);
2509
2509
  killed= Session::KILL_CONNECTION;
2510
2510
  if ((vio= net.vio) != 0)
2513
2513
      net_send_error(this, errcode, ER(errcode)); /* purecov: inspected */
2514
2514
    net_close(&net);            /* vio is freed in delete session */
2515
2515
  }
2516
 
  if (lock)
 
2516
  if (should_lock)
2517
2517
    (void) pthread_mutex_unlock(&LOCK_thread_count);
2518
2518
}
2519
2519