This class is great as I've used it in the past on many occasions to backup and restore databases. However, I have just only recently come across a peculiar behavior that it exhibits that is most unexpected and unwanted.
During a backup of the database, all NULL values that are stored are either converted to 0 (INT variable types) or an emptry string (VARCHAR data types).
This is a serious implementation flaw in my mind as you are basically casting the data and destroying it for the most part in these values.
What can be done to correct this? I'm not very familiar with the inderlying code or else I would recommend something....
G. Miernicki - 2009-02-03 21:06:53 - In reply to message 1 from G. Miernicki
I did some research and found the source of the problem. In the _sqlBackup() function, there was no check for NULL values in the code. As such, the insert statements where being made like INSERT ... VALUE("NULL") instead of INSERT ... VALUE(NULL). The quotes are what was the problem, it causes the integer and string fields in some cases to use default values instead of the actual value.
I have corrected the code in class.SQLBackup.php around 173 with the following: