mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/merge-5.0-5.1-opt mysql-test/r/type_time.result: Auto merged sql/field.cc: Auto merged sql/item_cmpfunc.cc: Auto merged BitKeeper/deleted/.del-index_merge.result: Auto merged mysql-test/include/index_merge1.inc: Auto merged sql/item_cmpfunc.h: Auto merged sql/opt_range.cc: Auto merged storage/heap/ha_heap.cc: Auto merged storage/heap/ha_heap.h: Auto merged
This commit is contained in:
@@ -1264,8 +1264,16 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
|
||||
thd= head->in_use;
|
||||
if (!(file= head->file->clone(thd->mem_root)))
|
||||
{
|
||||
/*
|
||||
Manually set the error flag. Note: there seems to be quite a few
|
||||
places where a failure could cause the server to "hang" the client by
|
||||
sending no response to a query. ATM those are not real errors because
|
||||
the storage engine calls in question happen to never fail with the
|
||||
existing storage engines.
|
||||
*/
|
||||
thd->net.report_error= 1; /* purecov: inspected */
|
||||
/* Caller will free the memory */
|
||||
goto failure;
|
||||
goto failure; /* purecov: inspected */
|
||||
}
|
||||
|
||||
head->column_bitmaps_set(&column_bitmap, &column_bitmap);
|
||||
@@ -7244,6 +7252,11 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree, bool update_tbl_stats)
|
||||
param->is_ror_scan is cleared if the function detects that the key scan is
|
||||
not a Rowid-Ordered Retrieval scan ( see comments for is_key_scan_ror
|
||||
function for description of which key scans are ROR scans)
|
||||
|
||||
RETURN
|
||||
#records E(#records) for given subtree
|
||||
HA_POS_ERROR if subtree cannot be used for record retrieval
|
||||
|
||||
*/
|
||||
|
||||
static ha_rows
|
||||
@@ -7445,27 +7458,24 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
|
||||
ROR (Rowid Ordered Retrieval) key scan is a key scan that produces
|
||||
ordered sequence of rowids (ha_xxx::cmp_ref is the comparison function)
|
||||
|
||||
An index scan is a ROR scan if it is done using a condition in form
|
||||
This function is needed to handle a practically-important special case:
|
||||
an index scan is a ROR scan if it is done using a condition in form
|
||||
|
||||
"key1_1=c_1 AND ... AND key1_n=c_n" (1)
|
||||
"key1_1=c_1 AND ... AND key1_n=c_n"
|
||||
|
||||
where the index is defined on (key1_1, ..., key1_N [,a_1, ..., a_n])
|
||||
|
||||
and the table has a clustered Primary Key
|
||||
and the table has a clustered Primary Key defined as
|
||||
|
||||
PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k) with first key parts being
|
||||
identical to uncovered parts ot the key being scanned (2)
|
||||
|
||||
Scans on HASH indexes are not ROR scans,
|
||||
any range scan on clustered primary key is ROR scan (3)
|
||||
|
||||
Check (1) is made in check_quick_keys()
|
||||
Check (3) is made check_quick_select()
|
||||
Check (2) is made by this function.
|
||||
PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k)
|
||||
|
||||
i.e. the first key parts of it are identical to uncovered parts ot the
|
||||
key being scanned. This function assumes that the index flags do not
|
||||
include HA_KEY_SCAN_NOT_ROR flag (that is checked elsewhere).
|
||||
|
||||
RETURN
|
||||
TRUE If the scan is ROR-scan
|
||||
FALSE otherwise
|
||||
TRUE The scan is ROR-scan
|
||||
FALSE Otherwise
|
||||
*/
|
||||
|
||||
static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts)
|
||||
|
Reference in New Issue
Block a user