#704: Programming error creating ticket via QCT (0.8-dev)
---------------------+---------------
  Reporter:  olemis  |    Owner:
      Type:  defect  |   Status:  new
  Priority:  major   |  Version:
Resolution:          |
---------------------+---------------
 After checking out and creating an environment from scratch using
 PostgreSQL DB the execution of translated SQL queries leads to the
 following error

 {{{

 2013-10-27 17:18:06,220 Trac[dbcursor] DEBUG: Original SQl: INSERT INTO
 ticket
 
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime)
 VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)
 2013-10-27 17:18:06,225 Trac[dbcursor] DEBUG: SQL: INSERT INTO ticket
 
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime,
 product) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,'test')
 2013-10-27 17:18:06,225 Trac[util] DEBUG: SQL: INSERT INTO ticket
 
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime,
 product) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,'test')
 2013-10-27 17:18:06,225 Trac[util] DEBUG: args: [u's', u'admin', '', u'd',
 u'defect', 'new', u'', u'test', u'', u'', u'', '', 1382912286219722L,
 1382912286219722L]
 2013-10-27 17:18:06,227 Trac[util] DEBUG: execute exception:
 ProgrammingError('column "product" specified more than once\nLINE 1:
 ...one,component,version,resolution,time,changetime, product) V...\n
 ^\n',)
 2013-10-27 17:18:06,227 Trac[theme] ERROR: BH: Quick create ticket failed
 column "product" specified more than once
 LINE 1: ...one,component,version,resolution,time,changetime, product) V...
                                                              ^
 Traceback (most recent call last):
   File "/path/to/bloodhound/bloodhound_theme/bhtheme/theme.py", line 593,
 in process_request
     product, tid = self.create(req, summary, desc, attrs, True)
   File "/path/to/bloodhound/bloodhound_theme/bhtheme/theme.py", line 636,
 in create
     t.insert()
   File "/path/to/bloodhound/trac/trac/ticket/model.py", line 241, in
 insert
     [values[name] for name in std_fields])
   File
 "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/dbcursor.py",
 line 145, in execute
     return self.cursor.execute(sql, args=args)
   File
 "/path/to/bloodhound/bloodhound_multiproduct/multiproduct/dbcursor.py",
 line 85, in execute
     return super(BloodhoundIterableCursor,
 self).execute(translate_sql(self.env, sql), args=args)
   File "/path/to/bloodhound/trac/trac/db/util.py", line 54, in execute
     r = self.cursor.execute(sql_escape_percent(sql), args)
 ProgrammingError: column "product" specified more than once
 LINE 1: ...one,component,version,resolution,time,changetime, product) V...
                                                              ^
 }}}

 I notice the same issue with SQLite even if it does not fail at all .

 {{{
 2013-10-28 01:23:45,998 Trac[dbcursor] DEBUG: Original SQl: INSERT INTO
 ticket
 
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime)
 VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)
 2013-10-28 01:23:46,003 Trac[dbcursor] DEBUG: SQL: INSERT INTO ticket
 
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime,
 product, id) VALUES
 (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,'w',COALESCE((SELECT MAX(id)
 FROM
                                            (SELECT * FROM ticket WHERE
 product='w')
                                            AS subquery), 0)+1)
 2013-10-28 01:23:46,003 Trac[util] DEBUG: SQL: INSERT INTO ticket
 
(summary,reporter,owner,description,type,status,priority,product,milestone,component,version,resolution,time,changetime,
 product, id) VALUES
 (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,'w',COALESCE((SELECT MAX(id)
 FROM
                                            (SELECT * FROM ticket WHERE
 product='w')
                                            AS subquery), 0)+1)
 2013-10-28 01:23:46,003 Trac[util] DEBUG: args: [u's', u'admin', '', u'd',
 u'defect', 'new', u'major', u'w', u'', u'', u'', '', 1382941425997845L,
 1382941425997845L]
 }}}

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/704>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Reply via email to