summaryrefslogtreecommitdiff
path: root/innobase/row/row0ins.c
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-12-20 22:45:07 +0200
committerunknown <heikki@donna.mysql.fi>2001-12-20 22:45:07 +0200
commit9d9e0a08d7495d9e7d02d941d45d5988baab6fa5 (patch)
tree4eb9c925b588defd4ee1175503ca3b849c4f2842 /innobase/row/row0ins.c
parenta1b810cc4aec8bb640fff87ff02966adb439f366 (diff)
downloadmariadb-git-9d9e0a08d7495d9e7d02d941d45d5988baab6fa5.tar.gz
row0ins.c:
Allow equal key values in a unique secondary index if the key value contains an SQL NULL innobase/row/row0ins.c: Allow equal key values in a unique secondary index if the key value contains an SQL NULL
Diffstat (limited to 'innobase/row/row0ins.c')
-rw-r--r--innobase/row/row0ins.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index 2c6d3b0ed00..3321c288e39 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -319,6 +319,7 @@ row_ins_dupl_error_with_rec(
ulint matched_fields;
ulint matched_bytes;
ulint n_unique;
+ ulint i;
n_unique = dict_index_get_n_unique(index);
@@ -329,12 +330,26 @@ row_ins_dupl_error_with_rec(
if (matched_fields < n_unique) {
- return(FALSE);
+ return(FALSE);
+ }
+
+ /* In a unique secondary index we allow equal key values if they
+ contain SQL NULLs */
+
+ if (!(index->type & DICT_CLUSTERED)) {
+
+ for (i = 0; i < n_unique; i++) {
+ if (UNIV_SQL_NULL == dfield_get_len(
+ dtuple_get_nth_field(entry, i))) {
+
+ return(FALSE);
+ }
+ }
}
if (!rec_get_deleted_flag(rec)) {
- return(TRUE);
+ return(TRUE);
}
return(FALSE);