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

Method reset_for_next_command

sql/sql_parse.cc:929–967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

927}
928
929void THD::reset_for_next_command()
930{
931 // TODO: Why on earth is this here?! We should probably fix this
932 // function and move it to the proper file. /Matz
933 THD *thd= this;
934 DBUG_ENTER("mysql_reset_thd_for_next_command");
935 DBUG_ASSERT(! thd->in_sub_stmt);
936 thd->free_list= 0;
937 thd->select_number= 1;
938 /*
939 Those two lines below are theoretically unneeded as
940 THD::cleanup_after_query() should take care of this already.
941 */
942 thd->auto_inc_intervals_in_cur_stmt_for_binlog.empty();
943 thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0;
944
945 thd->query_start_used= thd->query_start_usec_used= 0;
946 thd->is_fatal_error= thd->time_zone_used= 0;
947 /*
948 Clear the status flag that are expected to be cleared at the
949 beginning of each SQL statement.
950 */
951 thd->server_status&= ~SERVER_STATUS_CLEAR_SET;
952
953 DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx);
954 thd->thread_specific_used= FALSE;
955
956 thd->clear_error();
957 thd->get_stmt_da()->reset_diagnostics_area();
958 thd->get_stmt_da()->reset_for_next_command();
959 thd->rand_used= 0;
960
961 thd->clear_slow_extended();
962
963 thd->commit_error= THD::CE_NONE;
964 thd->durability_property= HA_REGULAR_DURABILITY;
965
966 DBUG_VOID_RETURN;
967}
968
969
970/**

Callers 1

Calls 5

clear_errorMethod · 0.80
get_stmt_daMethod · 0.80
clear_slow_extendedMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected