MySQL 5.6.14 Source Code Document
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
MySQL 5.6.14 Source Code Document
replication of field metadata works.
ndbapi_simple.cpp
ndbapi_async.cpp
ndbapi_async1.cpp
ndbapi_retries.cpp
ndbapi_simple_index.cpp
ndbapi_scan.cpp
ndbapi_event.cpp
Adaptive Send Algorithm
MySQL Cluster Concepts
basic.cpp
common.hpp
br_test.cpp
ptr_binding_test.cpp
The Performance Schema main page
Performance schema: instrumentation interface page.
Performance schema: the aggregates page.
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
client
cmake
cmd-line-utils
dbug
extra
include
libevent
libmysql
libmysqld
libservices
mysql-test
mysys
mysys_ssl
packaging
plugin
regex
scripts
sql
sql-common
storage
archive
blackhole
csv
example
federated
heap
innobase
api
btr
buf
data
dict
dyn
eval
fil
fsp
fts
fut
ha
handler
ibuf
include
api0api.h
api0misc.h
btr0btr.h
btr0cur.h
btr0pcur.h
btr0sea.h
btr0types.h
buf0buddy.h
buf0buf.h
buf0checksum.h
buf0dblwr.h
buf0dump.h
buf0flu.h
buf0lru.h
buf0rea.h
buf0types.h
data0data.h
data0type.h
data0types.h
db0err.h
dict0boot.h
dict0crea.h
dict0dict.h
dict0load.h
dict0mem.h
dict0priv.h
dict0stats.h
dict0stats_bg.h
dict0types.h
dyn0dyn.h
eval0eval.h
eval0proc.h
fil0fil.h
fsp0fsp.h
fsp0types.h
fts0ast.h
fts0blex.h
fts0fts.h
fts0opt.h
fts0pars.h
fts0priv.h
fts0tlex.h
fts0types.h
fut0fut.h
fut0lst.h
ha0ha.h
ha0storage.h
ha_prototypes.h
handler0alter.h
hash0hash.h
ibuf0ibuf.h
ibuf0types.h
lock0iter.h
lock0lock.h
lock0priv.h
lock0types.h
log0log.h
log0recv.h
mach0data.h
mem0dbg.h
mem0mem.h
mem0pool.h
mtr0log.h
mtr0mtr.h
mtr0types.h
os0file.h
os0proc.h
os0sync.h
os0thread.h
page0cur.h
page0page.h
page0types.h
page0zip.h
pars0grm.h
pars0opt.h
pars0pars.h
pars0sym.h
pars0types.h
que0que.h
que0types.h
read0read.h
read0types.h
rem0cmp.h
rem0rec.h
rem0types.h
row0ext.h
row0ftsort.h
row0import.h
row0ins.h
row0log.h
row0merge.h
row0mysql.h
row0purge.h
row0quiesce.h
row0row.h
row0sel.h
row0types.h
row0uins.h
row0umod.h
row0undo.h
row0upd.h
row0vers.h
srv0conc.h
srv0mon.h
srv0srv.h
srv0start.h
sync0arr.h
sync0rw.h
sync0sync.h
sync0types.h
trx0i_s.h
trx0purge.h
trx0rec.h
trx0roll.h
trx0rseg.h
trx0sys.h
trx0trx.h
trx0types.h
trx0undo.h
trx0xa.h
usr0sess.h
usr0types.h
ut0bh.h
ut0byte.h
ut0counter.h
ut0crc32.h
ut0dbg.h
ut0list.h
ut0lst.h
ut0mem.h
ut0rbt.h
ut0rnd.h
ut0sort.h
ut0ut.h
ut0vec.h
ut0wqueue.h
lock
log
mach
mem
mtr
os
page
pars
que
read
rem
row
srv
sync
trx
usr
ut
myisam
myisammrg
ndb
perfschema
strings
support-files
tests
unittest
vio
zlib
File Members
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ut0sort.h
Go to the documentation of this file.
1
/*****************************************************************************
2
3
Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
4
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
8
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc.,
15
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16
17
*****************************************************************************/
18
19
/******************************************************************/
26
#ifndef ut0sort_h
27
#define ut0sort_h
28
29
#include "univ.i"
30
31
/* This module gives a macro definition of the body of
32
a standard sort function for an array of elements of any
33
type. The comparison function is given as a parameter to
34
the macro. The sort algorithm is mergesort which has logarithmic
35
worst case.
36
*/
37
38
/*******************************************************************/
52
#define UT_SORT_FUNCTION_BODY(SORT_FUN, ARR, AUX_ARR, LOW, HIGH, CMP_FUN)\
53
{\
54
ulint ut_sort_mid77;\
55
ulint ut_sort_i77;\
56
ulint ut_sort_low77;\
57
ulint ut_sort_high77;\
58
\
59
ut_ad((LOW) < (HIGH));\
60
ut_ad(ARR);\
61
ut_ad(AUX_ARR);\
62
\
63
if ((LOW) == (HIGH) - 1) {\
64
return;\
65
} else if ((LOW) == (HIGH) - 2) {\
66
if (CMP_FUN((ARR)[LOW], (ARR)[(HIGH) - 1]) > 0) {\
67
(AUX_ARR)[LOW] = (ARR)[LOW];\
68
(ARR)[LOW] = (ARR)[(HIGH) - 1];\
69
(ARR)[(HIGH) - 1] = (AUX_ARR)[LOW];\
70
}\
71
return;\
72
}\
73
\
74
ut_sort_mid77 = ((LOW) + (HIGH)) / 2;\
75
\
76
SORT_FUN((ARR), (AUX_ARR), (LOW), ut_sort_mid77);\
77
SORT_FUN((ARR), (AUX_ARR), ut_sort_mid77, (HIGH));\
78
\
79
ut_sort_low77 = (LOW);\
80
ut_sort_high77 = ut_sort_mid77;\
81
\
82
for (ut_sort_i77 = (LOW); ut_sort_i77 < (HIGH); ut_sort_i77++) {\
83
\
84
if (ut_sort_low77 >= ut_sort_mid77) {\
85
(AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_high77];\
86
ut_sort_high77++;\
87
} else if (ut_sort_high77 >= (HIGH)) {\
88
(AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_low77];\
89
ut_sort_low77++;\
90
} else if (CMP_FUN((ARR)[ut_sort_low77],\
91
(ARR)[ut_sort_high77]) > 0) {\
92
(AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_high77];\
93
ut_sort_high77++;\
94
} else {\
95
(AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_low77];\
96
ut_sort_low77++;\
97
}\
98
}\
99
\
100
memcpy((void*) ((ARR) + (LOW)), (AUX_ARR) + (LOW),\
101
((HIGH) - (LOW)) * sizeof *(ARR));\
102
}\
103
104
105
#endif
106
storage
innobase
include
ut0sort.h
Generated on Sat Nov 9 2013 01:26:36 for MySQL 5.6.14 Source Code Document by
1.8.1.2