Page MenuHomePhabricator

searchindex: Data too long for column 'si_title'
Closed, DuplicatePublic

Description

Hi, when running rebuildall.php on a wiki, i am getting:

Wikimedia\Rdbms\DBQueryError from line 1603 of /srv/mediawiki/w/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: REPLACE INTO `searchindex` (si_page,si_title,si_text) VALUES ('131409','lost labyrinth ifu800 youu800 missed outu800 onu800 certain expansions oru800 stuff packs foru800 theu800 sims 2u800 here here\'su800 your chance tou800 grab them nowu800 comment-81u800u82e165u800u82e33u800u82e92u800-20140715230100 comment-2201555-20140715230503',' iu800 registered mine minutes before writing this blog. youu800 might getu800 lucky butu800 otherwise youu800 might have tou800 wait until next week. ')
Function: SearchMySQL::update
Error: 1406 Data too long for column 'si_title' at row 1 (mediawiki-internal-db-master.miraheze.org)

#0 /srv/mediawiki/w/includes/libs/rdbms/database/Database.php(1574): Wikimedia\Rdbms\Database->getQueryExceptionAndLog('Data too long f...', 1406, 'REPLACE INTO `s...', 'SearchMySQL::up...')
#1 /srv/mediawiki/w/includes/libs/rdbms/database/Database.php(1152): Wikimedia\Rdbms\Database->reportQueryError('Data too long f...', 1406, 'REPLACE INTO `s...', 'SearchMySQL::up...', false)
#2 /srv/mediawiki/w/includes/libs/rdbms/database/Database.php(2924): Wikimedia\Rdbms\Database->query('REPLACE INTO `s...', 'SearchMySQL::up...')
#3 /srv/mediawiki/w/includes/libs/rdbms/database/DatabaseMysqlBase.php(452): Wikimedia\Rdbms\Database->nativeReplace('`searchindex`', Array, 'SearchMySQL::up...')
#4 /srv/mediawiki/w/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\DatabaseMysqlBase->replace('searchindex', Array, Array, 'SearchMySQL::up...')
#5 /srv/mediawiki/w/includes/libs/rdbms/database/DBConnRef.php(490): Wikimedia\Rdbms\DBConnRef->__call('replace', Array)
#6 /srv/mediawiki/w/includes/search/SearchMySQL.php(352): Wikimedia\Rdbms\DBConnRef->replace('searchindex', Array, Array, 'SearchMySQL::up...')
#7 /srv/mediawiki/w/includes/deferred/SearchUpdate.php(106): SearchMySQL->update('131409', 'lost labyrinth ...', ' iu800 register...')
#8 /srv/mediawiki/w/maintenance/rebuildtextindex.php(111): SearchUpdate->doUpdate()
#9 /srv/mediawiki/w/maintenance/rebuildtextindex.php(66): RebuildTextIndex->populateSearchIndex()
#10 /srv/mediawiki/w/maintenance/rebuildall.php(48): RebuildTextIndex->execute()
#11 /srv/mediawiki/w/maintenance/doMaintenance.php(99): RebuildAll->execute()
#12 /srv/mediawiki/w/maintenance/rebuildall.php(67): require_once('/srv/mediawiki/...')
#13 {main}

Event Timeline

Restricted Application added subscribers: RhinosF1, Aklapper. · View Herald Transcript

User blog comment:Lost Labyrinth/If you missed out on certain expansions or stuff packs for The Sims 2, here's your chance to grab them now/@comment-81.165.33.92-20140715230100/@comment-2201555-20140715230503

Is the title it shows.

Change 565765 had a related patch set uploaded (by Paladox; owner: Paladox):
[mediawiki/core@master] Convert si_title to TEXT blob

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

lost labyrinth ifu800 youu800 missed outu800 onu800 certain expansions oru800 stuff packs foru800 theu800 sims 2u800 here here'su800 your chance tou800 grab them nowu800 comment-81u800u82e165u800u82e33u800u82e92u800-20140715230100 comment-2201555-20140715230503 === 262

Using the above patch fixed my issue.

Unless and until we find reason to believe otherwise, the problem is not the width of the table in the schema. The first problem is the program and the data it tries to insert.

Why is the program doing this? Where does it come from? Does that part work as expected? Are they real titles and there is no malfuction happening between that and the SQL query?

Seems to be a duplicate of T231827. Same table and schema, same SQL error, same underlying query class (SearchUpdate).

Why is the program doing this? Where does it come from? Does that part work as expected? Are they real titles and there is no malfuction happening between that and the SQL query?

--
-- When using the default MySQL search backend, page titles
-- and text are munged to strip markup, do Unicode case folding,
-- and prepare the result for MySQL's fulltext index.
--
-- This table must be MyISAM; InnoDB does not support the needed
-- fulltext index.
--
CREATE TABLE /*_*/searchindex (
  -- Key to page_id
  si_page int unsigned NOT NULL,

  -- Munged version of title
  si_title varchar(255) NOT NULL default '',

  -- Munged version of body text
  si_text mediumtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);
CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title);
CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text);

After munging, it doesn't seem unreasonable that it's longer

I would imagine it's doing that as page_title is a binary?