summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorsvoj@mysql.com/june.mysql.com <>2007-01-16 18:05:37 +0400
committersvoj@mysql.com/june.mysql.com <>2007-01-16 18:05:37 +0400
commitc606e30f3555164de4b8bec3de14685efb604c7b (patch)
tree9e0a80a2b9ca8c43e4cfafceb28240e19de82cfd /myisam
parent45aeb7f04d36a3bbed048edd110acef5fa22bf4d (diff)
downloadmariadb-git-c606e30f3555164de4b8bec3de14685efb604c7b.tar.gz
BUG#24855 - Crash mysqld 4.1.21 with corrupted tables
Accessing fixed record format table with crashed key definition results in server/myisamchk segmentation fault. This is fixed by refusing to open such tables. Affects MyISAM only. No test case, since it requires crashed table.
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_open.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 4efe6f42d5e..047686278b4 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -315,7 +315,13 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for (j=0 ; j < share->keyinfo[i].keysegs; j++,pos++)
{
disk_pos=mi_keyseg_read(disk_pos, pos);
-
+ if (pos->flag & HA_BLOB_PART &&
+ ! (share->options & (HA_OPTION_COMPRESS_RECORD |
+ HA_OPTION_PACK_RECORD)))
+ {
+ my_errno= HA_ERR_CRASHED;
+ goto err;
+ }
if (pos->type == HA_KEYTYPE_TEXT || pos->type == HA_KEYTYPE_VARTEXT)
{
if (!pos->language)