should remove column quoting

RESOLVED FIXED in Bugzilla 3.0



11 years ago
11 years ago


(Reporter: bugzilla-mozilla, Assigned: bugzilla-mozilla)


Bugzilla 3.0
Bug Flags:
approval +
approval3.0 +



(2 attachments)



11 years ago
As documented by man DBI (ehr, actually it only says it about the table names), $dbh->column_info columns can be quoted if they cause problems.
This is a problem with bzdbcopy as different databases have different quoting chars. This means the output of bz_table_columns_real (basically $dbh->column_info) in needs special handling to remove the quoting chars.
Note: It is not possible to avoid this quoting beforehand.

The error message you for instance get:
Writing data to the target 'fielddefs' table on Pg...DBD::Pg::st execute failed: ERROR:  invalid input syntax for integer: "type"
[for Statement "INSERT INTO fielddefs ( id,name,"type",custom,description,mailhead,sortkey,obsolete,enter_bug ) VALUES (?,?,?,?,?,?,?,?,?)" with ParamValues: 6='1', 3='type', 7='1', 9='0', 2='bug_id', 8='0', 1='1', 4='0', 5='Bug #'] at contrib/ line 149

The quote char on the target database was "; while the source database sees that as a string. Meaning, instead of selecting the column called type, it will return the string type each time.

None of the Bugzilla columns should cause any problems if not quoted, so attached patch just removes the quoting chars.

Comment 1

11 years ago
Created attachment 279303 [details] [diff] [review]
Patch v1
Assignee: database → bugzilla-mozilla
Attachment #279303 - Flags: review?(mkanat)
Comment on attachment 279303 [details] [diff] [review]
Patch v1

Make sure to remove the unrelated code at the top (the SOURCE_DB_TYPE thing) before committing this patch.

The middle bit should probably be .+ instead of .*, but that's fine.
Attachment #279303 - Flags: review?(mkanat) → review+


11 years ago
Flags: approval3.0+
Flags: approval+
Target Milestone: --- → Bugzilla 3.0

Comment 3

11 years ago
Created attachment 279307 [details] [diff] [review]
Checked in version

Comment 4

11 years ago
3.0 branch:
Checking in contrib/;
/cvsroot/mozilla/webtools/bugzilla/contrib/,v  <--
new revision:; previous revision: 1.3

Checking in contrib/;
/cvsroot/mozilla/webtools/bugzilla/contrib/,v  <--
new revision: 1.4; previous revision: 1.3
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.