summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-05-13 23:08:29 +0300
committermonty@mysql.com <>2005-05-13 23:08:29 +0300
commit9b39f8304ef1e9ca9a10803271125431ed15fc0f (patch)
treeb6fa522b4fdc511f6bdce8096b9424cf6704e153 /myisam
parent20f969b2568a730af3864b104134926a22e8ae96 (diff)
downloadmariadb-git-9b39f8304ef1e9ca9a10803271125431ed15fc0f.tar.gz
Fixed wrong buffer usage for auto-increment key with blob part that caused CHECK TABLE to report that the table was wrong. (Bug #10045)
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_key.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/myisam/mi_key.c b/myisam/mi_key.c
index 1688ab74823..06571c570e1 100644
--- a/myisam/mi_key.c
+++ b/myisam/mi_key.c
@@ -255,8 +255,25 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
} /* _mi_pack_key */
- /* Put a key in record */
- /* Used when only-keyread is wanted */
+
+/*
+ Store found key in record
+
+ SYNOPSIS
+ _mi_put_key_in_record()
+ info MyISAM handler
+ keynr Key number that was used
+ record Store key here
+
+ Last read key is in info->lastkey
+
+ NOTES
+ Used when only-keyread is wanted
+
+ RETURN
+ 0 ok
+ 1 error
+*/
static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
byte *record)
@@ -267,14 +284,8 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
byte *blob_ptr;
DBUG_ENTER("_mi_put_key_in_record");
- if (info->s->base.blobs && info->s->keyinfo[keynr].flag & HA_VAR_LENGTH_KEY)
- {
- if (!(blob_ptr=
- mi_alloc_rec_buff(info, info->s->keyinfo[keynr].keylength,
- &info->rec_buff)))
- goto err;
- }
- key=(byte*) info->lastkey;
+ blob_ptr= info->lastkey2; /* Place to put blob parts */
+ key=(byte*) info->lastkey; /* KEy that was read */
key_end=key+info->lastkey_length;
for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++)
{