diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-11-13 15:45:05 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-11-13 15:45:05 +0200 |
commit | 5907ab4e045767d5fed29cb181f8577a5066e754 (patch) | |
tree | 6b5a0c6971a4fd1944d0e8a217051cdb2ea02d32 /innobase | |
parent | 95ff7f77dd8dbbe804139e53c5fa521dfd13fa36 (diff) | |
download | mariadb-git-5907ab4e045767d5fed29cb181f8577a5066e754.tar.gz |
row0sel.c:
Fix bug: if a unique search from a primary key matched to a delete-marked row, it could return the NEXT row
innobase/row/row0sel.c:
Fix bug: if a unique search from a primary key matched to a delete-marked row, it could return the NEXT row
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/row/row0sel.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 2306b1af747..ce6ed091a48 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2972,15 +2972,12 @@ rec_loop: /*-------------------------------------------------------------*/ - if (unique_search_from_clust_index && btr_pcur_get_up_match(pcur) - == dtuple_get_n_fields(search_tuple)) { - /* The record matches enough */ + /* Note that we cannot trust the up_match value in the cursor at this + place because we can arrive here after moving the cursor! Thus + we have to recompare rec and search_tuple to determine if they + match enough. */ - ut_ad(mode == PAGE_CUR_GE); -#ifdef UNIV_SEARCH_DEBUG - ut_a(0 == cmp_dtuple_rec(search_tuple, rec)); -#endif - } else if (match_mode == ROW_SEL_EXACT) { + if (match_mode == ROW_SEL_EXACT) { /* Test if the index record matches completely to search_tuple in prebuilt: if not, then we return with DB_RECORD_NOT_FOUND */ |