MCPcopy Create free account
hub / github.com/MariaDB/server / reset_for_next_command

Method reset_for_next_command

sql/sql_parse.cc:7437–7536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7435*/
7436
7437void THD::reset_for_next_command(bool do_clear_error)
7438{
7439 DBUG_ENTER("THD::reset_for_next_command");
7440 DBUG_ASSERT(!spcont); /* not for substatements of routines */
7441 DBUG_ASSERT(!in_sub_stmt);
7442 /*
7443 Table maps should have been reset after previous statement except in the
7444 case where we have locked tables
7445 */
7446 DBUG_ASSERT(binlog_table_maps == 0 ||
7447 locked_tables_mode == LTM_LOCK_TABLES);
7448
7449 if (likely(do_clear_error))
7450 {
7451 clear_error(1);
7452 /*
7453 The following variable can't be reset in clear_error() as
7454 clear_error() is called during auto_repair of table
7455 */
7456 error_printed_to_log= 0;
7457 }
7458 free_list= 0;
7459 /*
7460 We also assign stmt_lex in lex_start(), but during bootstrap this
7461 code is executed first.
7462 */
7463 DBUG_ASSERT(lex == &main_lex);
7464 main_lex.stmt_lex= &main_lex; main_lex.current_select_number= 0;
7465 /*
7466 Those two lines below are theoretically unneeded as
7467 THD::cleanup_after_query() should take care of this already.
7468 */
7469 auto_inc_intervals_in_cur_stmt_for_binlog.empty();
7470 stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0;
7471
7472#ifdef WITH_WSREP
7473 /*
7474 Autoinc variables should be adjusted only for locally executed
7475 transactions. Appliers and replayers are either processing ROW
7476 events or get autoinc variable values from Query_log_event and
7477 mysql slave may be processing STATEMENT format events, but he should
7478 use autoinc values passed in binlog events, not the values forced by
7479 the cluster.
7480 */
7481 if (WSREP_NNULL(this) && wsrep_thd_is_local(this) &&
7482 !slave_thread && wsrep_auto_increment_control)
7483 {
7484 variables.auto_increment_offset=
7485 global_system_variables.auto_increment_offset;
7486 variables.auto_increment_increment=
7487 global_system_variables.auto_increment_increment;
7488 }
7489#endif /* WITH_WSREP */
7490
7491 used= 0;
7492 is_fatal_error= 0;
7493 variables.option_bits&= ~OPTION_BINLOG_THIS_STMT;
7494

Callers 15

record_gtidMethod · 0.45
gtid_delete_pendingMethod · 0.45
wsrep_apply_eventsFunction · 0.45
execute_SQLFunction · 0.45
init_stmtFunction · 0.45
executeMethod · 0.45
init_service_thdFunction · 0.45
retry_event_groupFunction · 0.45
run_sql_command_thdFunction · 0.45
executeMethod · 0.45
sql_parse.ccFile · 0.45
wsrep_mysql_parseFunction · 0.45

Calls 4

wsrep_thd_is_localFunction · 0.70
emptyMethod · 0.45
resetMethod · 0.45
is_openMethod · 0.45

Tested by

no test coverage detected