~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Merge Joe, plus I updated the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 PrimeBase Technologies GmbH, Germany
 
1
/* Copyright (c) 2005 PrimeBase Technologies GmbH, Germany
2
2
 *
3
3
 * PrimeBase XT
4
4
 *
14
14
 *
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
18
 *
19
19
 * 2005-05-24   Paul McCullagh
20
20
 *
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
670
667
                        ind_cac_globals.cg_free_list = block;
671
668
                        block++;
672
669
                }
683
680
        cont_(a);
684
681
}
685
682
 
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
 
 
699
683
xtPublic void xt_ind_exit(XTThreadPtr self)
700
684
{
701
685
#ifdef XT_USE_MYSYS
886
870
                         * #9   0x00e0ff0b in ha_pbxt::write_row at ha_pbxt.cc:2340
887
871
                         * #10  0x0023a00f in handler::ha_write_row at handler.cc:4570
888
872
                         * #11  0x001a32c8 in write_record at sql_insert.cc:1568
889
 
                         * #12  0x001ab635 in insert_query at sql_insert.cc:812
 
873
                         * #12  0x001ab635 in mysql_insert at sql_insert.cc:812
890
874
                         * #13  0x0010e068 in mysql_execute_command at sql_parse.cc:3066
891
875
                         * #14  0x0011480d in mysql_parse at sql_parse.cc:5787
892
876
                         * #15  0x00115afb in dispatch_command at sql_parse.cc:1200
1272
1256
         * Conditionally count the number of deleted entries in the index:
1273
1257
         * We do this before other threads can read the block.
1274
1258
         */
1275
 
        if (ind && ind->mi_lazy_delete && read_data)
 
1259
        if (ind->mi_lazy_delete && read_data)
1276
1260
                xt_ind_count_deleted_items(ot->ot_table, ind, block);
1277
1261
 
1278
1262
        /* Add to the hash table: */
1365
1349
#ifdef XT_TRACK_INDEX_UPDATES
1366
1350
        ot->ot_ind_changed++;
1367
1351
#endif
1368
 
#ifdef CHECK_BLOCK_TRAILERS
1369
 
        check_block_trailers();
1370
 
#endif
1371
1352
        return OK;
1372
1353
}
1373
1354