MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / THD

Method THD

sql/sql_class.cc:447–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445
446
447THD::THD(bool enable_plugins)
448 :Statement(&main_lex, &main_mem_root, STMT_CONVENTIONAL_EXECUTION,
449 /* statement id */ 0),
450 in_sub_stmt(0),
451 fill_status_recursion_level(0),
452 order_deterministic(false),
453 table_map_for_update(0),
454 arg_of_last_insert_id_function(FALSE),
455 first_successful_insert_id_in_prev_stmt(0),
456 first_successful_insert_id_in_prev_stmt_for_binlog(0),
457 first_successful_insert_id_in_cur_stmt(0),
458 stmt_depends_on_first_successful_insert_id_in_prev_stmt(FALSE),
459 m_statement_psi(NULL),
460 m_idle_psi(NULL),
461 m_server_idle(false),
462 is_fatal_error(0),
463 transaction_rollback_request(0),
464 is_fatal_sub_stmt_error(0),
465 rand_used(0),
466 time_zone_used(0),
467 in_lock_tables(0),
468 bootstrap(0),
469 derived_tables_processing(FALSE),
470 m_parser_state(NULL),
471#if defined(ENABLED_DEBUG_SYNC)
472 debug_sync_control(0),
473#endif /* defined(ENABLED_DEBUG_SYNC) */
474 m_enable_plugins(enable_plugins),
475 main_da(0, false),
476 m_stmt_da(&main_da)
477{
478 ulong tmp;
479
480 /*
481 Pass nominal parameters to init_alloc_root only to ensure that
482 the destructor works OK in case of an error. The main_mem_root
483 will be re-initialized in init_for_queries().
484 */
485 init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
486 stmt_arena= this;
487 thread_stack= 0;
488 skip_wait_timeout= false;
489 extra_port= 0;
490 catalog= (char*)"std"; // the only catalog we have for now
491 main_security_ctx.init();
492 security_ctx= &main_security_ctx;
493 no_errors= 0;
494 password= 0;
495 query_start_used= query_start_usec_used= 0;
496 killed= NOT_KILLED;
497 col_access=0;
498 is_slave_error= thread_specific_used= FALSE;
499 tmp_table=0;
500 cuted_fields= 0L;
501 limit_found_rows= 0;
502 m_row_count_func= -1;
503 statement_id_counter= 0UL;
504 // Must be reset to handle error with THD's created for init of mysqld

Callers

nothing calls this directly

Calls 5

init_sql_allocFunction · 0.85
sql_rnd_with_mutexFunction · 0.85
randominitFunction · 0.85
thr_lock_info_initFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected