Closed Bug 398986 Opened 18 years ago Closed 18 years ago

Incorrect SQL query when moving bugs to another product

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

3.1.2
defect
Not set
blocker

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

(Keywords: regression)

Attachments

(1 file)

Attached patch patch, v1Splinter Review
'?' x 5 means '?????', which is not what we want as join()'ing this string has no effect. ('?') x 5 means ('?','?','?','?','?'), which is the expected array as join()'ing this will give '?,?,?,?,?'. This is a regression due to bug 373689. Note that we could as well write: join(', ', @idlist) as I did in the original implementation of this code.
Flags: blocking3.1.3+
Attachment #283987 - Flags: review?(mkanat)
FYI, running PostgreSQL displays a blank page instead of the intermediate page.
Comment on attachment 283987 [details] [diff] [review] patch, v1 Hrm, okay. The docs said that in list context the "x" operator returns a list. Ah well.
Attachment #283987 - Flags: review?(mkanat) → review+
By the way, one reason that we do ('?') x @idlist instead of "join(',', @idlist)" is that the query analyzer can cache this query, and it can't cache the query with numbers in it. Also, I think it's always better to use placeholders where it's reasonable to use them.
Flags: approval+
Checking in Bugzilla/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.208; previous revision: 1.207 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: