diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-01-22 14:04:40 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-01-22 14:04:40 +0200 |
commit | 03e4b98c7b22203c911eb2396cef52f44768f6ef (patch) | |
tree | db1cb9732cc2b568c4a56c3f6d11cf8f4d5250b6 /sql/opt_range.cc | |
parent | 644e6c7fdd75b9e6e869927d956e38964eb95494 (diff) | |
parent | af583b828303e5ad7a285b54d60fb1b3669ee2a9 (diff) | |
download | mariadb-git-03e4b98c7b22203c911eb2396cef52f44768f6ef.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
BitKeeper/etc/ignore:
added mysql-test/mysql-test-run-shell
client/mysql.cc:
Auto merged
client/mysql_upgrade.c:
Auto merged
client/mysqlbinlog.cc:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
client/sql_string.cc:
Auto merged
client/sql_string.h:
Auto merged
extra/my_print_defaults.c:
Auto merged
include/m_ctype.h:
Auto merged
include/my_pthread.h:
Auto merged
include/my_sys.h:
Auto merged
include/my_time.h:
Auto merged
include/mysql.h:
Auto merged
libmysql/libmysql.c:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
myisam/ft_boolean_search.c:
Auto merged
myisam/mi_open.c:
Auto merged
myisam/mi_search.c:
Auto merged
myisam/mi_unique.c:
Auto merged
myisam/myisampack.c:
Auto merged
myisam/rt_index.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysys/default.c:
Auto merged
mysys/mf_iocache2.c:
Auto merged
mysys/mf_keycache.c:
Auto merged
mysys/my_bitmap.c:
Auto merged
mysys/sha1.c:
Auto merged
ndb/include/kernel/signaldata/ArbitSignalData.hpp:
Auto merged
ndb/include/kernel/signaldata/DictTabInfo.hpp:
Auto merged
ndb/include/ndbapi/NdbReceiver.hpp:
Auto merged
ndb/include/transporter/TransporterDefinitions.hpp:
Auto merged
ndb/include/util/InputStream.hpp:
Auto merged
ndb/include/util/OutputStream.hpp:
Auto merged
ndb/include/util/SimpleProperties.hpp:
Auto merged
ndb/include/util/SocketAuthenticator.hpp:
Auto merged
ndb/include/util/SocketServer.hpp:
Auto merged
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
Auto merged
ndb/src/common/portlib/NdbTick.c:
Auto merged
ndb/src/common/transporter/SHM_Transporter.cpp:
Auto merged
ndb/src/common/transporter/TCP_Transporter.cpp:
Auto merged
ndb/src/common/transporter/TCP_Transporter.hpp:
Auto merged
ndb/src/common/transporter/Transporter.cpp:
Auto merged
ndb/src/common/transporter/TransporterRegistry.cpp:
Auto merged
ndb/src/common/util/Bitmask.cpp:
Auto merged
ndb/src/common/util/ConfigValues.cpp:
Auto merged
ndb/src/common/util/File.cpp:
Auto merged
ndb/src/common/util/Properties.cpp:
Auto merged
ndb/src/common/util/SocketClient.cpp:
Auto merged
ndb/src/common/util/random.c:
Auto merged
ndb/src/common/util/socket_io.cpp:
Auto merged
ndb/src/cw/cpcd/APIService.cpp:
Auto merged
ndb/src/cw/cpcd/main.cpp:
Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Auto merged
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
Auto merged
ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
Auto merged
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Auto merged
ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
Auto merged
ndb/src/kernel/blocks/dbtup/DbtupScan.cpp:
Auto merged
ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp:
Auto merged
ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
Auto merged
ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp:
Auto merged
ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp:
Auto merged
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
Auto merged
ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp:
Auto merged
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
Auto merged
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
Auto merged
ndb/src/kernel/blocks/suma/Suma.cpp:
Auto merged
ndb/src/kernel/blocks/suma/Suma.hpp:
Auto merged
ndb/src/kernel/vm/MetaData.hpp:
Auto merged
ndb/src/mgmapi/LocalConfig.cpp:
Auto merged
ndb/src/mgmapi/mgmapi.cpp:
Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
ndb/src/mgmsrv/ConfigInfo.hpp:
Auto merged
ndb/src/mgmsrv/InitConfigFileParser.cpp:
Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
Auto merged
ndb/src/mgmsrv/Services.cpp:
Auto merged
ndb/src/mgmsrv/main.cpp:
Auto merged
ndb/src/ndbapi/ClusterMgr.hpp:
Auto merged
ndb/src/ndbapi/Ndb.cpp:
Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
ndb/src/ndbapi/NdbIndexOperation.cpp:
Auto merged
ndb/src/ndbapi/NdbOperationDefine.cpp:
Auto merged
ndb/src/ndbapi/NdbOperationExec.cpp:
Auto merged
ndb/src/ndbapi/NdbOperationSearch.cpp:
Auto merged
ndb/src/ndbapi/NdbScanFilter.cpp:
Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
Auto merged
ndb/src/ndbapi/SignalSender.cpp:
Auto merged
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Auto merged
ndb/tools/delete_all.cpp:
Auto merged
ndb/tools/desc.cpp:
Auto merged
ndb/tools/drop_index.cpp:
Auto merged
ndb/tools/drop_tab.cpp:
Auto merged
ndb/tools/listTables.cpp:
Auto merged
ndb/tools/ndb_config.cpp:
Auto merged
ndb/tools/restore/Restore.hpp:
Auto merged
ndb/tools/restore/consumer.hpp:
Auto merged
ndb/tools/restore/restore_main.cpp:
Auto merged
ndb/tools/select_all.cpp:
Auto merged
ndb/tools/select_count.cpp:
Auto merged
server-tools/instance-manager/commands.h:
Auto merged
server-tools/instance-manager/guardian.cc:
Auto merged
server-tools/instance-manager/instance_options.cc:
Auto merged
server-tools/instance-manager/mysql_connection.cc:
Auto merged
server-tools/instance-manager/options.cc:
Auto merged
server-tools/instance-manager/options.h:
Auto merged
server-tools/instance-manager/parse.cc:
Auto merged
server-tools/instance-manager/user_map.cc:
Auto merged
server-tools/instance-manager/user_map.h:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/filesort.cc:
Auto merged
sql/ha_archive.cc:
Auto merged
sql/ha_archive.h:
Auto merged
sql/ha_federated.cc:
Auto merged
sql/ha_heap.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_geofunc.cc:
Auto merged
sql/item_row.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_subselect.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/opt_range.h:
Auto merged
sql/password.c:
Auto merged
sql/protocol.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/spatial.cc:
Auto merged
sql/spatial.h:
Auto merged
sql/sql_cache.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_derived.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql-common/client.c:
Auto merged
sql-common/my_time.c:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_string.cc:
Auto merged
sql/sql_string.h:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_trigger.h:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/tztime.cc:
Auto merged
sql/unireg.cc:
Auto merged
strings/ctype-bin.c:
Auto merged
strings/ctype-cp932.c:
Auto merged
strings/ctype-eucjpms.c:
Auto merged
strings/ctype-mb.c:
Auto merged
strings/ctype-simple.c:
Auto merged
strings/ctype-sjis.c:
Auto merged
strings/ctype-uca.c:
Auto merged
strings/ctype-ujis.c:
Auto merged
strings/ctype-utf8.c:
Auto merged
strings/decimal.c:
Auto merged
strings/my_vsnprintf.c:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/t/mysqlbinlog.test:
Manual merge
sql/sql_class.h:
Manual merge
sql/sql_parse.cc:
Manual merge
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 156 |
1 files changed, 70 insertions, 86 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 04bc24b718a..fd67f4e7501 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -496,9 +496,6 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, double read_time); static TRP_GROUP_MIN_MAX *get_best_group_min_max(PARAM *param, SEL_TREE *tree); -static int get_index_merge_params(PARAM *param, key_map& needed_reg, - SEL_IMERGE *imerge, double *read_time, - ha_rows* imerge_rows); static double get_index_only_read_time(const PARAM* param, ha_rows records, int keynr); @@ -508,7 +505,6 @@ static void print_sel_tree(PARAM *param, SEL_TREE *tree, key_map *tree_map, static void print_ror_scans_arr(TABLE *table, const char *msg, struct st_ror_scan_info **start, struct st_ror_scan_info **end); -static void print_rowid(byte* val, int len); static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg); #endif @@ -820,7 +816,7 @@ QUICK_SELECT_I::QUICK_SELECT_I() QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr, bool no_alloc, MEM_ROOT *parent_alloc) - :dont_free(0),error(0),free_file(0),in_range(0),cur_range(NULL),range(0) + :dont_free(0),error(0),free_file(0),in_range(0),cur_range(NULL),last_range(0) { sorted= 0; index= key_nr; @@ -1245,13 +1241,12 @@ int QUICK_ROR_UNION_SELECT::queue_cmp(void *arg, byte *val1, byte *val2) int QUICK_ROR_UNION_SELECT::reset() { - QUICK_SELECT_I* quick; + QUICK_SELECT_I *quick; int error; DBUG_ENTER("QUICK_ROR_UNION_SELECT::reset"); have_prev_rowid= FALSE; if (!scans_inited) { - QUICK_SELECT_I *quick; List_iterator_fast<QUICK_SELECT_I> it(quick_selects); while ((quick= it++)) { @@ -6589,7 +6584,7 @@ int QUICK_RANGE_SELECT::reset() byte *mrange_buff; DBUG_ENTER("QUICK_RANGE_SELECT::reset"); next=0; - range= NULL; + last_range= NULL; in_range= FALSE; cur_range= (QUICK_RANGE**) ranges.buffer; @@ -6707,23 +6702,23 @@ int QUICK_RANGE_SELECT::get_next() { start_key= &mrange_slot->start_key; end_key= &mrange_slot->end_key; - range= *(cur_range++); + last_range= *(cur_range++); - start_key->key= (const byte*) range->min_key; - start_key->length= range->min_length; - start_key->flag= ((range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : - (range->flag & EQ_RANGE) ? + start_key->key= (const byte*) last_range->min_key; + start_key->length= last_range->min_length; + start_key->flag= ((last_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : + (last_range->flag & EQ_RANGE) ? HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT); - end_key->key= (const byte*) range->max_key; - end_key->length= range->max_length; + end_key->key= (const byte*) last_range->max_key; + end_key->length= last_range->max_length; /* We use HA_READ_AFTER_KEY here because if we are reading on a key prefix. We want to find all keys with this prefix. */ - end_key->flag= (range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY : + end_key->flag= (last_range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); - mrange_slot->range_flag= range->flag; + mrange_slot->range_flag= last_range->flag; } result= file->read_multi_range_first(&mrange, multi_range, count, @@ -6773,7 +6768,7 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, byte *cur_prefix) { int result; key_range start_key, end_key; - if (range) + if (last_range) { /* Read the next record in the same range with prefix after cur_prefix. */ DBUG_ASSERT(cur_prefix != 0); @@ -6787,35 +6782,35 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length, byte *cur_prefix) if (count == 0) { /* Ranges have already been used up before. None is left for read. */ - range= 0; + last_range= 0; DBUG_RETURN(HA_ERR_END_OF_FILE); } - range= *(cur_range++); + last_range= *(cur_range++); - start_key.key= (const byte*) range->min_key; - start_key.length= min(range->min_length, prefix_length); - start_key.flag= ((range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : - (range->flag & EQ_RANGE) ? + start_key.key= (const byte*) last_range->min_key; + start_key.length= min(last_range->min_length, prefix_length); + start_key.flag= ((last_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY : + (last_range->flag & EQ_RANGE) ? HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT); - end_key.key= (const byte*) range->max_key; - end_key.length= min(range->max_length, prefix_length); + end_key.key= (const byte*) last_range->max_key; + end_key.length= min(last_range->max_length, prefix_length); /* We use READ_AFTER_KEY here because if we are reading on a key prefix we want to find all keys with this prefix */ - end_key.flag= (range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY : + end_key.flag= (last_range->flag & NEAR_MAX ? HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY); - result= file->read_range_first(range->min_length ? &start_key : 0, - range->max_length ? &end_key : 0, - test(range->flag & EQ_RANGE), + result= file->read_range_first(last_range->min_length ? &start_key : 0, + last_range->max_length ? &end_key : 0, + test(last_range->flag & EQ_RANGE), sorted); - if (range->flag == (UNIQUE_RANGE | EQ_RANGE)) - range=0; // Stop searching + if (last_range->flag == (UNIQUE_RANGE | EQ_RANGE)) + last_range= 0; // Stop searching if (result != HA_ERR_END_OF_FILE) DBUG_RETURN(result); - range=0; // No matching rows; go to next range + last_range= 0; // No matching rows; go to next range } } @@ -6829,11 +6824,11 @@ int QUICK_RANGE_SELECT_GEOM::get_next() for (;;) { int result; - if (range) + if (last_range) { // Already read through key - result= file->index_next_same(record, (byte*) range->min_key, - range->min_length); + result= file->index_next_same(record, (byte*) last_range->min_key, + last_range->min_length); if (result != HA_ERR_END_OF_FILE) DBUG_RETURN(result); } @@ -6842,18 +6837,18 @@ int QUICK_RANGE_SELECT_GEOM::get_next() if (count == 0) { /* Ranges have already been used up before. None is left for read. */ - range= 0; + last_range= 0; DBUG_RETURN(HA_ERR_END_OF_FILE); } - range= *(cur_range++); + last_range= *(cur_range++); result= file->index_read(record, - (byte*) range->min_key, - range->min_length, - (ha_rkey_function)(range->flag ^ GEOM_FLAG)); + (byte*) last_range->min_key, + last_range->min_length, + (ha_rkey_function)(last_range->flag ^ GEOM_FLAG)); if (result != HA_ERR_KEY_NOT_FOUND) DBUG_RETURN(result); - range=0; // Not found, to next range + last_range= 0; // Not found, to next range } } @@ -6878,7 +6873,7 @@ int QUICK_RANGE_SELECT_GEOM::get_next() bool QUICK_RANGE_SELECT::row_in_ranges() { - QUICK_RANGE *range; + QUICK_RANGE *res; uint min= 0; uint max= ranges.elements - 1; uint mid= (max + min)/2; @@ -6894,8 +6889,8 @@ bool QUICK_RANGE_SELECT::row_in_ranges() max= mid; mid= (min + max) / 2; } - range= *(QUICK_RANGE**)dynamic_array_ptr(&ranges, mid); - return (!cmp_next(range) && !cmp_prev(range)); + res= *(QUICK_RANGE**)dynamic_array_ptr(&ranges, mid); + return (!cmp_next(res) && !cmp_prev(res)); } /* @@ -6909,14 +6904,14 @@ bool QUICK_RANGE_SELECT::row_in_ranges() */ QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, - uint used_key_parts) + uint used_key_parts_arg) : QUICK_RANGE_SELECT(*q), rev_it(rev_ranges) { QUICK_RANGE *r; QUICK_RANGE **pr= (QUICK_RANGE**)ranges.buffer; - QUICK_RANGE **last_range= pr + ranges.elements; - for (; pr!=last_range; pr++) + QUICK_RANGE **end_range= pr + ranges.elements; + for (; pr!=end_range; pr++) rev_ranges.push_front(*pr); /* Remove EQ_RANGE flag for keys that are not using the full key */ @@ -6950,11 +6945,11 @@ int QUICK_SELECT_DESC::get_next() for (;;) { int result; - if (range) + if (last_range) { // Already read through key - result = ((range->flag & EQ_RANGE) - ? file->index_next_same(record, (byte*) range->min_key, - range->min_length) : + result = ((last_range->flag & EQ_RANGE) + ? file->index_next_same(record, (byte*) last_range->min_key, + last_range->min_length) : file->index_prev(record)); if (!result) { @@ -6965,47 +6960,49 @@ int QUICK_SELECT_DESC::get_next() DBUG_RETURN(result); } - if (!(range=rev_it++)) + if (!(last_range= rev_it++)) DBUG_RETURN(HA_ERR_END_OF_FILE); // All ranges used - if (range->flag & NO_MAX_RANGE) // Read last record + if (last_range->flag & NO_MAX_RANGE) // Read last record { int local_error; if ((local_error=file->index_last(record))) DBUG_RETURN(local_error); // Empty table - if (cmp_prev(range) == 0) + if (cmp_prev(last_range) == 0) DBUG_RETURN(0); - range=0; // No matching records; go to next range + last_range= 0; // No match; go to next range continue; } - if (range->flag & EQ_RANGE) + if (last_range->flag & EQ_RANGE) { - result = file->index_read(record, (byte*) range->max_key, - range->max_length, HA_READ_KEY_EXACT); + result= file->index_read(record, (byte*) last_range->max_key, + last_range->max_length, HA_READ_KEY_EXACT); } else { - DBUG_ASSERT(range->flag & NEAR_MAX || range_reads_after_key(range)); - result=file->index_read(record, (byte*) range->max_key, - range->max_length, - ((range->flag & NEAR_MAX) ? - HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV)); + DBUG_ASSERT(last_range->flag & NEAR_MAX || + range_reads_after_key(last_range)); + result=file->index_read(record, (byte*) last_range->max_key, + last_range->max_length, + ((last_range->flag & NEAR_MAX) ? + HA_READ_BEFORE_KEY : + HA_READ_PREFIX_LAST_OR_PREV)); } if (result) { if (result != HA_ERR_KEY_NOT_FOUND) DBUG_RETURN(result); - range=0; // Not found, to next range + last_range= 0; // Not found, to next range continue; } - if (cmp_prev(range) == 0) + if (cmp_prev(last_range) == 0) { - if (range->flag == (UNIQUE_RANGE | EQ_RANGE)) - range = 0; // Stop searching + if (last_range->flag == (UNIQUE_RANGE | EQ_RANGE)) + last_range= 0; // Stop searching DBUG_RETURN(0); // Found key is in range } - range = 0; // To next range + last_range= 0; // To next range } } @@ -9485,23 +9482,9 @@ static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg) } -static void print_rowid(byte* val, int len) -{ - byte *pb; - DBUG_LOCK_FILE; - fputc('\"', DBUG_FILE); - for (pb= val; pb!= val + len; ++pb) - fprintf(DBUG_FILE, "%c", *pb); - fprintf(DBUG_FILE, "\", hex: "); - - for (pb= val; pb!= val + len; ++pb) - fprintf(DBUG_FILE, "%x ", *pb); - fputc('\n', DBUG_FILE); - DBUG_UNLOCK_FILE; -} - void QUICK_RANGE_SELECT::dbug_dump(int indent, bool verbose) { + /* purecov: begin inspected */ fprintf(DBUG_FILE, "%*squick range select, key %s, length: %d\n", indent, "", head->key_info[index].name, max_used_key_length); @@ -9509,8 +9492,8 @@ void QUICK_RANGE_SELECT::dbug_dump(int indent, bool verbose) { QUICK_RANGE *range; QUICK_RANGE **pr= (QUICK_RANGE**)ranges.buffer; - QUICK_RANGE **last_range= pr + ranges.elements; - for (; pr!=last_range; ++pr) + QUICK_RANGE **end_range= pr + ranges.elements; + for (; pr != end_range; ++pr) { fprintf(DBUG_FILE, "%*s", indent + 2, ""); range= *pr; @@ -9535,6 +9518,7 @@ void QUICK_RANGE_SELECT::dbug_dump(int indent, bool verbose) fputs("\n",DBUG_FILE); } } + /* purecov: end */ } void QUICK_INDEX_MERGE_SELECT::dbug_dump(int indent, bool verbose) |