~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-10-08 14:22:02 UTC
  • mfrom: (1802.16.21 bug621875)
  • mto: This revision was merged to the branch mainline in revision 1824.
  • Revision ID: brian@tangent.org-20101008142202-96maf31n9odkc13n
Merge Padraig

Show diffs side-by-side

added added

removed removed

Lines of Context:
2110
2110
 
2111
2111
        xt_spinlock_free(self, &mi->mi_dirty_lock);
2112
2112
        XT_INDEX_FREE_LOCK(self, mi);
 
2113
#ifndef DRIZZLED
2113
2114
        myxt_bitmap_free(self, &mi->mi_col_map);
 
2115
#endif
2114
2116
        if (mi->mi_free_list)
2115
2117
                xt_free(self, mi->mi_free_list);
2116
2118
 
2140
2142
        uint                                    options = 0;
2141
2143
        u_int                                   key_length = 0;
2142
2144
        xtBool                                  partial_field;
 
2145
    MX_BITMAP               mi_col_map;
2143
2146
 
2144
2147
        enter_();
2145
2148
 
2154
2157
        ind->mi_fix_key = TRUE;
2155
2158
        ind->mi_select_total = 0;
2156
2159
        ind->mi_subset_of = 0;
 
2160
#ifdef DRIZZLED
 
2161
    mi_col_map.resize(GET_TABLE_SHARE(table_arg)->fields);      
 
2162
    mi_col_map.reset();
 
2163
    ind->mi_col_map= mi_col_map.to_ulong();
 
2164
    ind->mi_col_map_size= GET_TABLE_SHARE(table_arg)->fields;
 
2165
#else
2157
2166
        myxt_bitmap_init(self, &ind->mi_col_map, GET_TABLE_SHARE(table_arg)->fields);
 
2167
#endif
2158
2168
        
2159
2169
        ind->mi_seg_count = (uint) index->key_parts;
2160
2170
        key_part_end = index->key_part + index->key_parts;
2301
2311
 
2302
2312
                /* NOTE: do not set if the field is only partially in the index!!! */
2303
2313
                if (!partial_field)
 
2314
#ifdef DRIZZLED
 
2315
                        MX_BIT_FAST_TEST_AND_SET(&mi_col_map, field->field_index);
 
2316
#else
2304
2317
                        MX_BIT_FAST_TEST_AND_SET(&ind->mi_col_map, field->field_index);
 
2318
#endif
2305
2319
        }
2306
2320
 
2307
2321
        if (key_length > XT_INDEX_MAX_KEY_SIZE)
3346
3360
 
3347
3361
static void myxt_bitmap_init(XTThreadPtr self, MX_BITMAP *map, u_int n_bits)
3348
3362
{
 
3363
#ifdef DRIZZLED
 
3364
    (void) self;
 
3365
    map= new boost::dynamic_bitset<>(n_bits);
 
3366
    map->resize(n_bits);
 
3367
    map->reset();
 
3368
#else
3349
3369
        my_bitmap_map   *buf;
3350
3370
    uint                        size_in_bytes = (((n_bits) + 31) / 32) * 4;
3351
 
 
3352
3371
        buf = (my_bitmap_map *) xt_malloc(self, size_in_bytes);
3353
 
 
3354
 
#ifdef DRIZZLED
3355
 
        map->init(buf, n_bits);
3356
 
#else
3357
3372
        map->bitmap= buf;
3358
3373
        map->n_bits= n_bits;
3359
3374
        create_last_word_mask(map);
3364
3379
static void myxt_bitmap_free(XTThreadPtr self, MX_BITMAP *map)
3365
3380
{
3366
3381
#ifdef DRIZZLED
3367
 
        my_bitmap_map *buf = map->getBitmap();
3368
 
        if (buf)
3369
 
                xt_free(self, buf);
3370
 
        map->setBitmap(NULL);
 
3382
    (void) self;
 
3383
    if (map->empty())
 
3384
        map->clear();
 
3385
    delete map;
3371
3386
#else
3372
3387
        if (map->bitmap) {
3373
3388
                xt_free(self, map->bitmap);