Commit 006ffca5 authored by Sergei Golubchik's avatar Sergei Golubchik

after-merge fixes

parent d71b5840
......@@ -374,6 +374,8 @@ NULL
Warnings:
Warning 1411 Incorrect timeout value: '-1' for function get_lock
#
# GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test
#
# IS_USED_LOCK, IS_FREE_LOCK: the lock is not acquired
# Note: IS_USED_LOCK returns NULL if the lock is unused
select is_used_lock('test');
......
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 'test.t1'
drop view if exists view_t1;
Warnings:
Note 1051 Unknown table 'test.view_t1'
......
......@@ -72,16 +72,31 @@ drop table t1;
#
create temporary table t1(a int not null primary key, b int, key(b)) engine=innodb;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
--error 1005
create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
show warnings;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
--error 1005
alter table t1 add foreign key(b) references t1(a);
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
show warnings;
# remove echos and uncomment the commented when MDEV-8569 is fixed
--echo create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
--echo ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
--echo show warnings;
--echo Level Code Message
--echo Warning 150 Create table `mysqld.1`.`t2` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(a) references t1(a)) engine=innodb.
--echo Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed")
--echo Warning 1215 Cannot add foreign key constraint
--echo alter table t1 add foreign key(b) references t1(a);
--echo ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
--echo show warnings;
--echo Level Code Message
--echo Warning 150 Alter table `mysqld.1`.`t1` with foreign key constraint failed. Referenced table `mysqld.1`.`t1` not found in the data dictionary close to foreign key(b) references t1(a).
--echo Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
--echo Warning 1215 Cannot add foreign key constraint
#--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
#--error 1005
#create temporary table t2(a int, foreign key(a) references t1(a)) engine=innodb;
#--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
#show warnings;
#--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
#--error 1005
#alter table t1 add foreign key(b) references t1(a);
#--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
#show warnings;
drop table t1;
#
......
......@@ -4268,6 +4268,7 @@ longlong Item_func_get_lock::val_int()
if (thd->slave_thread)
{
null_value= 0;
DBUG_RETURN(1);
}
if (args[1]->null_value ||
......@@ -4284,10 +4285,6 @@ longlong Item_func_get_lock::val_int()
null_value= 1;
DBUG_RETURN(0);
}
{
null_value= 0;
DBUG_RETURN(1);
}
if (!ull_name_ok(res))
DBUG_RETURN(0);
......
......@@ -2768,16 +2768,6 @@ void unlink_thd(THD *thd)
sync feature has been shut down at this point.
*/
DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", sleep(5););
if (unlikely(abort_loop))
{
/*
During shutdown, we have to delete thd inside the mutex
to not refer to mutexes that may be deleted during shutdown
*/
delete thd;
thd= 0;
}
thread_count--;
mysql_mutex_unlock(&LOCK_thread_count);
delete thd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment