This is a bit of a corner case. This is reproduced in http://d46.demo.civicrm.org.
Go to Contacts => Manage Groups
Click on Update Smart Group Counts (left side below the Find Groups box)
It will error with a syntax error. It errors on the smart group LYBUNT.
This smart group was created with Search => Custom Searches => Contributions made in Year X and not Year Y.