summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-09-03 20:55:56 +0300
committerMichael Widenius <monty@askmonty.org>2010-09-03 20:55:56 +0300
commit9f85560212241f07b7bdff7df639c0b9a519bed5 (patch)
treecd03dd0ae30a3703f2c47ee887eb213a4825fdcf /mysql-test
parenta4fff491eb7f8be7c635287377c57eeff1dd6e89 (diff)
downloadmariadb-git-9f85560212241f07b7bdff7df639c0b9a519bed5.tar.gz
Enable archive tables to work with mysql_upgrade / repair
Made long file names from previous patch shorter mysql-test/r/archive.result: Added testing of repair (for upgrade) of 5.0 tables. mysql-test/std_data/archive_5_0.ARM: Archive table created in MySQL 5.0 mysql-test/std_data/archive_5_0.ARZ: Archive table created in MySQL 5.0 mysql-test/std_data/archive_5_0.frm: Archive table created in MySQL 5.0 mysql-test/std_data/long_table_name.MYD: Made long file names shorter mysql-test/std_data/long_table_name.MYI: Made long file names shorter mysql-test/std_data/long_table_name.frm: Made long file names shorter mysql-test/t/archive.test: Added testing of repair (for upgrade) of 5.0 tables. sql/sql_table.cc: Allow recreate to open crashed tables. sql/table.cc: Fix error message if storage engine doesn't exists. storage/archive/azio.c: Reset status values in case archive is of old versions storage/archive/ha_archive.cc: Fix to allow one to open old versions of table during repair Reset status variables for old version tables If the the table is of old version, force upgrade with ALTER TABLE when doing repair storage/archive/ha_archive.h: Added variables to detect old versions
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/archive.result12
-rw-r--r--mysql-test/std_data/archive_5_0.ARMbin0 -> 19 bytes
-rw-r--r--mysql-test/std_data/archive_5_0.ARZbin0 -> 138 bytes
-rw-r--r--mysql-test/std_data/archive_5_0.frmbin0 -> 8578 bytes
-rw-r--r--mysql-test/std_data/long_table_name.MYD (renamed from mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYD)bin56 -> 56 bytes
-rw-r--r--mysql-test/std_data/long_table_name.MYI (renamed from mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYI)bin6144 -> 6144 bytes
-rw-r--r--mysql-test/std_data/long_table_name.frm (renamed from mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.frm)bin8650 -> 8650 bytes
-rw-r--r--mysql-test/t/archive.test13
8 files changed, 23 insertions, 2 deletions
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index f90bcb521e1..5a731e6476c 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12725,8 +12725,7 @@ INSERT INTO t1 (col1, col2) VALUES (1, "value");
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair Error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
-test.t1 repair error Corrupt
+test.t1 repair status OK
DROP TABLE t1;
#
# BUG#48757 - missing .ARZ file causes server crash
@@ -12756,3 +12755,12 @@ a
1
2
DROP TABLE t1;
+select * from t1;
+ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+select sum(length(a)),sum(b) from t1;
+sum(length(a)) sum(b)
+8670 187
+drop table t1;
diff --git a/mysql-test/std_data/archive_5_0.ARM b/mysql-test/std_data/archive_5_0.ARM
new file mode 100644
index 00000000000..8f1111437d8
--- /dev/null
+++ b/mysql-test/std_data/archive_5_0.ARM
Binary files differ
diff --git a/mysql-test/std_data/archive_5_0.ARZ b/mysql-test/std_data/archive_5_0.ARZ
new file mode 100644
index 00000000000..d24e76884cc
--- /dev/null
+++ b/mysql-test/std_data/archive_5_0.ARZ
Binary files differ
diff --git a/mysql-test/std_data/archive_5_0.frm b/mysql-test/std_data/archive_5_0.frm
new file mode 100644
index 00000000000..827213d329d
--- /dev/null
+++ b/mysql-test/std_data/archive_5_0.frm
Binary files differ
diff --git a/mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYD b/mysql-test/std_data/long_table_name.MYD
index 2ff33451b5f..2ff33451b5f 100644
--- a/mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYD
+++ b/mysql-test/std_data/long_table_name.MYD
Binary files differ
diff --git a/mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYI b/mysql-test/std_data/long_table_name.MYI
index cffa158beae..cffa158beae 100644
--- a/mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYI
+++ b/mysql-test/std_data/long_table_name.MYI
Binary files differ
diff --git a/mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.frm b/mysql-test/std_data/long_table_name.frm
index 6a812a8b137..6a812a8b137 100644
--- a/mysql-test/std_data/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.frm
+++ b/mysql-test/std_data/long_table_name.frm
Binary files differ
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 6704257f9af..7478c7dcdce 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1680,3 +1680,16 @@ SELECT * FROM t1;
REPAIR TABLE t1 EXTENDED;
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug #47012 archive tables are not upgradeable, and server crashes on
+# any access
+#
+copy_file std_data/archive_5_0.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/archive_5_0.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
+copy_file std_data/archive_5_0.ARM $MYSQLD_DATADIR/test/t1.ARM;
+--error ER_TABLE_NEEDS_UPGRADE
+select * from t1;
+repair table t1;
+select sum(length(a)),sum(b) from t1;
+drop table t1;