MySQL 9.1.0
Source Code Documentation
transaction.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef TRANSACTION_H
25#define TRANSACTION_H
26
27#include <sys/types.h>
28
29#include "lex_string.h"
30#include "my_inttypes.h" // IWYU pragma: keep
31
32class THD;
33
34bool trans_check_state(THD *thd);
36void trans_track_end_trx(THD *thd);
37
38bool trans_begin(THD *thd, uint flags = 0);
39bool trans_commit(THD *thd, bool ignore_global_read_lock = false);
40bool trans_commit_implicit(THD *thd, bool ignore_global_read_lock = false);
41bool trans_rollback(THD *thd);
43
44bool trans_commit_stmt(THD *thd, bool ignore_global_read_lock = false);
45bool trans_rollback_stmt(THD *thd);
47
51
52#endif /* TRANSACTION_H */
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
static int flags[50]
Definition: hp_test1.cc:40
Some integer typedefs for easier portability.
case opt name
Definition: sslopt-case.h:29
Definition: mysql_lex_string.h:35
bool trans_rollback(THD *thd)
Rollback the current transaction, canceling its changes.
Definition: transaction.cc:395
void trans_track_end_trx(THD *thd)
Helper: Tell tracker (if any) that transaction ended.
Definition: transaction.cc:63
void trans_reset_one_shot_chistics(THD *thd)
Helper: transaction ended, SET TRANSACTION one-shot variables revert to session values.
Definition: transaction.cc:72
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:93
bool trans_rollback_stmt(THD *thd)
Rollback the single statement transaction.
Definition: transaction.cc:559
bool trans_commit_attachable(THD *thd)
Commit the attachable transaction.
Definition: transaction.cc:638
bool trans_commit_stmt(THD *thd, bool ignore_global_read_lock=false)
Commit the single statement transaction.
Definition: transaction.cc:513
bool trans_rollback_implicit(THD *thd)
Implicitly rollback the current transaction, typically after deadlock was discovered.
Definition: transaction.cc:450
bool trans_commit_implicit(THD *thd, bool ignore_global_read_lock=false)
Implicitly commit the current transaction.
Definition: transaction.cc:319
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:834
bool trans_commit(THD *thd, bool ignore_global_read_lock=false)
Commit the current transaction, making its changes permanent.
Definition: transaction.cc:233
bool trans_savepoint(THD *thd, LEX_STRING name)
Set a named transaction savepoint.
Definition: transaction.cc:690
bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name)
Rollback a transaction to the named savepoint.
Definition: transaction.cc:766
bool trans_begin(THD *thd, uint flags=0)
Begin a new transaction.
Definition: transaction.cc:125