Last modified: 2013-02-26 21:50:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47129, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45129 - SMWSQLStore3Readers::fetchSemanticData() should in fact use DISTINCT for blobs
SMWSQLStore3Readers::fetchSemanticData() should in fact use DISTINCT for blobs
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 45289 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-18 19:11 UTC by Yaron Koren
Modified: 2013-02-26 21:50 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Yaron Koren 2013-02-18 19:11:04 UTC
Hi,

There has been an issue with Semantic Forms and SQLStore3 since SQLStore3 was first released: in autocompletion, some values show up multiple times. (This may also happen for dropdowns and other input types; I'm not sure.) I finally looked into this today, and figured out the issue: on line 314 of includes/storage/SQLStore/SMW_SQLStore3_Readers.php, there's the following:

                        // Don't use DISTINCT with text blobs:
                        if ( $typeid == 'l' ) $usedistinct = false;

I don't know who exactly introduced this line, since it looks like it was there since the SQLStore3 code was first added (though Markus added the comment line). But I would recommend to either remove it, or have it only called if $object is null - either way would fix the problem.

-Yaron
Comment 1 MWJames 2013-02-20 10:50:20 UTC
(In reply to comment #0)
> since the SQLStore3 code was first added (though Markus added the comment
> line). But I would recommend to either remove it, or have it only called if
> $object is null - either way would fix the problem.

Whoever is going to look into in this, I like to see a unit test where when applied (with the impression it is really all its needs and not scruing something else) this change one can see that this "regression" is gone (and not just pushing things into another corner, while waiting for the next issue to pop up).
Comment 2 Markus Krötzsch 2013-02-22 18:23:27 UTC
The problematic line was originally (in SQLStore2) inserted, since it was supposed to be a performance issue to use DISTINCT on BLOBs. I do not think that this assumption was correct. I removed the line now: 

https://gerrit.wikimedia.org/r/50381

When merged, this should fix the bug. After this change, $usedistinct only serves optimization purposes: we avoid DISTINCT in cases where results are distinct anyway (since they belong to one subject).
Comment 3 Nischay Nahata 2013-02-22 20:51:02 UTC
*** Bug 45289 has been marked as a duplicate of this bug. ***
Comment 4 Neill Mitchell 2013-02-23 12:31:58 UTC
I can test this fix when merged.
Comment 5 Neill Mitchell 2013-02-26 21:21:51 UTC
Confirmed fixed :) Thanks all.
Comment 6 Jeroen De Dauw 2013-02-26 21:31:17 UTC
Just backported his to 1.8.x

https://github.com/wikimedia/mediawiki-extensions-SemanticMediaWiki/compare/master...1.8.x
Comment 7 Neill Mitchell 2013-02-26 21:50:55 UTC
Tested fine on 1.8.x :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links