Last modified: 2013-02-26 21:50:55 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
(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).
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).
*** Bug 45289 has been marked as a duplicate of this bug. ***
I can test this fix when merged.
Confirmed fixed :) Thanks all.
Just backported his to 1.8.x https://github.com/wikimedia/mediawiki-extensions-SemanticMediaWiki/compare/master...1.8.x
Tested fine on 1.8.x :)