summaryrefslogtreecommitdiff
path: root/storage/myisam/mi_write.c
diff options
context:
space:
mode:
authorNeeraj Bisht <neeraj.x.bisht@oracle.com>2013-01-15 14:33:22 +0530
committerNeeraj Bisht <neeraj.x.bisht@oracle.com>2013-01-15 14:33:22 +0530
commitf7f21ee732acf386745ec9e70c536f51e8871bf0 (patch)
tree7c158063cb703543ce2a6fd065116e8d3af14b40 /storage/myisam/mi_write.c
parent5cf1a8c2956c0bfce150a99661c9f9b09996e085 (diff)
parent65af83f642374c9d9476a125af30f723f7684e2e (diff)
downloadmariadb-git-f7f21ee732acf386745ec9e70c536f51e8871bf0.tar.gz
Bug#11758009 - UNION EXECUTION ORDER WRONG ?
Problem:- In case of blob data field, UNION ALL doesn't give correct result. Analysis:- In MyISAM table, when we dont want to check for the distinct for particular key, we set the key_map to zero. While writing record in MyISAM table, we check the distinct with the help of keys, by checking whether that key is active in key_map and then writing the record. In case of blob field, we are checking for distinct by unique constraint, where we are not checking whether that unique key is active or not in key_map. Solution: Before checking for distinct, check whether any key is active in key_map. storage/myisam/mi_write.c: check whether key_map is active before checking distinct.
Diffstat (limited to 'storage/myisam/mi_write.c')
-rw-r--r--storage/myisam/mi_write.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index b1bbf209e25..53140f2ea4c 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -83,12 +83,15 @@ int mi_write(MI_INFO *info, uchar *record)
goto err2;
/* Calculate and check all unique constraints */
- for (i=0 ; i < share->state.header.uniques ; i++)
+ if (mi_is_any_key_active(share->state.key_map))
{
- if (mi_check_unique(info,share->uniqueinfo+i,record,
- mi_unique_hash(share->uniqueinfo+i,record),
- HA_OFFSET_ERROR))
- goto err2;
+ 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))
+ goto err2;
+ }
}
/* Write all keys to indextree */