【发布时间】:2017-07-12 08:30:27
【问题描述】:
我试图更新 mysql 表并得到 ERROR 1054,然后发生了一些奇怪的事情。
表架构
CREATE TABLE `useraccount` (
`userId` bigint(20) NOT NULL,
`currentBalance` float NOT NULL,
`currentDataBalance` bigint(20) NOT NULL,
PRIMARY KEY (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
我的表中有一个条目,即
mysql> select * from UserAccount;
+--------+----------------+--------------------+
| userId | currentBalance | currentDataBalance |
+--------+----------------+--------------------+
| 1 | 0 | 4296 |
+--------+----------------+--------------------+
我尝试更新 currentDataBalance 字段并得到错误
错误 1054 (42S22):“字段列表”中的未知列“253600l”
mysql> update UserAccount set currentDataBalance=253600l where userId=1;
ERROR 1054 (42S22): Unknown column '253600l' in 'field list'
然后我删除了更新值的最后一位(从 253600l 到 253600) 并且值得到了更新
mysql> update UserAccount set currentDataBalance=253600 where userId=1;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
然后我再次将值更改为以前的值(从 253600 到 2536001),这次更新了值。
mysql> update UserAccount set currentDataBalance=2536001 where userId=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
我在 stackoverflow 上浏览了许多与错误 1054 相关的帖子,但我没有得到相关答案。
【问题讨论】: