Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MySQL查询在特定的WHERE条件下中断_Mysql - Fatal编程技术网

MySQL查询在特定的WHERE条件下中断

MySQL查询在特定的WHERE条件下中断,mysql,Mysql,我有一个MySQL查询,它只在某个where子句上崩溃,它说表已经崩溃,需要修复 此查询可用于: SELECT DirectionId FROM Messages WHERE CustomField1 = 56 AND DirectionId = 1 这个没有 SELECT DirectionId FROM Messages WHERE CustomField1 = 209 AND DirectionId = 1 但如果我这样做,它会起作用:

我有一个MySQL查询,它只在某个where子句上崩溃,它说
表已经崩溃,需要修复

此查询可用于:

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

有什么想法吗?

尝试使用MySQL内部清理例程修复索引:

在MySQL CLI上键入以下命令:

REPAIR TABLE Messages

请将
SHOW CREATE TABLE Messages
的输出添加到您的问题中。似乎你有一个索引<代码>键(CueField1,DirectionId)(或类似),它被破坏了,需要重建。在一个简单的尝试中,在MySQL Cclipse上做<代码>修复表消息< /代码>。你能显示表结构吗?考虑与你的主机联系。你试过修复表吗?