[Checkins] SVN: relstorage/trunk/relstorage/ Fixed type coercion of the transaction extension field. This fixes

Shane Hathaway shane at hathawaymix.org
Tue Mar 25 15:56:39 EDT 2008


Log message for revision 84944:
  Fixed type coercion of the transaction extension field.  This fixes
  an issue with converting databases.  Thanks to Kevin Smith for
  discovering this.
  

Changed:
  U   relstorage/trunk/relstorage/adapters/common.py
  U   relstorage/trunk/relstorage/relstorage.py

-=-
Modified: relstorage/trunk/relstorage/adapters/common.py
===================================================================
--- relstorage/trunk/relstorage/adapters/common.py	2008-03-25 19:39:01 UTC (rev 84943)
+++ relstorage/trunk/relstorage/adapters/common.py	2008-03-25 19:56:38 UTC (rev 84944)
@@ -137,7 +137,7 @@
         and may have other columns.
         """
         for row in cursor:
-            tid, username, description = row[:3]
+            tid, username, description, ext = row[:4]
             if username is None:
                 username = ''
             else:
@@ -146,7 +146,11 @@
                 description = ''
             else:
                 description = str(description)
-            yield (tid, username, description) + tuple(row[3:])
+            if ext is None:
+                ext = ''
+            else:
+                ext = str(ext)
+            yield (tid, username, description, ext) + tuple(row[4:])
 
 
     def iter_transactions(self, cursor):

Modified: relstorage/trunk/relstorage/relstorage.py
===================================================================
--- relstorage/trunk/relstorage/relstorage.py	2008-03-25 19:39:01 UTC (rev 84943)
+++ relstorage/trunk/relstorage/relstorage.py	2008-03-25 19:56:38 UTC (rev 84944)
@@ -609,8 +609,6 @@
                      'user_name': user or '',
                      'description': desc or ''}
                 if ext:
-                    ext = str(ext)
-                if ext:
                     d.update(cPickle.loads(ext))
                 if filter is None or filter(d):
                     if i >= first:



More information about the Checkins mailing list