Last Comment Bug 657707 - importxml.pl crashes when importing keywords
: importxml.pl crashes when importing keywords
Status: RESOLVED FIXED
: regression
Product: Bugzilla
Classification: Server Software
Component: Bug Import/Export & Moving (show other bugs)
: 4.0
: All All
: -- major (vote)
: Bugzilla 4.0
Assigned To: Frédéric Buclin
: default-qa
:
Mentors:
Depends on: 69621
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-17 11:26 PDT by jwiseheart
Modified: 2011-05-24 08:23 PDT (History)
3 users (show)
LpSolit: approval+
LpSolit: blocking4.2+
LpSolit: approval4.0+
LpSolit: blocking4.0.2+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch, v1 (954 bytes, patch)
2011-05-22 11:43 PDT, Frédéric Buclin
glob: review+
Details | Diff | Splinter Review

Description jwiseheart 2011-05-17 11:26:42 PDT
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: 4.0

I am importing bugs from a legacy home-grown application we have using a VB6 front end and a MySQL back end. I am performing the migration using importxml.pl. My XML export from the legacy system conforms to the Bugzilla DTD, and (thanks to the ability to add AND IMPORT TO custom fields, which is nice) have successfully imported ALL data from the old system into the new, with the sole exception of the Keywords field.

The error I get is the following: cvs:/srv/www/htdocs # ./importxml.pl -v bugsfile.xml
DBD::mysql::db do failed: Unknown column 'keywords' in 'field list' [for Statement "UPDATE bugs SET keywords = ? WHERE bug_id = ?"] at ./importxml.pl line 1147

My theory is this: Upon looking at the Bugzilla back end in MySQL, I'm guessing at one point in time, there was a 'Keywords' field in the 'bugs' table. For relational database purposes, it was probably decided to break the keywords out into a separate table, but importxml.pl was never updated to reflect this.

I'd try to fix it myself, but unfortunately Perl is not in my quiver of programming language arrows...

Thanks!

Reproducible: Always

Steps to Reproduce:
1. Do an import using importxml.pl
2. Make sure something is populated in the <keywords> element


Actual Results:  
cvs:/srv/www/htdocs # ./importxml.pl -v bugsfile.xml
DBD::mysql::db do failed: Unknown column 'keywords' in 'field list' [for Statement "UPDATE bugs SET keywords = ? WHERE bug_id = ?"] at ./importxml.pl line 1147

Expected Results:  
Imported keywords into the keywords table, related to the associated Bug ID. 

This is the only "technology" issue holding up our migration. Luckily, there are also training and political issues being resolved, so I have a little time to try to get a resolution to this issue.
Comment 1 Max Kanat-Alexander 2011-05-17 11:51:20 PDT
  You're right about the cause of the problem! :-) I'm not sure who's maintaining importxml.pl these days, though.
Comment 2 Frédéric Buclin 2011-05-17 12:29:13 PDT
(In reply to comment #1)
> I'm not sure who's maintaining importxml.pl these days, though.

It's me, mostly.
Comment 3 Frédéric Buclin 2011-05-22 11:43:42 PDT
Created attachment 534312 [details] [diff] [review]
patch, v1
Comment 4 Byron Jones ‹:glob› [PTO until 2016-10-10] 2011-05-22 22:59:00 PDT
Comment on attachment 534312 [details] [diff] [review]
patch, v1

r=glob
Comment 5 Frédéric Buclin 2011-05-23 09:57:05 PDT
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified importxml.pl
Committed revision 7821.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified importxml.pl
Committed revision 7597.
Comment 6 jwiseheart 2011-05-24 08:23:28 PDT
Thank you for responding to this. I will test it in our application this week, and let you know the result.

Note You need to log in before you can comment on or make changes to this bug.