~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/cache_xt.cc

  • Committer: Paul McCullagh
  • Date: 2010-09-16 15:26:41 UTC
  • mto: (1771.3.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1785.
  • Revision ID: paul.mccullagh@primebase.org-20100916152641-9mwb1hga0qwz41nu
Merged with 1.1 trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
664
664
                        block->cb_data = buffer;
665
665
                        buffer += XT_INDEX_PAGE_SIZE;
666
666
#endif
 
667
#ifdef CHECK_BLOCK_TRAILERS
 
668
                        XT_SET_DISK_4(block->cp_check, 0xDEADBEEF);
 
669
#endif
667
670
                        ind_cac_globals.cg_free_list = block;
668
671
                        block++;
669
672
                }
680
683
        cont_(a);
681
684
}
682
685
 
 
686
#ifdef CHECK_BLOCK_TRAILERS
 
687
xtPublic void check_block_trailers()
 
688
{
 
689
        XTIndBlockPtr   block;
 
690
 
 
691
        block = ind_cac_globals.cg_blocks;
 
692
        for (u_int i=0; i<ind_cac_globals.cg_block_count; i++) {
 
693
                ASSERT_NS(XT_GET_DISK_4(block->cp_check) == 0xDEADBEEF);
 
694
                block++;
 
695
        }
 
696
}
 
697
#endif
 
698
 
683
699
xtPublic void xt_ind_exit(XTThreadPtr self)
684
700
{
685
701
#ifdef XT_USE_MYSYS
1256
1272
         * Conditionally count the number of deleted entries in the index:
1257
1273
         * We do this before other threads can read the block.
1258
1274
         */
1259
 
        if (ind->mi_lazy_delete && read_data)
 
1275
        if (ind && ind->mi_lazy_delete && read_data)
1260
1276
                xt_ind_count_deleted_items(ot->ot_table, ind, block);
1261
1277
 
1262
1278
        /* Add to the hash table: */
1349
1365
#ifdef XT_TRACK_INDEX_UPDATES
1350
1366
        ot->ot_ind_changed++;
1351
1367
#endif
 
1368
#ifdef CHECK_BLOCK_TRAILERS
 
1369
        check_block_trailers();
 
1370
#endif
1352
1371
        return OK;
1353
1372
}
1354
1373