diff options
author | heikki@hundin.mysql.fi <> | 2002-11-13 15:45:05 +0200 |
---|---|---|
committer | heikki@hundin.mysql.fi <> | 2002-11-13 15:45:05 +0200 |
commit | d7d128cba939a27bbc64139d41826e5397e9daf4 (patch) | |
tree | 6b5a0c6971a4fd1944d0e8a217051cdb2ea02d32 /innobase | |
parent | 84e18e15d0ebfcfeb67a83e7a182ef69bbf6fb19 (diff) | |
download | mariadb-git-d7d128cba939a27bbc64139d41826e5397e9daf4.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
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 */ |