Sunday Morning Source Code

I’m trying to figure out why duplicate key errors keep getting generated for the drupal twitter module, because it’s all open source, I started reading code to figure out why it didn’t seem to be using mysql BIGINTS.  I came across this comment:

/**
* Dear PHP, I hate you so bad. Love, Jeff.
*
* Workaround for drupal_write_record(), which treats a DB bigint as a signed 32
* bit int on 32 bit PHP builds. We can STORE bigints, and PHP automatically
* converts them to floats in memory while we work with them, but db_placeholders()
* always treats them as %d and casts them back to dumb signed ints.
*
* See http://drupal.org/node/333788 for more info.
*
* Instead we’ll set the column type to ‘string’ which is a little like jumping
* off the Sears Tower because the elevator’s broken. But that’s life.
*/

I laughed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s