Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQLBackup leaves out 'timestamp' column #81

Closed
Mario-Omni opened this issue Oct 13, 2021 · 7 comments
Closed

MySQLBackup leaves out 'timestamp' column #81

Mario-Omni opened this issue Oct 13, 2021 · 7 comments

Comments

@Mario-Omni
Copy link

I use MySQLBackup to have a live backup of my MySQL-database but the TIMESTAMP-column simply disappeared in the backup.
Backup Test.zip

@adriancs2
Copy link
Member

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 INSERTs 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.

@adriancs2
Copy link
Member

adriancs2 commented Oct 14, 2021

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 INSERTs 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.

@Mario-Omni
Copy link
Author

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

@adriancs2
Copy link
Member

adriancs2 commented Oct 16, 2021

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.

@adriancs2
Copy link
Member

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 :)

@adriancs2
Copy link
Member

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/

@Mario-Omni
Copy link
Author

Thanks for your quick solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants