Below is the list of changes that have just been committed into a local
5.2 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-03-10 12:00:04+03:00, sergefp@stripped +2 -0
WL#2475: "Batched range read functions for MyISAM/InnoDb"
Test failure fixes
sql/ha_ndbcluster.cc@stripped, 2007-03-10 12:00:00+03:00, sergefp@stripped +3 -2
WL#2475: "Batched range read functions for MyISAM/InnoDb", post-fixes
- Make ha_ndbcluster::multi_read_range_info() require proper buffer size.
sql/opt_range.cc@stripped, 2007-03-10 12:00:00+03:00, sergefp@stripped +35 -1
WL#2475: "Batched range read functions for MyISAM/InnoDb", post-fixes
- When creating QUICK_RANGE_SELECT for ref access, call
file->multi_range_read_info() to get a proper set of MRR flags.
- In particular, pass HA_MRR_NO_NULL_ENDPOINTS flag so NDB can decide
whether it can use its native MRR or not.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: sergefp
# Host: pylon.mylan
# Root: /home/psergey/mysql-5.2-mymrr-r55
--- 1.266/sql/opt_range.cc 2007-03-10 12:00:11 +03:00
+++ 1.267/sql/opt_range.cc 2007-03-10 12:00:11 +03:00
@@ -7689,6 +7689,23 @@
return fts;
}
+static bool
+key_has_nulls(const KEY* key_info, const byte *key, uint key_len)
+{
+ KEY_PART_INFO *curr_part, *end_part;
+ const byte* end_ptr= key + key_len;
+ curr_part= key_info->key_part;
+ end_part= curr_part + key_info->key_parts;
+
+ for (; curr_part != end_part && key < end_ptr; curr_part++)
+ {
+ if (curr_part->null_bit && *key)
+ return TRUE;
+
+ key += curr_part->store_length;
+ }
+ return FALSE;
+}
/*
Create quick select from ref/ref_or_null scan.
@@ -7785,8 +7802,25 @@
goto err;
}
- return quick;
+ /* Call multi_range_read_info() to get the MRR flags and buffer size */
+ quick->mrr_flags= HA_MRR_NO_ASSOCIATION |
+ (table->key_read ? HA_MRR_INDEX_ONLY : 0);
+ if (thd->lex->sql_command != SQLCOM_SELECT)
+ quick->mrr_flags |= HA_MRR_USE_DEFAULT_IMPL;
+#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
+ if (!ref->null_ref_key && !key_has_nulls(key_info, range->min_key,
+ ref->key_length))
+ quick->mrr_flags |= HA_MRR_NO_NULL_ENDPOINTS;
+#endif
+
+ quick->mrr_buf_size= thd->variables.read_rnd_buff_size;
+ COST_VECT cost;
+ if (table->file->multi_range_read_info(quick->index, 1, records,
+ &quick->mrr_buf_size,
+ &quick->mrr_flags, &cost))
+ goto err;
+ return quick;
err:
delete quick;
return 0;
--- 1.417/sql/ha_ndbcluster.cc 2007-03-10 12:00:12 +03:00
+++ 1.418/sql/ha_ndbcluster.cc 2007-03-10 12:00:12 +03:00
@@ -8162,6 +8162,7 @@
uint *bufsz, uint *flags, COST_VECT *cost)
{
int res;
+ uint save_bufsize= *bufsz;
res= handler::multi_range_read_info(keyno, n_ranges, keys, bufsz, flags,
cost);
if (uses_blob_value() || !(*flags & HA_MRR_NO_NULL_ENDPOINTS))
@@ -8172,7 +8173,7 @@
else
{
*flags &= ~HA_MRR_USE_DEFAULT_IMPL;
- *bufsz= min(*bufsz, keys * table_share->reclength);
+ *bufsz= min(save_bufsize, keys * table_share->reclength);
}
return res;
}
@@ -8196,7 +8197,7 @@
m_write_op= FALSE;
int res;
Thd_ndb *thd_ndb= get_thd_ndb(current_thd);
- DBUG_ENTER("ha_ndbcluster::read_multi_range_first");
+ DBUG_ENTER("ha_ndbcluster::multi_range_read_init");
if (mode & HA_MRR_USE_DEFAULT_IMPL)
{
| Thread |
|---|
| • bk commit into 5.2 tree (sergefp:1.2475) | Sergey Petrunia | 10 Mar |