MySQLBackup leaves out 'timestamp' column
Mario-Omni opened this issue · 7 comments
I use MySQLBackup to have a live backup of my MySQL-database but the TIMESTAMP-column simply disappeared in the backup.
Backup Test.zip
Nope, this did not occur in my test. The timestamp column did appear in the dump.
INSERT INTO `test`(`wEvtId`,`wDtEvtId`,`Stage`,`StageDate`,`NumeroOcorrencia`) VALUES
(1,'2021-10-14 08:29:01','Open','2021-10-13 15:07:00','1'),
(2,'2021-10-14 08:29:01','Open','2021-10-13 15:08:00','2'),
(3,'2021-10-14 08:29:02','Closed','2021-10-13 15:09:00','3'),
(4,'2021-10-14 08:29:03','Resolved','2021-10-13 15:11:00','4'),
(5,'2021-10-14 08:29:04','Closed','2021-10-13 15:14:00','5');
The INSERT
s statement is created by collecting data from the SELECT
statement.
You can simply test it by executing:
SELECT * FROM `test`;
If the timestamp column data occur in above select statement, then it will be included in the dump.
The only possible way for this to occur is the timestamp data column is somehow not included in the SELECT
statement. This is because MySqlBackup.NET is constructing the INSERT
s based on the SELECT
data returned from MySQL.
I have performed a quick search at Google, it seems that I'm unable to search similar case that resembles your problem. You may try to provide more specific details.
I have attached new files as a new extract using MySQL Data Export, and a new extract using C#.
I also attached the select result in MySQL as well as the simplified C# code that I'm using in the extraction.
And finally the link to the same problem I found on Google.
https://superuser.com/questions/1404754/mysqlbackup-leaves-out-timestamp-column
Thanks in advance.
Mario
New Files.zip
After finding the clues in above info that you've posted, I'm able to reproduce the bug.
From the link (superuser.com) that you provided, I notice this
MySql Server 8.0.14
I got a clue that this might not happened on every version of Server.
This problem did not happened at my local MySQL server v5.7.26.
Then I tried on MySQL server v8.0.26, MySqlBackup.NET exported the following:
INSERT INTO `test`(`wEvtId`,`Stage`,`StageDate`,`NumeroOcorrencia`) VALUES
(1,'Open','2021-10-13 15:07:00','1'),
(2,'Open','2021-10-13 15:08:00','2'),
(3,'Closed','2021-10-13 15:09:00','3'),
(4,'Resolved','2021-10-13 15:11:00','4'),
(5,'Closed','2021-10-13 15:14:00','5');
the timestamp column was ignored.
Then, I tried the ordinary SELECT
statement execution by using MySqlDataAdapter
and MySqlDataReader
. These 2 components did return the timestamp data, but not MySqlBackup.NET.
I'm now in the process of debugging MySqlBackup.NET to fix this problem.
I have fixed the bug. You can try this out with the following source code.
MySqlBackup.NET_debug_81_v1.zip
I will later release the new nuget packages after I repacked them.
Thanks for reporting this bug. cheers :)
New nuget package had released. You may visit the nuget site at the following:
For MySql.Data.DLL PM> Install-Package MySqlBackup.NET
https://www.nuget.org/packages/MySqlBackup.NET/
For dotConnector Devart.Express.MySql PM> Install-Package MySqlBackup.Net.DevartExpress
https://www.nuget.org/packages/MySqlBackup.Net.DevartExpress/
For MySqlConnector (MIT) PM> Install-Package MySqlBackup.NET.MySqlConnector
https://www.nuget.org/packages/MySqlBackup.NET.MysqlConnector/
Thanks for your quick solution.