Modify

Opened 6 years ago

Closed 2 years ago

#3482 closed defect (wontfix)

Python Error on save new CoreReview

Reported by: 3dh@… Owned by: andersm
Priority: normal Component: PeerReviewPlugin
Severity: normal Keywords:
Cc: krigstask Trac Release: 0.10

Description

On Trac 0.10.4 (standalone server using PostgreSQL DB), python 2.3.3 (64 bit), running on a SuSE 9 server, I installed the current svn version of the plugin (2008-07-30).

When creating a new codereview, I get following Python error / trace when clicking on button "add review", after adding one file and the title+comment:

Traceback (most recent call last):
  File "/usr/lib64/python2.3/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib64/python2.3/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/codereview/peerReviewNew.py", line 137, in process_request
  File "build/bdist.linux-x86_64/egg/codereview/peerReviewNew.py", line 177, in createCodeReview
  File "build/bdist.linux-x86_64/egg/codereview/CodeReviewStruct.py", line 50, in save
  File "/usr/lib64/python2.3/site-packages/trac/db/util.py", line 51, in execute
    return self.cursor.execute(sql)
  File "/usr/lib64/python2.3/site-packages/trac/db/util.py", line 51, in execute
    return self.cursor.execute(sql)
IntegrityError:  NULL-Value in column »idreview« hurts Not-Null-Constraint

Any help is appreciated.

Attachments (0)

Change History (3)

comment:1 Changed 5 years ago by krigstask

  • Cc krigstask added; anonymous removed

Here's where the problem lurks.

When inserted in PgSQL table, ID can't be set to NULL.

TracDB=> INSERT INTO CodeReviews VALUES (NULL, 'krigstask', 'Open for review', 1261388961, 'Temp', 'Let us try');
ERROR:  null value in column "idreview" violates not-null constraint

TracDB=> INSERT INTO CodeReviews VALUES (DEFAULT, 'krigstask', 'Open for review', 1261388961, 'Temp', 'Let us try');
INSERT 0 1

TracDB=> SELECT * FROM codereviews;
 idreview |  author   |     status      | datecreate | name |   notes    
----------+-----------+-----------------+------------+------+------------
        1 | krigstask | Open for review | 1261388961 | Temp | Let us try
(1 row)

Can't say how this could be handled in a generic with SQLite way. Probably using named VALUES like this:

INSERT INTO codereviews (author, status, datecreate, name, notes) VALUES ('krigstask', 'Open for review', 1261388961, 'Temp', 'Let us try');

Don't forget to see into ticket 4118 regarding letter case in table / column names.

comment:2 Changed 3 years ago by andersm

  • Owner changed from proofek to andersm

comment:3 Changed 2 years ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

0.10 is no longer supported. The plugin should be database agnostic now with the latest trunk code.

Add Comment

Modify Ticket

Action
as closed The owner will remain andersm.
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.