~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/univ.i

  • Committer: lbieber
  • Date: 2010-10-01 13:06:31 UTC
  • mfrom: (1802.2.2 drizzle-bug-651948)
  • mto: This revision was merged to the branch mainline in revision 1805.
  • Revision ID: lbieber@orisndriz08-20101001130631-xubscnhmj7r5dn6g
Merge Andrew - Fix bug 651948 - Index lengths not retrieved using drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1994, 2010, Innobase Oy. All Rights Reserved.
4
 
Copyright (C) 2008 Google Inc.
5
 
Copyright (C) 2009 Sun Microsystems, Inc.
 
3
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
 
4
Copyright (c) 2008, Google Inc.
 
5
Copyright (c) 2009, Sun Microsystems, Inc.
6
6
 
7
7
Portions of this file contain modifications contributed and copyrighted by
8
8
Google, Inc. Those modifications are gratefully acknowledged and are described
25
25
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
26
26
 
27
27
You should have received a copy of the GNU General Public License along with
28
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
29
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
28
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
29
Place, Suite 330, Boston, MA 02111-1307 USA
30
30
 
31
31
*****************************************************************************/
32
32
 
51
51
#endif /* UNIV_HOTBACKUP */
52
52
 
53
53
#define INNODB_VERSION_MAJOR    1
54
 
#define INNODB_VERSION_MINOR    1
 
54
#define INNODB_VERSION_MINOR    0
55
55
#define INNODB_VERSION_BUGFIX   4
56
56
 
57
57
/* The following is the InnoDB version as shown in
58
58
SELECT plugin_version FROM information_schema.plugins;
59
 
calculated in make_version_string() in sql/sql_show.cc like this:
 
59
calculated in in make_version_string() in sql/sql_show.cc like this:
60
60
"version >> 8" . "version & 0xff"
61
61
because the version is shown with only one dot, we skip the last
62
62
component, i.e. we show M.N.P as M.N */
90
90
 
91
91
# include <windows.h>
92
92
 
 
93
# if defined(HAVE_WINDOWS_ATOMICS)
 
94
/* If atomics are defined we use them in InnoDB mutex implementation */
 
95
#  define HAVE_ATOMIC_BUILTINS
 
96
# endif /* HAVE_WINDOWS_ATOMICS */
 
97
 
93
98
# ifdef _NT_
94
99
#  define __NT__
95
100
# endif
108
113
#  endif /* UNIV_HOTBACKUP */
109
114
# endif
110
115
 
111
 
#ifdef HAVE_PTHREAD
112
 
#include <pthread.h>
113
 
#endif
114
 
 
115
116
/* Include <sys/stat.h> to get S_I... macros defined for os0file.c */
116
117
# include <sys/stat.h>
117
 
# if !defined(__WIN__) 
 
118
# if !defined(__NETWARE__) && !defined(__WIN__) 
118
119
#  include <sys/mman.h> /* mmap() for os0proc.c */
119
120
# endif
120
121
 
 
122
# undef PACKAGE
 
123
# undef VERSION
 
124
 
121
125
/* Include the header file generated by GNU autoconf */
122
126
# if !defined(__WIN__) && !defined(BUILD_DRIZZLE)
123
127
#  ifndef UNIV_HOTBACKUP
129
133
#  include <sched.h>
130
134
# endif
131
135
 
 
136
# if defined(HAVE_GCC_ATOMIC_BUILTINS) || defined(HAVE_SOLARIS_ATOMICS) \
 
137
     || defined(HAVE_WINDOWS_ATOMICS)
 
138
/* If atomics are defined we use them in InnoDB mutex implementation */
 
139
#  define HAVE_ATOMIC_BUILTINS
 
140
# endif /* (HAVE_GCC_ATOMIC_BUILTINS) || (HAVE_SOLARIS_ATOMICS)
 
141
        || (HAVE_WINDOWS_ATOMICS) */
 
142
 
 
143
/* For InnoDB rw_locks to work with atomics we need the thread_id
 
144
to be no more than machine word wide. The following enables using
 
145
atomics for InnoDB rw_locks where these conditions are met. */
 
146
#ifdef HAVE_ATOMIC_BUILTINS
 
147
/* if HAVE_ATOMIC_PTHREAD_T is defined at this point that means that
 
148
the code from plug.in has defined it and we do not need to include
 
149
ut0auxconf.h which would either define HAVE_ATOMIC_PTHREAD_T or will
 
150
be empty */
 
