MySQL Forums
Forum List  »  Replication

error on Slave with CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
Posted by: yvonne kire
Date: September 09, 2013 03:42PM

I added a date column that get updated on insert to the a DW slave.

It works if I manually insert records [see below]
but not when the application / replication do it.

???WHY???

When I stated the slave I got this error – it tried to insert two columns
Error 'Column count doesn't match value count at row 1' on query

mysql dbadmin >> start slave;

Last_SQL_Errno: 1136
Last_SQL_Error: Error 'Column count doesn't match value count at row 1' on query. Default database: Query: 'INSERT INTO batch_file VALUES ('1904076518',2109444072)'
1 row in set (0.01 sec)

mysql dbadmin >> stop slave;
Query OK, 0 rows affected (0.04 sec)


TEST on SANDBOX
add a date column who gets updated when a record get inserted


mysql dbadmin>> alter table batch_file ADD COLUMN 4etl_modified_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , ADD KEY i_batch_file_4etl_date (4etl_modified_date) ;

insert into batch_file(batch_id,id) values (1,1) ;
insert into batch_file(batch_id,id) values (2,2) ;
insert into batch_file(batch_id,id) values (3,3) ;

| 206113691 | 189026211 | 0000-00-00 00:00:00 |
| 206110861 | 189026221 | 0000-00-00 00:00:00 |
| 206110771 | 189026251 | 0000-00-00 00:00:00 |
| 206102591 | 189026261 | 0000-00-00 00:00:00 |
| 206112651 | 189026271 | 0000-00-00 00:00:00 |
| 206109341 | 189026281 | 0000-00-00 00:00:00 |
| 1 | 1 | 2013-09-04 15:51:48 |
| 2 | 2 | 2013-09-04 15:51:58 |
| 3 | 3 | 2013-09-04 15:52:05 |
+-----------+-----------+---------------------+
103 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
error on Slave with CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
2841
September 09, 2013 03:42PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.