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

Method abort_result_set

sql/sql_delete.cc:1492–1562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1490
1491
1492void multi_delete::abort_result_set()
1493{
1494 TABLE_LIST *cur_table;
1495 DBUG_ENTER("multi_delete::abort_result_set");
1496
1497 /****************************************************************************
1498
1499 NOTE: if you change here be aware that almost the same code is in
1500 multi_delete::send_eof().
1501
1502 ***************************************************************************/
1503
1504 /* the error was handled or nothing deleted and no side effects return */
1505 if (error_handled ||
1506 (!thd->transaction->stmt.modified_non_trans_table && !deleted))
1507 DBUG_VOID_RETURN;
1508
1509 /* Something already deleted so we have to invalidate cache */
1510 if (deleted)
1511 query_cache_invalidate3(thd, delete_tables, 1);
1512
1513 if (thd->transaction->stmt.modified_non_trans_table)
1514 thd->transaction->all.modified_non_trans_table= TRUE;
1515 thd->transaction->all.m_unsafe_rollback_flags|=
1516 (thd->transaction->stmt.m_unsafe_rollback_flags & THD_TRANS::DID_WAIT);
1517
1518 /*
1519 If rows from the first table only has been deleted and it is
1520 transactional, just do rollback.
1521 The same if all tables are transactional, regardless of where we are.
1522 In all other cases do attempt deletes ...
1523 */
1524 if (do_delete && normal_tables &&
1525 (table_being_deleted != delete_tables ||
1526 !table_being_deleted->table->file->has_transactions_and_rollback()))
1527 {
1528 /*
1529 We have to execute the recorded do_deletes() and write info into the
1530 error log
1531 */
1532 error= 1;
1533 send_eof();
1534 DBUG_ASSERT(error_handled);
1535 DBUG_VOID_RETURN;
1536 }
1537
1538 if (thd->transaction->stmt.modified_non_trans_table ||
1539 thd->log_current_statement())
1540 {
1541 /*
1542 there is only side effects; to binlog with the error
1543 */
1544 if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open())
1545 {
1546 StatementBinlog stmt_binlog(thd, thd->binlog_need_stmt_format(transactional_tables));
1547 int errcode= query_error_code(thd, thd->killed == NOT_KILLED);
1548 /* possible error of writing binary log is ignored deliberately */
1549 (void) thd->binlog_query(THD::ROW_QUERY_TYPE,

Callers 1

execute_innerMethod · 0.45

Calls 9

query_error_codeFunction · 0.85
log_current_statementMethod · 0.80
binlog_queryMethod · 0.80
query_lengthMethod · 0.80
mark_as_not_binloggedMethod · 0.80
is_openMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected