MySQL  8.0.18
Source Code Documentation
transaction.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
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 
31 class THD;
32 
33 bool trans_check_state(THD *thd);
35 void trans_track_end_trx(THD *thd);
36 
37 bool trans_begin(THD *thd, uint flags = 0);
38 bool trans_commit(THD *thd, bool ignore_global_read_lock = false);
39 bool trans_commit_implicit(THD *thd, bool ignore_global_read_lock = false);
40 bool trans_rollback(THD *thd);
41 bool trans_rollback_implicit(THD *thd);
42 
43 bool trans_commit_stmt(THD *thd, bool ignore_global_read_lock = false);
44 bool trans_rollback_stmt(THD *thd);
45 bool trans_commit_attachable(THD *thd);
46 
50 
51 #endif /* TRANSACTION_H */
void trans_reset_one_shot_chistics(THD *thd)
Helper: transaction ended, SET TRANSACTION one-shot variables revert to session values.
Definition: transaction.cc:74
Definition: mysql_lex_string.h:34
bool trans_commit_attachable(THD *thd)
Commit the attachable transaction.
Definition: transaction.cc:636
bool trans_commit_implicit(THD *thd, bool ignore_global_read_lock=false)
Implicitly commit the current transaction.
Definition: transaction.cc:321
const string name("\ame\)
bool trans_savepoint(THD *thd, LEX_STRING name)
Set a named transaction savepoint.
Definition: transaction.cc:688
Some integer typedefs for easier portability.
bool trans_commit(THD *thd, bool ignore_global_read_lock=false)
Commit the current transaction, making its changes permanent.
Definition: transaction.cc:242
bool trans_commit_stmt(THD *thd, bool ignore_global_read_lock=false)
Commit the single statement transaction.
Definition: transaction.cc:511
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:832
bool trans_rollback(THD *thd)
Rollback the current transaction, canceling its changes.
Definition: transaction.cc:397
bool trans_begin(THD *thd, uint flags=0)
Begin a new transaction.
Definition: transaction.cc:130
unsigned int uint
Definition: uca-dump.cc:29
bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name)
Rollback a transaction to the named savepoint.
Definition: transaction.cc:764
bool trans_rollback_stmt(THD *thd)
Rollback the single statement transaction.
Definition: transaction.cc:557
void trans_track_end_trx(THD *thd)
Helper: Tell tracker (if any) that transaction ended.
Definition: transaction.cc:62
bool trans_rollback_implicit(THD *thd)
Implicitly rollback the current transaction, typically after deadlock was discovered.
Definition: transaction.cc:448
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:98
static int flags[50]
Definition: hp_test1.cc:39
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:778