1 /***************************************************************************** 2 3 Copyright (c) 2008, 2012, Oracle and/or its affiliates. All Rights Reserved. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License, version 2.0, 7 as published by the Free Software Foundation. 8 9 This program is also distributed with certain software (including 10 but not limited to OpenSSL) that is licensed under separate terms, 11 as designated in a particular file or component or in included license 12 documentation. The authors of MySQL hereby grant you an additional 13 permission to link the program and your derivative works with the 14 separately licensed software that they have included with MySQL. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License, version 2.0, for more details. 20 21 You should have received a copy of the GNU General Public License along with 22 this program; if not, write to the Free Software Foundation, Inc., 23 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA 24 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 "univ.i" 39 #include "os0file.h" 40 #include "que0que.h" 41 #include "trx0trx.h" 42 43 /** Whether binlog is enabled for applications using InnoDB APIs */ 44 extern my_bool ib_binlog_enabled; 45 46 /** Whether MySQL MDL is enabled for applications using InnoDB APIs */ 47 extern my_bool ib_mdl_enabled; 48 49 /** Whether InnoDB row lock is disabled for applications using InnoDB APIs */ 50 extern my_bool ib_disable_row_lock; 51 52 /** configure value for transaction isolation level */ 53 extern ulong ib_trx_level_setting; 54 55 /** configure value for background commit interval (in seconds) */ 56 extern ulong ib_bk_commit_interval; 57 58 /******************************************************************** 59 Handles user errors and lock waits detected by the database engine. 60 @return TRUE if it was a lock wait and we should continue running 61 the query thread */ 62 UNIV_INTERN 63 ibool 64 ib_handle_errors( 65 /*=============*/ 66 dberr_t* new_err, /*!< out: possible new error 67 encountered in lock wait, or if 68 no new error, the value of 69 trx->error_state at the entry of this 70 function */ 71 trx_t* trx, /*!< in: transaction */ 72 que_thr_t* thr, /*!< in: query thread */ 73 trx_savept_t* savept); /*!< in: savepoint or NULL */ 74 75 /************************************************************************* 76 Sets a lock on a table. 77 @return error code or DB_SUCCESS */ 78 UNIV_INTERN 79 dberr_t 80 ib_trx_lock_table_with_retry( 81 /*=========================*/ 82 trx_t* trx, /*!< in/out: transaction */ 83 dict_table_t* table, /*!< in: table to lock */ 84 enum lock_mode mode); /*!< in: lock mode */ 85 86 #endif /* api0misc_h */ 87