mariadb/mysql-test/suite/innodb/r
Annamalai Gurusami db78f29b31 Bug 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
..
blob-update-debug.result
create-index.result
foreign-keys.result Bug SERVER CRASHES WHEN EXECUTING ALTER TABLE ADD FOREIGN KEY 2014-08-25 16:25:07 +02:00
innodb-analyze.result
innodb-autoinc-18274.result
innodb-autoinc-44030.result
innodb-autoinc-56228.result
innodb-autoinc-optimize.result
innodb-autoinc.result
innodb-blob.result
innodb-change-buffer-recovery.result
innodb-consistent.result
innodb-fk.result Bug OPENING INNODB TABLES WITH MANY FOREIGN KEY REFERENCES IS 2014-06-10 09:35:50 +05:30
innodb-index.result
innodb-index_ucs2.result
innodb-lock.result
innodb-replace.result
innodb-semi-consistent.result
innodb-timeout.result
innodb-truncate.result
innodb-ucs2.result
innodb-update-insert.result
innodb-use-sys-malloc.result
innodb.result
innodb_autoinc_lock_mode_zero.result
innodb_bug21704.result
innodb_bug30423.result
innodb_bug30919.result
innodb_bug34053.result
innodb_bug34300.result
innodb_bug35220.result
innodb_bug38231.result
innodb_bug39438.result
innodb_bug40360.result
innodb_bug40565.result
innodb_bug41904.result
innodb_bug42101-nonzero.result
innodb_bug42101.result
innodb_bug42419.result
innodb_bug44032.result
innodb_bug44369.result
innodb_bug44571.result
innodb_bug45357.result
innodb_bug46000.result
innodb_bug46676.result
innodb_bug47167.result
innodb_bug47621.result
innodb_bug47622.result
innodb_bug47777.result
innodb_bug48024.result
innodb_bug49164.result
innodb_bug51378.result
innodb_bug51920.result
innodb_bug52199.result
innodb_bug52663.result
innodb_bug53046.result
innodb_bug53290.result
innodb_bug53592.result
innodb_bug53674.result
innodb_bug53756.result
innodb_bug54044.result
innodb_bug56143.result
innodb_bug56716.result
innodb_bug56947.result
innodb_bug57252.result
innodb_bug57255.result
innodb_bug57904.result Bug#16395459 TEST AND RESULT FILES WITH EXECUTE BIT 2014-06-25 12:35:50 +02:00
innodb_bug59307.result
innodb_bug59410.result
innodb_bug59641.result
innodb_bug59733.result
innodb_bug60049.result
innodb_bug60196.result Bug#16395459 TEST AND RESULT FILES WITH EXECUTE BIT 2014-06-25 12:35:50 +02:00
innodb_bug60229.result
innodb_bug11754376.result
innodb_bug11766634.result
innodb_bug12400341.result
innodb_bug12661768.result
innodb_bug12902967.result
innodb_bug13510739.result
innodb_bug13635833.result
innodb_bug14007649.result
innodb_bug14147491.result
innodb_bug14676111.result
innodb_bug14704286.result
innodb_corrupt_bit.result
innodb_file_format.result
innodb_gis.result
innodb_information_schema.result
innodb_information_schema_buffer.result
innodb_lock_wait_timeout_1.result
innodb_misc1.result
innodb_multi_update.result
innodb_mysql.result
innodb_mysql_rbk.result
innodb_notembedded.result
innodb_prefix_index_restart_server.result
innodb_replace.result
innodb_timeout_rollback.result
innodb_trx_weight.result
sp_temp_table.result Bug FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED 2014-09-18 15:17:39 +05:30
strict_mode.result Bug PRINT A WARNING WHEN DDL HAS AN ERROR IN INNODB_STRICT_MODE = 1 2014-09-17 10:42:31 +05:30