Ticket #309 (closed defect: fixed)
Problem with the SQL query of the LoadWantedPages() function with MySQL 5.0.22.
| Reported by: | vincent.fretin@… | Owned by: | DarTar |
|---|---|---|---|
| Priority: | high | Milestone: | 1.1.6.5 |
| Component: | database | Version: | 1.1.6.4 |
| Severity: | major | Keywords: | mysql, php5, LoadWantedPages, 1.1.7-ported |
| Cc: | ajmh |
Description
There is a problem with the SQL query of the LoadWantedPages() function with MySQL 5.0.22. With Mysql 5.0.22, it seems the field name tag from pages table has priority on the alias "wikini_links.to_tag as tag", and so the "group by" statement doesn't work as expected and so the WantedPages page give you false result.
Here is the original query:
select distinct wikka_links.to_tag as tag,count(wikka_links.from_tag) as count from wikka_links left join wikka_pages on wikka_links.to_tag = wikka_pages.tag where wikka_pages.tag is NULL group by tag order by count desc
I propose to rename the tag alias to page_tag:
select distinct wikka_links.to_tag as page_tag,count(wikka_links.from_tag) as count from wikka_links left join wikka_pages on wikka_links.to_tag = wikka_pages.tag where wikka_pages.tag is NULL group by page_tag order by count desc
And there are 3 modificiations to do in actions/wantedpages.php and one modification in IsWantedPage() function in libs/Wakka.class.php
The above changes give you good results in the WantedPages page.
