MySQL 8.0.31
Source Code Documentation
api0misc.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2008, 2022, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is also distributed with certain software (including but not
10limited to OpenSSL) that is licensed under separate terms, as designated in a
11particular file or component or in included license documentation. The authors
12of MySQL hereby grant you an additional permission to link the program and
13your derivative works with the separately licensed software that they have
14included with MySQL.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
25*****************************************************************************/
26
27/** @file include/api0misc.h
28 InnoDB Native API
29
30 3/20/2011 Jimmy Yang extracted from Embedded InnoDB
31 2008 Created by Sunny Bains
32 *******************************************************/
33
34#ifndef api0misc_h
35#define api0misc_h
36
37#include <sys/types.h>
38
39#include "handler.h"
40#include "os0file.h"
41#include "que0que.h"
42#include "trx0trx.h"
43#include "univ.i"
44
45/** Whether binlog is enabled for applications using InnoDB APIs */
46extern bool ib_binlog_enabled;
47
48/** Whether MySQL MDL is enabled for applications using InnoDB APIs */
49extern bool ib_mdl_enabled;
50
51/** Whether InnoDB row lock is disabled for applications using InnoDB APIs */
52extern bool ib_disable_row_lock;
53
54/** configure value for transaction isolation level */
55extern ulong ib_trx_level_setting;
56
57/** configure value for background commit interval (in seconds) */
58extern ulong ib_bk_commit_interval;
59
60struct ib_sdi_key {
62};
63
66};
67
68/* Handles user errors and lock waits detected by the database engine.
69@param[out] new_err possible new error encountered in lock wait, or if no
70new error, the value of trx->error_state at the entry of this function
71@param[in] trx transaction
72@param[in] thr query thread
73@param[in] savept savepoint or NULL
74@param[in] is_sdi true if table is SDI
75@return true if it was a lock wait and we should continue running
76the query thread. */
77bool ib_handle_errors(dberr_t *new_err, trx_t *trx, que_thr_t *thr,
78 trx_savept_t *savept, bool is_sdi);
79
80/*************************************************************************
81Sets a lock on a table.
82@return error code or DB_SUCCESS */
84 trx_t *trx, /*!< in/out: transaction */
85 dict_table_t *table, /*!< in: table to lock */
86 enum lock_mode mode); /*!< in: lock mode */
87
88#endif /* api0misc_h */
bool ib_disable_row_lock
Whether InnoDB row lock is disabled for applications using InnoDB APIs.
Definition: api0api.cc:72
bool ib_binlog_enabled
Whether binlog is enabled for applications using InnoDB APIs.
Definition: api0api.cc:66
dberr_t ib_trx_lock_table_with_retry(trx_t *trx, dict_table_t *table, enum lock_mode mode)
in: lock mode
Definition: api0misc.cc:47
bool ib_mdl_enabled
Whether MySQL MDL is enabled for applications using InnoDB APIs.
Definition: api0api.cc:69
ulong ib_bk_commit_interval
configure value for background commit interval (in seconds)
Definition: api0api.cc:78
bool ib_handle_errors(dberr_t *new_err, trx_t *trx, que_thr_t *thr, trx_savept_t *savept, bool is_sdi)
Handles user errors and lock waits detected by the database engine.
Definition: api0misc.cc:65
ulong ib_trx_level_setting
configure value for transaction isolation level
Definition: api0api.cc:75
dberr_t
Definition: db0err.h:38
lock_mode
Definition: lock0types.h:51
mode
Definition: file_handle.h:59
The interface to the operating system file io.
Query graph.
TempTable public handler API declaration.
Data structure for a database table.
Definition: dict0mem.h:1884
Definition: api0misc.h:60
const sdi_key_t * sdi_key
Definition: api0misc.h:61
Definition: api0misc.h:64
sdi_vector_t * sdi_vector
Definition: api0misc.h:65
Definition: que0que.h:241
Key to identify a dictionary object.
Definition: handler.h:125
Definition: handler.h:134
Transaction savepoint.
Definition: trx0types.h:147
Definition: trx0trx.h:680
The transaction.
Version control for database, common definitions, and include files.