[wp-hackers] Time to change GUID to UUID?
otto at ottodestruct.com
Fri May 6 17:50:06 UTC 2011
On Fri, May 6, 2011 at 12:14 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
> It's definitely been considered, especially since we've now bumped our
> required versions. MySQL UUIDs, though, have issues when it comes to
> replication. Ultimately, a post's GUID can't be considered globally unique.
> Just unique across the site/network. Given that GUIDs are only used for
> feeds, this is acceptable. If a plugin may wish to leverage their
> "GUID-ness" for something else, then your mileage may vary.
I investigated the replication issue a while back, and figured out
that they don't have issues as long as you treat them as strings.
Meaning that if you do something like: UPDATE wp_posts SET guid =
UUID(); then that won't replicate right. The UUID() function call is
passed along to the replicated boxes and thus each one will generate
it's own UUID().
However, if you do a SELECT UUID();, then take the string you get back
and do your insert/update with that string, then it replicates just
fine, because it's just a string, not a function call.
More information about the wp-hackers