更新查询匹配记录但不更新表

时间:2016-01-28 15:50:52

标签: mysql

我有一个数据集,我试图调试一些问题,并且我遇到了更新查询与表中的记录匹配但没有更新的情况数据。这是我的数据集:

> describe genotypes;
+--------------+------------+------+-----+-------------------+-----------------------------+
| Field        | Type       | Null | Key | Default           | Extra                       |
+--------------+------------+------+-----+-------------------+-----------------------------+
| id           | int(11)    | NO   | PRI | NULL              | auto_increment              |
| userstamp    | int(11)    | YES  |     | NULL              |                             |
| timestamp    | timestamp  | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+--------------+------------+------+-----+-------------------+-----------------------------+
12 rows in set (0.00 sec)


> SELECT id, userstamp FROM genotypes WHERE id = 7276;
+------+-----------+
| id   | userstamp |
+------+-----------+
| 7276 |      NULL |
+------+-----------+

当我尝试运行查询以更新userstamp字段时,我得到以下结果:

> UPDATE genotypes SET userstamp = 142 WHERE id = 7276;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

我已从表中删除了所有触发器,因此我不确定是什么阻止了更新。

0 个答案:

没有答案