MySQL Forums
Forum List  »  InnoDB

Strange SELECT lock / timeout
Posted by: Zen Itt
Date: April 11, 2013 01:58PM

I'm having a strange problem with a SELECT in an Innodb table, it never returns.

CREATE TABLE `example` (
`id` int(11) NOT NULL,
`done` tinyint(2) NOT NULL DEFAULT '0',
`agent` tinyint(4) NOT NULL DEFAULT '0',
`text` varchar(256) NOT NULL,
PRIMARY KEY (`id`),
KEY `da_idx` (`done`,`agent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |


The query that I can't obtain the results is:
SELECT id, text FROM example WHERE done = 0 AND agent = 0 LIMIT 120;

First I thought in some index optimization or lock problem, I was some time researching that but then I found this:

SELECT id FROM example WHERE done = 0 AND agent = 0 LIMIT 120;
...
...
...
120 rows in set (0.27 sec)


SELECT text FROM example WHERE done = 0 AND agent = 0 LIMIT 120;
...
...
...
120 rows in set (0.83 sec)

Now I'm lost, how obtaining id or text column separately with exactly the same query (same WHERE and LIMIT) works perfect and then obtaining both of them not??

Executing the "SELECT id, text..." again after that two queries have the same effect, never returns.

Options: ReplyQuote


Subject
Views
Written By
Posted
Strange SELECT lock / timeout
1677
April 11, 2013 01:58PM
828
April 11, 2013 02:36PM
620
April 12, 2013 10:14PM
688
April 17, 2013 11:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.