From 41016485dfdbd5e12367c7e8c7504e0cc4666ef5 Mon Sep 17 00:00:00 2001
From: "Jared K. Smith" <jsmith@fedoraproject.org>
Date: Thu, 5 Jan 2012 14:10:47 -0500
Subject: [PATCH] Issue #1393394: Change columns so that pgsql and sqlite can
 store serialized data

---
 feeds.install |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/feeds.install b/feeds.install
index f44ee99..b899289 100644
--- a/feeds.install
+++ b/feeds.install
@@ -517,3 +517,35 @@ function feeds_update_7205() {
   db_add_index('feeds_item', 'global_lookup_url', array('entity_type', array('url', 128)));
   db_add_index('feeds_item', 'global_lookup_guid', array('entity_type', array('guid', 128)));
 }
+
+/**
+ * Don't store serialized data in text fields, because serialized objects with
+ * protected members have NULL bytes (\0) in them, and PostgreSQL and sqlite
+ * truncate the string when they encounter the first null byte.
+ *
+ * See http://drupal.org/node/690746 for more details
+ */
+function feeds_update_7206() {
+  db_change_field('feeds_source', 'state', 'state', array(
+    'type' => 'blob',
+    'size' => 'big',
+    'not null' => FALSE,
+    'description' => 'State of import or clearing batches.',
+    'serialize' => TRUE,
+  ));
+  db_change_field('feeds_source', 'config', 'config', array(
+    'type' => 'blob',
+    'size' => 'big',
+    'not null' => FALSE,
+    'description' => 'Configuration of the feeds object.',
+    'serialize' => TRUE,
+  ));
+  db_change_field('feeds_source', 'fetcher_result', 'fetcher_result', array(
+    'type' => 'blob',
+    'size' => 'big',
+    'not null' => FALSE,
+    'description' => 'Cache for fetcher result.',
+    'serialize' => TRUE,
+    'not null' => FALSE,
+  ));
+}
-- 
1.7.7.5

