1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #55580 : segfault in read_view_sees_trx_id

The server was not checking for errors generated during
the execution of Item::val_xxx() methods when copying
data to the group, order, or distinct temp table's row.
Fixed by extending the copy_funcs() to return an error
code and by checking for that error code on the places
copy_funcs() is called. 
Test case added.
This commit is contained in:
Georgi Kodinov
2010-08-13 11:07:39 +03:00
parent b6e3adf10f
commit 12f7d57d42
5 changed files with 99 additions and 10 deletions

View File

@ -2499,4 +2499,26 @@ ORDER BY f1 DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range f2,f4 f4 1 NULL 11 Using where
DROP TABLE t1;
#
# Bug#55580: segfault in read_view_sees_trx_id
#
CREATE TABLE t1 (a INT) ENGINE=Innodb;
CREATE TABLE t2 (a INT) ENGINE=Innodb;
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
START TRANSACTION;
SELECT * FROM t2 LOCK IN SHARE MODE;
a
1
2
START TRANSACTION;
SELECT * FROM t1 LOCK IN SHARE MODE;
a
1
2
SELECT * FROM t1 FOR UPDATE;
# should not crash
SELECT * FROM t1 GROUP BY (SELECT a FROM t2 LIMIT 1 FOR UPDATE) + t1.a;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1,t2;
End of 5.1 tests