List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:August 29 2007 8:48pm
Subject:Re: bk commit into 5.1 tree (dlenev:1.2577)
View as plain text  
* dlenev@stripped <dlenev@stripped> [07/08/29 23:35]:
> ChangeSet@stripped, 2007-08-29 23:30:03+04:00, dlenev@stripped +11 -0
>   Further improvements to prototype of new meta-data locking subsystem/
>   table cache/table definition cache.
>   
>   This new subsystem (or rather rework of existing subsystem) is needed
>   to simplify fix for such bugs as:
>   

You rock.

>    #25144 "replication / binlog with view breaks"
>    #989   "If DROP TABLE while there's an active transaction,
>            wrong binlog order"
>   
>   See earlier commits for more info on the topic.
>   
>   Note that changes in this particular patch could be actually
>   done (and make sense) even without introduction of new meta-data
>   locking. These changes are:

How would you support open placeholders without open
cache? Table definition cache placeholders look like a stretch.
But this is hypothetical anyway.


> +  pthread_mutex_unlock(&LOCK_open);
> +
> +  if (open_table_from_share(thd, share, table_list->alias,
> +                            (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE |
> +                                    HA_GET_INDEX |
> +                                    HA_TRY_READ_ONLY),
> +                            READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD,
> +                            ha_open_options | HA_OPEN_FOR_REPAIR,
> +                            entry, FALSE) || ! entry->file ||
> +      (entry->file->is_crashed() &&
> entry->file->check_and_repair(thd)))
> +  {
> +    /* Give right error message */
> +    thd->clear_error();
> +    my_error(ER_NOT_KEYFILE, MYF(0), share->table_name.str, my_errno);
> +    sql_print_error("Couldn't repair table: %s.%s", share->db.str,
> +                    share->table_name.str);
> +    pthread_mutex_lock(&LOCK_open);

Where do you unlock this?

> +    if (entry->file)
> +      closefrm(entry, 0);
> +    result= TRUE;
> +  }
> +  else
> +  {
> +    thd->clear_error();			// Clear error message
> +    closefrm(entry, 0);
> +  }
> +  my_free(entry, MYF(0));
> +
> +  pthread_mutex_lock(&LOCK_open);
> +
> +end_with_lock_open:
>    release_table_share(share, RELEASE_NORMAL);
> -  DBUG_RETURN(1);
> +  pthread_mutex_unlock(&LOCK_open);
> +  return result;
> +}
> +

-- 
-- Konstantin Osipov              Software Developer, Moscow, Russia
-- MySQL AB, www.mysql.com   The best DATABASE COMPANY in the GALAXY
Thread
bk commit into 5.1 tree (dlenev:1.2577)dlenev29 Aug
  • Re: bk commit into 5.1 tree (dlenev:1.2577)Konstantin Osipov29 Aug