summaryrefslogtreecommitdiff
path: root/storage/maria
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-17 21:24:29 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-17 21:24:29 +0200
commit97e640b9ae83e07b444fceede6b0524256c7a3cc (patch)
tree8f48fbfaf88ea7895ce59fd3ac2fbe6184334387 /storage/maria
parent2f6a2494a5eb2cf3ab06fbedd2584eca85d90230 (diff)
parentc7973615e723b13c6457b494b72be2fac35bfd18 (diff)
downloadmariadb-git-97e640b9ae83e07b444fceede6b0524256c7a3cc.tar.gz
5.5 merge
Diffstat (limited to 'storage/maria')
-rw-r--r--storage/maria/ha_maria.cc25
-rw-r--r--storage/maria/ma_write.c8
2 files changed, 27 insertions, 6 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index f215b04b68f..ef2ee01c0e4 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2134,7 +2134,9 @@ void ha_maria::start_bulk_insert(ha_rows rows, uint flags)
else if (!file->bulk_insert &&
(!rows || rows >= MARIA_MIN_ROWS_TO_USE_BULK_INSERT))
{
- maria_init_bulk_insert(file, thd->variables.bulk_insert_buff_size, rows);
+ maria_init_bulk_insert(file,
+ (size_t) thd->variables.bulk_insert_buff_size,
+ rows);
}
}
DBUG_VOID_RETURN;
@@ -3475,7 +3477,7 @@ static int ha_maria_init(void *p)
maria_hton= (handlerton *)p;
maria_hton->state= SHOW_OPTION_YES;
- maria_hton->db_type= DB_TYPE_UNKNOWN;
+ maria_hton->db_type= DB_TYPE_ARIA;
maria_hton->create= maria_create_handler;
maria_hton->panic= maria_hton_panic;
maria_hton->tablefile_extensions= ha_maria_exts;
@@ -3802,6 +3804,25 @@ int ha_maria::multi_range_read_explain_info(uint mrr_mode, char *str,
Item *ha_maria::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;
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 09d42a9be72..fb9e04ea419 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -1715,7 +1715,7 @@ static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
}
-int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows)
+int maria_init_bulk_insert(MARIA_HA *info, size_t cache_size, ha_rows rows)
{
MARIA_SHARE *share= info->s;
MARIA_KEYDEF *key=share->keyinfo;
@@ -1723,7 +1723,7 @@ int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows)
uint i, num_keys, total_keylength;
ulonglong key_map;
DBUG_ENTER("_ma_init_bulk_insert");
- DBUG_PRINT("enter",("cache_size: %lu", cache_size));
+ DBUG_PRINT("enter",("cache_size: %lu", (ulong) cache_size));
DBUG_ASSERT(!info->bulk_insert &&
(!rows || rows >= MARIA_MIN_ROWS_TO_USE_BULK_INSERT));
@@ -1741,11 +1741,11 @@ int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows)
}
if (num_keys==0 ||
- num_keys * MARIA_MIN_SIZE_BULK_INSERT_TREE > cache_size)
+ num_keys * (size_t) MARIA_MIN_SIZE_BULK_INSERT_TREE > cache_size)
DBUG_RETURN(0);
if (rows && rows*total_keylength < cache_size)
- cache_size= (ulong)rows;
+ cache_size= (size_t)rows;
else
cache_size/=total_keylength*16;