summaryrefslogtreecommitdiff
path: root/storage/myisam/mi_write.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-06-06 17:51:28 +0200
committerSergei Golubchik <sergii@pisem.net>2013-06-06 17:51:28 +0200
commit4749d40c635634e25e07d28ce1a04e9263bcc375 (patch)
treec5bb3287675cd8676d76c8ee42ef2d79cc599e25 /storage/myisam/mi_write.c
parent1ff1cb10fc236010b5969058cab934c2b306c931 (diff)
parent33ef993773449cb3917665b188f6b6575d399bd0 (diff)
downloadmariadb-git-4749d40c635634e25e07d28ce1a04e9263bcc375.tar.gz
5.5 merge
Diffstat (limited to 'storage/myisam/mi_write.c')
-rw-r--r--storage/myisam/mi_write.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 60ea7757827..011df5e8eb9 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -85,9 +85,10 @@ int mi_write(MI_INFO *info, uchar *record)
/* Calculate and check all unique constraints */
for (i=0 ; i < share->state.header.uniques ; i++)
{
- if (mi_check_unique(info,share->uniqueinfo+i,record,
- mi_unique_hash(share->uniqueinfo+i,record),
- HA_OFFSET_ERROR))
+ MI_UNIQUEDEF *def= share->uniqueinfo + i;
+ if (mi_is_key_active(share->state.key_map, def->key) &&
+ mi_check_unique(info, def, record, mi_unique_hash(def, record),
+ HA_OFFSET_ERROR))
goto err2;
}