From eec32a33b73b8d2f820b936a71ed6ecf6d3d9a4b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 14 Jan 2011 12:05:46 +0100 Subject: Optimize use of SEARCH_SAVE_BUFF in Aria (less not-needed copies of key pages) storage/maria/ma_rkey.c: Fixed wrong test if SEARCH_SAVE_BUFF should be set. Now we assume that if we are doing HA_READ_KEY_EXACT, we don't have to copy the last key buffer (in other words, it's not likely this will be followed by a read-next call) --- storage/maria/ma_unique.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'storage/maria/ma_unique.c') diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c index 0c7a2a3cbcf..c7d277486c4 100644 --- a/storage/maria/ma_unique.c +++ b/storage/maria/ma_unique.c @@ -45,7 +45,8 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record, info->update&= ~HA_STATE_RNEXT_SAME; DBUG_ASSERT(key.data_length == MARIA_UNIQUE_HASH_LENGTH); - if (_ma_search(info, &key, SEARCH_FIND, info->s->state.key_root[def->key])) + if (_ma_search(info, &key, SEARCH_FIND | SEARCH_SAVE_BUFF, + info->s->state.key_root[def->key])) { info->page_changed=1; /* Can't optimize read next */ info->cur_row.lastpos= lastpos; -- cgit v1.2.1