Thanks Ipstenu. Uninstalling W3TC and deleting db.php and object-cache.php from the WP root folder solved it for me.
Betcha you haven’t upgraded W3TC yet.
W3TC is at the latest version 0.9.2.8. That’s said, the plugin page is reporting that it’s broken for 3.5.1. Still not sure how this can be causing the problem as the plugin isn’t network activated.