summaryrefslogtreecommitdiff
path: root/storage/myisam/ha_myisam.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisam/ha_myisam.cc')
-rw-r--r--storage/myisam/ha_myisam.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index b99cf9f647e..756d52a4890 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1562,7 +1562,8 @@ void ha_myisam::start_bulk_insert(ha_rows rows, uint flags)
if (!file->bulk_insert &&
(!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
{
- mi_init_bulk_insert(file, thd->variables.bulk_insert_buff_size, rows);
+ mi_init_bulk_insert(file, (size_t) thd->variables.bulk_insert_buff_size,
+ rows);
}
}
DBUG_VOID_RETURN;
@@ -2278,6 +2279,25 @@ int ha_myisam::multi_range_read_explain_info(uint mrr_mode, char *str,
Item *ha_myisam::idx_cond_push(uint keyno_arg, Item* idx_cond_arg)
{
+ /*
+ Check if the key contains a blob field. If it does then MyISAM
+ should not accept the pushed index condition since MyISAM will not
+ read the blob field from the index entry during evaluation of the
+ pushed index condition and the BLOB field might be part of the
+ range evaluation done by the ICP code.
+ */
+ const KEY *key= &table_share->key_info[keyno_arg];
+
+ for (uint k= 0; k < key->key_parts; ++k)
+ {
+ const KEY_PART_INFO *key_part= &key->key_part[k];
+ if (key_part->key_part_flag & HA_BLOB_PART)
+ {
+ /* Let the server handle the index condition */
+ return idx_cond_arg;
+ }
+ }
+
pushed_idx_cond_keyno= keyno_arg;
pushed_idx_cond= idx_cond_arg;
in_range_check_pushed_down= TRUE;