From: Michael Widenius Date: December 29 2011 10:53pm Subject: Re: question about locks with optimize table List-Archive: http://lists.mysql.com/internals/38414 Message-Id: <20220.61275.297044.958394@narttu.askmonty.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! >>>>> "Zardosht" == Zardosht Kasheff writes: Zardosht> In this region of code that is locking out other clients, I don't see table-> lock set to TL_WRITE_ALLOW_WRITE, even though store_lock does Zardosht> so. It does not seem to be working. Yes, you are right. store_lock modifies the MYSQL_LOCK structure and not table->lock. We should probably fix this in lock.cc:get_lock_data() so that we store in table->used_lock the real lock we got after store_lock and use this in the problem code. Zardosht> Here is the big question. If we change the code somehow such that for Zardosht> our engine, the below if-clause evaluates to FALSE, would that be ok? Zardosht> if (lock_type == TL_WRITE && table->table->s->version) Zardosht> { Zardosht> DBUG_PRINT("admin", ("removing table from cache")); Yes, that should be ok. Regards, Monty