151
# ifndef HAVE_ATOMIC_PTHREAD_T
 
152
#  include "ut0auxconf.h"
 
153
# endif /* HAVE_ATOMIC_PTHREAD_T */
 
154
/* now HAVE_ATOMIC_PTHREAD_T is eventually defined either by plug.in or
 
155
from Makefile.in->ut0auxconf.h */
 
156
# ifdef HAVE_ATOMIC_PTHREAD_T
 
157
#  define INNODB_RW_LOCKS_USE_ATOMICS
 
158
# endif /* HAVE_ATOMIC_PTHREAD_T */
 
159
#endif /* HAVE_ATOMIC_BUILTINS */
 
160
 
132
161
/* We only try to do explicit inlining of functions with gcc and
133
162
Sun Studio */
134
163
 
137
166
#  define UNIV_MUST_NOT_INLINE
138
167
# endif
139
168
 
140
 
# if defined(__GNUC__)
141
 
#  define UNIV_WARN_UNUSED_RESULT_NONNULL __attribute__((nonnull, warn_unused_result))
142
 
#  define UNIV_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
143
 
#else
144
 
#  define UNIV_WARN_UNUSED_RESULT
145
 
#  define UNIV_WARN_UNUSED_RESULT_NONNULL
146
 
#endif
147
 
 
148
169
# ifdef HAVE_PREAD
149
170
#  define HAVE_PWRITE
150
171
# endif
151
172
 
152
173
#endif /* #if (defined(WIN32) || ... */
153
174
 
154
 
/* Following defines are to enable performance schema
155
 
instrumentation in each of four InnoDB modules if
156
 
HAVE_PSI_INTERFACE is defined. */
157
 
#ifdef HAVE_PSI_INTERFACE
158
 
# define UNIV_PFS_MUTEX
159
 
# define UNIV_PFS_RWLOCK
160
 
/* For I/O instrumentation, performance schema rely
161
 
on a native descriptor to identify the file, this
162
 
descriptor could conflict with our OS level descriptor.
163
 
Disable IO instrumentation on Windows until this is
164
 
resolved */
165
 
# ifndef __WIN__
166
 
#  define UNIV_PFS_IO
167
 
# endif
168
 
# define UNIV_PFS_THREAD
169
 
#endif /* HAVE_PSI_INTERFACE */
170
 
 
171
175
/*                      DEBUG VERSION CONTROL
172
176
                        ===================== */
173
177
 
189
193
#define UNIV_COMPILE_TEST_FUNCS
190
194
*/
191
195
 
192
 
#if defined HAVE_VALGRIND
193
 
# define UNIV_DEBUG_VALGRIND
194
 
#endif /* HAVE_VALGRIND */
195
196
#if 0
196
197
#define UNIV_DEBUG_VALGRIND                     /* Enable extra
197
198
                                                Valgrind instrumentation */
203
204
                                                debugging without UNIV_DEBUG */
204
205
#define UNIV_DEBUG                              /* Enable ut_ad() assertions
205
206
                                                and disable UNIV_INLINE */
206
 
#define UNIV_DEBUG_LOCK_VALIDATE                /* Enable
207
 
                                                ut_ad(lock_rec_validate_page())
208
 
                                                assertions. */
209
207
#define UNIV_DEBUG_FILE_ACCESSES                /* Debug .ibd file access
210
208
                                                (field file_page_was_freed
211
209
                                                in buf_page_t) */
212
210
#define UNIV_LRU_DEBUG                          /* debug the buffer pool LRU */
213
211
#define UNIV_HASH_DEBUG                         /* debug HASH_ macros */
214
212
#define UNIV_LIST_DEBUG                         /* debug UT_LIST_ macros */
215
 
#define UNIV_LOG_LSN_DEBUG                      /* write LSN to the redo log;
216
 
this will break redo log file compatibility, but it may be useful when
217
 
debugging redo log application problems. */
218
213
#define UNIV_MEM_DEBUG                          /* detect memory leaks etc */
219
214
#define UNIV_IBUF_DEBUG                         /* debug the insert buffer */
220
215
#define UNIV_IBUF_COUNT_DEBUG                   /* debug the insert buffer;
235
230
                                                for compressed pages */
