List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:September 7 2007 3:19am
Subject:Re: bk commit into 5.2 tree (davi:1.2605) BUG#25858
View as plain text  
Post commit comments for the reviewer...

Davi Arnaut wrote:

[..]

> ChangeSet@stripped, 2007-09-06 00:54:06-03:00, davi@stripped +21 -0
>   Bug#25858 Some DROP TABLE under LOCK TABLES can cause deadlocks

[..]

>  
> +/**
> +  Test if a list of tables are droppable wrt locks.
> +
> +  @param thd        The current thread handler
> +  @param table_list Table container containing the tables to check
> +
> +  @return FALSE if successful, TRUE FALSE otherwise.
> +*/

I've removed the extra FALSE.

> +static bool mysql_rm_table_lock_check(THD *thd, TABLE_LIST *table_list)
> +{
> +  TABLE *table;
> +  TABLE_LIST *tbl;
> +  uint i, key_length;
> +  char key[MAX_DBKEY_LENGTH];
> +  MYSQL_LOCK *lock_data= thd->locked_tables;
> +  DBUG_ENTER("mysql_rm_table_lock_check");
> +
> +  if (! lock_data->table_count)
> +    DBUG_RETURN(FALSE);
> +
> +  for (tbl= table_list; tbl; tbl= tbl->next_local)
> +  {
> +    table= find_temporary_table(thd, tbl->db, tbl->table_name);
> +
> +    /* A temporary table is visible only to the current connection */
> +    if (table)
> +      continue;
> +
> +    key_length= create_table_def_key(thd, key, tbl, 0);
> +
> +    /* Find out if this table is locked */
> +    for (i= 0; i < lock_data->table_count; i++)
> +    {
> +      table= lock_data->table[i];
> +
> +      if (table->s->tmp_table)
> +        key_length+= TMP_TABLE_KEY_EXTRA;

tmp_table check left from a previous version of the patch, removed.

-- 
Davi Arnaut, Software Engineer
MySQL Inc, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification
Thread
bk commit into 5.2 tree (davi:1.2605) BUG#25858Davi Arnaut6 Sep
  • Re: bk commit into 5.2 tree (davi:1.2605) BUG#25858Davi Arnaut7 Sep
  • Re: bk commit into 5.2 tree (davi:1.2605) BUG#25858Konstantin Osipov27 Sep
    • Re: bk commit into 5.2 tree (davi:1.2605) BUG#25858Davi Arnaut2 Oct