MySQL throws this error when I try to execute a query when the number of columns matches. Here is the table structure:
mysql> desc S_3068;
+-------------------+----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+----------------------+------+-----+---------+-------+
| SfmID | smallint(5) unsigned | NO | PRI | 1 | |
| DatValue | float | NO | | 0 | |
| DatRawValue | int(10) unsigned | NO | | 0 | |
| DatTime | int(10) unsigned | NO | PRI | 0 | |
| DatBusOrder | tinyint(3) unsigned | NO | PRI | 1 | |
| DatFormulaVersion | tinyint(3) unsigned | NO | | 0 | |
+-------------------+----------------------+------+-----+---------+-------+
6 rows in set (0.00 sec)
I get the above error while executing this request:
mysql> insert ignore into S_3068 values (133, 15.82, 5542, 1339309260, 0, 1);
ERROR 1136 (21S01): Column count doesn't match value count at row 1
As you can see, the number of columns corresponds to the count of values. Now even more perplexing is that the query works fine with SfmID = 132:
mysql> insert ignore into S_3068 values (132, 15.82, 5542, 1339309260, 0, 1);
Query OK, 1 row affected (0.00 sec)
SfmID is unsigned smallint, which makes no sense to me.
Any help on this would be greatly appreciated.
EDIT: The error is caused by a trigger associated with the table. Please see Comments for more information.
source
share