#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 ticket:8379 for a related ticket
Attachments (0)
Change History (9)
comment:1 follow-up: ↓ 2 Changed 15 years ago by wbell
comment:2 in reply to: ↑ 1 ; follow-up: ↓ 7 Changed 15 years ago by Emmanuel Blot <manu.blot@…>
Replying to wbell:
No, it only fixes one error out of three. I just found another one:
-
bitten/model.py
223 223 build.delete() 224 224 225 225 cursor = db.cursor() 226 cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (s elf.id,))226 cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (str(self.id),)) 227 227 cursor.execute("DELETE FROM bitten_platform WHERE id=%s", (self.id,)) 228 228 if handle_ta: 229 229 db.commit() … … 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:
comment:3 Changed 15 years ago by Emmanuel Blot <manu.blot@…>
- Cc manu.blot@… added
comment:5 Changed 15 years ago by osimons
See also attachment:ticket:318:bitten_model.patch that identifies many Postgres casting issues, and check that all identified issues are covered by [639:641] (#390) and the patch on this ticket.
comment:6 Changed 15 years ago by osimons
attachment:ticket:288:bitten-postgres8.3.patch is another patch covering type issues with Progress. Remember to review this patch as well to see if all issues are identified.
comment:7 in reply to: ↑ 2 Changed 15 years ago by jhampton
- Owner changed from osimons to jhampton
- Status changed from new to assigned
Replying to Emmanuel Blot <manu.blot@…>:
Replying to wbell:
No, it only fixes one error out of three. I just found another one:
Did you actually update your install? It looks as though the rev used for your diff was 629 (pre wbell's changes)
The id issues should be fixed now by [639] changing the schema to an integer column for id. The str(rev) change is added in [640] and [641]. I can't find any other location where rev would cause a problem. Additionally, I'm running the latest trunk with PG 8.3 and haven't had any type issues.
I'm going to close this ticket as worksforme in a few days if I don't hear anything back to the contrary
comment:8 Changed 15 years ago by eblot
- Resolution set to worksforme
- Status changed from assigned to closed
Yes it has been fixed, sorry.
comment:9 Changed 15 years ago by eblot
- Milestone 0.6 deleted
Is this not fixed by [639]-[641]?