~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_connect.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
*/
77
77
 
78
78
int
79
 
check_user(THD *thd, const char *passwd,
 
79
check_user(Session *thd, const char *passwd,
80
80
           uint32_t passwd_len, const char *db,
81
81
           bool check_count)
82
82
{
161
161
  free((char*) uc);
162
162
}
163
163
 
164
 
void thd_init_client_charset(THD *thd, uint32_t cs_number)
 
164
void thd_init_client_charset(Session *thd, uint32_t cs_number)
165
165
{
166
166
  /*
167
167
   Use server character set and collation if
218
218
   > 0  error code (not sent to user)
219
219
*/
220
220
 
221
 
static int check_connection(THD *thd)
 
221
static int check_connection(Session *thd)
222
222
{
223
223
  NET *net= &thd->net;
224
224
  uint32_t pkt_len= 0;
394
394
        In this case we will close the connection and increment status
395
395
*/
396
396
 
397
 
bool setup_connection_thread_globals(THD *thd)
 
397
bool setup_connection_thread_globals(Session *thd)
398
398
{
399
399
  if (thd->store_globals())
400
400
  {
423
423
*/
424
424
 
425
425
 
426
 
bool login_connection(THD *thd)
 
426
bool login_connection(Session *thd)
427
427
{
428
428
  NET *net= &thd->net;
429
429
  int error;
456
456
    This mainly updates status variables
457
457
*/
458
458
 
459
 
void end_connection(THD *thd)
 
459
void end_connection(Session *thd)
460
460
{
461
461
  NET *net= &thd->net;
462
462
  plugin_thdvar_cleanup(thd);
484
484
 
485
485
 
486
486
/*
487
 
  Initialize THD to handle queries
 
487
  Initialize Session to handle queries
488
488
*/
489
489
 
490
 
void prepare_new_connection_state(THD* thd)
 
490
void prepare_new_connection_state(Session* thd)
491
491
{
492
492
  Security_context *sctx= thd->security_ctx;
493
493
 
513
513
    execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect);
514
514
    if (thd->is_error())
515
515
    {
516
 
      thd->killed= THD::KILL_CONNECTION;
 
516
      thd->killed= Session::KILL_CONNECTION;
517
517
      sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
518
518
                        thd->thread_id,(thd->db ? thd->db : "unconnected"),
519
519
                        sctx->user ? sctx->user : "unauthenticated",
532
532
 
533
533
  SYNOPSIS
534
534
    handle_one_connection()
535
 
    arg         Connection object (THD)
 
535
    arg         Connection object (Session)
536
536
 
537
537
  IMPLEMENTATION
538
538
    This function (normally) does the following:
539
539
    - Initialize thread
540
 
    - Initialize THD to be used with this thread
 
540
    - Initialize Session to be used with this thread
541
541
    - Authenticate user
542
542
    - Execute all queries sent on the connection
543
543
    - Take connection down
546
546
 
547
547
pthread_handler_t handle_one_connection(void *arg)
548
548
{
549
 
  THD *thd= (THD*) arg;
 
549
  Session *thd= (Session*) arg;
550
550
  uint32_t launch_time= (uint32_t) ((thd->thr_create_utime= my_micro_time()) -
551
551
                              thd->connect_utime);
552
552
 
582
582
    prepare_new_connection_state(thd);
583
583
 
584
584
    while (!net->error && net->vio != 0 &&
585
 
           !(thd->killed == THD::KILL_CONNECTION))
 
585
           !(thd->killed == Session::KILL_CONNECTION))
586
586
    {
587
587
      if (do_command(thd))
588
588
        break;