[wp-hackers] Unsigned wp_posts.post_parent

Brian Layman Brian at b5media.com
Wed Oct 14 21:52:38 UTC 2009

Yeah, this has caused a whole lot of problems across b5 too. Basically any
WP user with a plugin that worked with the post attachements/galleries had
it break. In our case, we simply altered all of our databases restoring the
signed field type. That got us into production immediately.

We'd looked at possibly rewriting the code to look for 0 instead of -1,
however upon further investication, that produced result sets of tens of
thousands of items that had to be iterated, rather than the few posts that
filtering -1 returned.

I've not yet returned to this topic, but my next plan of attack was to
create a constant for (essentially) max(unsigned bigint(20)) which is
"18,446,744,073,709,551,615" according to http://bit.ly/VXYdk. I think we
are safe to assume that there are no blogs with over a quintillion posts.
Replacing that value in the plugins should be easy enough. Creating a
constant for it - if there isn't one already, might not be a bad idea either
specifically for this kind of use.  

In anycase, either of these approaches might work for you, at least until
the ticket is addressed.

Brian Layman
b5media, Inc.

More information about the wp-hackers mailing list