summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Elkin <aelkin@mysql.com>2009-04-30 17:29:57 +0300
committerAndrei Elkin <aelkin@mysql.com>2009-04-30 17:29:57 +0300
commit943b90fb05f39a47174b93d9c1547925172c48ff (patch)
treecffbf1982dd9e6b95a3a9c93956c328c6b3dbc8c
parentf683c5e0b6d4093d1e0b210d5b34be237de8e71a (diff)
parent767a835b5228c7341f08edc879a0a699f4471aaf (diff)
downloadmariadb-git-943b90fb05f39a47174b93d9c1547925172c48ff.tar.gz
merge 5.1-bt rep -> local 5.1-bt
-rw-r--r--mysql-test/r/upgrade.result12
-rw-r--r--mysql-test/std_data/bug37631.MYD0
-rw-r--r--mysql-test/std_data/bug37631.MYIbin0 -> 1024 bytes
-rw-r--r--mysql-test/std_data/bug37631.frmbin0 -> 8590 bytes
-rw-r--r--mysql-test/t/upgrade.test14
-rw-r--r--storage/ibmdb2i/Makefile.am1
-rw-r--r--storage/myisam/ha_myisam.cc4
7 files changed, 29 insertions, 2 deletions
diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result
index 711e69094f7..da6201692a9 100644
--- a/mysql-test/r/upgrade.result
+++ b/mysql-test/r/upgrade.result
@@ -57,6 +57,18 @@ s1
1
drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`;
+#
+# Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
+#
+# copy table created using mysql4.0 into the data dir
+# check the table created using mysql 4.0
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+# query the table created using mysql 4.0
+SELECT * FROM t1;
+c1 c2 c3
+DROP TABLE t1;
truncate t1;
drop table t1;
drop database if exists `tabc`;
diff --git a/mysql-test/std_data/bug37631.MYD b/mysql-test/std_data/bug37631.MYD
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/std_data/bug37631.MYD
diff --git a/mysql-test/std_data/bug37631.MYI b/mysql-test/std_data/bug37631.MYI
new file mode 100644
index 00000000000..8bf14b46add
--- /dev/null
+++ b/mysql-test/std_data/bug37631.MYI
Binary files differ
diff --git a/mysql-test/std_data/bug37631.frm b/mysql-test/std_data/bug37631.frm
new file mode 100644
index 00000000000..2742a387c38
--- /dev/null
+++ b/mysql-test/std_data/bug37631.frm
Binary files differ
diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test
index e096b6520a1..d571a2efc7c 100644
--- a/mysql-test/t/upgrade.test
+++ b/mysql-test/t/upgrade.test
@@ -48,6 +48,20 @@ select * from `txu#p#p1`;
drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`;
+--echo #
+--echo # Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
+--echo #
+--echo # copy table created using mysql4.0 into the data dir
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+copy_file std_data/bug37631.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/bug37631.MYD $MYSQLD_DATADIR/test/t1.MYD;
+copy_file std_data/bug37631.MYI $MYSQLD_DATADIR/test/t1.MYI;
+--echo # check the table created using mysql 4.0
+CHECK TABLE t1;
+--echo # query the table created using mysql 4.0
+SELECT * FROM t1;
+DROP TABLE t1;
+
#
# Check if old tables work
#
diff --git a/storage/ibmdb2i/Makefile.am b/storage/ibmdb2i/Makefile.am
index 2436a764429..768ca15f4cf 100644
--- a/storage/ibmdb2i/Makefile.am
+++ b/storage/ibmdb2i/Makefile.am
@@ -27,6 +27,7 @@ DEFS = @DEFS@
noinst_HEADERS = ha_ibmdb2i.h db2i_collationSupport.h db2i_file.h \
db2i_ioBuffers.h db2i_blobCollection.h \
db2i_global.h db2i_misc.h db2i_charsetSupport.h db2i_errors.h \
+ db2i_iconv.h db2i_myconv.h db2i_safeString.h db2i_sqlStatementStream.h \
db2i_ileBridge.h db2i_validatedPointer.h
EXTRA_LTLIBRARIES = ha_ibmdb2i.la
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index b98b090d021..e82246638ff 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -414,7 +414,7 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
test(t2_keyinfo[i].flag & HA_SPATIAL)));
DBUG_RETURN(1);
}
- if ((mysql_40_compat &&
+ if ((!mysql_40_compat &&
t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg) ||
t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs)
{
@@ -446,7 +446,7 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
t1_keysegs_j__type= HA_KEYTYPE_VARBINARY1; /* purecov: inspected */
}
- if ((mysql_40_compat &&
+ if ((!mysql_40_compat &&
t1_keysegs[j].language != t2_keysegs[j].language) ||
t1_keysegs_j__type != t2_keysegs[j].type ||
t1_keysegs[j].null_bit != t2_keysegs[j].null_bit ||