https://bugzilla.wikimedia.org/show_bug.cgi?id=62098

            Bug ID: 62098
           Summary: LCStoreDB not working on postgres due to \0
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Database
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: duplicate...@googlemail.com
            Blocks: 384
       Web browser: ---
   Mobile Platform: ---

LCStoreDB has a problem under postgres.

The lc_key 'deps' contains objects which will be serialized and than there are
\0 in the serialized string, but for postgres a \0 is end of input stream, this
means the lc_value for deps is cut of at the first \0, which breaks unserialize
when getting this value back.

The insert row is ([...] is a placeholder to make it shorter):
array (
  'lc_lang' => 'de',
  'lc_key' => 'deps',
  'lc_value' => 'a:9:{i:0;O:14:"FileDependency":2:{s:24:"' . "\0" .
'FileDependency' . "\0" . 'filename";s:110:[...];i:2;}}',
)

Gives:
INSERT /* LCStoreDB::set  */ INTO "l10n_cache" (lc_lang,lc_key,lc_value) VALUES
('de','deps','a:9:{i:0;O:14:"FileDependency":2:{s:24:"')

Reading on the internet, the only chance here is to use bytea, which can be
done by using Database::decodeBlob and Database::encodeBlob. Than the \0 is
changed to \000, but I didnot know, if oracle and sqlite still will work than.

Maybe there is another solution.

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to