MySQL 9.1.0
Source Code Documentation
api0misc.cc File Reference

InnoDB Native API. More...

#include "api0misc.h"
#include "dict0dict.h"
#include "dict0mem.h"
#include "ha_prototypes.h"
#include "lock0lock.h"
#include "pars0pars.h"
#include "row0sel.h"
#include "srv0srv.h"
#include "trx0roll.h"

Functions

dberr_t ib_trx_lock_table_with_retry (trx_t *trx, dict_table_t *table, enum lock_mode mode)
 Sets a lock on a table. More...
 
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. More...
 

Detailed Description

InnoDB Native API.

2008-08-01 Created by Sunny Bains 3/20/2011 Jimmy Yang extracted from Embedded InnoDB

Function Documentation

◆ ib_handle_errors()

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.

Parameters
[out]new_errpossible new error encountered in lock wait, or if no new error, the value of trx->error_state at the entry of this function
[in]trxtransaction
[in]thrquery thread
[in]saveptsavepoint or NULL
[in]is_sditrue if table is SDI
Returns
true if it was a lock wait and we should continue running the query thread.

◆ ib_trx_lock_table_with_retry()

dberr_t ib_trx_lock_table_with_retry ( trx_t trx,
dict_table_t table,
enum lock_mode  mode 
)

Sets a lock on a table.

in: lock mode

Returns
error code or DB_SUCCESS
Parameters
trxin/out: transaction
tablein: table to lock
modein: LOCK_X or LOCK_S