Bug #45055 update error: Column count doesn't match value count at row 1
Submitted: 24 May 2009 17:25 Modified: 24 May 2009 21:18
Reporter: Wendy Tao Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S1 (Critical)
Version:5.0.41 OS:Linux (4)
Assigned to: CPU Architecture:Any
Tags: Column count doesn't match value count at row 1, UPDATE ERROR

[24 May 2009 17:25] Wendy Tao
Description:
1::::. What did I try to do

I tried to update a record in a proposal table. I received an error. THe SQL statement looks fine to me. Could it be a bug?

Listed below is the SQL statement and table description:

update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1

| proposal | CREATE TABLE `proposal` (
  `proposal_id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `user_id` varchar(50) NOT NULL,
  `session_id` varchar(50) NOT NULL,
  `title` varchar(100) NOT NULL,
  `method` varchar(50) DEFAULT NULL,
  `rational` text,
  `file_name` varchar(100) DEFAULT NULL,
  `create_date` date NOT NULL,
  `status` varchar(20) NOT NULL,
  `comment_to_author` text,
  `commettee_user_id` varchar(50) DEFAULT NULL,
  `committee_decision_date` date DEFAULT NULL,
  `psi_center` varchar(50) DEFAULT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`proposal_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `proposal_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 | 

2::::. What is my expectation: 
I expected that the record is updated with new value

3::::. What is the problem:
Received the following error:

update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1 Column count doesn't match value count at row 1
java.sql.SQLException: Column count doesn't match value count at row 1
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) 

How to repeat:
Run the SQL statement at the command line. If you need the database dump file. Let me know. I can provide that to you.

update proposal set status = 'Pending', title = 'Test Proposal 1', method = 'X-ray', rational = 'Test Proposal Text', file_name = '', last_update = CURRENT_TIMESTAMP where proposal_id = 1;
[24 May 2009 19:20] Wendy Tao
To whom it may concern:

You can change the status of this case to "Close" now.

I have resolved this issue by a work around. The root cause was that when a table was dropped, for some reason the associated trigger was not dropped, which caused this issue. I have to drop the trigger explicitly by using the following statement:

 drop TRIGGER dataBaseName.triggerName;

Then re-create the table and trigger. The update SQL statement ran fine.

You can change the status of this case to "Close" now.

Regards,

Wendy
[24 May 2009 21:18] MySQL Verification Team
Closing according last comment.