2001-02-17 14:19:19 +02:00
|
|
|
/***************************************************************************
|
|
|
|
Version control for database, common definitions, and include files
|
|
|
|
|
|
|
|
(c) 1994 - 2000 Innobase Oy
|
|
|
|
|
|
|
|
Created 1/20/1994 Heikki Tuuri
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef univ_i
|
|
|
|
#define univ_i
|
|
|
|
|
2002-12-12 21:01:32 +02:00
|
|
|
#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && !defined(MYSQL_SERVER) && !defined(__WIN__)
|
|
|
|
#undef __WIN__
|
2001-02-17 14:19:19 +02:00
|
|
|
#define __WIN__
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
2001-08-04 19:36:14 +03:00
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
#include <windows.h>
|
|
|
|
|
2002-06-22 20:41:14 +03:00
|
|
|
#if !defined(WIN64) && !defined(_WIN64)
|
2002-04-18 10:50:42 +03:00
|
|
|
#define UNIV_CAN_USE_X86_ASSEMBLER
|
2002-04-18 12:03:40 +03:00
|
|
|
#endif
|
2002-04-18 10:50:42 +03:00
|
|
|
|
2001-04-24 16:24:10 +03:00
|
|
|
#ifdef _NT_
|
|
|
|
#define __NT__
|
|
|
|
#endif
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
#else
|
2002-06-22 20:41:14 +03:00
|
|
|
/* The defines used with MySQL */
|
2001-05-03 15:22:43 +03:00
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
/* Include two header files from MySQL to make the Unix flavor used
|
2002-06-22 20:41:14 +03:00
|
|
|
in compiling more Posix-compatible. These headers also define __WIN__
|
|
|
|
if we are compiling on Windows. */
|
|
|
|
|
2001-09-14 02:54:33 +03:00
|
|
|
#include <my_global.h>
|
2001-02-17 14:19:19 +02:00
|
|
|
#include <my_pthread.h>
|
|
|
|
|
2001-03-26 13:27:36 +03:00
|
|
|
/* Include <sys/stat.h> to get S_I... macros defined for os0file.c */
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
#undef PACKAGE
|
|
|
|
#undef VERSION
|
|
|
|
|
2006-09-28 15:18:33 -04:00
|
|
|
#if !defined(__WIN__) && !defined(WIN64) && !defined(_WIN64)
|
2001-02-17 14:19:19 +02:00
|
|
|
/* Include the header file generated by GNU autoconf */
|
|
|
|
#include "../ib_config.h"
|
2006-09-28 15:18:33 -04:00
|
|
|
#endif
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2001-04-18 17:23:06 +03:00
|
|
|
#ifdef HAVE_SCHED_H
|
|
|
|
#include <sched.h>
|
|
|
|
#endif
|
|
|
|
|
2002-06-22 20:41:14 +03:00
|
|
|
/* When compiling for Itanium IA64, undefine the flag below to prevent use
|
|
|
|
of the 32-bit x86 assembler in mutex operations. */
|
|
|
|
|
|
|
|
#if defined(__WIN__) && !defined(WIN64) && !defined(_WIN64)
|
|
|
|
#define UNIV_CAN_USE_X86_ASSEMBLER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* We only try to do explicit inlining of functions with gcc and
|
|
|
|
Microsoft Visual C++ */
|
|
|
|
|
|
|
|
#if !defined(__GNUC__) && !defined(__WIN__)
|
2003-01-05 20:18:49 +02:00
|
|
|
#undef UNIV_MUST_NOT_INLINE /* Remove compiler warning */
|
2002-06-22 20:41:14 +03:00
|
|
|
#define UNIV_MUST_NOT_INLINE
|
|
|
|
#endif
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
#ifdef HAVE_PREAD
|
|
|
|
#define HAVE_PWRITE
|
|
|
|
#endif
|
|
|
|
|
2003-12-19 20:39:19 +02:00
|
|
|
#endif /* #if (defined(WIN32) || ... */
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
/* DEBUG VERSION CONTROL
|
|
|
|
===================== */
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
2001-08-04 19:36:14 +03:00
|
|
|
|
2001-09-20 21:14:49 +03:00
|
|
|
/* The following flag will make InnoDB to initialize
|
|
|
|
all memory it allocates to zero. It hides Purify
|
|
|
|
warnings about reading unallocated memory unless
|
|
|
|
memory is read outside the allocated blocks. */
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
2001-08-04 19:36:14 +03:00
|
|
|
/*
|
2001-09-20 21:14:49 +03:00
|
|
|
#define UNIV_INIT_MEM_TO_ZERO
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
2001-08-04 19:36:14 +03:00
|
|
|
*/
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
/* Make a non-inline debug version */
|
2002-04-18 10:50:42 +03:00
|
|
|
|
2001-03-02 18:05:19 +02:00
|
|
|
/*
|
2005-01-26 08:57:43 +01:00
|
|
|
#define UNIV_DEBUG
|
2002-08-06 22:59:13 +03:00
|
|
|
#define UNIV_MEM_DEBUG
|
2001-02-17 14:19:19 +02:00
|
|
|
#define UNIV_IBUF_DEBUG
|
2003-10-07 17:28:59 +03:00
|
|
|
#define UNIV_SYNC_DEBUG
|
2002-04-18 10:50:42 +03:00
|
|
|
#define UNIV_SEARCH_DEBUG
|
2001-02-17 14:19:19 +02:00
|
|
|
#define UNIV_SYNC_PERF_STAT
|
|
|
|
#define UNIV_SEARCH_PERF_STAT
|
2004-12-24 12:13:32 +01:00
|
|
|
#define UNIV_SRV_PRINT_LATCH_WAITS;
|
2001-03-02 18:05:19 +02:00
|
|
|
*/
|
2001-02-17 14:19:19 +02:00
|
|
|
#define UNIV_LIGHT_MEM_DEBUG
|
|
|
|
|
|
|
|
#define YYDEBUG 1
|
|
|
|
|
2003-04-20 19:36:09 +03:00
|
|
|
#ifdef HAVE_purify
|
|
|
|
/* The following sets all new allocated memory to zero before use:
|
|
|
|
this can be used to eliminate unnecessary Purify warnings, but note that
|
|
|
|
it also masks many bugs Purify could detect. For detailed Purify analysis it
|
|
|
|
is best to remove the define below and look through the warnings one
|
|
|
|
by one. */
|
|
|
|
#define UNIV_SET_MEM_TO_ZERO
|
|
|
|
#endif
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
/*
|
|
|
|
#define UNIV_SQL_DEBUG
|
|
|
|
#define UNIV_LOG_DEBUG
|
|
|
|
*/
|
|
|
|
/* the above option prevents forcing of log to disk
|
|
|
|
at a buffer page write: it should be tested with this
|
|
|
|
option off; also some ibuf tests are suppressed */
|
|
|
|
/*
|
|
|
|
#define UNIV_BASIC_LOG_DEBUG
|
|
|
|
*/
|
|
|
|
/* the above option enables basic recovery debugging:
|
|
|
|
new allocated file pages are reset */
|
|
|
|
|
2001-04-06 20:37:31 +03:00
|
|
|
#if (!defined(UNIV_DEBUG) && !defined(INSIDE_HA_INNOBASE_CC) && !defined(UNIV_MUST_NOT_INLINE))
|
2001-02-17 14:19:19 +02:00
|
|
|
/* Definition for inline version */
|
|
|
|
|
|
|
|
#ifdef __WIN__
|
2005-01-26 08:57:43 +01:00
|
|
|
#define UNIV_INLINE __inline
|
2001-02-17 14:19:19 +02:00
|
|
|
#else
|
2002-08-01 00:37:27 +03:00
|
|
|
#define UNIV_INLINE static inline
|
2001-10-30 16:31:35 +02:00
|
|
|
#endif
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
#else
|
|
|
|
/* If we want to compile a noninlined version we use the following macro
|
|
|
|
definitions: */
|
|
|
|
|
|
|
|
#define UNIV_NONINL
|
|
|
|
#define UNIV_INLINE
|
|
|
|
|
|
|
|
#endif /* UNIV_DEBUG */
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
#define UNIV_WORD_SIZE 4
|
|
|
|
#elif defined(_WIN64)
|
|
|
|
#define UNIV_WORD_SIZE 8
|
|
|
|
#else
|
ut0ut.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
mem0pool.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0file.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0shm.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0sync.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0thread.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
page0page.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
que0que.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
row0ins.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
row0mysql.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
row0sel.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
row0upd.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
row0vers.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
srv0srv.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
srv0start.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
sync0arr.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
sync0rw.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
sync0sync.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
trx0rec.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
trx0trx.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
srv0srv.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
sync0rw.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
sync0sync.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
ut0dbg.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
lock0lock.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
log0log.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
log0recv.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
ibuf0ibuf.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
buf0buf.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
buf0buf.ic Fixes for 64-bit Linux, bug fixes, compiler warning fixes
hash0hash.ic Fixes for 64-bit Linux, bug fixes, compiler warning fixes
mach0data.ic Fixes for 64-bit Linux, bug fixes, compiler warning fixes
mem0mem.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
mem0pool.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
mtr0mtr.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0file.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0sync.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0sync.ic Fixes for 64-bit Linux, bug fixes, compiler warning fixes
os0thread.h Fixes for 64-bit Linux, bug fixes, compiler warning fixes
univ.i Fixes for 64-bit Linux, bug fixes, compiler warning fixes
row0mysql.ic Fixes for 64-bit Linux, bug fixes, compiler warning fixes
com0shm.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
data0data.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
data0type.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
dict0crea.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
dict0dict.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
fil0fil.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
fsp0fsp.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
fut0lst.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
btr0sea.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
buf0buf.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
buf0flu.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
btr0btr.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
btr0cur.c Fixes for 64-bit Linux, bug fixes, compiler warning fixes
2001-03-02 17:33:11 +02:00
|
|
|
/* MySQL config.h generated by GNU autoconf will define SIZEOF_LONG in Posix */
|
|
|
|
#define UNIV_WORD_SIZE SIZEOF_LONG
|
2001-02-17 14:19:19 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* The following alignment is used in memory allocations in memory heap
|
|
|
|
management to ensure correct alignment for doubles etc. */
|
|
|
|
#define UNIV_MEM_ALIGNMENT 8
|
|
|
|
|
|
|
|
/* The following alignment is used in aligning lints etc. */
|
|
|
|
#define UNIV_WORD_ALIGNMENT UNIV_WORD_SIZE
|
|
|
|
|
|
|
|
/*
|
|
|
|
DATABASE VERSION CONTROL
|
|
|
|
========================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* The universal page size of the database */
|
|
|
|
#define UNIV_PAGE_SIZE (2 * 8192) /* NOTE! Currently, this has to be a
|
|
|
|
power of 2 */
|
|
|
|
/* The 2-logarithm of UNIV_PAGE_SIZE: */
|
|
|
|
#define UNIV_PAGE_SIZE_SHIFT 14
|
|
|
|
|
|
|
|
/* Maximum number of parallel threads in a parallelized operation */
|
|
|
|
#define UNIV_MAX_PARALLELISM 32
|
|
|
|
|
|
|
|
/*
|
|
|
|
UNIVERSAL TYPE DEFINITIONS
|
|
|
|
==========================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Note that inside MySQL 'byte' is defined as char on Linux! */
|
2003-12-20 13:48:35 +02:00
|
|
|
#define byte unsigned char
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2003-12-20 13:48:35 +02:00
|
|
|
/* Another basic type we use is unsigned long integer which should be equal to
|
|
|
|
the word size of the machine, that is on a 32-bit platform 32 bits, and on a
|
|
|
|
64-bit platform 64 bits. We also give the printf format for the type as a
|
2005-06-10 12:29:35 +03:00
|
|
|
macro ULINTPF. */
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2003-06-04 16:05:27 +03:00
|
|
|
#ifdef _WIN64
|
|
|
|
typedef unsigned __int64 ulint;
|
2003-12-20 13:48:35 +02:00
|
|
|
#define ULINTPF "%I64u"
|
|
|
|
typedef __int64 lint;
|
2003-06-04 16:05:27 +03:00
|
|
|
#else
|
2001-02-17 14:19:19 +02:00
|
|
|
typedef unsigned long int ulint;
|
2003-12-20 13:48:35 +02:00
|
|
|
#define ULINTPF "%lu"
|
2001-02-17 14:19:19 +02:00
|
|
|
typedef long int lint;
|
2003-12-20 13:48:35 +02:00
|
|
|
#endif
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2001-05-21 19:04:46 +03:00
|
|
|
#ifdef __WIN__
|
2003-12-20 13:48:35 +02:00
|
|
|
typedef __int64 ib_longlong;
|
2001-05-21 19:04:46 +03:00
|
|
|
#else
|
2003-12-20 13:48:35 +02:00
|
|
|
typedef longlong ib_longlong;
|
2001-05-21 19:04:46 +03:00
|
|
|
#endif
|
|
|
|
|
2007-08-15 17:20:54 -06:00
|
|
|
typedef unsigned long long int ullint;
|
|
|
|
|
2003-12-20 13:13:55 +02:00
|
|
|
#ifndef __WIN__
|
|
|
|
#if SIZEOF_LONG != SIZEOF_VOIDP
|
|
|
|
#error "Error: InnoDB's ulint must be of the same size as void*"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
/* The following type should be at least a 64-bit floating point number */
|
2003-12-20 13:48:35 +02:00
|
|
|
typedef double utfloat;
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
/* The 'undefined' value for a ulint */
|
|
|
|
#define ULINT_UNDEFINED ((ulint)(-1))
|
|
|
|
|
|
|
|
/* The undefined 32-bit unsigned integer */
|
|
|
|
#define ULINT32_UNDEFINED 0xFFFFFFFF
|
|
|
|
|
|
|
|
/* Maximum value for a ulint */
|
|
|
|
#define ULINT_MAX ((ulint)(-2))
|
|
|
|
|
|
|
|
/* This 'ibool' type is used within Innobase. Remember that different included
|
|
|
|
headers may define 'bool' differently. Do not assume that 'bool' is a ulint! */
|
2003-12-20 13:48:35 +02:00
|
|
|
#define ibool ulint
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
#ifndef TRUE
|
|
|
|
|
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* The following number as the length of a logical field means that the field
|
2002-07-23 01:59:43 +03:00
|
|
|
has the SQL NULL as its value. NOTE that because we assume that the length
|
|
|
|
of a field is a 32-bit integer when we store it, for example, to an undo log
|
|
|
|
on disk, we must have also this number fit in 32 bits, also in 64-bit
|
|
|
|
computers! */
|
|
|
|
|
|
|
|
#define UNIV_SQL_NULL ULINT32_UNDEFINED
|
2001-02-17 14:19:19 +02:00
|
|
|
|
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files
srv0srv.c Support raw disk partitions as data files
row0purge.c < 4 GB rows, doublewrite, hang fixes
row0row.c < 4 GB rows, doublewrite, hang fixes
row0sel.c < 4 GB rows, doublewrite, hang fixes
row0uins.c < 4 GB rows, doublewrite, hang fixes
row0umod.c < 4 GB rows, doublewrite, hang fixes
row0undo.c < 4 GB rows, doublewrite, hang fixes
row0upd.c < 4 GB rows, doublewrite, hang fixes
srv0srv.c < 4 GB rows, doublewrite, hang fixes
srv0start.c < 4 GB rows, doublewrite, hang fixes
sync0rw.c < 4 GB rows, doublewrite, hang fixes
sync0sync.c < 4 GB rows, doublewrite, hang fixes
trx0purge.c < 4 GB rows, doublewrite, hang fixes
trx0rec.c < 4 GB rows, doublewrite, hang fixes
trx0sys.c < 4 GB rows, doublewrite, hang fixes
btr0btr.c < 4 GB rows, doublewrite, hang fixes
btr0cur.c < 4 GB rows, doublewrite, hang fixes
buf0buf.c < 4 GB rows, doublewrite, hang fixes
buf0flu.c < 4 GB rows, doublewrite, hang fixes
buf0rea.c < 4 GB rows, doublewrite, hang fixes
data0data.c < 4 GB rows, doublewrite, hang fixes
fil0fil.c < 4 GB rows, doublewrite, hang fixes
fsp0fsp.c < 4 GB rows, doublewrite, hang fixes
ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes
lock0lock.c < 4 GB rows, doublewrite, hang fixes
log0log.c < 4 GB rows, doublewrite, hang fixes
log0recv.c < 4 GB rows, doublewrite, hang fixes
os0file.c < 4 GB rows, doublewrite, hang fixes
page0cur.c < 4 GB rows, doublewrite, hang fixes
pars0pars.c < 4 GB rows, doublewrite, hang fixes
rem0cmp.c < 4 GB rows, doublewrite, hang fixes
rem0rec.c < 4 GB rows, doublewrite, hang fixes
row0ins.c < 4 GB rows, doublewrite, hang fixes
row0mysql.c < 4 GB rows, doublewrite, hang fixes
univ.i < 4 GB rows, doublewrite, hang fixes
data0data.ic < 4 GB rows, doublewrite, hang fixes
mach0data.ic < 4 GB rows, doublewrite, hang fixes
rem0rec.ic < 4 GB rows, doublewrite, hang fixes
row0upd.ic < 4 GB rows, doublewrite, hang fixes
trx0rec.ic < 4 GB rows, doublewrite, hang fixes
rem0cmp.h < 4 GB rows, doublewrite, hang fixes
rem0rec.h < 4 GB rows, doublewrite, hang fixes
row0ins.h < 4 GB rows, doublewrite, hang fixes
row0mysql.h < 4 GB rows, doublewrite, hang fixes
row0row.h < 4 GB rows, doublewrite, hang fixes
row0upd.h < 4 GB rows, doublewrite, hang fixes
srv0srv.h < 4 GB rows, doublewrite, hang fixes
sync0sync.h < 4 GB rows, doublewrite, hang fixes
trx0rec.h < 4 GB rows, doublewrite, hang fixes
trx0sys.h < 4 GB rows, doublewrite, hang fixes
trx0types.h < 4 GB rows, doublewrite, hang fixes
trx0undo.h < 4 GB rows, doublewrite, hang fixes
ut0dbg.h < 4 GB rows, doublewrite, hang fixes
ut0ut.h < 4 GB rows, doublewrite, hang fixes
btr0btr.h < 4 GB rows, doublewrite, hang fixes
btr0cur.h < 4 GB rows, doublewrite, hang fixes
buf0buf.h < 4 GB rows, doublewrite, hang fixes
buf0flu.h < 4 GB rows, doublewrite, hang fixes
data0data.h < 4 GB rows, doublewrite, hang fixes
dict0mem.h < 4 GB rows, doublewrite, hang fixes
fil0fil.h < 4 GB rows, doublewrite, hang fixes
fsp0fsp.h < 4 GB rows, doublewrite, hang fixes
os0file.h < 4 GB rows, doublewrite, hang fixes
2001-08-04 19:36:14 +03:00
|
|
|
/* Lengths which are not UNIV_SQL_NULL, but bigger than the following
|
|
|
|
number indicate that a field contains a reference to an externally
|
|
|
|
stored part of the field in the tablespace. The length field then
|
|
|
|
contains the sum of the following flag and the locally stored len. */
|
|
|
|
|
|
|
|
#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
|
|
|
|
|
2005-06-10 12:29:35 +03:00
|
|
|
/* Some macros to improve branch prediction and reduce cache misses */
|
2005-08-17 18:15:50 +03:00
|
|
|
#if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
|
2005-06-10 12:29:35 +03:00
|
|
|
/* Tell the compiler that 'expr' probably evaluates to 'constant'. */
|
|
|
|
# define UNIV_EXPECT(expr,constant) __builtin_expect(expr, constant)
|
|
|
|
/* Tell the compiler that a pointer is likely to be NULL */
|
|
|
|
# define UNIV_LIKELY_NULL(ptr) __builtin_expect((ulint) ptr, 0)
|
|
|
|
/* Minimize cache-miss latency by moving data at addr into a cache before
|
|
|
|
it is read. */
|
2005-04-21 14:23:26 +03:00
|
|
|
# define UNIV_PREFETCH_R(addr) __builtin_prefetch(addr, 0, 3)
|
2005-06-10 12:29:35 +03:00
|
|
|
/* Minimize cache-miss latency by moving data at addr into a cache before
|
|
|
|
it is read or written. */
|
2005-04-21 14:23:26 +03:00
|
|
|
# define UNIV_PREFETCH_RW(addr) __builtin_prefetch(addr, 1, 3)
|
|
|
|
#else
|
2005-06-10 12:29:35 +03:00
|
|
|
/* Dummy versions of the macros */
|
2005-04-21 14:23:26 +03:00
|
|
|
# define UNIV_EXPECT(expr,value) (expr)
|
|
|
|
# define UNIV_LIKELY_NULL(expr) (expr)
|
|
|
|
# define UNIV_PREFETCH_R(addr) ((void) 0)
|
|
|
|
# define UNIV_PREFETCH_RW(addr) ((void) 0)
|
|
|
|
#endif
|
2005-06-10 12:29:35 +03:00
|
|
|
/* Tell the compiler that cond is likely to hold */
|
|
|
|
#define UNIV_LIKELY(cond) UNIV_EXPECT(cond, TRUE)
|
|
|
|
/* Tell the compiler that cond is unlikely to hold */
|
|
|
|
#define UNIV_UNLIKELY(cond) UNIV_EXPECT(cond, FALSE)
|
2005-04-21 14:23:26 +03:00
|
|
|
|
2006-04-21 01:07:37 +04:00
|
|
|
/* Compile-time constant of the given array's size. */
|
|
|
|
#define UT_ARR_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "ut0dbg.h"
|
|
|
|
#include "ut0ut.h"
|
|
|
|
#include "db0err.h"
|
|
|
|
|
|
|
|
#endif
|