Skip to content

Commit

Permalink
after-merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Aug 4, 2015
1 parent d71b584 commit 006ffca
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
2 changes: 2 additions & 0 deletions mysql-test/r/func_misc.result
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/sp-group.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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'
Expand Down
35 changes: 25 additions & 10 deletions mysql-test/suite/innodb/t/innodb-fk-warnings.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;

#
Expand Down
5 changes: 1 addition & 4 deletions sql/item_func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand All @@ -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);
Expand Down
10 changes: 0 additions & 10 deletions sql/mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 006ffca

Please sign in to comment.