1278
1278
return mi_delete(file,buf);
1285
bool index_cond_func_myisam(void *arg)
1287
ha_myisam *h= (ha_myisam*)arg;
1288
/*if (h->in_range_read)*/
1291
if (h->compare_key2(h->end_range) > 0)
1292
return 2; /* caller should return HA_ERR_END_OF_FILE already */
1294
return (bool)h->pushed_idx_cond->val_int();
1302
1282
int ha_myisam::index_init(uint32_t idx, bool )
1304
1284
active_index=idx;
1305
1285
//in_range_read= false;
1306
if (pushed_idx_cond_keyno == idx)
1307
mi_set_index_cond_func(file, index_cond_func_myisam, this);
1312
1290
int ha_myisam::index_end()
1314
1292
active_index=MAX_KEY;
1315
//pushed_idx_cond_keyno= MAX_KEY;
1316
mi_set_index_cond_func(file, NULL, 0);
1317
in_range_check_pushed_down= false;
1502
1477
if (share->tmp_table == NO_TMP_TABLE)
1503
1478
pthread_mutex_lock(&share->mutex);
1504
1479
set_prefix(share->keys_in_use, share->keys);
1505
share->keys_in_use&= misam_info.key_map;
1481
* Due to bug 394932 (32-bit solaris build failure), we need
1482
* to convert the uint64_t key_map member of the misam_info
1483
* structure in to a std::bitset so that we can logically and
1484
* it with the share->key_in_use key_map.
1487
string binary_key_map;
1488
uint64_t num= misam_info.key_map;
1490
* Convert the uint64_t to a binary
1491
* string representation of it.
1495
uint64_t bin_digit= num % 2;
1499
binary_key_map.append(ostr.str());
1501
* Now we have the binary string representation of the
1502
* flags, we need to fill that string representation out
1503
* with the appropriate number of bits. This is needed
1504
* since key_map is declared as a std::bitset of a certain bit
1505
* width that depends on the MAX_INDEXES variable.
1507
if (MAX_INDEXES <= 64)
1509
size_t len= 72 - binary_key_map.length();
1510
string all_zeros(len, '0');
1511
binary_key_map.insert(binary_key_map.begin(),
1517
size_t len= (MAX_INDEXES + 7) / 8 * 8;
1518
string all_zeros(len, '0');
1519
binary_key_map.insert(binary_key_map.begin(),
1523
key_map tmp_map(binary_key_map);
1524
share->keys_in_use&= tmp_map;
1506
1525
share->keys_for_keyread&= share->keys_in_use;
1507
1526
share->db_record_offset= misam_info.record_offset;
1508
1527
if (share->key_parts)
1780
1796
return mi_panic(HA_PANIC_CLOSE);
1784
/* Index condition pushdown implementation*/
1787
Item *ha_myisam::idx_cond_push(uint32_t keyno_arg, Item* idx_cond_arg)
1789
pushed_idx_cond_keyno= keyno_arg;
1790
pushed_idx_cond= idx_cond_arg;
1791
in_range_check_pushed_down= true;
1792
if (active_index == pushed_idx_cond_keyno)
1793
mi_set_index_cond_func(file, index_cond_func_myisam, this);
1797
1799
static DRIZZLE_SYSVAR_UINT(block_size, block_size,
1798
1800
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
1799
1801
N_("Block size to be used for MyISAM index pages."),