MySQL 8.0.31
Source Code Documentation
transaction.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef TRANSACTION_H
24#define TRANSACTION_H
25
26#include <sys/types.h>
27
28#include "lex_string.h"
29#include "my_inttypes.h" // IWYU pragma: keep
30
31class THD;
32
33bool trans_check_state(THD *thd);
35void trans_track_end_trx(THD *thd);
36
37bool trans_begin(THD *thd, uint flags = 0);
38bool trans_commit(THD *thd, bool ignore_global_read_lock = false);
39bool trans_commit_implicit(THD *thd, bool ignore_global_read_lock = false);
40bool trans_rollback(THD *thd);
42
43bool trans_commit_stmt(THD *thd, bool ignore_global_read_lock = false);
44bool trans_rollback_stmt(THD *thd);
46
50
51#endif /* TRANSACTION_H */
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:922
static int flags[50]
Definition: hp_test1.cc:39
Some integer typedefs for easier portability.
case opt name
Definition: sslopt-case.h:32
Definition: mysql_lex_string.h:34
bool trans_rollback(THD *thd)
Rollback the current transaction, canceling its changes.
Definition: transaction.cc:394
void trans_track_end_trx(THD *thd)
Helper: Tell tracker (if any) that transaction ended.
Definition: transaction.cc:62
void trans_reset_one_shot_chistics(THD *thd)
Helper: transaction ended, SET TRANSACTION one-shot variables revert to session values.
Definition: transaction.cc:71
bool trans_check_state(THD *thd)
Check if we have a condition where the transaction state must not be changed (committed or rolled bac...
Definition: transaction.cc:92
bool trans_rollback_stmt(THD *thd)
Rollback the single statement transaction.
Definition: transaction.cc:558
bool trans_commit_attachable(THD *thd)
Commit the attachable transaction.
Definition: transaction.cc:637
bool trans_commit_stmt(THD *thd, bool ignore_global_read_lock=false)
Commit the single statement transaction.
Definition: transaction.cc:512
bool trans_rollback_implicit(THD *thd)
Implicitly rollback the current transaction, typically after deadlock was discovered.
Definition: transaction.cc:449
bool trans_commit_implicit(THD *thd, bool ignore_global_read_lock=false)
Implicitly commit the current transaction.
Definition: transaction.cc:318
bool trans_release_savepoint(THD *thd, LEX_STRING name)
Remove the named savepoint from the set of savepoints of the current transaction.
Definition: transaction.cc:833
bool trans_commit(THD *thd, bool ignore_global_read_lock=false)
Commit the current transaction, making its changes permanent.
Definition: transaction.cc:232
bool trans_savepoint(THD *thd, LEX_STRING name)
Set a named transaction savepoint.
Definition: transaction.cc:689
bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name)
Rollback a transaction to the named savepoint.
Definition: transaction.cc:765
bool trans_begin(THD *thd, uint flags=0)
Begin a new transaction.
Definition: transaction.cc:124
unsigned int uint
Definition: uca-dump.cc:29