Recently I've been building a MySQL server for our users. I've put phpMyAdmin on it (the latest version has some really nice features, but takes some fiddling about with to get set up). I think it's quite nice. (Well, I would, wouldn't I?)
After setting it up, I realised that we hadn't added it to the backup system. OK, only one user testing it out for us right now, it's on a resilient virtual infrastructure, only the possibility of corrupt tables if there is a problem... better dump DBs and back 'em up.
Using mysqldump, that's quite easy. So, now to test it....
Oh, look, the MySQL documentation mentions a test database called sakilla. It makes use of lots of MySQL features. Great, I can test lots of stuff. Just import sakilla, dump it and compare the dump with the original SQL. That might be a bit tricky....
There's bound to be a perl library that'll do that....not that... or that... or that.... aha! Just what I'm looking for. I'll just check if there's another one.... not that.... or that.... almost, but no... not that... doesn't look like it.
Compare MySQL code against MSQL code ... perfect.
Hah!
This library takes two filenames. OK, two SQL files - one from mysqldump, one from the sakila tarball.
The comparison failed with an error - invalid syntax and a line number. The error message just gives the type of token the parser is expecting. Not very helpful!
I guess I'll write a quick hack that removes the MySQL token that it must be failing on. Perl can do that really easily!
HAH!
Fix one missing feature, run again... fix the next one, run again... and the Next one, run again... and the NEXT one, run again.... and it's getting further and further and slower and slower... and the quick perl hack is getting bigger and BIGGER and more complex and MORE complex... and I'm getting MORE and MORE FRUSTRATED!!!!
The quick hack is now PRACTICALLY A MYSQL PARSER!!!!
No comments:
Post a Comment