~clint-fewbar/ubuntu/lucid/mysql-dfsg-5.1/increase-killtimeout

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/ut0sort.h

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-08 03:05:40 UTC
  • mfrom: (1.1.4 upstream) (0.1.15 sid)
  • Revision ID: james.westby@ubuntu.com-20091208030540-l5xq57znyuy9ctgt
Tags: 5.1.41-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/control:
    + Don't provide a libmysqlclient15-dev package as long as there
      are packages still build-depending on libmysqlclient15-dev and
      mysql-dfsg-5.0 is in the archive.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in a
      full MTA on all installs of mysql-server (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    + debian/apparmor-profile: apparmor profile
    + debian/rules, debian/mysql-server-5.1.files: install apparmor profile.
    + debian/mysql-server-5.1.dirs: add etc/apparmor.d/fore-complain
    + debian/mysql-server-5.1.postrm: remove symlink in force-complain/ on
      purge.
    + debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    + debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    + debian/mysql-esrver-5.1.postinst: reload apparmor profiles
  - debian/additions/my.cfn: remove language options. Error message files are
    located in a different direction in Mysql 5.0. Setting the language option
    to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1 use a 
    default value that works. (LP: #316974)
  - debian/mysql-server-5.1.postinst: Clear out the second password when
    setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - debian/libmysqlclient16.symbols.amd64: remove amd64 symbols as it has
    not been correcly generated in Debian.
  - Add Apport hook: (LP: #354188):
    + debian/mysql-server-5.1.py: apport package hook
    + debian/mysql-server-5.1.files, debian/rules: install apport package hook
  - debian/addtions/my.cnf:
    + drop old_password option.
    + fix commentened logging options to use general_log and general_log_file.
  - Don't upgrade if there is an ndb management node configured (LP: #413792)
  - Set thread stack size to 192K rather than 128K. 128K is only useful on 
    systems with < 64M RAM and causes stack overrides with some SQL commands.
    See http://dev.mysql.com/doc/refman/5.1/en/server-system-varriables.html
    for more details. (LP: #426919)
  - Convert to upstart:
    + Add mysql-server-5.1.mysql.upstart
    + Dropped debian/mysql-server-5.1.mysql.init,
      debian/additions/mysqld_safe_syslog.cnf
    + debian/additions/my.cnf:
      * Removed pid declaration
      * Set up error logging to /var/log/mysql since we're not piping anything
        around logger anymore
    + Remove references to mysqld_safe in these files:
      * debian/rules, mysql-server-5.1.logcheck.ignore.paranoid
        mysql-server-5.1.logcheck.ignore.workstation, 
        mysql-server-5.1.logcheck.ignore.server
    + debian/mysql-server-5.1.postinst:
      * Replace calls to /etc/init.d with regular upstart calls
      * Remove reference to mysqld_safe
    + Dropped debian/patches/38_scripts_mysqld_safe.sh_signals.dpatch:
  - Dropped already merged upstream:
    + debian/{control,rules}: add and enable hardening build for PIE.
   

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 1995, 2009, Innobase Oy. 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., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
 
16
 
 
17
*****************************************************************************/
 
18
 
 
19
/******************************************************************//**
 
20
@file include/ut0sort.h
 
21
Sort utility
 
22
 
 
23
Created 11/9/1995 Heikki Tuuri
 
24
***********************************************************************/
 
25
 
 
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
/*******************************************************************//**
 
39
This macro expands to the body of a standard sort function.
 
40
The sort function uses mergesort and must be defined separately
 
41
for each type of array.
 
42
Also the comparison function has to be defined individually
 
43
for each array cell type. SORT_FUN is the sort function name.
 
44
The function takes the array to be sorted (ARR),
 
45
the array of auxiliary space (AUX_ARR) of same size,
 
46
and the low (LOW), inclusive, and high (HIGH), noninclusive,
 
47
limits for the sort interval as arguments.
 
48
CMP_FUN is the comparison function name. It takes as arguments
 
49
two elements from the array and returns 1, if the first is bigger,
 
50
0 if equal, and -1 if the second bigger. */
 
51
 
 
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