mirror of
https://github.com/MariaDB/server.git
synced 2025-07-05 12:42:17 +03:00
manual merge from mysql-5.1-security
This commit is contained in:
@ -2538,6 +2538,14 @@ ORDER BY f1 DESC LIMIT 5;
|
|||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 range f2,f4 f4 1 NULL 11 Using where
|
1 SIMPLE t1 range f2,f4 f4 1 NULL 11 Using where
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# Bug#54117 crash in thr_multi_unlock, temporary table
|
||||||
|
#
|
||||||
|
CREATE TEMPORARY TABLE t1(a INT) ENGINE = InnoDB;
|
||||||
|
LOCK TABLES t1 READ;
|
||||||
|
ALTER TABLE t1 COMMENT 'test';
|
||||||
|
UNLOCK TABLES;
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
#
|
#
|
||||||
# Test for bug #39932 "create table fails if column for FK is in different
|
# Test for bug #39932 "create table fails if column for FK is in different
|
||||||
|
@ -737,6 +737,20 @@ ORDER BY f1 DESC LIMIT 5;
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Bug#54117 crash in thr_multi_unlock, temporary table
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE t1(a INT) ENGINE = InnoDB;
|
||||||
|
|
||||||
|
LOCK TABLES t1 READ;
|
||||||
|
ALTER TABLE t1 COMMENT 'test';
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
|
||||||
|
|
||||||
|
@ -7331,12 +7331,22 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
|||||||
if (table->s->tmp_table != NO_TMP_TABLE)
|
if (table->s->tmp_table != NO_TMP_TABLE)
|
||||||
{
|
{
|
||||||
/* Close lock if this is a transactional table */
|
/* Close lock if this is a transactional table */
|
||||||
if (thd->lock &&
|
if (thd->lock)
|
||||||
! (thd->locked_tables_mode == LTM_LOCK_TABLES ||
|
|
||||||
thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES))
|
|
||||||
{
|
{
|
||||||
mysql_unlock_tables(thd, thd->lock);
|
if (thd->locked_tables_mode != LTM_LOCK_TABLES &&
|
||||||
thd->lock=0;
|
thd->locked_tables_mode != LTM_PRELOCKED_UNDER_LOCK_TABLES)
|
||||||
|
{
|
||||||
|
mysql_unlock_tables(thd, thd->lock);
|
||||||
|
thd->lock=0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
If LOCK TABLES list is not empty and contains this table,
|
||||||
|
unlock the table and remove the table from this list.
|
||||||
|
*/
|
||||||
|
mysql_lock_remove(thd, thd->lock, table);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* Remove link to old table and rename the new one */
|
/* Remove link to old table and rename the new one */
|
||||||
close_temporary_table(thd, table, 1, 1);
|
close_temporary_table(thd, table, 1, 1);
|
||||||
|
Reference in New Issue
Block a user