summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-05-14 01:27:26 +0300
committerunknown <monty@narttu.mysql.fi>2003-05-14 01:27:26 +0300
commit13a23a879f3f2e9b3d09578e08802e6fe19f88f4 (patch)
tree20a0c2176ea7293129e729c7022715b730591b58 /mysql-test
parent6c60313bc71ac1dc2a507efcc63e99208e54f599 (diff)
downloadmariadb-git-13a23a879f3f2e9b3d09578e08802e6fe19f88f4.tar.gz
Fix for MacOSX and symlinks
Fix for USE_FRM and crashed index file configure.in: Fix for MacOSX and symlinks myisam/mi_open.c: Give better error message in case of of crashed index file mysql-test/r/repair.result: new test case mysql-test/r/update.result: new test case mysql-test/t/repair.test: Added test with crashed MyISAM index header mysql-test/t/update.test: Added test case from bugs system sql/handler.cc: Indentation changes sql/sql_table.cc: Fix for USE_FRM and crashed index file
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/repair.result3
-rw-r--r--mysql-test/r/repair_part2.result8
-rw-r--r--mysql-test/r/update.result16
-rw-r--r--mysql-test/t/repair.test4
-rw-r--r--mysql-test/t/repair_part2-master.sh1
-rw-r--r--mysql-test/t/repair_part2.test7
-rw-r--r--mysql-test/t/update.test15
7 files changed, 53 insertions, 1 deletions
diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result
index ad869787b8a..6c2107b2cf3 100644
--- a/mysql-test/r/repair.result
+++ b/mysql-test/r/repair.result
@@ -11,4 +11,5 @@ test.t1 repair error The handler for the table doesn't support repair
drop table t1;
repair table t1 use_frm;
Table Op Msg_type Msg_text
-t1 repair error table is read-only or does not exists
+test.t1 repair error Table 'test.t1' doesn't exist
+create table t1 type=myisam SELECT 1,"table 1";
diff --git a/mysql-test/r/repair_part2.result b/mysql-test/r/repair_part2.result
new file mode 100644
index 00000000000..77aa98c3da9
--- /dev/null
+++ b/mysql-test/r/repair_part2.result
@@ -0,0 +1,8 @@
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair error Can't open file: 't1.MYI'. (errno: 130)
+repair table t1 use_frm;
+Table Op Msg_type Msg_text
+test.t1 repair warning Number of rows changed from 0 to 1
+test.t1 repair status OK
+drop table t1;
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 5357e8367e3..11aff8fe50a 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -150,3 +150,19 @@ select * from t1;
id_param nom_option valid
185 test 1
drop table t1;
+create table t1 (F1 VARCHAR(30), F2 VARCHAR(30), F3 VARCHAR(30), cnt int, groupid int, KEY groupid_index (groupid));
+insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
+('0','1','2',1,5), ('0','2','0',1,3), ('1','0','1',1,2),
+('1','2','1',1,1), ('1','2','2',1,1), ('2','0','1',2,4),
+('2','2','0',1,7);
+delete from t1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3);
+select * from t1;
+F1 F2 F3 cnt groupid
+0 0 0 1 6
+0 1 2 1 5
+0 2 0 1 3
+1 0 1 1 2
+1 2 1 1 1
+2 0 1 2 4
+2 2 0 1 7
+drop table t1;
diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test
index e7da79d8c9e..159fc090653 100644
--- a/mysql-test/t/repair.test
+++ b/mysql-test/t/repair.test
@@ -12,4 +12,8 @@ drop table t1;
# non-existent table
repair table t1 use_frm;
+#
+# Create test table for repair2
+# The following must be last in this file
+create table t1 type=myisam SELECT 1,"table 1";
diff --git a/mysql-test/t/repair_part2-master.sh b/mysql-test/t/repair_part2-master.sh
new file mode 100644
index 00000000000..964bde06c18
--- /dev/null
+++ b/mysql-test/t/repair_part2-master.sh
@@ -0,0 +1 @@
+echo "1" > $MYSQL_TEST_DIR/var/master-data/test/t1.MYI
diff --git a/mysql-test/t/repair_part2.test b/mysql-test/t/repair_part2.test
new file mode 100644
index 00000000000..8c27e382dff
--- /dev/null
+++ b/mysql-test/t/repair_part2.test
@@ -0,0 +1,7 @@
+#
+# This test starts with a crashed t1.MYI file left over from repair.test
+#
+
+repair table t1;
+repair table t1 use_frm;
+drop table t1;
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 6ac8543ec93..a455b308158 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -108,3 +108,18 @@ INSERT INTO t1 (id_param,nom_option,valid) VALUES (185,'600x1200',1);
UPDATE t1 SET nom_option='test' WHERE id_param=185 AND nom_option='600x1200' AND valid=1 LIMIT 1;
select * from t1;
drop table t1;
+
+#
+# Multi table update test from bugs
+#
+
+create table t1 (F1 VARCHAR(30), F2 VARCHAR(30), F3 VARCHAR(30), cnt int, groupid int, KEY groupid_index (groupid));
+
+insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
+('0','1','2',1,5), ('0','2','0',1,3), ('1','0','1',1,2),
+('1','2','1',1,1), ('1','2','2',1,1), ('2','0','1',2,4),
+('2','2','0',1,7);
+
+delete from t1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3);
+select * from t1;
+drop table t1;