~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/ha/ha0ha.c

Merge Revision revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6900 from MySQL InnoDB

Original revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6900

Original Authors: mmakela
Original commit message:
branches/zip: Merge c6899 from branches/innodb+:

Add debug assertions to track down Bug #52360.
hash_table_t::magic_n: Add HASH_TABLE_MAGIC_N checks, which were fully absent.
ut_hash_ulint(): Assert table_size > 0 before division.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
        ulint   i;
102
102
        ulint   n;
103
103
 
 
104
        ut_ad(table);
 
105
        ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
104
106
#ifdef UNIV_SYNC_DEBUG
105
107
        ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EXCLUSIVE));
106
108
#endif /* UNIV_SYNC_DEBUG */
146
148
        ha_node_t*      prev_node;
147
149
        ulint           hash;
148
150
 
149
 
        ut_ad(table && data);
 
151
        ut_ad(data);
 
152
        ut_ad(table);
 
153
        ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
150
154
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
151
155
        ut_a(block->frame == page_align(data));
152
156
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
237
241
        hash_table_t*   table,          /*!< in: hash table */
238
242
        ha_node_t*      del_node)       /*!< in: node to be deleted */
239
243
{
 
244
        ut_ad(table);
 
245
        ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
240
246
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
241
247
# ifndef UNIV_HOTBACKUP
242
248
        if (table->adaptive) {
267
273
{
268
274
        ha_node_t*      node;
269
275
 
 
276
        ut_ad(table);
 
277
        ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
270
278
        ASSERT_HASH_MUTEX_OWN(table, fold);
271
279
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
272
280
        ut_a(new_block->frame == page_align(new_data));
304
312
{
305
313
        ha_node_t*      node;
306
314
 
 
315
        ut_ad(table);
 
316
        ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
307
317
        ASSERT_HASH_MUTEX_OWN(table, fold);
308
318
 
309
319
        node = ha_chain_get_first(table, fold);
353
363
        ibool           ok      = TRUE;
354
364
        ulint           i;
355
365
 
 
366
        ut_ad(table);
 
367
        ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
356
368
        ut_a(start_index <= end_index);
357
369
        ut_a(start_index < hash_get_n_cells(table));
358
370
        ut_a(end_index < hash_get_n_cells(table));
391
403
        FILE*           file,   /*!< in: file where to print */
392
404
        hash_table_t*   table)  /*!< in: hash table */
393
405
{
 
406
        ut_ad(table);
 
407
        ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
394
408
#ifdef UNIV_DEBUG
395
409
/* Some of the code here is disabled for performance reasons in production
396
410
builds, see http://bugs.mysql.com/36941 */