Ticket #404 (closed defect: worksforme)
Bitten mixes invalid data types
| Reported by: | Emmanuel Blot <manu.blot@…> | Owned by: | jhampton |
|---|---|---|---|
| Priority: | critical | Milestone: | |
| Component: | Build master | Version: | dev |
| Keywords: | Cc: | manu.blot@… | |
| Operating System: | BSD |
Description
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.
-
bitten/model.py
294 294 platform = TargetPlatform(env, config=row[0], name=row[1]) 295 295 platform.id = id 296 296 cursor.execute("SELECT propname,pattern FROM bitten_rule " 297 "WHERE id=%s ORDER BY orderno", ( id,))297 "WHERE id=%s ORDER BY orderno", (str(id),)) 298 298 for propname, pattern in cursor: 299 299 platform.rules.append((propname, pattern)) 300 300 return platform … … 500 500 if config is not None: 501 501 where_clauses.append(("config=%s", config)) 502 502 if rev is not None: 503 where_clauses.append(("rev=%s", rev))503 where_clauses.append(("rev=%s", str(rev))) 504 504 if platform is not None: 505 505 where_clauses.append(("platform=%s", platform)) 506 506 if slave is not None:
See trac:ticket:8379 for a related ticket
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
