CODE
my @entries=MT::Entry->count({ blog_id => $ctx->stash('blog_id'),
created_on => [(sprintf "%04d0101000000", $year), (sprintf "%04d1231235959", $year)],
status => MT::Entry::RELEASE() },
{ range => {created_on => 1}});
created_on => [(sprintf "%04d0101000000", $year), (sprintf "%04d1231235959", $year)],
status => MT::Entry::RELEASE() },
{ range => {created_on => 1}});
I'm using Berkeley DB, not SQL, which could be important to the problem.
I've also noticed this affects other kinds of searches as well; the post that was moved to 2002, even though it was moved back to 2003, now screws up "first post" searches using start_val so that if you start on a date even as early as January 1, 2002, the first post found is the second post, not the first. (This is the kind of search used in MT::Util::get_entry().)
Is there some way to slap the database back into order so it forgets I ever moved the first post? [Oh, and there's a bonus problem: Is there a way to do this without changing the order of the entries? When I imported my posts from Blogger, the dates were reversed and so 350 is my first post, not 1. I've changed all the internal links to fit this order and it'd be a royal pain to change them to something else.]
Lummox JR