236
231
#define UNIV_ZIP_COPY                           /* call page_zip_copy_recs()
237
232
                                                more often */
238
 
#define UNIV_AIO_DEBUG                          /* prints info about
239
 
                                                submitted and reaped AIO
240
 
                                                requests to the log. */
241
233
#endif
242
234
 
243
235
#define UNIV_BTR_DEBUG                          /* check B-tree links */
244
236
#define UNIV_LIGHT_MEM_DEBUG                    /* light memory debugging */
245
237
 
246
 
#ifdef HAVE_VALGRIND
 
238
#ifdef HAVE_purify
247
239
/* The following sets all new allocated memory to zero before use:
248
240
this can be used to eliminate unnecessary Purify warnings, but note that
249
241
it also masks many bugs Purify could detect. For detailed Purify analysis it
259
251
                        /* the above option prevents forcing of log to disk
260
252
                        at a buffer page write: it should be tested with this
261
253
                        option off; also some ibuf tests are suppressed */
 
254
/*
 
255
#define UNIV_BASIC_LOG_DEBUG
 
256
*/
 
257
                        /* the above option enables basic recovery debugging:
 
258
                        new allocated file pages are reset */
262
259
 
263
260
/* Linkage specifier for non-static InnoDB symbols (variables and functions)
264
261
that are only referenced from within InnoDB, not from MySQL */
304
301
/* The following alignment is used in aligning lints etc. */
305
302
#define UNIV_WORD_ALIGNMENT     UNIV_WORD_SIZE
306
303
 
307
 
/* The maximum length of a table name. This is the MySQL limit and is
308
 
defined in mysql_com.h like NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN, the
309
 
number does not include a terminating '\0'. InnoDB probably can handle
310
 
longer names internally */
311
 
#define MAX_TABLE_NAME_LEN      192
312
 
 
313
304
/*
314
305
                        DATABASE VERSION CONTROL
315
306
                        ========================
323
314
/* Maximum number of parallel threads in a parallelized operation */
324
315
#define UNIV_MAX_PARALLELISM    32
325
316
 
326
 
/* The maximum length of a table name. This is the MySQL limit and is
327
 
defined in mysql_com.h like NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN, the
328
 
number does not include a terminating '\0'. InnoDB probably can handle
329
 
longer names internally */
330
 
#define MAX_TABLE_NAME_LEN      192
331
 
 
332
317
/*
333
318
                        UNIVERSAL TYPE DEFINITIONS
334
319
                        ==========================
393
378
/* The 'undefined' value for a ulint */
394
379
#define ULINT_UNDEFINED         ((ulint)(-1))
395
380
 
396
 
/** The bitmask of 32-bit unsigned integer */
397
 
#define ULINT32_MASK            0xFFFFFFFF
398
381
/* The undefined 32-bit unsigned integer */
399
 
#define ULINT32_UNDEFINED       ULINT32_MASK
 
382
#define ULINT32_UNDEFINED       0xFFFFFFFF
400
383
 
401
384
/* Maximum value for a ulint */
402
385
#define ULINT_MAX               ((ulint)(-2))
404
387
/* Maximum value for ib_uint64_t */
405
388
#define IB_ULONGLONG_MAX        ((ib_uint64_t) (~0ULL))
406
389
 
407
 
/** The generic InnoDB system object identifier data type */
408
 
typedef ib_uint64_t     ib_id_t;
409
 
 
410
 
/* THe 'undefined' value for ullint */
411
 
#define ULLINT_UNDEFINED        ((ullint)(-1))
412
 
 
413
390
/* This 'ibool' type is used within Innobase. Remember that different included
414
391
headers may define 'bool' differently. Do not assume that 'bool' is a ulint! */
415
392
#define ibool                   ulint
448
425
/* Minimize cache-miss latency by moving data at addr into a cache before
449
426
it is read or written. */
450
427
# define UNIV_PREFETCH_RW(addr) __builtin_prefetch(addr, 1, 3)
451
 
/* Sun Studio includes sun_prefetch.h as of version 5.9 */
452
 
#elif (defined(__SUNPRO_C) && __SUNPRO_C >= 0x590) \
453
 
       || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590)
 
428
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
454
429
# include <sun_prefetch.h>
455
430
#if __SUNPRO_C >= 0x550
456
431
# undef UNIV_INTERN