From 0f9c02d49a52c9faacb328649f9eab23b2d93a6b Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Thu, 3 Dec 2009 14:41:29 +0300 Subject: [PATCH] WL#3726 "DDL locking", post-review fixes. ---------------------------------------------------------- revno: 2630.2.23 committer: Konstantin Osipov branch nick: mysql-6.0-runtime timestamp: Fri 2008-06-27 21:15:11 +0400 message: Add an assert that we never call COMMIT or ROLLBACK while having a table lock. --- sql/sql_parse.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 55ff9b5c835..62046dddcbd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3989,12 +3989,16 @@ end_with_restore_list: my_ok(thd); break; case SQLCOM_COMMIT: + DBUG_ASSERT(thd->lock == NULL || + thd->locked_tables_mode == LTM_LOCK_TABLES); if (end_trans(thd, lex->tx_release ? COMMIT_RELEASE : lex->tx_chain ? COMMIT_AND_CHAIN : COMMIT)) goto error; my_ok(thd); break; case SQLCOM_ROLLBACK: + DBUG_ASSERT(thd->lock == NULL || + thd->locked_tables_mode == LTM_LOCK_TABLES); if (end_trans(thd, lex->tx_release ? ROLLBACK_RELEASE : lex->tx_chain ? ROLLBACK_AND_CHAIN : ROLLBACK)) goto error;