summaryrefslogtreecommitdiff
path: root/mysql-test/r/bug39022.result
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-12-23 12:45:18 +0200
committerGeorgi Kodinov <joro@sun.com>2009-12-23 12:45:18 +0200
commit6b8ec684c794455f442d45e2086dd3161e9bcde1 (patch)
tree4bb33f1a7edac36c32ca5f3753096ca7573ac78e /mysql-test/r/bug39022.result
parent2be07c70947924c9829ad58dd1ee9d1f4228c401 (diff)
downloadmariadb-git-6b8ec684c794455f442d45e2086dd3161e9bcde1.tar.gz
Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
flush_cached_records() was not correctly checking for errors after calling Item::val_xxx() methods. The expressions may contain subqueries or stored procedures that cause errors that should stop the statement. Fixed by correctly checking for errors and propagating them up the call stack.
Diffstat (limited to 'mysql-test/r/bug39022.result')
-rw-r--r--mysql-test/r/bug39022.result32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/bug39022.result b/mysql-test/r/bug39022.result
new file mode 100644
index 00000000000..1c02d7873e4
--- /dev/null
+++ b/mysql-test/r/bug39022.result
@@ -0,0 +1,32 @@
+#
+# Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
+#
+CREATE TABLE t1(a TINYINT NOT NULL,b TINYINT,PRIMARY KEY(b)) ENGINE=innodb;
+CREATE TABLE t2(d TINYINT NOT NULL,UNIQUE KEY(d)) ENGINE=innodb;
+INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
+(11,5),(11,6),(7,7),(7,8),(4,9),(6,10),(3,11),(11,12),
+(12,13),(7,14);
+INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
+(11),(12),(13),(14);
+# in thread1
+START TRANSACTION;
+# in thread2
+REPLACE INTO t2 VALUES (-17);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+d
+# in thread1
+REPLACE INTO t1(a,b) VALUES (67,20);
+# in thread2
+COMMIT;
+START TRANSACTION;
+REPLACE INTO t1(a,b) VALUES (65,-50);
+REPLACE INTO t2 VALUES (-91);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+# in thread1
+# should not crash
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+# in thread2
+d
+# in default
+DROP TABLE t1,t2;