summaryrefslogtreecommitdiff
path: root/innobase/row/row0sel.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/row/row0sel.c')
-rw-r--r--innobase/row/row0sel.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 57de309c090..b32f0b204b3 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2886,7 +2886,16 @@ row_search_for_mysql(
if (match_mode == ROW_SEL_EXACT
&& index->type & DICT_UNIQUE
&& dtuple_get_n_fields(search_tuple)
- == dict_index_get_n_unique(index)) {
+ == dict_index_get_n_unique(index)
+ && (index->type & DICT_CLUSTERED
+ || !dtuple_contains_null(search_tuple))) {
+
+ /* Note above that a UNIQUE secondary index can contain many
+ rows with the same key value if one of the columns is the SQL
+ null. A clustered index under MySQL can never contain null
+ columns because we demand that all the columns in primary key
+ are non-null. */
+
unique_search = TRUE;
/* Even if the condition is unique, MySQL seems to try to