#At file:///opt/local/work/pe/ based on
revid:sergey.glukhov@stripped
3651 Konstantin Osipov 2009-10-28 [merge]
Pull Bug#46539 from 5.1-bugteam.
renamed:
mysql-test/r/bug40113.result => mysql-test/r/innodb_lock_wait_timeout_1.result
mysql-test/t/bug40113-master.opt =>
mysql-test/t/innodb_lock_wait_timeout_1-master.opt
mysql-test/t/bug40113.test => mysql-test/t/innodb_lock_wait_timeout_1.test
modified:
sql/sql_class.cc
mysql-test/r/innodb_lock_wait_timeout_1.result
mysql-test/t/innodb_lock_wait_timeout_1.test
=== renamed file 'mysql-test/r/bug40113.result' =>
'mysql-test/r/innodb_lock_wait_timeout_1.result'
--- a/mysql-test/r/bug40113.result 2009-07-13 15:11:16 +0000
+++ b/mysql-test/r/innodb_lock_wait_timeout_1.result 2009-10-28 14:49:56 +0000
@@ -26,4 +26,27 @@ SELECT * FROM t1;
a b
1070109 99
DROP TABLE t2, t1;
-End of 5.0 tests
+# End of 5.0 tests
+#
+# Bug#46539 Various crashes on INSERT IGNORE SELECT + SELECT
+# FOR UPDATE
+#
+drop table if exists t1;
+create table t1 (a int primary key auto_increment,
+b int, index(b)) engine=innodb;
+insert into t1 (b) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+set autocommit=0;
+begin;
+select * from t1 where b=5 for update;
+a b
+5 5
+insert ignore into t1 (b) select a as b from t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Cleanup
+#
+commit;
+set autocommit=default;
+drop table t1;
+#
+# End of 5.1 tests
+#
=== renamed file 'mysql-test/t/bug40113-master.opt' =>
'mysql-test/t/innodb_lock_wait_timeout_1-master.opt'
=== renamed file 'mysql-test/t/bug40113.test' =>
'mysql-test/t/innodb_lock_wait_timeout_1.test'
--- a/mysql-test/t/bug40113.test 2009-07-13 15:11:16 +0000
+++ b/mysql-test/t/innodb_lock_wait_timeout_1.test 2009-10-28 14:49:56 +0000
@@ -43,4 +43,33 @@ DISCONNECT addconroot;
DROP TABLE t2, t1;
---echo End of 5.0 tests
+--echo # End of 5.0 tests
+
+--echo #
+--echo # Bug#46539 Various crashes on INSERT IGNORE SELECT + SELECT
+--echo # FOR UPDATE
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int primary key auto_increment,
+ b int, index(b)) engine=innodb;
+insert into t1 (b) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+set autocommit=0;
+begin;
+select * from t1 where b=5 for update;
+connect (con1, localhost, root,,);
+connection con1;
+--error ER_LOCK_WAIT_TIMEOUT
+insert ignore into t1 (b) select a as b from t1;
+connection default;
+--echo # Cleanup
+--echo #
+disconnect con1;
+commit;
+set autocommit=default;
+drop table t1;
+
+--echo #
+--echo # End of 5.1 tests
+--echo #
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2009-10-22 06:12:30 +0000
+++ b/sql/sql_class.cc 2009-10-28 14:53:00 +0000
@@ -3387,6 +3387,16 @@ void mark_transaction_to_rollback(THD *t
{
thd->is_fatal_sub_stmt_error= TRUE;
thd->transaction_rollback_request= all;
+ /*
+ Aborted transactions can not be IGNOREd.
+ Switch off the IGNORE flag for the current
+ SELECT_LEX. This should allow my_error()
+ to report the error and abort the execution
+ flow, even in presence
+ of IGNORE clause.
+ */
+ if (thd->lex->current_select)
+ thd->lex->current_select->no_error= FALSE;
}
}
/***************************************************************************
Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20091028145300-ngpgxpk5y4fwv195.bundle
| Thread |
|---|
| • bzr commit into mysql-pe branch (kostja:3651) Bug#46539 | Konstantin Osipov | 28 Oct 2009 |