Adsense Deluxe, WordPress 2.5 and MySQL 5.0

Part of the issue the other day, when this site was a little more than broken, was that I had made the switch from a MySQL 4.0 database to a MySQL 5.0 database. You wouldn’t think that would be an issue. Well, that would be a wrong assumption.

First, I use a plugin called Adsense Deluxe. I’m sure that many of you might as well. It’s kind of a old thing that I implemented and don’t actively use now, but it’s still there in some of the old posts. If it breaks, the implementation simply reverts to a few comments here and there. Again, not a problem.

Again, wrong assumption. There’s something in the way that MySQL 5.0 runs the queries that causes an issue with the empty array handling that worked fine in MySQL 4.0. I’m no expert on MySQL, so I wasn’t able to figure out exactly what the problem was. What I do know is that rather than just breaking and being just comments, it became some very ugly MySQL error lines at the beginning of each and every page and post. Not very nice at all. All made worse by the fact that the plugin hasn’t been updated for at least two versions of WordPress. The fact that it works at all is probably a miracle.

Another issue that I ran into was that suddenly, the front page of this site was starting at the beginning of the posts (in this case August 24, 2005) and working it’s way up. So when I told it to show the 5 most recent posts, it showed the first 5. I changed the orderby and order settings in the call and it still did the same thing. A little research on the codex gave me a answer. There is an issue in one of the early versions of MySQL 5.0 that causes the database calls for the posts in WordPress to break and default to the first x posts. The fix? Update MySQL. No workaround.

So, with the both of the errors making the site pretty much unusable, I had only one option. Revert the database to a older version or update it to a newer version. Since there wasn’t a newer version, I had to reinitialize a new database as a MySQL 4.0 database and wipe the old database. This takes a little bit of time, but really isn’t more than a 30 minute job. What took the time, was the 2-3 hours it took for me to reach that conclusion.

Now that it’s all back on MySQL 4.0, the recent posts show like they are supposed to. Adsense Deluxe works like it’s supposed to. And all is happy here in thatedeguy land. Until the next update anyways…