MySQL查询在某些WHERE条件下中断

时间:2012-05-07 14:35:08

标签: mysql

我有一个只在某个where子句崩溃的MySQL查询,它表示table has crashed and needs to be repaired

此查询有效:

SELECT
    DirectionId
FROM
    Messages
WHERE
    CustomField1 = 56 AND DirectionId = 1

这个不是

SELECT
    DirectionId
FROM
    Messages
WHERE
    CustomField1 = 209 AND DirectionId = 1

但如果我这样做,那就有效:

SELECT
    DirectionId
FROM
    Messages
WHERE
    CustomField1 = 209

或者它也有效

SELECT
    DirectionId
FROM
    Messages
WHERE
    DirectionId = 1

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试使用MySQL内部清理例程来修复您的INDEX:

在MySQL CLI上输入:

REPAIR TABLE Messages