Page MenuHomePhabricator

Database error (Special:BrowseData, from method SDBrowseDataPage::reallyDoQuery)
Closed, DeclinedPublic

Description

I use MW 1.25.3 with Extension:SemanticDrilldown master (17. Jan. 2016) and on Special:Browse a SQL error is issued (see forelast line):

SELECT DISTINCT 
  ids.smw_title AS title, 
  ids.smw_title AS value, 
  ids.smw_title AS t, 
  ids.smw_namespace AS namespace, 
  ids.smw_namespace AS ns, 
  ids.smw_id AS id, 
  ids.smw_iw AS iw, 
  ids.smw_sortkey AS sortkey 
FROM `smw_object_ids` ids 
JOIN `smw_fpt_inst` insts ON ids.smw_id = insts.s_id AND ids.smw_namespace != 14 
JOIN a0 ON ids.smw_id = a0.s_id 
WHERE insts.o_id IN (
  SELECT smw_id 
  FROM `smw_object_ids` cat_ids 
  WHERE smw_namespace = 14 
    AND (smw_title = 'Gedicht' OR smw_title = 'Gedichttext' OR smw_title = 'Tischspruch')
) 
AND a0.p_id = (
  SELECT MAX(smw_id) 
  FROM `smw_object_ids` 
  WHERE smw_title = '' AND smw_namespace = 102
) AND (a0. = 'Gedicht') 
ORDER BY sortkey LIMIT 251

… I tries to execute a0. = 'Gedicht' where a0 seems like an alias of some kind but it is never defined. The debug tells it is executed by SDBrowseDataPage::reallyDoQuery

Event Timeline

infinite-dao raised the priority of this task from to High.
infinite-dao updated the task description. (Show Details)
infinite-dao subscribed.

On https://www.semantic-mediawiki.org/wiki/Special:BrowseData/Extensions there appear similar issues.

A database query error has occurred. This may indicate a bug in the software.

  • Query: CREATE TEMPORARY TABLE semantic_drilldown_filter_values AS SELECT s_id AS id, AS value FROM JOIN smw_object_ids p_ids ON .p_id = p_ids.smw_id WHERE p_ids.smw_title = ''`
  • Function: DatabaseBase::query
  • Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS value\x0A\x09FROM \x0A\x09JOIN smw_object_ids p_ids ON .p_id = p_ids.smw_id' at line 2 (localhost)

On my wiki I removed the old [[Has:Filter::...]] and then at least Special:BrowseData does shows the page. However then another issue comes, when I setup the filters on a category page using {{#drilldowninfo:filters=Autor (property=Autor), Stichwort (property=Stichwort)}} the filters get displayed as tag-cloud style on Special:BrowseData and it seems fine, but selecting a property filter value and attempting the filtering leads to allegedly reporting no results but emulating the same query with #ask does report results.

Is there a way to debug this?