summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2014-01-26 16:41:15 +0200
committerunknown <sanja@montyprogram.com>2014-01-26 16:41:15 +0200
commit31249744fe88bccee1054398baa532f44a6c2a10 (patch)
treed32034bd289b9cc6df07238eb214204f28db02bc /mysql-test
parentc6de45584a40052754ccfa7fc27f59483af51e98 (diff)
parentd9cb1352c8256d9c19a3d29af6fe3d705578a413 (diff)
downloadmariadb-git-31249744fe88bccee1054398baa532f44a6c2a10.tar.gz
merge 5.3->5.5
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/derived.result22
-rw-r--r--mysql-test/r/repair_symlink-5543.result14
-rw-r--r--mysql-test/t/derived.test29
-rw-r--r--mysql-test/t/repair_symlink-5543.test26
4 files changed, 91 insertions, 0 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 699d3279e3e..3a3b69f1fc7 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -479,6 +479,28 @@ SELECT * FROM
WHERE tmp.a;
a b
100 200
+#
+# MDEV-5356: Server crashes in Item_equal::contains on 2nd
+# execution of a PS
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2),(3,4);
+CREATE TABLE t2 (c INT);
+INSERT INTO t2 VALUES (5),(6);
+CREATE TABLE t3 (d INT);
+INSERT INTO t3 VALUES (7),(8);
+CREATE PROCEDURE pr()
+UPDATE t3,
+(SELECT c FROM
+(SELECT 1 FROM t1 WHERE a=72 AND NOT b) sq,
+t2
+) sq2
+SET d=sq2.c;
+CALL pr();
+CALL pr();
+CALL pr();
+drop procedure pr;
+drop table t1,t2,t3;
# End of 5.3 tests
#
# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
diff --git a/mysql-test/r/repair_symlink-5543.result b/mysql-test/r/repair_symlink-5543.result
new file mode 100644
index 00000000000..051c9ca3472
--- /dev/null
+++ b/mysql-test/r/repair_symlink-5543.result
@@ -0,0 +1,14 @@
+create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR';
+insert t1 values (1);
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair error Can't create new tempfile: 'MYSQL_TMP_DIR/t1.TMD'
+test.t1 repair status Operation failed
+drop table t1;
+create table t2 (a int) engine=aria data directory='MYSQL_TMP_DIR';
+insert t2 values (1);
+repair table t2;
+Table Op Msg_type Msg_text
+test.t2 repair error Can't create new tempfile: 'MYSQL_TMP_DIR/t2.TMD'
+test.t2 repair status Operation failed
+drop table t2;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 559a8b76280..4b1d7604b9d 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -394,6 +394,35 @@ WHERE tmp.b;
SELECT * FROM
( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp
WHERE tmp.a;
+
+--echo #
+--echo # MDEV-5356: Server crashes in Item_equal::contains on 2nd
+--echo # execution of a PS
+--echo #
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2),(3,4);
+
+CREATE TABLE t2 (c INT);
+INSERT INTO t2 VALUES (5),(6);
+
+CREATE TABLE t3 (d INT);
+INSERT INTO t3 VALUES (7),(8);
+
+CREATE PROCEDURE pr()
+ UPDATE t3,
+ (SELECT c FROM
+ (SELECT 1 FROM t1 WHERE a=72 AND NOT b) sq,
+ t2
+ ) sq2
+ SET d=sq2.c;
+
+CALL pr();
+CALL pr();
+CALL pr();
+
+drop procedure pr;
+drop table t1,t2,t3;
+
--echo # End of 5.3 tests
--echo #
diff --git a/mysql-test/t/repair_symlink-5543.test b/mysql-test/t/repair_symlink-5543.test
new file mode 100644
index 00000000000..bad65a4175a
--- /dev/null
+++ b/mysql-test/t/repair_symlink-5543.test
@@ -0,0 +1,26 @@
+#
+# MDEV-5543 MyISAM repair unsafe usage of TMD files
+#
+--source include/have_symlink.inc
+--source include/not_windows.inc
+--source include/have_maria.inc
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR';
+insert t1 values (1);
+--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+repair table t1;
+drop table t1;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR';
+insert t2 values (1);
+--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+repair table t2;
+drop table t2;
+
+--list_files $MYSQL_TMP_DIR foobar5543
+--system rm $MYSQL_TMP_DIR/t1.TMD $MYSQL_TMP_DIR/t2.TMD
+