mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-29664 Assertion `!n_mysql_tables_in_use' failed in innobase_close_connection
When ha_end_bulk_insert() fails F_UNLCK was done twice: in select_insert::prepare_eof() and in select_create::abort_result_set(). Now we avoid making F_UNLCK in prepare_eof() if error is non-zero.
This commit is contained in:
@ -1,88 +0,0 @@
|
||||
#
|
||||
# Check CREATE OR REPLACE TABLE for test that requires DEBUG
|
||||
#
|
||||
|
||||
--source include/have_debug.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
SET @old_debug= @@session.debug;
|
||||
|
||||
#
|
||||
# MDEV-5854
|
||||
# Interrupted CREATE OR REPLACE is written into binlog, and in a wrong format
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB;
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam;
|
||||
SET debug_dbug='+d,send_kill_after_delete';
|
||||
CREATE OR REPLACE TABLE t1 LIKE tmp;
|
||||
SET debug_dbug=@old_debug;
|
||||
SHOW TABLES;
|
||||
show create table t1;
|
||||
--sync_slave_with_master
|
||||
SHOW TABLES;
|
||||
show create table t1;
|
||||
--connection master
|
||||
|
||||
--disable_warnings
|
||||
drop temporary table if exists tmp;
|
||||
--enable_warnings
|
||||
drop table t1;
|
||||
--source include/rpl_end.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-25292 Atomic CREATE OR REPLACE TABLE
|
||||
--echo #
|
||||
set @saved_debug_dbug= @@session.debug_dbug;
|
||||
create table t1 (a int primary key) engine innodb;
|
||||
insert t1 values (1), (2);
|
||||
create table t2 (c int, a int constraint t1_a references t1 (a)) engine innodb;
|
||||
insert into t2 values (2, 2);
|
||||
lock tables t2 write, t1 write;
|
||||
set session debug_dbug= '+d,atomic_replace_external_lock_fail';
|
||||
--error ER_LOCK_TABLE_FULL
|
||||
create or replace table t2 (y int) as select * from t1;
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
--list_files $MYSQLD_DATADIR/test *sql*
|
||||
show create table t1;
|
||||
show create table t2;
|
||||
select * from t2;
|
||||
unlock tables;
|
||||
drop tables t2, t1;
|
||||
set session debug_dbug= @saved_debug_dbug;
|
||||
|
||||
--echo # Test entry_pos in higher position, so drop chain executes before create chain
|
||||
--echo # (see commit message: On linking two chains together)
|
||||
create table t1 (c int);
|
||||
--error ER_DUP_KEYNAME
|
||||
create or replace table t1 (a int, b int, key k (a), key k (b));
|
||||
--error ER_DUP_KEYNAME
|
||||
create or replace table t1 (a int, b int, key k (a), key k (b));
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES
|
||||
--echo #
|
||||
--echo # Non-atomic CREATE OR REPLACE part:
|
||||
--echo #
|
||||
set @saved_debug_dbug= @@session.debug_dbug;
|
||||
set @@debug_dbug="+d,ddl_log_expensive_rename";
|
||||
create table t1 (pk int primary key) engine=innodb;
|
||||
create or replace table t2 (a int primary key references t1 (pk)) engine=innodb;
|
||||
|
||||
lock tables t1 write, t2 write;
|
||||
--error ER_DUP_FIELDNAME
|
||||
create or replace table t2 (c1 int not null, c1 varchar(255) ) engine=innodb;
|
||||
select * from t1;
|
||||
--error ER_TABLE_NOT_LOCKED
|
||||
select * from t2;
|
||||
unlock tables;
|
||||
|
||||
drop tables t1;
|
||||
set @@debug_dbug= @saved_debug_dbug;
|
Reference in New Issue
Block a user