This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

Table replication with xtra column on slave

I have one table DailyMetrics on Interim server like below. Mater DB->Secondary DB--> Interim DB Master DB: Table DailyMetrics ( a char,b char Secondary DB: Table DailyMetrics ( a char,b char Interim DB: Table DailyMetrics ( a char,b char, InsertTime timestamp default current_timestamp)

Replication is working fine but added column InsertTime on interim DB is storing 000.000.00 00-00-00 value. It is not storing current system timestamp. When I issue separate insert statement on slave side, it is storing system time but nor with replication. Can anyone suggest me how to achieve system timestamp on slave side.

Other details as follows: MySQl DB: MariaDB 5.5.23 Replication Type: Row based. Platform: Linux

Answer Answered by Stephane VAROQUI in this comment.

Hello,

You can investigate a new 10.1 feature made for this case. https://mariadb.com/kb/en/mariadb/running-triggers-on-the-slave-for-row-based-events/

Such architecture looks complex to maintain as the middle slave data will be in definition different from the master. If you reload the master from a logical backup, it should be ok to get the new reload time in the slave ?

/svar

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.