Page MenuHomePhabricator

Cargo gives SQL query error after updating
Closed, ResolvedPublicBUG REPORT

Description

Cargo gives SQL query error after upgrading to 1.37.0 (which included updating Cargo), when using Special:RunQuery.

However, I do not believe the issue is only with 1.37. Based on the output, it is likely present on previous MediaWiki versions as well, as long as on latest Cargo.

After doing some debugging, the issue is caused by https://github.com/wikimedia/mediawiki-extensions-Cargo/commit/b68e912, which seems to use the wrong SQL. I was able to build some correct SQL which does properly return:

Current/Incorrect
SELECT  `anotacions_zk`.`_pageID` AS `cargo_backlink_page_id_anotacions_zk`,`_value` AS `_value` FROM `cargo__anotacions_zk__tags` GROUP BY `_value` ORDER BY `_value` LIMIT 100
New/Correct
SELECT `anotacions_zk`.`_pageID` AS `cargo_backlink_page_id_anotacions_zk`,`anotacions_zk__tags`.`_value` AS `_value` FROM `cargo__anotacions_zk__tags` AS `anotacions_zk__tags`, `cargo__anotacions_zk` AS `anotacions_zk` GROUP BY `_value` ORDER BY `_value` LIMIT 100;|

Event Timeline

Sorry for the delay on this. What does the original Cargo query look like?

Sorry for the delay on this. What does the original Cargo query look like?

As mentioned, the sql query it returns currently is the following, but the other query mentioned in task is what properly returns.

SELECT  `anotacions_zk`.`_pageID` AS `cargo_backlink_page_id_anotacions_zk`,`_value` AS `_value` FROM `cargo__anotacions_zk__tags` GROUP BY `_value` ORDER BY `_value` LIMIT 100

Sorry, I meant - what's the #cargo_query call?

Yaron_Koren claimed this task.

I believe this is fixed now - I'm marking it as resolved. Please re-open the bug report if it's still a problem.