id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os
404,Bitten mixes invalid data types,Emmanuel Blot <manu.blot@…>,jhampton,"Although SQLite backend is able to cope with those type mistmaches, when Trac is using a PostgreSQL backend, Bitten prevents Trac from initialiazing properly.

 * `bitten_rule` ''id'' column is declared as TEXT, but sometimes used with INTEGER values
 * `bitten_build` ''rev'' column is declared as TEXT, but sometimes used with INTEGER values

Attaching a quick and dirty patch: works Ok, but it is likely that type conversion should occur in a more appropriate location.

{{{
#!diff
Index: bitten/model.py
===================================================================
--- bitten/model.py	(revision 629)
+++ bitten/model.py	(working copy)
@@ -294,7 +294,7 @@
         platform = TargetPlatform(env, config=row[0], name=row[1])
         platform.id = id
         cursor.execute(""SELECT propname,pattern FROM bitten_rule ""
-                       ""WHERE id=%s ORDER BY orderno"", (id,))
+                       ""WHERE id=%s ORDER BY orderno"", (str(id),))
         for propname, pattern in cursor:
             platform.rules.append((propname, pattern))
         return platform
@@ -500,7 +500,7 @@
         if config is not None:
             where_clauses.append((""config=%s"", config))
         if rev is not None:
-            where_clauses.append((""rev=%s"", rev))
+            where_clauses.append((""rev=%s"", str(rev)))
         if platform is not None:
             where_clauses.append((""platform=%s"", platform))
         if slave is not None:
}}}

See [trac:ticket:8379] for a related ticket",defect,closed,critical,,Build master,dev,worksforme,,manu.blot@…,BSD
