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