When I tried to do an automatic upgrade from WordPress 2.7.1 to 2.8 yesterday, it failed miserably. The files were all put in place, but when I tried to load /wp-admin/upgrade.php, this error popped up:
Fatal error: Call to undefined method wpdb::has_cap() in /path/to/wordpress/wp-admin/includes/schema.php on line 22
I was perplexed at the error, so I restored from a backup and began upgrading manually. The manual upgrades have always worked well for me in the past, so I figured this would probably fix the problem. After the upgrade, I went to /wp-admin/upgrade.php and saw:
Fatal error: Call to undefined method wpdb::has_cap() in /path/to/wordpress/wp-admin/includes/schema.php on line 22
What the heck is going on? I restored from a backup, tried the manual upgrade again, and it still failed. I took a look at the lines causing the problem in schema.php:
if ( $wpdb->has_cap( 'collation' ) ) { if ( ! empty($wpdb->charset) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty($wpdb->collate) ) $charset_collate .= " COLLATE $wpdb->collate"; }
I figured I could comment out the if statement and probably still be safe:
// if ( $wpdb->has_cap( 'collation' ) ) { if ( ! empty($wpdb->charset) ) $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; if ( ! empty($wpdb->collate) ) $charset_collate .= " COLLATE $wpdb->collate"; // }
Success? I could make it through the upgrade.php part fine at this point, but whenever I tried to add a tag to a post, it wasn't saving to the database. I caught this error in my apache logs:
[Fri Jun 12 23:45:03 2009] [error] [client 72.183.200.144] WordPress database error Duplicate entry 'debian' for key 'slug' for query INSERT INTO wp_terms (`name`,`slug`,`term_group`) VALUES ('debian','debian','0') made by wp_insert_term, referer: http://rackerhacker.com/wp-admin/post.php?action=edit&post=877
Frustration quickly ensued. I moved my /wp-content/ folder out of the way and replaced it with the standard WordPress stuff, but that didn't help. I moved plugins out of the way, one by one, but that didn't fix it either. Then I spotted a strange file sitting in /wp-content/ called db.php. When I opened it, I found a lot of database setup classes for mysqli.
I renamed it to db.pleasedonteverrunthisphp and I was able to save tags properly. So far, I haven't found any issues after I made chat change.
Does anyone know where that file might have come from? I don't remember adding it myself, so I'm wondering if it was ever packaged with a WordPress plugin or a WordPress installation. I hope this helps someone else!

That sounds a little odd. My wordpress upgrade went fairly smoothly (apart from a little bit of stupidity by me that meant I needed to restore from backup and re-do the automatic upgrade)
The only thing i'm not so happy about is on the Fusion theme I was using, the right hand widget column now mysteriously started appearing half off the page on the bottom left. Very odd, couldn't fix it by repositioning it and couldn't be bothered to faff about with the template, so just switched to another one.
I know there is a condition in wordpress to load that db.php if there is no MySQL found. If you ever used a different database you would have had to add that db.php file in order for wordpress to speak to the database. No idea how you would have wound up with that file.
Are you using/have you ever used DB Cache? This post seems to match your tag issue, but not the upgrade one:
http://wordpress.org/support/topic/275443
Also, DB Cache seem to be the only WordPress plugin which creates a db.php file.
(An (unrelated?) plugin, HyperDB, contains a db.php, but looks nothing like the one you pastebin'd)
That is quite strange. I was able to update my wordpress to 2.8 manually without a hitch. I even double checked that I could save tags when I saw your tweet about it.
This is why I have a dummy duplicate blog with all the same addons installed, the same widgets on the side, an identical theme and so on with some dummy posts ala wp-themes.com.
I run my upgrades there first now.
Little weird..
I was upgraded mine manually also.. as dunno how to auto-upgrade it.
installed brand-new 2.8 into a new folder..
edited the config.php to reflect the old one..
then moved all my file under old one
( under wp-contents -uploads, plugins, themes)
into a new folder.
then.. it seem ok.
until i want to login into administrator mode..
just need to press one button .. to upgrade database..
and it is done.. after that..
Same problem after upgrading: the tags were out. I will look at your solution.