Closed Bug 308653 Opened 19 years ago Closed 19 years ago

[PostgreSQL] 'relation "map_products" does not exist' when the classification column is displayed

Categories

(Bugzilla :: Query/Bug List, defect)

2.20
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

Attachments

(1 file)

DBD::Pg::st execute failed: ERROR:  relation "map_products" does not exist
[for Statement "SELECT ... FROM bugs  ... INNER JOIN classifications AS
map_classifications ON (map_products.classification_id = map_classifications.id)
INNER JOIN products AS map_products ON (bugs.product_id = map_products.id) ...
"] at /var/www/html/bugzilla-tip-pg/buglist.cgi line 834

It looks like that MySQL doesn't care about the order in which tables are
joined, but PostgreSQL does, and when "ON (map_products.classification_id =
map_classifications.id)" is called, "INNER JOIN products AS map_products" has
not been declared yet.


This incorrect order comes from bug 286461:

Search.pm, line 141:

    if (lsearch($fieldsref, 'map_classifications.name') >= 0) {
        push @supptables,
                "INNER JOIN classifications AS map_classifications " .
                "ON map_products.classification_id = map_classifications.id";
        push @supptables, "INNER JOIN products AS map_products " .
                          "ON bugs.product_id = map_products.id";
    }

These insertions should be inverted.
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
Attached patch patch, v1Splinter Review
Applies on both tip and 2.20
Attachment #196145 - Flags: review?(mkanat)
Comment on attachment 196145 [details] [diff] [review]
patch, v1

r=mkanat by inspection. :-) Obviously correct. :-)
Attachment #196145 - Flags: review?(mkanat) → review+
Flags: approval?
Flags: approval2.20?
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval+
tip:

Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v  <--  Search.pm
new revision: 1.113; previous revision: 1.112
done

2.20rc2:

Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v  <--  Search.pm
new revision: 1.99.2.5; previous revision: 1.99.2.4
done
Status: ASSIGNED → RESOLVED
Closed: 19 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: