Modify ↓
#13343 closed defect (fixed)
Type mismatch in Postgres DB
Reported by: | ntmlod | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Component: | CodeReviewerPlugin |
Severity: | normal | Keywords: | PostgreSQL |
Cc: | Trac Release: | 1.0 |
Description
Now that I have enabled the explicit synchronization, every commit failed to be inserted in the codereviewer_map
datatable.
2017-12-07 12:14:24,243 Trac[console] ERROR: Exception in trac-admin command: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/trac/admin/console.py", line 109, in onecmd rv = cmd.Cmd.onecmd(self, line) or 0 File "/usr/lib64/python2.7/cmd.py", line 220, in onecmd return self.default(line) File "/usr/lib/python2.7/site-packages/trac/admin/console.py", line 285, in default return cmd_mgr.execute_command(*args) File "/usr/lib/python2.7/site-packages/trac/admin/api.py", line 124, in execute_command return f(*fargs) File "/usr/lib/python2.7/site-packages/trac/versioncontrol/admin.py", line 96, in _do_changeset_added rm.notify('changeset_added', reponame, revs) File "/usr/lib/python2.7/site-packages/trac/versioncontrol/api.py", line 674, in notify getattr(listener, event)(repos, changeset, *args) File "build/bdist.linux-x86_64/egg/coderev/web_ui.py", line 339, in changeset_added self._map(repos.reponame, changeset) File "build/bdist.linux-x86_64/egg/coderev/web_ui.py", line 354, in _map (reponame or '', changeset.rev)) File "/usr/lib/python2.7/site-packages/trac/db/util.py", line 121, in execute cursor.execute(query, params) File "/usr/lib/python2.7/site-packages/trac/db/util.py", line 65, in execute return self.cursor.execute(sql_escape_percent(sql), args) ProgrammingError: operator does not exist: text = integer LINE 1: ...ELETE FROM codereviewer_map WHERE repo='' and changeset=8933 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. ProgrammingError: operator does not exist: text = integer LINE 1: ...ELETE FROM codereviewer_map WHERE repo='' and changeset=8933 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
My fix
-
coderev/web_ui.py
351 351 352 352 with self.env.db_transaction as db: 353 353 db("DELETE FROM codereviewer_map WHERE repo=%s and changeset=%s", 354 (reponame or '', changeset.rev))354 (reponame or '', str(changeset.rev))) 355 355 if not tickets: 356 356 tickets = [''] # we still want merges inserted 357 357 for ticket in tickets: … … 359 359 db("""INSERT INTO codereviewer_map 360 360 (repo,changeset,ticket,time) 361 361 VALUES (%s,%s,%s,%s) 362 """, (reponame or '', changeset.rev, ticket, when))362 """, (reponame or '', str(changeset.rev), ticket, when)) 363 363 except Exception, e: 364 364 self.log.warning("Unable to insert changeset " 365 365 "%s/%s and ticket %s into db: %s", 366 changeset.rev, reponame or '',366 str(changeset.rev), reponame or '', 367 367 ticket, e)
Attachments (0)
Change History (2)
comment:1 Changed 7 years ago by
Keywords: | PostgreSQL added |
---|---|
Summary: | Type mismatch in Postgre DB → Type mismatch in Postgres DB |
comment:2 Changed 7 years ago by
Owner: | set to Jun Omae |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
In 17014: