From: Date: February 6 2008 9:26pm Subject: bk commit into 5.1 tree (istruewing:1.2518) BUG#31331 List-Archive: http://lists.mysql.com/commits/41830 X-Bug: 31331 Message-Id: Below is the list of changes that have just been committed into a local 5.1 repository of istruewing. When istruewing does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2008-02-06 21:26:05+01:00, istruewing@stripped +1 -0 Bug#31331 - MyISAM or Merge Table upgrade incompatibility with 5.1 A table with BLOB/TEXT prefix key part, created with version 4.1, could not be opened by a 5.1 server. The routine check at table open, if the frm file matches the MyISAM table, was too picky regarding old and new implementation of such keys. Added relaxed check for blob prefix key part. No test case. It requires to create a table in 4.1 and open it in 5.1. storage/myisam/ha_myisam.cc@stripped, 2008-02-06 21:26:03+01:00, istruewing@stripped +20 -1 Bug#31331 - MyISAM or Merge Table upgrade incompatibility with 5.1 Added relaxed check for blob prefix key part. diff -Nrup a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc --- a/storage/myisam/ha_myisam.cc 2008-01-29 10:59:29 +01:00 +++ b/storage/myisam/ha_myisam.cc 2008-02-06 21:26:03 +01:00 @@ -397,7 +397,26 @@ int check_definition(MI_KEYDEF *t1_keyin } for (j= t1_keyinfo[i].keysegs; j--;) { - if (t1_keysegs[j].type != t2_keysegs[j].type || + uint8 t1_keysegs_j__type= t1_keysegs[j].type; + + /* + Table migration from 4.1 to 5.1. In 5.1 a *TEXT key part is + always HA_KEYTYPE_VARTEXT2. In 4.1 we had only the equivalent of + HA_KEYTYPE_VARTEXT1. Since we treat both the same on MyISAM + level, we can ignore a mismatch between these types. + */ + if ((t1_keysegs[j].flag & HA_BLOB_PART) && + (t2_keysegs[j].flag & HA_BLOB_PART)) + { + if ((t1_keysegs_j__type == HA_KEYTYPE_VARTEXT2) && + (t2_keysegs[j].type == HA_KEYTYPE_VARTEXT1)) + t1_keysegs_j__type= HA_KEYTYPE_VARTEXT1; + else if ((t1_keysegs_j__type == HA_KEYTYPE_VARBINARY2) && + (t2_keysegs[j].type == HA_KEYTYPE_VARBINARY1)) + t1_keysegs_j__type= HA_KEYTYPE_VARBINARY1; + } + + if (t1_keysegs_j__type != t2_keysegs[j].type || t1_keysegs[j].language != t2_keysegs[j].language || t1_keysegs[j].null_bit != t2_keysegs[j].null_bit || t1_keysegs[j].length != t2_keysegs[j].length)