Web browser: ---
            Bug ID: 60213
           Summary: Type mismatch when caching SMW IDs
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: Semantic MediaWiki
    Classification: Unclassified
   Mobile Platform: ---

MediaWiki        1.22.1                (721b9e0) 22:03, 14 January 2014
Semantic MediaWiki (Version 1.9 alpha-3) (9a55761) 19:21, 22 October 2013


(SMW_Sql3SmwIds.php)SMWSql3SmwIds->setCache() is called from


with $id that is string, not integer as documented for setCache.

In most cases it is not a problem, php cast values automatically.
But arrays containing ids are serialized 
when hashes for property tables are computed.
In this case, types of ids are important - serialized arrays differs
and md5 hashes also differs.

For example (take a look at s_id or p_id):

smw_di_wikipage data:


These hashes are used to compare new semantic data 
with current semantic data stored in database to avoid unnecessary writes.

Fortunately functionality is not affected, only performance.

I propose to add explicit type cast in
(SMW_Sql3SmwIds.php)SMWSql3SmwIds->setCache() method
to make sure ids are always integer.

You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to