summaryrefslogtreecommitdiff
path: root/include/myisammrg.h
diff options
context:
space:
mode:
authorV Narayanan <v.narayanan@sun.com>2009-07-30 16:04:41 +0530
committerV Narayanan <v.narayanan@sun.com>2009-07-30 16:04:41 +0530
commit5a5b5c8256c2ef472dfc5b9f890ee5d2784a4a33 (patch)
tree43c8bace65c891fb293ef8e212baf68bb01f4111 /include/myisammrg.h
parent7c6ed98f6a55dbc2442e6479d74388cfb946555d (diff)
downloadmariadb-git-5a5b5c8256c2ef472dfc5b9f890ee5d2784a4a33.tar.gz
Bug#45800 crash when replacing into a merge table and there is a duplicate
A REPLACE in the MERGE engine is actually a REPLACE into one (FIRST or LAST) of the underlying MyISAM tables. So in effect the server works on the meta data of the MERGE table, while the real insert happens in the MyISAM table. The MERGE table has no index, while MyISAM has a unique index. When a REPLACE into a MERGE table ( and the REPLACE conflicts with a duplicate in a child table) is done, we try to access the duplicate key information for the MERGE table. This information actually does not exist, hence this results in a crash. The problem can be resolved by modifying the MERGE engine to provide us the duplicate key information directly, instead of just returning the MyISAM index number as the error key. Then the SQL layer (or "the server") does not try to access the key_info of the MERGE table, which does not exist. The current patch modifies the MERGE engine to provide the position for a record where a unique key violation occurs.
Diffstat (limited to 'include/myisammrg.h')
-rw-r--r--include/myisammrg.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/myisammrg.h b/include/myisammrg.h
index 446ecb7d719..31ce3fa47b8 100644
--- a/include/myisammrg.h
+++ b/include/myisammrg.h
@@ -47,6 +47,7 @@ typedef struct st_mymerge_info /* Struct from h_info */
ulonglong deleted; /* Deleted records in database */
ulonglong recpos; /* Pos for last used record */
ulonglong data_file_length;
+ ulonglong dupp_key_pos; /* Offset of the Duplicate key in the merge table */
uint reclength; /* Recordlength */
int errkey; /* With key was dupplicated on err */
uint options; /* HA_OPTION_... used */