~ubuntu-branches/ubuntu/karmic/mysql-dfsg-5.1/karmic

« back to all changes in this revision

Viewing changes to storage/innobase/btr/btr0sea.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-02-10 16:42:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090210164205-ej41ocvm4z1s14nq
Tags: 5.1.31-1ubuntu1
* Merge from debian experimental, remaining changes: 
  - debian/mysql-server-5.1.config: ask for MySQL root password at priority
    high instead of medium so that the password prompt is seen on a default
    install. (LP: #319843)
  - debian/control: 
    + Don't build mysql-server, mysql-client, mysql-common and 
      libmysqlclient15-dev binary packages since they're still provided 
      by mysql-dfsg-5.0.
    + Rename libmysqlclient-dev package to libmysqlclient16-dev (LP: #316280).
      Make it conflict with libmysqlclient15-dev.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide 
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src 
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
  - debian/rules: added -fno-strict-aliasing to CFLAGS to get
    around mysql testsuite build failures.
* debian/patches/92_ssl_test_cert.dpatch: certificate expiration in 
  test suite (LP: #323755).
* Dropped changes:
  - all of the changes made to support both 5.0 and 5.1 installed at the
    same time have been dropped now that amarok doesn't depend on
    mysql-server-5.1 anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
        info->magic_n = BTR_SEARCH_MAGIC_N;
162
162
#endif /* UNIV_DEBUG */
163
163
 
 
164
        info->ref_count = 0;
164
165
        info->root_guess = NULL;
165
166
 
166
167
        info->hash_analysis = 0;
184
185
        return(info);
185
186
}
186
187
 
 
188
/*********************************************************************
 
189
Returns the value of ref_count. The value is protected by
 
190
btr_search_latch. */
 
191
ulint
 
192
btr_search_info_get_ref_count(
 
193
/*==========================*/
 
194
                                /* out: ref_count value. */
 
195
        btr_search_t*   info)   /* in: search info. */
 
196
{
 
197
        ulint ret;
 
198
 
 
199
        ut_ad(info);
 
200
 
 
201
#ifdef UNIV_SYNC_DEBUG
 
202
        ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
 
203
        ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
 
204
#endif /* UNIV_SYNC_DEBUG */
 
205
 
 
206
        rw_lock_s_lock(&btr_search_latch);
 
207
        ret = info->ref_count;
 
208
        rw_lock_s_unlock(&btr_search_latch);
 
209
 
 
210
        return(ret);
 
211
}
 
212
 
187
213
/*************************************************************************
188
214
Updates the search info of an index about hash successes. NOTE that info
189
215
is NOT protected by any semaphore, to save CPU time! Do not assume its fields
1022
1048
                ha_remove_all_nodes_to_page(table, folds[i], page);
1023
1049
        }
1024
1050
 
 
1051
        ut_a(index->search_info->ref_count > 0);
 
1052
        index->search_info->ref_count--;
 
1053
 
1025
1054
        block->is_hashed = FALSE;
1026
1055
        block->index = NULL;
 
1056
        
1027
1057
cleanup:
1028
1058
        if (UNIV_UNLIKELY(block->n_pointers)) {
1029
1059
                /* Corruption */
1244
1274
                goto exit_func;
1245
1275
        }
1246
1276
 
 
1277
        /* This counter is decremented every time we drop page
 
1278
        hash index entries and is incremented here. Since we can
 
1279
        rebuild hash index for a page that is already hashed, we
 
1280
        have to take care not to increment the counter in that
 
1281
        case. */
 
1282
        if (!block->is_hashed) {
 
1283
                index->search_info->ref_count++;
 
1284
        }
 
1285
 
1247
1286
        block->is_hashed = TRUE;
1248
1287
        block->n_hash_helps = 0;
1249
1288