Closed
Bug 394627
Opened 17 years ago
Closed 17 years ago
bzdbcopy.pl should remove column quoting
Categories
(Bugzilla :: Database, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.0
People
(Reporter: bugzilla-mozilla, Assigned: bugzilla-mozilla)
Details
Attachments
(2 files)
1.93 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
1.37 KB,
patch
|
Details | Diff | Splinter Review |
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 bzdbcopy.pl 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/bzdbcopy.pl 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.
Assignee | ||
Comment 1•17 years ago
|
||
Assignee: database → bugzilla-mozilla
Attachment #279303 -
Flags: review?(mkanat)
Comment 2•17 years ago
|
||
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+
Updated•17 years ago
|
Flags: approval3.0+
Flags: approval+
Target Milestone: --- → Bugzilla 3.0
Assignee | ||
Comment 3•17 years ago
|
||
Assignee | ||
Comment 4•17 years ago
|
||
3.0 branch: Checking in contrib/bzdbcopy.pl; /cvsroot/mozilla/webtools/bugzilla/contrib/bzdbcopy.pl,v <-- bzdbcopy.pl new revision: 1.3.2.1; previous revision: 1.3 done HEAD: Checking in contrib/bzdbcopy.pl; /cvsroot/mozilla/webtools/bugzilla/contrib/bzdbcopy.pl,v <-- bzdbcopy.pl new revision: 1.4; previous revision: 1.3 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•