Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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

     
    294294        platform = TargetPlatform(env, config=row[0], name=row[1])
    295295        platform.id = id
    296296        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),))
    298298        for propname, pattern in cursor:
    299299            platform.rules.append((propname, pattern))
    300300        return platform
     
    500500        if config is not None:
    501501            where_clauses.append(("config=%s", config))
    502502        if rev is not None:
    503             where_clauses.append(("rev=%s", rev))
     503            where_clauses.append(("rev=%s", str(rev)))
    504504        if platform is not None:
    505505            where_clauses.append(("platform=%s", platform))
    506506        if slave is not None:

See ticket:8379 for a related ticket

Attachments (0)

Change History (9)

comment:1 follow-up: Changed 15 years ago by wbell

Is this not fixed by [639]-[641]?

comment:2 in reply to: ↑ 1 ; follow-up: Changed 15 years ago by Emmanuel Blot <manu.blot@…>

Replying to wbell:

Is this not fixed by [639]-[641]?

No, it only fixes one error out of three. I just found another one:

  • bitten/model.py

     
    223223            build.delete()
    224224
    225225        cursor = db.cursor()
    226         cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (self.id,))
     226        cursor.execute("DELETE FROM bitten_rule WHERE id=%s", (str(self.id),))
    227227        cursor.execute("DELETE FROM bitten_platform WHERE id=%s", (self.id,))
    228228        if handle_ta:
    229229            db.commit()
     
    294294        platform = TargetPlatform(env, config=row[0], name=row[1])
    295295        platform.id = id
    296296        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),))
    298298        for propname, pattern in cursor:
    299299            platform.rules.append((propname, pattern))
    300300        return platform
     
    500500        if config is not None:
    501501            where_clauses.append(("config=%s", config))
    502502        if rev is not None:
    503             where_clauses.append(("rev=%s", rev))
     503            where_clauses.append(("rev=%s", str(rev)))
    504504        if platform is not None:
    505505            where_clauses.append(("platform=%s", platform))
    506506        if slave is not None:

comment:3 Changed 15 years ago by Emmanuel Blot <manu.blot@…>

  • Cc manu.blot@… added

comment:4 Changed 15 years ago by osimons

  • Owner changed from cmlenz to osimons

I'll look at it.

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:

Is this not fixed by [639]-[641]?

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

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain jhampton.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.