~james-page/ubuntu/precise/mysql-5.5/misc-fixes

« back to all changes in this revision

Viewing changes to storage/innobase/dict/dict0dict.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-06-11 07:34:33 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120611073433-l9za2ni4ipp848y3
Tags: 5.5.24-0ubuntu0.12.04.1
* SECURITY UPDATE: Update to 5.5.24 to fix security issues (LP: #1011371)
  - http://dev.mysql.com/doc/refman/5.5/en/news-5-5-24.html

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
 
3
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
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
 
14
this program; if not, write to the Free Software Foundation, Inc.,
 
15
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
55
55
#include "m_ctype.h" /* my_isspace() */
56
56
#include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/
57
57
#include "row0upd.h"
 
58
#include "m_string.h"
 
59
#include "my_sys.h"
58
60
 
59
61
#include <ctype.h>
60
62
 
2329
2331
/*==============*/
2330
2332
        dict_foreign_t* foreign)        /*!< in, own: foreign key struct */
2331
2333
{
 
2334
        ut_a(foreign->foreign_table->n_foreign_key_checks_running == 0);
 
2335
 
2332
2336
        mem_heap_free(foreign->heap);
2333
2337
}
2334
2338
 
4337
4341
                    (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE
4338
4342
                     || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
4339
4343
                         && dict_index_is_clust(index)))) {
 
4344
                        mtr_t   mtr;
4340
4345
                        ulint   size;
4341
 
                        size = btr_get_size(index, BTR_TOTAL_SIZE);
4342
 
 
4343
 
                        index->stat_index_size = size;
4344
 
 
4345
 
                        sum_of_index_sizes += size;
4346
 
 
4347
 
                        size = btr_get_size(index, BTR_N_LEAF_PAGES);
4348
 
 
4349
 
                        if (size == 0) {
 
4346
 
 
4347
                        mtr_start(&mtr);
 
4348
                        mtr_s_lock(dict_index_get_lock(index), &mtr);
 
4349
 
 
4350
                        size = btr_get_size(index, BTR_TOTAL_SIZE, &mtr);
 
4351
 
 
4352
                        if (size != ULINT_UNDEFINED) {
 
4353
                                sum_of_index_sizes += size;
 
4354
                                index->stat_index_size = size;
 
4355
                                size = btr_get_size(
 
4356
                                        index, BTR_N_LEAF_PAGES, &mtr);
 
4357
                        }
 
4358
 
 
4359
                        mtr_commit(&mtr);
 
4360
 
 
4361
                        switch (size) {
 
4362
                        case ULINT_UNDEFINED:
 
4363
                                goto fake_statistics;
 
4364
                        case 0:
4350
4365
                                /* The root node of the tree is a leaf */
4351
4366
                                size = 1;
4352
4367
                        }
4363
4378
                        various means, also via secondary indexes. */
4364
4379
                        ulint   i;
4365
4380
 
 
4381
fake_statistics:
4366
4382
                        sum_of_index_sizes++;
4367
4383
                        index->stat_index_size = index->stat_n_leaf_pages = 1;
4368
4384