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

Function trans_commit_implicit

sql/transaction.cc:312–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310*/
311
312bool trans_commit_implicit(THD *thd)
313{
314 bool res= FALSE;
315 DBUG_ENTER("trans_commit_implicit");
316
317 if (trans_check(thd))
318 DBUG_RETURN(TRUE);
319
320 if (thd->variables.option_bits & OPTION_GTID_BEGIN)
321 {
322 DBUG_PRINT("error", ("OPTION_GTID_BEGIN is set. "
323 "Master and slave will have different GTID values"));
324 }
325
326 if (thd->in_multi_stmt_transaction_mode() ||
327 (thd->variables.option_bits & OPTION_TABLE_LOCK))
328 {
329 PSI_stage_info org_stage;
330 thd->backup_stage(&org_stage);
331 THD_STAGE_INFO(thd, stage_commit_implicit);
332
333 /* Safety if one did "drop table" on locked tables */
334 if (!thd->locked_tables_mode)
335 thd->variables.option_bits&= ~OPTION_TABLE_LOCK;
336 thd->server_status&=
337 ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY);
338 DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS"));
339 res= MY_TEST(ha_commit_trans(thd, TRUE));
340
341 THD_STAGE_INFO(thd, org_stage);
342 }
343
344 thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_BINLOG_THIS_TRX);
345 thd->transaction->all.reset();
346
347 /* The transaction should be marked as complete in P_S. */
348 DBUG_ASSERT(thd->m_transaction_psi == NULL);
349
350 /*
351 Upon implicit commit, reset the current transaction
352 isolation level and access mode. We do not care about
353 @@session.completion_type since it's documented
354 to not have any effect on implicit commit.
355 */
356 trans_reset_one_shot_chistics(thd);
357
358 trans_track_end_trx(thd);
359
360 DBUG_RETURN(res);
361}
362
363
364/**

Callers 10

send_eofMethod · 0.85
ha_enable_transactionFunction · 0.85
sequence_insertFunction · 0.85
executeMethod · 0.85
mysql_alter_tableFunction · 0.85
sql_parse.ccFile · 0.85
sql_killFunction · 0.85
sql_kill_userFunction · 0.85

Calls 7

trans_checkFunction · 0.85
ha_commit_transFunction · 0.85
trans_track_end_trxFunction · 0.85
backup_stageMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected