I don't think it locks the tables. The behavior may be similar, but I
seriously doubt that's what's happening. Take a snapshot of SHOW
INNODB STATUS while this is going on. And use mysqladmin debug and
check the error log. Then put those in some pastebin and send us the
link. And realize that you've only given us bits and snippets of
information about this -- you still haven't given us SHOW CREATE TABLE
or even shown us the query that's running. There's not a lot I can do
to really help you with this other than assume that you are wrong :)
Your version is definitely affected by that bug, which I can't find --
I am using the wrong search terms and can't find the right ones to
find the bug.
5.0.37 is a very buggy version and I would upgrade regardless if I
were you, to the latest 5.0 release. You might be surprised at how
much that changes things.
On Wed, Mar 4, 2009 at 3:33 PM, Carl <carl@stripped> wrote:
> I am using 5.0.37.
> While it may be true that there is a bug that shows tables as being locked
> when they really aren't, I do not think that applies here. I do know that
> when a table shows a status of 'Locked' in the Navicat Server Monitor that
> the transaction which created and is processing the query comes to a
> complete stop until the report query (the one I am trying to straighten out
> or understand) is finished. For example, the report query is reading from
> several files, e.g., receipt_master, if a user tries to check out (which
> requires an insert into the receipt_master table), they are stopped until
> the report query finishes and query on that table shows in Navicat as
> waiting for lock ('Locked'.)
> Since the report query is only reading data, I am puzzled why it locks the
> tables. Any ideas?
> ----- Original Message ----- From: "Baron Schwartz" <baron@stripped>
> To: "Carl" <carl@stripped>
> Cc: <mysql@stripped>
> Sent: Wednesday, March 04, 2009 2:29 PM
> Subject: Re: Select query locks tables in Innodb
>> Locked status in SHOW PROCESSLIST and a table being locked are
>> different. There is a bug in MySQL that shows Locked status for
>> queries accessing InnoDB tables in some cases. What version of MySQL
>> are you using?
>> The table is not really locked, you're just seeing that as a side
>> effect of whatever's really happening.
>> On Wed, Mar 4, 2009 at 2:01 PM, Carl <carl@stripped> wrote:
>>> I did check that all tables are Innodb.
>>> I was using the Navicat Server Monitor because I know that when I see the
>>> monitor reporting a status of locked during an attempted query, that user
>>> comes to a complete halt until the lock is cleared (usually by the bad
Baron Schwartz, Director of Consulting, Percona Inc.
Our Blog: http://www.mysqlperformanceblog.com/
Our Services: http://www.percona.com/services.html