Upgrading from 2.1 to 2.5 - I removed the old wp-includes and wp-admin and uploaded the new folders.
When I went to the page on my site equivalent to
Warning: Invalid argument supplied for foreach() in .../wp-includes/query.php on line 683
Fatal error: Call to undefined function update_object_term_cache() in .../wp-includes/post.php on line 2745
I tested this out on another version first, going from 2.2 and it worked fine.