~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Brian Aker
  • Date: 2009-02-09 02:50:21 UTC
  • Revision ID: brian@tangent.org-20090209025021-84e62awsk93tiuva
Fix for error when thread/whatever can not be created on connection.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2284
2284
 
2285
2285
  thread_count++;
2286
2286
 
2287
 
  thread_scheduler.add_connection(session);
 
2287
  /* 
 
2288
    If we error on creation we drop the connection and delete the session.
 
2289
  */
 
2290
  if (thread_scheduler.add_connection(session))
 
2291
  {
 
2292
    char error_message_buff[DRIZZLE_ERRMSG_SIZE];
 
2293
 
 
2294
    session->killed= Session::KILL_CONNECTION;                        // Safety
 
2295
 
 
2296
    statistic_increment(aborted_connects, &LOCK_status);
 
2297
 
 
2298
    /* Can't use my_error() since store_globals has not been called. */
 
2299
    snprintf(error_message_buff, sizeof(error_message_buff), ER(ER_CANT_CREATE_THREAD), 1); /* TODO replace will better error message */
 
2300
    net_send_error(session, ER_CANT_CREATE_THREAD, error_message_buff);
 
2301
    (void) pthread_mutex_lock(&LOCK_thread_count);
 
2302
    --connection_count;
 
2303
    session->close_connection(0, 0);
 
2304
    delete session;
 
2305
    (void) pthread_mutex_unlock(&LOCK_thread_count);
 
2306
  }
2288
2307
}
2289
2308
 
2290
2309