summaryrefslogtreecommitdiff
path: root/storage/myisam
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
commita44084413cf48b37a6306e3e6ecf624b8696b330 (patch)
tree7c158063cb703543ce2a6fd065116e8d3af14b40 /storage/myisam
parent8552bf4ce4c522fbd1cda24a3e2ea10fa9907a72 (diff)
parentd8d6f270372521ac41248a499a3d0c5a856e04e3 (diff)
downloadmariadb-git-a44084413cf48b37a6306e3e6ecf624b8696b330.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.
Diffstat (limited to 'storage/myisam')
-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 */