mariadb/storage/innobase
Annamalai Gurusami b8c9d93bf3 Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED
FROM A FUNCTION

Scenario:

In a stored procedure, CREATE TABLE statement is not allowed.  But an
exception is provided for CREATE TEMPORARY TABLE.  We can create a temporary
table in a stored procedure.

Let there be two stored functions f1 and f2 and two stored procedures p1 and
p2.  Their properties are as follows:

. stored function f1() calls stored procedure p1().
. stored function f2() calls stored procedure p2().
. stored procedure p1() creates temporary table t1.
. stored procedure p2() does DML on t1.

Consider the following situation:

1.  Autocommit mode is on. 
2.  select f1()
3.  select f2()

Step 2:  In this step, t1 would be created via p1().  A table level transaction
lock would have been taken.  The ::external_lock() would not have been called
on this table.  At the end of step 2, because of autocommit mode on, this table
level lock will be released.

Step 3:  When we execute DML on table t1 via p2() we have two problems:

Problem 1:

The function ha_innobase::external_lock() would have been called but since
it is a select query no table level locks would have been taken.  Hence the
following assert will fail:

ut_ad(lock_table_has(thr_get_trx(thr), index->table, LOCK_IX));

Solution:

The solution would be to identify this situation and take a table level lock
and use the proper lock type prebuilt->select_lock_type = LOCK_X for DML
operations.

Problem 2:

Another problem is that in step 3, ha_innobase::open() is never called on
the table t1.  

Solution:

The solution would be to identify this situation and call re-init the handler
of table t1.

rb#6429 approved by Krunal.
2014-09-18 15:17:39 +05:30
..
btr post-push fix for bug#17565888/bug#14621190 2013-10-28 17:08:31 +01:00
buf Remove unstable test case innodb_bug18942294, approved by Jimmy over IM. 2014-08-06 09:51:20 +08:00
data Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
dict Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN INNODB_STRICT_MODE = 1 2014-09-17 10:42:31 +05:30
dyn Bug#16138582 MTR_MEMO_RELEASE AND DYN_ARRAY TOGETHER ARE VERY INEFFICIENT 2013-01-17 17:30:13 +02:00
eval Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
fil Testcase i_innodb.innodb-alter-restart.test fails on some Windows platforms 2013-10-29 11:39:04 -05:00
fsp Merging from mysql-5.1 to mysql-5.5. 2012-03-09 12:35:27 +05:30
fut Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
ha Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
handler Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED 2014-09-18 15:17:39 +05:30
ibuf Merge fix for BUG#17446090 from mysql-5.1 to mysql-5.5 2013-09-27 18:32:13 +05:30
include Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED 2014-09-18 15:17:39 +05:30
lock Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
log Adjustment for fix for Bug#11758196 2013-09-30 15:02:54 +09:00
mach Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
mem Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
mtr Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
os Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
page Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
pars Bug 16876388 - PLEASE BACKPORT BUG#16208542 TO 5.5 2013-06-25 09:42:54 +08:00
que Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
read Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
rem Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
row Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED 2014-09-18 15:17:39 +05:30
srv Bug#16287752 INNODB_DATA_FILE_PATH MINIMUM SIZE 2014-01-08 22:25:41 +05:30
sync Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
trx Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
usr Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
ut Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
CMakeLists.txt Bug#11766305 - 59392: Remove thr0loc.c and ibuf_inside() [part 4 of 4] 2011-03-24 14:00:14 +02:00
compile-innodb Fixing the bug 16919882 - WRONG FSF ADDRESS IN LICENSES HEADERS 2013-06-10 22:29:41 +02:00
COPYING.Google Renamed storage/innodb_plugin to storage/innobase, so that 1) it's the same 2009-08-07 12:16:00 +02:00
COPYING.Percona Renamed storage/innodb_plugin to storage/innobase, so that 1) it's the same 2009-08-07 12:16:00 +02:00
Doxyfile Remove ut0auxconf.h. 2010-09-09 14:27:52 +03:00
ha_innodb.def Renamed storage/innodb_plugin to storage/innobase, so that 1) it's the same 2009-08-07 12:16:00 +02:00